public class AxeBox extends Object implements IAxe
Modifier and Type | Field and Description |
---|---|
protected List<AxeAnnotation> |
annotations |
static int |
AXE_X |
static int |
AXE_Y |
static int |
AXE_Z |
protected int[][] |
axeXquads |
protected float[][] |
axeXx |
protected float[][] |
axeXy |
protected float[][] |
axeXz |
protected int[][] |
axeYquads |
protected float[][] |
axeYx |
protected float[][] |
axeYy |
protected float[][] |
axeYz |
protected int[][] |
axeZquads |
protected float[][] |
axeZx |
protected float[][] |
axeZy |
protected float[][] |
axeZz |
protected BoundingBox3d |
boxBounds |
protected Coord3d |
center |
protected IAxeLayout |
layout |
protected float[] |
normx |
protected float[] |
normy |
protected float[] |
normz |
protected static int |
PRECISION |
protected boolean[] |
quadIsHidden |
protected float[][] |
quadx |
protected float[][] |
quady |
protected float[][] |
quadz |
protected Coord3d |
scale |
protected SpaceTransformer |
spaceTransformer |
protected ITextRenderer |
txt |
protected View |
view |
protected BoundingBox3d |
wholeBounds |
protected float |
xrange |
protected float |
yrange |
protected float |
zrange |
Constructor and Description |
---|
AxeBox(BoundingBox3d bbox) |
AxeBox(BoundingBox3d bbox,
IAxeLayout layout) |
Modifier and Type | Method and Description |
---|---|
void |
addAnnotation(AxeAnnotation annotation) |
void |
cullingDisable(com.jogamp.opengl.GL gl) |
void |
cullingEnable(com.jogamp.opengl.GL gl) |
void |
dispose() |
void |
doTransform(com.jogamp.opengl.GL gl)
reset to identity and apply scaling
|
void |
draw(com.jogamp.opengl.GL gl,
com.jogamp.opengl.glu.GLU glu,
Camera camera)
Draws the AxeBox.
|
void |
drawAxisLabel(com.jogamp.opengl.GL gl,
com.jogamp.opengl.glu.GLU glu,
Camera cam,
int direction,
Color color,
BoundingBox3d ticksTxtBounds,
double xlab,
double ylab,
double zlab,
String axeLabel) |
void |
drawAxisTickNumericLabel(com.jogamp.opengl.GL gl,
com.jogamp.opengl.glu.GLU glu,
int direction,
Camera cam,
Color color,
Halign hAlign,
Valign vAlign,
BoundingBox3d ticksTxtBounds,
String tickLabel,
Coord3d tickPosition) |
void |
drawAxisTicks(com.jogamp.opengl.GL gl,
com.jogamp.opengl.glu.GLU glu,
Camera cam,
int direction,
Color color,
Halign hal,
Valign val,
float tickLength,
BoundingBox3d ticksTxtBounds,
double xpos,
double ypos,
double zpos,
float xdir,
float ydir,
float zdir,
double[] ticks)
Draw an array of ticks on the given axis indicated by direction field.
|
protected void |
drawCube(com.jogamp.opengl.GL gl,
int mode)
Make all GL2 calls allowing to build a cube with 6 separate quads.
|
void |
drawFace(com.jogamp.opengl.GL gl) |
void |
drawGrid(com.jogamp.opengl.GL gl) |
protected void |
drawGridOnQuad(com.jogamp.opengl.GL gl,
int quad)
Draw a grid on the desired quad.
|
void |
drawTickLine(com.jogamp.opengl.GL gl,
Color color,
double xpos,
double ypos,
double zpos,
double xlab,
double ylab,
double zlab) |
protected BoundingBox3d |
drawTicks(com.jogamp.opengl.GL gl,
com.jogamp.opengl.glu.GLU glu,
Camera cam,
int axis,
int direction,
Color color) |
protected BoundingBox3d |
drawTicks(com.jogamp.opengl.GL gl,
com.jogamp.opengl.glu.GLU glu,
Camera cam,
int axis,
int direction,
Color color,
Halign hal,
Valign val)
Draws axis labels, tick lines and tick label
|
void |
drawTicksAndLabels(com.jogamp.opengl.GL gl,
com.jogamp.opengl.glu.GLU glu,
Camera camera) |
void |
drawTicksAndLabelsX(com.jogamp.opengl.GL gl,
com.jogamp.opengl.glu.GLU glu,
Camera camera) |
void |
drawTicksAndLabelsY(com.jogamp.opengl.GL gl,
com.jogamp.opengl.glu.GLU glu,
Camera camera) |
void |
drawTicksAndLabelsZ(com.jogamp.opengl.GL gl,
com.jogamp.opengl.glu.GLU glu,
Camera camera) |
protected int |
findClosestXaxe(Camera cam)
Selects the closest displayable X axe from camera
|
protected int |
findClosestYaxe(Camera cam)
Selects the closest displayable Y axe from camera
|
protected int |
findClosestZaxe(Camera cam)
Selects the closest displayable Z axe from camera
|
List<AxeAnnotation> |
getAnnotations() |
protected double[] |
getAxisTicks(int direction) |
BoundingBox3d |
getBoxBounds() |
Coord3d |
getCenter() |
boolean[] |
getHiddenQuads(Coord3d scaledEye,
Coord3d center) |
protected boolean[] |
getHiddenQuads(com.jogamp.opengl.GL gl,
Camera cam)
Computes the visibility of each cube face.
|
IAxeLayout |
getLayout() |
Coord3d |
getScale() |
SpaceTransformer |
getSpaceTransformer() |
ITextRenderer |
getTextRenderer() |
View |
getView() |
BoundingBox3d |
getWholeBounds()
Return the boundingBox of this axis, including the volume occupied by the texts.
|
protected void |
init() |
protected boolean |
isX(int direction) |
protected boolean |
isXDisplayed(int direction) |
protected boolean |
isY(int direction) |
protected boolean |
isYDisplayed(int direction) |
protected boolean |
isZ(int direction) |
protected boolean |
isZDisplayed(int direction) |
Halign |
layoutHorizontal(int direction,
Camera cam,
Halign hal,
Coord3d tickPosition) |
Valign |
layoutVertical(int direction,
Valign val,
float zdir) |
protected int |
min(double[] values)
Return the index of the minimum value contained in the input array of doubles.
|
void |
setAnnotations(List<AxeAnnotation> annotations) |
void |
setAxe(BoundingBox3d bbox) |
protected void |
setAxeBox(float xmin,
float xmax,
float ymin,
float ymax,
float zmin,
float zmax)
Set the parameters and data of the AxeBox.
|
void |
setScale(Coord3d scale)
Set the scaling factor that are applyed on this object before GL2 commands.
|
void |
setSpaceTransformer(SpaceTransformer spaceTransformer) |
void |
setTextRenderer(ITextRenderer renderer) |
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.
|
protected void |
updateHiddenQuads(com.jogamp.opengl.GL gl,
Camera camera) |
protected void |
vertexGL2(com.jogamp.opengl.GL gl,
Coord3d c)
A helper to call glVerted3f on the input coordinate.
|
protected void |
vertexGL2(com.jogamp.opengl.GL gl,
float x,
float y,
float z) |
protected void |
vertexGLES2(Coord3d c)
A helper to call glVerted3f on the input coordinate.
|
protected void |
vertexGLES2(float x,
float y,
float z) |
protected static final int PRECISION
protected View view
protected ITextRenderer txt
protected IAxeLayout layout
protected BoundingBox3d boxBounds
protected BoundingBox3d wholeBounds
protected Coord3d center
protected Coord3d scale
protected float xrange
protected float yrange
protected float zrange
protected float[][] quadx
protected float[][] quady
protected float[][] quadz
protected float[] normx
protected float[] normy
protected float[] normz
protected float[][] axeXx
protected float[][] axeXy
protected float[][] axeXz
protected float[][] axeYx
protected float[][] axeYy
protected float[][] axeYz
protected float[][] axeZx
protected float[][] axeZy
protected float[][] axeZz
protected int[][] axeXquads
protected int[][] axeYquads
protected int[][] axeZquads
protected boolean[] quadIsHidden
public static final int AXE_X
public static final int AXE_Y
public static final int AXE_Z
protected List<AxeAnnotation> annotations
protected SpaceTransformer spaceTransformer
public AxeBox(BoundingBox3d bbox)
public AxeBox(BoundingBox3d bbox, IAxeLayout layout)
public List<AxeAnnotation> getAnnotations()
getAnnotations
in interface IAxe
public void setAnnotations(List<AxeAnnotation> annotations)
setAnnotations
in interface IAxe
public void addAnnotation(AxeAnnotation annotation)
public void draw(com.jogamp.opengl.GL gl, com.jogamp.opengl.glu.GLU glu, Camera camera)
public void doTransform(com.jogamp.opengl.GL gl)
public void cullingDisable(com.jogamp.opengl.GL gl)
public void cullingEnable(com.jogamp.opengl.GL gl)
public void drawFace(com.jogamp.opengl.GL gl)
public void drawGrid(com.jogamp.opengl.GL gl)
public void drawTicksAndLabels(com.jogamp.opengl.GL gl, com.jogamp.opengl.glu.GLU glu, Camera camera)
public void drawTicksAndLabelsX(com.jogamp.opengl.GL gl, com.jogamp.opengl.glu.GLU glu, Camera camera)
public void drawTicksAndLabelsY(com.jogamp.opengl.GL gl, com.jogamp.opengl.glu.GLU glu, Camera camera)
public void drawTicksAndLabelsZ(com.jogamp.opengl.GL gl, com.jogamp.opengl.glu.GLU glu, Camera camera)
protected void drawCube(com.jogamp.opengl.GL gl, int mode)
protected void drawGridOnQuad(com.jogamp.opengl.GL gl, int quad)
protected BoundingBox3d drawTicks(com.jogamp.opengl.GL gl, com.jogamp.opengl.glu.GLU glu, Camera cam, int axis, int direction, Color color)
protected BoundingBox3d drawTicks(com.jogamp.opengl.GL gl, com.jogamp.opengl.glu.GLU glu, Camera cam, int axis, int direction, Color color, Halign hal, Valign val)
public void drawAxisLabel(com.jogamp.opengl.GL gl, com.jogamp.opengl.glu.GLU glu, Camera cam, int direction, Color color, BoundingBox3d ticksTxtBounds, double xlab, double ylab, double zlab, String axeLabel)
protected boolean isZDisplayed(int direction)
protected boolean isYDisplayed(int direction)
protected boolean isXDisplayed(int direction)
protected boolean isZ(int direction)
protected boolean isY(int direction)
protected boolean isX(int direction)
protected double[] getAxisTicks(int direction)
public void drawAxisTicks(com.jogamp.opengl.GL gl, com.jogamp.opengl.glu.GLU glu, Camera cam, int direction, Color color, Halign hal, Valign val, float tickLength, BoundingBox3d ticksTxtBounds, double xpos, double ypos, double zpos, float xdir, float ydir, float zdir, double[] ticks)
public void drawAxisTickNumericLabel(com.jogamp.opengl.GL gl, com.jogamp.opengl.glu.GLU glu, int direction, Camera cam, Color color, Halign hAlign, Valign vAlign, BoundingBox3d ticksTxtBounds, String tickLabel, Coord3d tickPosition)
public Halign layoutHorizontal(int direction, Camera cam, Halign hal, Coord3d tickPosition)
public void drawTickLine(com.jogamp.opengl.GL gl, Color color, double xpos, double ypos, double zpos, double xlab, double ylab, double zlab)
protected void vertexGL2(com.jogamp.opengl.GL gl, Coord3d c)
protected void vertexGL2(com.jogamp.opengl.GL gl, float x, float y, float z)
protected void vertexGLES2(Coord3d c)
protected void vertexGLES2(float x, float y, float z)
protected int findClosestXaxe(Camera cam)
protected int findClosestYaxe(Camera cam)
protected int findClosestZaxe(Camera cam)
protected int min(double[] values)
protected void updateHiddenQuads(com.jogamp.opengl.GL gl, Camera camera)
protected boolean[] getHiddenQuads(com.jogamp.opengl.GL gl, Camera cam)
protected void setAxeBox(float xmin, float xmax, float ymin, float ymax, float zmin, float zmax)
protected void init()
public ITextRenderer getTextRenderer()
public void setTextRenderer(ITextRenderer renderer)
public View getView()
public BoundingBox3d getBoxBounds()
getBoxBounds
in interface IAxe
public IAxeLayout getLayout()
public SpaceTransformer getSpaceTransformer()
getSpaceTransformer
in interface IAxe
public void setSpaceTransformer(SpaceTransformer spaceTransformer)
setSpaceTransformer
in interface IAxe
public void setView(View view)
public void setAxe(BoundingBox3d bbox)
public BoundingBox3d getWholeBounds()
draw()
before, which computes actual ticks position in 3d, and updates the bounds.getWholeBounds
in interface IAxe
public void setScale(Coord3d scale)
Copyright © 2018. All rights reserved.