public void drawString(String string, PlotterPoint2d startPoint) { startPoint.changeFrame(screenFrame); drawString(string, pixelate(startPoint.getX()), pixelate(startPoint.getY())); }
public void setFocusPointX(double focusPointX) { focusPoint.changeFrame(metersFrame); focusPoint.setX(focusPointX); centerOnFocusPoint(); }
private void centerOnFocusPoint() { focusPoint.changeFrame(pixelsFrame); screenPosition.changeFrame(pixelsFrame); screenPosition.set(focusPoint); screenPosition.add(-getPlotterWidthPixels() / 2.0, getPlotterHeightPixels() / 2.0); updateFrames(); }
public void drawSquareFilled(PlotterReferenceFrame frame, Point2d center, Vector2d radii) { PlotterPoint2d centerFramePoint = pointBin[0]; PlotterVector2d radiiFrameVector = vectorBin[0]; centerFramePoint.setIncludingFrame(frame, center); radiiFrameVector.setIncludingFrame(frame, radii.getX(), radii.getY()); centerFramePoint.changeFrame(screenFrame); radiiFrameVector.changeFrame(screenFrame); radiiFrameVector.set(Math.abs(radiiFrameVector.getX()), Math.abs(radiiFrameVector.getY())); centerFramePoint.sub(radiiFrameVector); drawRectangleFilled(pixelate(centerFramePoint.getX()), pixelate(centerFramePoint.getY()), pixelate(2.0 * radiiFrameVector.getX()), pixelate(2.0 * radiiFrameVector.getY())); }
public void drawRectangle(PlotterReferenceFrame frame, double x, double y, double width, double height) { PlotterPoint2d position = pointBin[0]; PlotterVector2d dimensions = vectorBin[0]; position.setIncludingFrame(frame, x, y); dimensions.setIncludingFrame(frame, Math.abs(width), Math.abs(height)); position.changeFrame(screenFrame); dimensions.changeFrame(screenFrame); drawRectangle(pixelate(position.getX()), pixelate(position.getY()), pixelate(dimensions.getX()), pixelate(dimensions.getY())); }
public PlotterLegendPanel createPlotterLegendPanel() { PlotterLegendPanel plotterLegendPanel = new PlotterLegendPanel(plotter2dAdapter); addArtifactsChangedListener(plotterLegendPanel); return plotterLegendPanel; }
/** * Specify amount of meters that occupy view in X and Y. */ public void setViewRange(double viewRangeInX, double viewRangeInY) { setScale(getPlotterWidthPixels() / viewRangeInX, getPlotterHeightPixels() / viewRangeInY); }
public void initialize() { updateCnt = 0; if (enabled) plotter.showInNewWindow(ctaskName, false); }
public void setFocusPointY(double focusPointY) { focusPoint.changeFrame(metersFrame); focusPoint.setY(focusPointY); centerOnFocusPoint(); }
@Override public void artifactsChanged(ArrayList<Artifact> newArtifacts) { setArtifacts(newArtifacts); repaint(); } }
public void setScale(double pixelsPerMeterX, double pixelsPerMeterY) { focusPoint.changeFrame(metersFrame); metersToPixels.set(pixelsPerMeterX, pixelsPerMeterY); centerOnFocusPoint(); }
public Plotter2DAdapter(MetersReferenceFrame metersFrame, PixelsReferenceFrame screenFrame, PixelsReferenceFrame pixelsFrame) { this.metersFrame = metersFrame; this.screenFrame = screenFrame; this.pixelsFrame = pixelsFrame; for (int i = 0; i < pointBin.length; i++) { pointBin[i] = new PlotterPoint2d(metersFrame); vectorBin[i] = new PlotterVector2d(metersFrame); } }
public double getFocusPointX() { focusPoint.changeFrame(metersFrame); return focusPoint.getX(); }
public void setFocusOrientationYaw(double focusOrientationYaw) { screenRotation = focusOrientationYaw - Math.PI / 2.0; centerOnFocusPoint(); }
@Override public void drawLegend(Plotter2DAdapter graphics, Point2d origin) { graphics.drawString(graphics.getScreenFrame(), "Polygon", origin); }
public void drawString(PlotterReferenceFrame frame, String string, Point2d startPoint) { PlotterPoint2d plotStart = pointBin[0]; plotStart.setIncludingFrame(frame, startPoint); plotStart.changeFrame(screenFrame); drawString(string, pixelate(plotStart.getX()), pixelate(plotStart.getY())); }
public PlotterLegendPanel createPlotterLegendPanel() { PlotterLegendPanel plotterLegendPanel = new PlotterLegendPanel(plotter2dAdapter); addArtifactsChangedListener(plotterLegendPanel); return plotterLegendPanel; }
public void drawLineSegment(PlotterReferenceFrame frame, double firstPointX, double firstPointY, double secondPointX, double secondPointY) { PlotterPoint2d firstEndpoint = pointBin[0]; PlotterPoint2d secondEndpoint = pointBin[1]; firstEndpoint.setIncludingFrame(frame, firstPointX, firstPointY); secondEndpoint.setIncludingFrame(frame, secondPointX, secondPointY); firstEndpoint.changeFrame(screenFrame); secondEndpoint.changeFrame(screenFrame); drawLineSegment(pixelate(firstEndpoint.getX()), pixelate(firstEndpoint.getY()), pixelate(secondEndpoint.getX()), pixelate(secondEndpoint.getY())); }
public void drawPoint(PlotterReferenceFrame frame, Point2d point) { PlotterPoint2d plotterPoint = pointBin[0]; plotterPoint.setIncludingFrame(frame, point); plotterPoint.changeFrame(screenFrame); drawLineSegment(pixelate(plotterPoint.getX()), pixelate(plotterPoint.getY()), pixelate(plotterPoint.getX()), pixelate(plotterPoint.getY())); }
private void setupForDrawPolygon(PlotterReferenceFrame frame, ConvexPolygon2d convexPolygon2d) { for (int i = 0; i < convexPolygon2d.getNumberOfVertices(); i++) { pointBin[i].setIncludingFrame(frame, convexPolygon2d.getVertex(i)); pointBin[i].changeFrame(screenFrame); tempPoints[0][i] = pixelate(pointBin[i].getX()); tempPoints[1][i] = pixelate(pointBin[i].getY()); } }