public YoArtifactLine2d(String name, YoFrameLine2D yoFrameLine2d, Color color) { super(name, new double[0], color, yoFrameLine2d.getYoPointX(), yoFrameLine2d.getYoPointY(), yoFrameLine2d.getYoDirectionX(), yoFrameLine2d.getYoDirectionY()); this.yoFrameLine2d = yoFrameLine2d; }
/** * Provides a {@code String} representation of this line as follows:<br> * Line 2D: point = (x, y), direction = (x, y)-worldFrame * * @return the {@code String} representing this line. */ @Override public String toString() { return EuclidGeometryIOTools.getLine2DString(this) + "-" + getReferenceFrame(); } }
/** * Creates a copy of {@code this} by finding the duplicated {@code YoVariable}s in the given * {@link YoVariableRegistry}. * <p> * This method does not duplicate {@code YoVariable}s. Assuming the given registry is a duplicate * of the registry that was used to create {@code this}, this method searches for the duplicated * {@code YoVariable}s and use them to duplicate {@code this}. * </p> * * @param newRegistry YoVariableRegistry to duplicate {@code this} to. * @return the duplicate of {@code this}. */ public YoFrameLine2D duplicate(YoVariableRegistry newRegistry) { return new YoFrameLine2D(point.duplicate(newRegistry), direction.duplicate(newRegistry)); }
@Override public YoArtifactLine2d duplicate(YoVariableRegistry newRegistry) { return new YoArtifactLine2d(getName(), yoFrameLine2d.duplicate(newRegistry), color); } }
lineSegment.getYoSecondEndpointY().set(2.0); YoFrameLine2D line = new YoFrameLine2D("line", "", ReferenceFrame.getWorldFrame(), registry); line.getYoPointX().set(-1.0); line.getYoPointY().set(1.0); line.getYoDirectionX().set(-0.5); line.getYoDirectionY().set(1.0);