예제 #1
0
  @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();
  }
예제 #2
0
  @Override
  public void setWaitForUpdateVisualStyle() {
    super.setWaitForUpdateVisualStyle();

    // also update for plane clip
    setWaitForUpdate();
  }
예제 #3
0
  @Override
  public void setWaitForReset() {

    gridIndex = -1;
    gridOutlineIndex = -1;
    super.setWaitForReset();
  }
예제 #4
0
  @Override
  public void setWaitForUpdate() {

    super.setWaitForUpdate();
    setMinMax();
    checkViewDirectionIsParallel();
  }
예제 #5
0
  @Override
  protected void recordTrace() {
    GeoQuadric3D quadric = (GeoQuadric3D) getGeoElement();
    switch (quadric.getType()) {
      case GeoQuadricNDConstants.QUADRIC_PARALLEL_PLANES:
      case GeoQuadricNDConstants.QUADRIC_INTERSECTING_PLANES:
        initDrawPlanes(quadric);
        drawPlanes[0].recordTrace();
        drawPlanes[1].recordTrace();
        break;

      case GeoQuadricNDConstants.QUADRIC_PLANE:
        initDrawPlanes(quadric);
        drawPlanes[0].recordTrace();
        break;

      case GeoQuadricNDConstants.QUADRIC_LINE:
        initDrawLine(quadric);
        drawLine.recordTrace();
        break;

      default:
        super.recordTrace();
        break;
    }
  }
예제 #6
0
  @Override
  protected void drawTracesTranspSurface(Renderer renderer) {
    if (drawPlanes != null) {
      drawPlanes[0].drawTracesTranspSurface(renderer);
      if (drawPlanes[1] != null) {
        drawPlanes[1].drawTracesTranspSurface(renderer);
      }
    }

    super.drawTracesTranspSurface(renderer);
  }
예제 #7
0
  @Override
  protected void clearTraceForViewChanged() {

    if (drawPlanes != null) {
      drawPlanes[0].clearTraceForViewChanged();
      if (drawPlanes[1] != null) {
        drawPlanes[1].clearTraceForViewChanged();
      }
    }

    if (drawLine != null) {
      drawLine.clearTraceForViewChanged();
    }

    super.clearTraceForViewChanged();
  }
예제 #8
0
  @Override
  public void disposePreview() {

    // first update preview to ensure segments arrays are correct
    updatePreview();

    super.disposePreview();

    // dispose segments
    if (segments != null) {
      for (DrawSegment3D s : segments) {
        s.disposePreview();
      }
    }

    // we may reuse it
    if (segmentsPoints != null) {
      segmentsPoints.clear();
    }
  }
예제 #9
0
  @Override
  protected void updateColors() {
    super.updateColors();

    GeoQuadric3D quadric = (GeoQuadric3D) getGeoElement();
    switch (quadric.getType()) {
      case GeoQuadricNDConstants.QUADRIC_PARALLEL_PLANES:
      case GeoQuadricNDConstants.QUADRIC_INTERSECTING_PLANES:
        initDrawPlanes(quadric);
        drawPlanes[0].updateColors();
        drawPlanes[1].updateColors();
        break;

      case GeoQuadricNDConstants.QUADRIC_PLANE:
        initDrawPlanes(quadric);
        drawPlanes[0].updateColors();
        break;

      case GeoQuadricNDConstants.QUADRIC_LINE:
        initDrawLine(quadric);
        drawLine.updateColors();
        break;
    }
  }
예제 #10
0
  @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;
    }
  }
예제 #11
0
 @Override
 public void removeFromDrawable3DLists(Drawable3DLists lists) {
   removeFromDrawable3DLists(lists, DRAW_TYPE_CURVES);
   super.removeFromDrawable3DLists(lists);
 }
예제 #12
0
 @Override
 public void addToDrawable3DLists(Drawable3DLists lists) {
   addToDrawable3DLists(lists, DRAW_TYPE_CURVES);
   super.addToDrawable3DLists(lists);
 }
예제 #13
0
  @Override
  public void drawHidden(Renderer renderer) {
    super.drawHidden(renderer);

    drawTracesOutline(renderer, true);
  }
예제 #14
0
  @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;
    }
  }