Package org.jzy3d.plot3d.primitives.axis
Class AxisBox
- java.lang.Object
-
- org.jzy3d.plot3d.primitives.axis.AxisBox
-
- All Implemented Interfaces:
IAxis
- Direct Known Subclasses:
AxisBox2d,AxisBoxWithTxtRenderer,ContourAxisBox,FeedbackBufferAxisBox
public class AxisBox extends Object implements IAxis
TheAxisBoxdisplays a box with front face invisible and ticks labels.- Author:
- Martin Pernollet
-
-
Field Summary
Fields Modifier and Type Field Description protected List<AxeAnnotation>annotationsstatic intAXE_Xstatic intAXE_Ystatic intAXE_Zprotected int[][]axeXquadsprotected float[][]axeXxprotected float[][]axeXyprotected float[][]axeXzprotected int[][]axeYquadsprotected float[][]axeYxprotected float[][]axeYyprotected float[][]axeYzprotected int[][]axeZquadsprotected float[][]axeZxprotected float[][]axeZyprotected float[][]axeZzprotected BoundingBox3dboxBoundsprotected Coord3dcenterprotected AxisLabelProcessorlabelsprotected IAxisLayoutlayoutprotected float[]normxprotected float[]normyprotected float[]normzprotected static intPRECISIONprotected boolean[]quadIsHiddenprotected float[][]quadxprotected float[][]quadyprotected float[][]quadzprotected AxisLabelRotatorrotateLabelprotected Coord3dscaleprotected SpaceTransformerspaceTransformerprotected ITextRenderertextRendererprotected AxisTickProcessorticksprotected Viewviewprotected BoundingBox3dwholeBoundsprotected floatxrangeprotected floatyrangeprotected floatzrange
-
Constructor Summary
Constructors Constructor Description AxisBox(BoundingBox3d bbox)AxisBox(BoundingBox3d bbox, IAxisLayout layout)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddAnnotation(AxeAnnotation annotation)voidcullingDisable(IPainter painter)voidcullingEnable(IPainter painter)voiddispose()voiddoTransform(IPainter painter)reset to identity and apply scalingvoiddraw(IPainter painter)Draws the AxeBox.protected voiddrawAnnotations(IPainter painter)protected voiddrawCube(IPainter painter, RenderMode mode)voiddrawFace(IPainter painter)voiddrawGrid(IPainter painter)protected voiddrawGridOnQuad(IPainter painter, int quad)voiddrawTicksAndLabels(IPainter painter)voiddrawTicksAndLabelsX(IPainter painter)voiddrawTicksAndLabelsY(IPainter painter)voiddrawTicksAndLabelsZ(IPainter painter)protected intfindClosestXaxe(Camera cam)Selects the closest displayable X axe from cameraprotected intfindClosestYaxe(Camera cam)Selects the closest displayable Y axe from cameraprotected intfindClosestZaxe(Camera cam)Selects the closest displayable Z axe from cameraList<AxeAnnotation>getAnnotations()protected double[]getAxisTicks(int direction)BoundingBox3dgetBounds()Coord3dgetCenter()BoundingBox3d.CornersgetCorners()boolean[]getHiddenQuads(Coord3d scaledEye, Coord3d center)protected boolean[]getHiddenQuads(IPainter painter)Computes the visibility of each cube face.IAxisLayoutgetLayout()boolean[]getQuadIsHidden()float[][]getQuadX()float[][]getQuadY()float[][]getQuadZ()Coord3dgetScale()SpaceTransformergetSpaceTransformer()ITextRenderergetTextRenderer()ViewgetView()BoundingBox3dgetWholeBounds()Return the boundingBox of this axis, including the volume occupied by the texts.protected voidinit()protected booleanisX(int direction)protected booleanisXAxeLabelDisplayed(int direction)protected booleanisY(int direction)protected booleanisYAxeLabelDisplayed(int direction)protected booleanisZ(int direction)protected booleanisZAxeLabelDisplayed(int direction)protected intmin(double[] values)Return the index of the minimum value contained in the input array of doubles.voidsetAnnotations(List<AxeAnnotation> annotations)voidsetAxe(BoundingBox3d bbox)protected voidsetAxeBox(float xmin, float xmax, float ymin, float ymax, float zmin, float zmax)Set the parameters and data of the AxeBox.voidsetScale(Coord3d scale)Set the scaling factor that are applyed on this object before GL2 commands.voidsetSpaceTransformer(SpaceTransformer spaceTransformer)voidsetTextRenderer(ITextRenderer renderer)voidsetView(View view)When setting a current view, the AxeBox can know the view is on mode CameraMode.TOP, and optimize some axis placement.protected voidupdateHiddenQuads(IPainter painter)
-
-
-
Field Detail
-
PRECISION
protected static final int PRECISION
- See Also:
- Constant Field Values
-
view
protected View view
-
textRenderer
protected ITextRenderer textRenderer
-
rotateLabel
protected AxisLabelRotator rotateLabel
-
labels
protected AxisLabelProcessor labels
-
ticks
protected AxisTickProcessor ticks
-
layout
protected IAxisLayout 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:
- Constant Field Values
-
AXE_Y
public static final int AXE_Y
- See Also:
- Constant Field Values
-
AXE_Z
public static final int AXE_Z
- See Also:
- Constant Field Values
-
annotations
protected List<AxeAnnotation> annotations
-
spaceTransformer
protected SpaceTransformer spaceTransformer
-
-
Constructor Detail
-
AxisBox
public AxisBox(BoundingBox3d bbox)
-
AxisBox
public AxisBox(BoundingBox3d bbox, IAxisLayout layout)
-
-
Method Detail
-
draw
public void draw(IPainter painter)
Draws the AxeBox. 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.
-
drawAnnotations
protected void drawAnnotations(IPainter painter)
-
doTransform
public void doTransform(IPainter painter)
reset to identity and apply scaling- Parameters:
painter- TODO
-
cullingDisable
public void cullingDisable(IPainter painter)
-
cullingEnable
public void cullingEnable(IPainter painter)
-
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)
-
drawTicksAndLabelsX
public void drawTicksAndLabelsX(IPainter painter)
-
drawTicksAndLabelsY
public void drawTicksAndLabelsY(IPainter painter)
-
drawTicksAndLabelsZ
public void drawTicksAndLabelsZ(IPainter painter)
-
isZAxeLabelDisplayed
protected boolean isZAxeLabelDisplayed(int direction)
-
isYAxeLabelDisplayed
protected boolean isYAxeLabelDisplayed(int direction)
-
isXAxeLabelDisplayed
protected boolean isXAxeLabelDisplayed(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.
-
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()
-
getTextRenderer
public ITextRenderer getTextRenderer()
- Specified by:
getTextRendererin interfaceIAxis
-
setTextRenderer
public void setTextRenderer(ITextRenderer renderer)
- Specified by:
setTextRendererin interfaceIAxis
-
getView
public View getView()
-
getBounds
public BoundingBox3d getBounds()
-
getLayout
public IAxisLayout getLayout()
-
getSpaceTransformer
public SpaceTransformer getSpaceTransformer()
- Specified by:
getSpaceTransformerin interfaceIAxis
-
setSpaceTransformer
public void setSpaceTransformer(SpaceTransformer spaceTransformer)
- Specified by:
setSpaceTransformerin interfaceIAxis
-
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)
-
getWholeBounds
public BoundingBox3d getWholeBounds()
Return the boundingBox of this axis, including the volume occupied by the texts. This requires callingdraw()before, which computes actual ticks position in 3d, and updates the bounds.- Specified by:
getWholeBoundsin interfaceIAxis
-
setScale
public void setScale(Coord3d scale)
Set the scaling factor that are applyed on this object before GL2 commands.
-
getAnnotations
public List<AxeAnnotation> getAnnotations()
- Specified by:
getAnnotationsin interfaceIAxis
-
setAnnotations
public void setAnnotations(List<AxeAnnotation> annotations)
- Specified by:
setAnnotationsin interfaceIAxis
-
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()
-
-