Class AxisBox

java.lang.Object
org.jzy3d.plot3d.primitives.axis.AxisBox
All Implemented Interfaces:
IAxis
Direct Known Subclasses:
AxisBox2d, ContourAxisBox, FeedbackBufferAxisBox

public class AxisBox extends Object implements IAxis
The AxisBox displays a box with front face invisible and ticks labels.
Author:
Martin Pernollet
  • Field Details

    • PRECISION

      protected static final int PRECISION
      See Also:
    • view

      protected View view
    • textRenderer

      protected ITextRenderer textRenderer
    • rotateLabel

      protected AxisLabelRotator rotateLabel
    • labels

      protected AxisLabelProcessor labels
    • ticks

      protected AxisTickProcessor ticks
    • layout

      protected AxisLayout layout
    • boxBounds

      protected BoundingBox3d boxBounds
    • wholeBounds

      protected BoundingBox3d wholeBounds
    • center

      protected Coord3d center
    • scale

      protected Coord3d scale
    • xrange

      protected float xrange
    • yrange

      protected float yrange
    • zrange

      protected float zrange
    • quadx

      protected float[][] quadx
    • quady

      protected float[][] quady
    • quadz

      protected float[][] quadz
    • normx

      protected float[] normx
    • normy

      protected float[] normy
    • normz

      protected float[] normz
    • axeXx

      protected float[][] axeXx
    • axeXy

      protected float[][] axeXy
    • axeXz

      protected float[][] axeXz
    • axeYx

      protected float[][] axeYx
    • axeYy

      protected float[][] axeYy
    • axeYz

      protected float[][] axeYz
    • axeZx

      protected float[][] axeZx
    • axeZy

      protected float[][] axeZy
    • axeZz

      protected float[][] axeZz
    • axeXquads

      protected int[][] axeXquads
    • axeYquads

      protected int[][] axeYquads
    • axeZquads

      protected int[][] axeZquads
    • quadIsHidden

      protected boolean[] quadIsHidden
    • AXE_X

      public static final int AXE_X
      See Also:
    • AXE_Y

      public static final int AXE_Y
      See Also:
    • AXE_Z

      public static final int AXE_Z
      See Also:
    • EDGE_0

      public static final int EDGE_0
      See Also:
    • EDGE_1

      public static final int EDGE_1
      See Also:
    • EDGE_2

      public static final int EDGE_2
      See Also:
    • EDGE_3

      public static final int EDGE_3
      See Also:
    • depthRangeTrick

      protected boolean depthRangeTrick
    • NO_OVERLAP_DEPTH_RATIO

      public static float NO_OVERLAP_DEPTH_RATIO
      The higher the value, the more the line are far from the faces and hence no z-fighting occurs between faces and lines. In case of higher value, line will be display more often, but also lines that should be behind the polygon
    • annotations

      protected List<AxeAnnotation> annotations
    • spaceTransformer

      protected SpaceTransformer spaceTransformer
  • Constructor Details

  • Method Details

    • draw

      public void draw(IPainter painter)
      Draws the AxisBox. The camera is used to determine which axis is closest to the ur point ov view, in order to decide for an axis on which to diplay the tick values.
      Specified by:
      draw in interface IAxis
    • drawAnnotations

      protected void drawAnnotations(IPainter painter)
    • doTransform

      public void doTransform(IPainter painter)
      reset to identity and apply scaling
    • drawFace

      public void drawFace(IPainter painter)
    • drawGrid

      public void drawGrid(IPainter painter)
    • drawCube

      protected void drawCube(IPainter painter, RenderMode mode)
    • drawGridOnQuad

      protected void drawGridOnQuad(IPainter painter, int quad)
    • drawTicksAndLabels

      public void drawTicksAndLabels(IPainter painter)
      Trigger all axis ticks and labels rendering if conditions are met.
    • drawTicksAndLabelsX

      public void drawTicksAndLabelsX(IPainter painter)
      Select an X axis for ticks and labels rendering if conditions are met (range > 0 and axis layout configured to display this axis)
    • drawTicksAndLabelsY

      public void drawTicksAndLabelsY(IPainter painter)
      Select an Y axis for ticks and labels rendering if conditions are met (range > 0 and axis layout configured to display this axis)
    • drawTicksAndLabelsZ

      public void drawTicksAndLabelsZ(IPainter painter)
      Select a Z axis for ticks and labels rendering if conditions are met (range > 0 and axis layout configured to display this axis)
    • is3D

      protected boolean is3D()
      returns true if view is configured for a 3D chart where all axes are visible.
    • is2DWithX

      protected boolean is2DWithX()
      returns true if view is configured for a 2D chart where X is a visible axis.
    • is2DWithY

      protected boolean is2DWithY()
      returns true if view is configured for a 2D chart where Y is a visible axis.
    • is2DWithZ

      protected boolean is2DWithZ()
      returns true if view is configured for a 2D chart where Z is a visible axis.
    • isZAxisLabelDisplayed

      protected boolean isZAxisLabelDisplayed(int direction)
    • isYAxisLabelDisplayed

      protected boolean isYAxisLabelDisplayed(int direction)
    • isXAxisLabelDisplayed

      protected boolean isXAxisLabelDisplayed(int direction)
    • isZ

      protected boolean isZ(int direction)
    • isY

      protected boolean isY(int direction)
    • isX

      protected boolean isX(int direction)
    • getAxisTicks

      protected double[] getAxisTicks(int direction)
    • findClosestXaxe

      protected int findClosestXaxe(Camera cam)
      Selects the closest displayable X axe from camera
    • findClosestYaxe

      protected int findClosestYaxe(Camera cam)
      Selects the closest displayable Y axe from camera
    • findClosestZaxe

      protected int findClosestZaxe(Camera cam)
      Selects the closest displayable Z axe from camera
    • min

      protected int min(double[] values)
      Return the index of the minimum value contained in the input array of doubles. If no value is smaller than Double.MAX_VALUE, the returned index is -1.
    • updateHiddenQuads

      protected void updateHiddenQuads(IPainter painter)
    • getHiddenQuads

      protected boolean[] getHiddenQuads(IPainter painter)
      Computes the visibility of each cube face.
    • getHiddenQuads

      public boolean[] getHiddenQuads(Coord3d scaledEye, Coord3d center)
    • setAxeBox

      protected void setAxeBox(float xmin, float xmax, float ymin, float ymax, float zmin, float zmax)
      Set the parameters and data of the AxeBox.
    • init

      protected void init()
    • dispose

      public void dispose()
      Specified by:
      dispose in interface IAxis
    • getTextRenderer

      public ITextRenderer getTextRenderer()
      Specified by:
      getTextRenderer in interface IAxis
    • setTextRenderer

      public void setTextRenderer(ITextRenderer renderer)
      Specified by:
      setTextRenderer in interface IAxis
    • getView

      public View getView()
    • getBounds

      public BoundingBox3d getBounds()
      Specified by:
      getBounds in interface IAxis
    • getLayout

      public AxisLayout getLayout()
      Specified by:
      getLayout in interface IAxis
    • getSpaceTransformer

      public SpaceTransformer getSpaceTransformer()
      Specified by:
      getSpaceTransformer in interface IAxis
    • setSpaceTransformer

      public void setSpaceTransformer(SpaceTransformer spaceTransformer)
      Specified by:
      setSpaceTransformer in interface IAxis
    • setView

      public void setView(View view)
      When setting a current view, the AxeBox can know the view is on mode CameraMode.TOP, and optimize some axis placement.
    • setAxe

      public void setAxe(BoundingBox3d bbox)
      Specified by:
      setAxe in interface IAxis
    • getWholeBounds

      public BoundingBox3d getWholeBounds()
      Return the boundingBox of this axis, including the volume occupied by the texts. This requires calling
      invalid @link
      draw()
      before, which computes actual ticks position in 3d, and updates the bounds.
      Specified by:
      getWholeBounds in interface IAxis
    • getCenter

      public Coord3d getCenter()
      Specified by:
      getCenter in interface IAxis
    • setScale

      public void setScale(Coord3d scale)
      Set the scaling factor that are applyed on this object before GL2 commands.
      Specified by:
      setScale in interface IAxis
    • getScale

      public Coord3d getScale()
      Specified by:
      getScale in interface IAxis
    • getAnnotations

      public List<AxeAnnotation> getAnnotations()
      Specified by:
      getAnnotations in interface IAxis
    • setAnnotations

      public void setAnnotations(List<AxeAnnotation> annotations)
      Specified by:
      setAnnotations in interface IAxis
    • addAnnotation

      public void addAnnotation(AxeAnnotation annotation)
    • getQuadX

      public float[][] getQuadX()
    • getQuadY

      public float[][] getQuadY()
    • getQuadZ

      public float[][] getQuadZ()
    • getQuadIsHidden

      public boolean[] getQuadIsHidden()
    • getCorners

      public BoundingBox3d.Corners getCorners()
    • getLabelRotator

      public AxisLabelRotator getLabelRotator()
    • setLabelRotator

      public void setLabelRotator(AxisLabelRotator rotateLabel)
    • getLabelProcessor

      public AxisLabelProcessor getLabelProcessor()
    • setLabelProcessor

      public void setLabelProcessor(AxisLabelProcessor labels)
    • getTickProcessor

      public AxisTickProcessor getTickProcessor()
    • setTickProcessor

      public void setTickProcessor(AxisTickProcessor ticks)