@Override public void setWaitForUpdateVisualStyle() { GeoQuadric3D quadric = (GeoQuadric3D) getGeoElement(); switch (quadric.getType()) { case GeoQuadricNDConstants.QUADRIC_SINGLE_POINT: super.setWaitForUpdate(); break; case GeoQuadricNDConstants.QUADRIC_PARALLEL_PLANES: case GeoQuadricNDConstants.QUADRIC_INTERSECTING_PLANES: initDrawPlanes(quadric); drawPlanes[0].setWaitForUpdateVisualStyle(); drawPlanes[1].setWaitForUpdateVisualStyle(); super.setWaitForUpdate(); break; case GeoQuadricNDConstants.QUADRIC_PLANE: initDrawPlanes(quadric); drawPlanes[0].setWaitForUpdateVisualStyle(); super.setWaitForUpdate(); break; case GeoQuadricNDConstants.QUADRIC_LINE: initDrawLine(quadric); drawLine.setWaitForUpdateVisualStyle(); super.setWaitForUpdate(); break; } super.setWaitForUpdateVisualStyle(); }
@Override public void setWaitForUpdate() { super.setWaitForUpdate(); setMinMax(); checkViewDirectionIsParallel(); }
@Override public void setWaitForUpdate() { super.setWaitForUpdate(); GeoQuadric3D quadric = (GeoQuadric3D) getGeoElement(); int type = quadric.getType(); switch (type) { case GeoQuadricNDConstants.QUADRIC_PARALLEL_PLANES: case GeoQuadricNDConstants.QUADRIC_INTERSECTING_PLANES: initDrawPlanes(quadric); drawPlanes[0].setWaitForUpdate(); drawPlanes[1].setWaitForUpdate(); break; case GeoQuadricNDConstants.QUADRIC_PLANE: initDrawPlanes(quadric); drawPlanes[0].setWaitForUpdate(); break; case GeoQuadricNDConstants.QUADRIC_LINE: initDrawLine(quadric); drawLine.setWaitForUpdate(); break; } }
@Override protected void updateForView() { GeoQuadric3D quadric = (GeoQuadric3D) getGeoElement(); int type = quadric.getType(); switch (type) { case GeoQuadricNDConstants.QUADRIC_SPHERE: if (getView3D().viewChangedByZoom()) { Renderer renderer = getView3D().getRenderer(); PlotterSurface surface = renderer.getGeometryManager().getSurface(); double s = scale; scale = getView3D().getScale(); // check if longitude length changes double radius = quadric.getHalfAxis(0); int l = surface.calcSphereLongitudesNeeded(radius, scale); // redraw if sphere was not visible, or if new longitude length, // or if negative zoom occured if (visible == Visible.TOTALLY_OUTSIDE || l != longitude || scale < s) { Coords center = quadric.getMidpoint3D(); checkSphereVisible(center, radius); if (visible != Visible.TOTALLY_OUTSIDE) { // App.debug(l+","+longitude); longitude = l; surface.start(getReusableSurfaceIndex()); drawSphere(surface, center, radius); setSurfaceIndex(surface.end()); recordTrace(); } else { setSurfaceIndex(-1); } } } else if (visible != Visible.TOTALLY_INSIDE && getView3D().viewChangedByTranslate()) { Renderer renderer = getView3D().getRenderer(); PlotterSurface surface = renderer.getGeometryManager().getSurface(); Coords center = quadric.getMidpoint3D(); double radius = quadric.getHalfAxis(0); checkSphereVisible(center, radius); if (visible != Visible.TOTALLY_OUTSIDE) { surface.start(getReusableSurfaceIndex()); drawSphere(surface, center, radius); setSurfaceIndex(surface.end()); recordTrace(); } else { setSurfaceIndex(-1); } } break; case GeoQuadricNDConstants.QUADRIC_ELLIPSOID: case GeoQuadricNDConstants.QUADRIC_CONE: case GeoQuadricNDConstants.QUADRIC_CYLINDER: case GeoQuadricNDConstants.QUADRIC_HYPERBOLOID_ONE_SHEET: case GeoQuadricNDConstants.QUADRIC_HYPERBOLOID_TWO_SHEETS: case GeoQuadricNDConstants.QUADRIC_PARABOLOID: case GeoQuadricNDConstants.QUADRIC_HYPERBOLIC_PARABOLOID: case GeoQuadricNDConstants.QUADRIC_PARABOLIC_CYLINDER: case GeoQuadricNDConstants.QUADRIC_HYPERBOLIC_CYLINDER: case GeoQuadricNDConstants.QUADRIC_SINGLE_POINT: if (getView3D().viewChangedByZoom() || getView3D().viewChangedByTranslate()) { updateForItSelf(); } break; case GeoQuadricNDConstants.QUADRIC_PARALLEL_PLANES: case GeoQuadricNDConstants.QUADRIC_INTERSECTING_PLANES: if (getView3D().viewChanged()) { initDrawPlanes(quadric); drawPlanes[0].updateForView(); drawPlanes[1].updateForView(); super.setWaitForUpdate(); } break; case GeoQuadricNDConstants.QUADRIC_PLANE: if (getView3D().viewChanged()) { initDrawPlanes(quadric); drawPlanes[0].updateForView(); super.setWaitForUpdate(); } break; case GeoQuadricNDConstants.QUADRIC_LINE: if (getView3D().viewChanged()) { initDrawLine(quadric); drawLine.updateForView(); super.setWaitForUpdate(); } break; } }