@Override public void setToNaN(ReferenceFrame desiredReferenceFrame) { setToNaN(); multipleFramesHelper.switchCurrentReferenceFrame(desiredReferenceFrame); } }
/** * Change the current reference frame and set to zero the coordinates (different from changeFrame() ). * @return the previous current reference frame. */ @Override public ReferenceFrame switchCurrentReferenceFrame(ReferenceFrame referenceFrame) { ReferenceFrame previousReferenceFrame = multipleFramesHelper.switchCurrentReferenceFrame(referenceFrame); setToZero(); return previousReferenceFrame; }
public YoGraphicPosition(String name, YoFramePoint2dInMultipleFrames framePoint, double scale, AppearanceDefinition appearance) { this(name, framePoint.buildUpdatedYoFramePointForVisualizationOnly(), scale, appearance, GraphicType.BALL); }
public YoFramePoint2D buildUpdatedYoFramePointForVisualizationOnly() { if (yoFramePointInWorld == null) { final ReferenceFrame worldFrame = ReferenceFrame.getWorldFrame(); if (!isReferenceFrameRegistered(worldFrame)) registerReferenceFrame(worldFrame); yoFramePointInWorld = new YoFramePoint2D(namePrefix, worldFrame.getName(), worldFrame, registry); attachVariableChangedListener(new VariableChangedListener() { private final FramePoint2D localFramePoint = new FramePoint2D(); private final YoFramePoint2D point = yoFramePointInWorld; @Override public void notifyOfVariableChange(YoVariable<?> v) { localFramePoint.setIncludingFrame(YoFramePoint2dInMultipleFrames.this); point.setMatchingFrame(localFramePoint); } }); } return yoFramePointInWorld; }
@Override public void changeFrame(ReferenceFrame desiredFrame) { get(point2d); ReferenceFrame currentReferenceFrame = multipleFramesHelper.switchCurrentReferenceFrame(desiredFrame); framePoint2d.setIncludingFrame(currentReferenceFrame, point2d); framePoint2d.changeFrame(desiredFrame); framePoint2d.get(point2d); set(point2d); }
public void setIncludingFrame(FrameTuple2DReadOnly frameTuple2d) { multipleFramesHelper.switchCurrentReferenceFrame(frameTuple2d.getReferenceFrame()); set(frameTuple2d); }
@Override public void variableChanged(YoVariable<?> v) { getFrameTuple2dIncludingFrame(localFramePoint); point.setAndMatchFrame(localFramePoint); } });
public YoFramePoint2d buildUpdatedYoFramePointForVisualizationOnly() { if (yoFramePointInWorld == null) { final ReferenceFrame worldFrame = ReferenceFrame.getWorldFrame(); if (!isReferenceFrameRegistered(worldFrame)) registerReferenceFrame(worldFrame); yoFramePointInWorld = new YoFramePoint2d(namePrefix, worldFrame.getName(), worldFrame, registry); attachVariableChangedListener(new VariableChangedListener() { private final FramePoint2d localFramePoint = new FramePoint2d(); private final YoFramePoint2d point = yoFramePointInWorld; @Override public void variableChanged(YoVariable<?> v) { getFrameTuple2dIncludingFrame(localFramePoint); point.setAndMatchFrame(localFramePoint); } }); } return yoFramePointInWorld; }
public void setIncludingFrame(FrameTuple2d<?, ?> frameTuple2d) { multipleFramesHelper.switchCurrentReferenceFrame(frameTuple2d.getReferenceFrame()); set(frameTuple2d); }
@Override public String toString() { String ret = ""; List<ReferenceFrame> referenceFrames = new ArrayList<ReferenceFrame>(); multipleFramesHelper.getRegisteredReferenceFrames(referenceFrames); for (int i = 0; i < referenceFrames.size(); i++) { getFrameTuple2dIncludingFrame(framePoint2d); framePoint2d.changeFrame(referenceFrames.get(i)); if (i > 0) ret += "\n"; ret += framePoint2d.toString(); } return ret; }
@Override public void changeFrame(ReferenceFrame desiredFrame) { point2d.set(this); ReferenceFrame currentReferenceFrame = multipleFramesHelper.switchCurrentReferenceFrame(desiredFrame); framePoint2d.setIncludingFrame(currentReferenceFrame, point2d); framePoint2d.changeFrame(desiredFrame); point2d.set(framePoint2d); set(point2d); }
/** * Change the current reference frame and set to zero the coordinates (different from changeFrame() ). * @return the previous current reference frame. */ @Override public ReferenceFrame switchCurrentReferenceFrame(ReferenceFrame referenceFrame) { ReferenceFrame previousReferenceFrame = multipleFramesHelper.switchCurrentReferenceFrame(referenceFrame); setToZero(); return previousReferenceFrame; }
@Override public void setToNaN(ReferenceFrame desiredReferenceFrame) { setToNaN(); multipleFramesHelper.switchCurrentReferenceFrame(desiredReferenceFrame); } }
public YoGraphicPosition(String name, YoFramePoint2dInMultipleFrames framePoint, double scale, AppearanceDefinition appearance, GraphicType type) { this(name, framePoint.buildUpdatedYoFramePointForVisualizationOnly(), scale, appearance, type); }