public static ShapeArtifact load(BufferedReader bufferedReader) { ShapeArtifact shapeArtifact = null; try { String line = bufferedReader.readLine(); if (line == null) return null; StringTokenizer s = new StringTokenizer(line, " "); double x = Double.parseDouble(s.nextToken()); double y = Double.parseDouble(s.nextToken()); Point2D pose = new Point2D(x, y); double width = Double.parseDouble(s.nextToken()); double height = Double.parseDouble(s.nextToken()); String type = s.nextToken(); String id = s.nextToken(); shapeArtifact = new ShapeArtifact(id, type, height, width, pose); } catch (Exception e) { e.printStackTrace(); } return shapeArtifact; }
public static ShapeArtifact load(BufferedReader bufferedReader) { ShapeArtifact shapeArtifact = null; try { String line = bufferedReader.readLine(); if (line == null) return null; StringTokenizer s = new StringTokenizer(line, " "); double x = Double.parseDouble(s.nextToken()); double y = Double.parseDouble(s.nextToken()); Point2d pose = new Point2d(x, y); double width = Double.parseDouble(s.nextToken()); double height = Double.parseDouble(s.nextToken()); String type = s.nextToken(); String id = s.nextToken(); shapeArtifact = new ShapeArtifact(id, type, height, width, pose); } catch (Exception e) { e.printStackTrace(); } return shapeArtifact; }
public ShapeArtifact getCopy() { ShapeArtifact shapeCopy = new ShapeArtifact(this.getID(), this.getType(), height, width, this.getPose()); shapeCopy.setColor(this.getColor()); return shapeCopy; }
public ShapeArtifact getCopy() { ShapeArtifact shapeCopy = new ShapeArtifact(this.getID(), this.getType(), height, width, this.getPose()); shapeCopy.setColor(this.getColor()); return shapeCopy; }