Class CurveRenderingPanel

All Implemented Interfaces:
ImageObserver, MenuContainer, Serializable, Accessible
Direct Known Subclasses:
SurfaceMaskPanel

public class CurveRenderingPanel extends JPanel
Panel for drawing 2D cutting curves.
See Also:
  • Field Details

    • faceBoundingBox

      protected Box faceBoundingBox
  • Constructor Details

    • CurveRenderingPanel

      public CurveRenderingPanel()
      Constructor.
  • Method Details

    • getHighlightIndex

      public int getHighlightIndex()
    • setHighlightIndex

      public void setHighlightIndex(int highlightIndex)
    • getSampling

      public int getSampling()
    • setSampling

      public void setSampling(int sampling)
      Sets sampling for rendering the cross-cut curve
      Parameters:
      sampling - % of points to keep on the curve
    • getNormalVectorLength

      public int getNormalVectorLength()
    • setNormalVectorLength

      public void setNormalVectorLength(int normalVectorLength)
    • setCurves

      public void setCurves(List<CrossSection2D> primaryCrossSectionCurves, List<CrossSection2D> secondaryCrossSectionCurves)
      Sets computed cross-section curves for rendering.
      Parameters:
      primaryCrossSectionCurves - cross-sections with primary face
      secondaryCrossSectionCurves - cross-sections with secondary face
    • get2DPrimaryCurves

      public List<CrossSection2D> get2DPrimaryCurves()
      Getter for primary curves.
      Returns:
      list of visible 2D curves for primary face
    • get2DSecondaryCurves

      public List<CrossSection2D> get2DSecondaryCurves()
      Getter for secondary curves.
      Returns:
      list of visible 2D curves for secondary face
    • setCurrentCuttingPlane

      public void setCurrentCuttingPlane(javax.vecmath.Vector3d currentPlaneNormal)
      Sets current cutting plane and recomputes scale and offset fields for proper display of CrossSectionCurve.
      Parameters:
      currentPlaneNormal - normal vector of current cutting plane
    • getCurrentCuttingPlane

      public javax.vecmath.Vector3d getCurrentCuttingPlane()
    • setFaceBoundingBox

      public void setFaceBoundingBox(Box boundingBox)
      Sets bounding box used for computing scale and offset when drawing CrossSectionCurve.
      Parameters:
      boundingBox - bounding box of currently analyzed face
    • setShowNormals

      public void setShowNormals(boolean showNormals)
    • getPreferredSize

      public Dimension getPreferredSize()
      Overrides:
      getPreferredSize in class JComponent
    • paintComponent

      protected void paintComponent(Graphics g)
      Overrides:
      paintComponent in class JComponent
    • paintCurve

      protected void paintCurve(Graphics2D g2, CrossSection2D curve, Color faceColor, boolean highlight)
    • paintCurveSegment

      protected void paintCurveSegment(Graphics2D g2, List<javax.vecmath.Point2d> curveSegment, Color faceColor)
    • drawProjectedFeaturePoints

      protected void drawProjectedFeaturePoints(Graphics2D g2, CrossSection2D curve, Color faceColor)