public final class PgAxes extends PgGeometry implements PvCameraListenerIf
PgRuler
,
Serialized FormModifier and Type | Field and Description |
---|---|
static int |
AXES_2DBOUNDINGBOX
Not supported yet.
|
static int |
AXES_2DXY_CENTER |
static int |
AXES_2DXY_CORNER |
static int |
AXES_2DYZ_CENTER |
static int |
AXES_2DYZ_CORNER |
static int |
AXES_2DZX_CENTER |
static int |
AXES_2DZX_CORNER |
static int |
AXES_3DBOUNDINGBOX |
static int |
AXES_3DCENTRAL |
static int |
AXES_3DCORNER |
static int |
AXES_NONE |
static int |
COORD_ADJUST
Indicates that axes adjusts to ambient transformation.
|
static int |
COORD_AMBIENT
Ambient coordinate system, not implemented yet.
|
static int |
COORD_MODEL
Modelling coordinate system.
|
static int |
COORD_SCENE
Scene respectively camera coordinate system.
|
static int |
OPT_HASH_NUMBER
Preferred number of major hash ticks on an axis.
|
static double |
OPT_HASH_RATIO
Preferred ratio of major unit to minor unit.
|
HAS_BOUNDARY_PANEL, HAS_CONFIG_PANEL, HAS_INFO_PANEL, HAS_LABEL_PANEL, HAS_MATERIAL_PANEL, HAS_TEXTURE_PANEL, HAS_VECTOR_PANEL, INSPECTOR_INFO, INSPECTOR_INFO_EXT, IS_DELETED, IS_FIXED, IS_FOCUSSED, IS_PICKED, IS_SELECTED, IS_USED, NUM_TAGS
AMBIENT_H2_HYPERBOLIC, AMBIENT_H3_HYPERBOLIC, AMBIENT_H4_HYPERBOLIC, AMBIENT_PROJECTIONS, AMBIENT_R1_EUCLIDEAN, AMBIENT_R2_EUCLIDEAN, AMBIENT_R3_EUCLIDEAN, AMBIENT_R4_EUCLIDEAN, AMBIENT_R5_EUCLIDEAN, AMBIENT_S1_SPHERE, AMBIENT_S2_SPHERE, AMBIENT_S3_SPHERE, AMBIENT_S4_SPHERE, AMBIENT_SPACES, BLEND_ALPHA, BLEND_MATERIAL, BLEND_REPLACE, FILTER_DIRECT, FILTER_LINEAR, FILTER_QUADRATIC, HAS_METHOD_MENU, INSPECTOR_CONTROL, INSPECTOR_CONTROL_EXT, INSPECTOR_MATERIAL, INSPECTOR_MATERIAL_EXT, INSPECTOR_TEXTURE, INSPECTOR_TEXTURE_EXT, LABEL_BASE, LABEL_CENTER, LABEL_HEAD, LABEL_MIDDLE, LABEL_TAIL, LABEL_TOP, m_numLabelTypes, METHOD_EXT, PERIODIC_BOTH, PERIODIC_HEIGHT, PERIODIC_NONE, PERIODIC_WIDTH, PROJ_KLEIN_BALL, PROJ_PARALLEL, PROJ_POINCARE_BALL, PROJ_STEREOGRAPHIC, PROJ_UPPER_HALFSPACE, SIDE_BACK, SIDE_BOTH, SIDE_FRONT, SIDE_NONE
Constructor and Description |
---|
PgAxes(int dim)
Constructs an axes object which handles the axis of a right handed coordinate system.
|
Modifier and Type | Method and Description |
---|---|
void |
configure(PdVector[] bndBox,
PdVector viewDir)
Assign new camera viewing direction and scene bounding box,
and, if autoHashing is enabled, recompute hashing units.
|
void |
dragCamera(PvCameraEvent pos)
Get camera events resulting from dragging the mouse.
|
PgRuler[] |
getAxes()
Set of axis will be returned.
|
PdVector[] |
getBounds()
Compute bounding box of the vertices which are transformed with ambient and model matrix.
|
int |
getCoordSystem()
Check if axes is attached to scene, individual geometry or ambient coordinate system.
|
boolean[] |
getHashingFlags()
Get state of showing of grid xy, yz, and zx planes.
|
int |
getHashMode()
Get hashing mode of a ruler is either partitioned or fixed, see PgRuler#HASH_FIXED or PgRuler#HASH_PARTITIONED.
|
java.lang.String[] |
getLabels()
Deprecated.
use getNames().
|
int |
getMode()
Get the axes type which is currently displayed.
|
java.lang.String[] |
getNames()
Get names of all axes showing at one of their midpoints.
|
int |
getNumRulers()
Get number of individual axis, respectively rulers.
|
java.lang.String[] |
getTitles()
Deprecated.
use getNames().
|
void |
init()
Initialization of axis object.
|
boolean |
isEnabledAutoBounds()
Check if automatic adjustment of size of axes to varying bounding box is enabled.
|
boolean |
isEnabledAutoConfigure()
Deprecated.
since JavaView 3.12.002, use isEnabledAutoHashing()
|
boolean |
isEnabledAutoHashing()
Check if axes is automatically adjusted to varying size of the shown shape.
|
boolean |
isEnabledAutoLayout()
Check if automatic positioning of axes is enabled.
|
boolean |
isShowing()
Determine if all axes are visible in the display.
|
boolean |
isShowingFixedMode()
Deprecated.
since JavaView 3.12.002, use getHashMode() which returns PgRuler#HASH_FIXED or PgRuler#HASH_PARTITIONED
|
boolean |
isShowingLabels()
Determine if numbers are shown at hashings of this axis.
|
boolean |
isShowingMajorHashings()
Get showing of major hashing ticks of this axis and all rulers.
|
boolean |
isShowingMinorHashings()
Get showing of minor hashing ticks of this axis and all rulers.
|
boolean |
isShowingNames()
Determine if names of axes are shown at the middle of axes.
|
boolean |
isShowingXYGrid()
Get visibility of xy grid.
|
boolean |
isShowingYZGrid()
Get visibility of yz grid.
|
boolean |
isShowingZXGrid()
Get visibility of zx grid.
|
void |
pickCamera(PvCameraEvent pos)
Get camera events resulting from picking the mouse.
|
void |
reset()
Reset the current axes and rulers, re-construct axes and
recompute hashings of rulers.
|
void |
setAutoConfigure(boolean flag)
Deprecated.
use setEnabledAutoHashing(boolean)
|
void |
setAxesColor(java.awt.Color col)
Assign color of all individual axes.
|
void |
setAxesSize(double size)
Assign color of all individual axes.
|
void |
setBounds(PdVector[] bndbox)
Update the bounding box used to configure these axes.
|
void |
setBoxRatio(PdVector boxRatio)
Enable usage of a variable aspect ratio for the viewing frustum of this camera.
|
void |
setCameraType(int type)
Determines the current projection in the display where this axis is used.
|
void |
setCoordSystem(int coord)
Set coordinate system to which axes is attached, e.g. to scene, individual geometry or ambient space.
|
void |
setDisplay(PvDisplayIf disp)
Display must be assigned right after creating an axes object.
|
void |
setEnabledAutoBounds(boolean flag)
Enable automatic adjustment of size of axes to varying bounding box.
|
void |
setEnabledAutoConfigure(boolean flag)
Deprecated.
since JavaView 3.12.002, use setEnabledAutoHashing(boolean)
|
void |
setEnabledAutoHashing(boolean flag)
Flag is axes in "absolute unit mode" will automatically adjust to a 'good' viewing scale
based on the bounding box passed into configure().
|
void |
setEnabledAutoLayout(boolean flag)
Enable automatic positioning of axes.
|
void |
setEnabledBoxRatio(boolean flag)
Enable usage of a variable aspect ratio for the viewing frustum of this camera.
|
void |
setFixedHashings(double major,
double minor)
Set major and minor hashing units of this axis.
|
void |
setHashingsFlags(boolean[] flags)
Enable state of showing of grid xy, yz, and zx planes.
|
void |
setHashMode(int mode)
Set hashing mode of a ruler which is either partitioned or fixed, see PgRuler#HASH_FIXED or PgRuler#HASH_PARTITIONED.
|
void |
setLabelColors(java.awt.Color col)
Assign label color of all individual axes.
|
void |
setLabels(java.lang.String[] axisName)
Deprecated.
use setNames(String []).
|
void |
setLabelSize(int size)
Assign label size of all individual axes labels.
|
void |
setLabelStyles(int style)
Assign label style of all individual axes labels.
|
void |
setMode(int mode)
Set the axes type which is currently displayed.
|
void |
setNameAlignments(int[] xAlign,
int[] yAlign,
int[] zAlign)
Each parameter is an array of 4 int values, [ruleralignment, labelalignment, deltax, deltay] where
ruleralignment:={PgRuler.RULER_NAME_ALIGN_LEFT,PgRuler.RULER_NAME_ALIGN_RIGHT,PgRuler.RULER_NAME_ALIGN_CENTER}
labelalignment:=the side of the label to bound to given point, {PgGeometryIf.LABEL_HEAD, PgGeometryIf.LABEL_CENTER, PgGeometryIf.LABEL_TAIL}
deltax resp. deltay are the number of pixels to displace the label in the x resp. y direction.
|
void |
setNames(java.lang.String[] axisName)
Set names of all axes showing at one of their midpoints.
|
void |
setNumRulers(int num)
Set number of individual axis, respectively rulers.
|
void |
setPartitionedHashing(int major,
int minor)
Set number of major and minor hashing ticks.
|
void |
setShowing(boolean flag)
Set visibility of this axes geometry.
|
void |
setTitles(java.lang.String[] axisName)
Deprecated.
use setNames(String []).
|
void |
showFixedMode(boolean flag)
Deprecated.
since JavaView 3.12.002, use setHashMode(int) with PgRuler#HASH_FIXED or PgRuler#HASH_PARTITIONED
|
void |
showLabels(boolean flag)
Enable showing of numbers at hashings of this axis and all rulers.
|
void |
showMajorHashings(boolean flag)
Enable showing of major hashing ticks of this axis and all rulers.
|
void |
showMinorHashings(boolean flag)
Enable showing of minor hashing ticks of this axis and all rulers.
|
void |
showNames(boolean flag)
Show names of all axes at one of their midpoint.
|
void |
showTitles(boolean flag)
Deprecated.
use showNames(boolean).
|
void |
showXYGrid(boolean flag)
Enable showing of grid in xy-plane which is spaced at major and minor hashing ticks.
|
void |
showYZGrid(boolean flag)
Enable showing of grid in yz-plane which is spaced at major and minor hashing ticks.
|
void |
showZXGrid(boolean flag)
Enable showing of grid in zx-plane which is spaced at major and minor hashing ticks.
|
boolean |
update(java.lang.Object event)
Update calculations when the axes object or its children such as slider
change.
|
addDisplay, addElement, addPolygon, addVertex, applyAmbientMatrix, applyModelingMatrix, blend, clearTagElement, clearTagPolygon, clearTagVertex, clone, convertWorldToModel, copy, fillMethodMenu, fillMethodMenu, getAmbientBounds, getAmbientInvMatrix, getAmbientMatrix, getAmbientProjection, getAmbientSpace, getAuthorInfo, getAuthors, getCenter, getCenterOfElement, getControlPanel, getDiameter, getDimOfSimplex, getDimOfVertices, getDisplayList, getDisplays, getElement, getGeometryInfo, getJvx, getLabelAttribute, getLabelColor, getLabelFont, getLabelSize, getLabelStyle, getMaterialPanel, getModelMatrix, getPolygon, getState, getTextureImage, getTextureImageName, getTitle, getType, getVersion, getVersionType, getVertex, hasAmbientMatrix, hasDisplay, hasModelMatrix, hasTagElement, hasTagPolygon, hasTagVertex, intersectionWithLine, isConfigurable, isEnabledInstanceSharing, isShowingBndBox, isShowingCenter, isShowingName, isShowingTitle, isVisible, merge, paint, projectFromAmbientSpace, reflect, removeDisplay, removeElement, removeMethodMenus, removePolygon, removeVertex, setAmbientMatrix, setAmbientProjection, setAmbientSpace, setAuthorInfo, setAuthors, setCenter, setDimOfSimplex, setDimOfVertices, setElement, setEnabledInstanceSharing, setGeometryInfo, setJvx, setLabelAttribute, setLabelAttribute, setLabelColor, setLabelFont, setLabelSize, setLabelStyle, setModelMatrix, setPolygon, setState, setTagElement, setTagPolygon, setTagVertex, setTextureImage, setTextureImageName, setTitle, setType, setVersion, setVersionType, setVertex, setVisible, showBndBox, showCenter, showName, showTitle, toString
addInspector, addUpdateListener, assureInspector, clearTag, clone, clone, getFather, getInfoPanel, getInspector, getName, getNumObjects, getSymbol, hasInspector, hasTag, hasUpdateListener, instanceOf, instanceOf, newInspector, newInspector, removeInspector, removeInspector, removeUpdateListener, setName, setParent, setSymbol, setTag, updatePanels
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
getName
assureInspector, getInfoPanel, getName, hasTag, setName
getFather, setParent
public static final int AXES_NONE
public static final int AXES_3DCENTRAL
public static final int AXES_3DCORNER
public static final int AXES_3DBOUNDINGBOX
public static final int AXES_2DXY_CENTER
public static final int AXES_2DYZ_CENTER
public static final int AXES_2DZX_CENTER
public static final int AXES_2DXY_CORNER
public static final int AXES_2DYZ_CORNER
public static final int AXES_2DZX_CORNER
public static final int AXES_2DBOUNDINGBOX
public static final int COORD_ADJUST
public static final int COORD_SCENE
public static final int COORD_MODEL
public static final int COORD_AMBIENT
public static int OPT_HASH_NUMBER
public static double OPT_HASH_RATIO
public PgAxes(int dim)
HACK: Internally we currently allocate always 3 rulers even if dim==2. A user may not notice this behaviour.
public void init()
init
in class PgGeometry
public void reset()
public void setEnabledBoxRatio(boolean flag)
public void setBoxRatio(PdVector boxRatio)
public boolean update(java.lang.Object event)
update
in interface PsUpdateIf
update
in class PgGeometry
event
- carries a lot of informationPsObject.setParent(PsUpdateIf)
,
PsObject.getFather()
,
PsObject.addUpdateListener(PsUpdateIf)
public void setDisplay(PvDisplayIf disp)
public void setAxesColor(java.awt.Color col)
public void setAxesSize(double size)
public boolean isShowing()
public void setShowing(boolean flag)
public int getNumRulers()
public void setNumRulers(int num)
public boolean[] getHashingFlags()
public void setHashingsFlags(boolean[] flags)
public boolean isShowingXYGrid()
public void showXYGrid(boolean flag)
setHashingsFlags(boolean [])
public boolean isShowingYZGrid()
public void showYZGrid(boolean flag)
setHashingsFlags(boolean [])
public boolean isShowingZXGrid()
public void showZXGrid(boolean flag)
setHashingsFlags(boolean [])
public boolean isShowingFixedMode()
public void showFixedMode(boolean flag)
public int getHashMode()
public void setHashMode(int mode)
public boolean isShowingMajorHashings()
public void showMajorHashings(boolean flag)
public boolean isShowingMinorHashings()
public void showMinorHashings(boolean flag)
public boolean isShowingLabels()
public void showLabels(boolean flag)
public void setLabelColors(java.awt.Color col)
col
- Font color used to draw the label.public void setLabelStyles(int style)
style
- Font style used to draw the label.public void setLabelSize(int size)
size
- Font size used to draw the label.public void showTitles(boolean flag)
public java.lang.String[] getTitles()
public void setTitles(java.lang.String[] axisName)
public java.lang.String[] getLabels()
public void setLabels(java.lang.String[] axisName)
public boolean isShowingNames()
public void showNames(boolean flag)
flag
- enable showing of namepublic java.lang.String[] getNames()
public void setNames(java.lang.String[] axisName)
axisName
- array of names, one name per axispublic void setNameAlignments(int[] xAlign, int[] yAlign, int[] zAlign)
For axes in 2D, the last argument may be null.
public void setFixedHashings(double major, double minor)
major
- interval length between adjacent major hashing units in world coordinatesminor
- interval length between adjacent minor hashing units in world coordinatespublic void setPartitionedHashing(int major, int minor)
major
- total number of major hashing ticksminor
- number of minor hashing ticks within a major interval.public boolean isEnabledAutoHashing()
public void setEnabledAutoHashing(boolean flag)
public boolean isEnabledAutoConfigure()
public void setEnabledAutoConfigure(boolean flag)
public void setAutoConfigure(boolean flag)
public boolean isEnabledAutoLayout()
public void setEnabledAutoLayout(boolean flag)
public boolean isEnabledAutoBounds()
public void setEnabledAutoBounds(boolean flag)
public int getCoordSystem()
public void setCoordSystem(int coord)
coord
- integer value like PgAxes#COORD_ADJUST etc.public int getMode()
public void setMode(int mode)
Only in mode AXES_3DCORNER axes are shown in back drawing order.
mode
- one of the values like PgAxes#AXES_3DCORNERpublic PgRuler[] getAxes()
public void configure(PdVector[] bndBox, PdVector viewDir)
Hashing units are computed for each ruler individually if boxRatio is enabled.
bndBox
- current bounding box of scene in display.viewDir
- normalized viewing direction of current camera.public void setCameraType(int type)
type
- camera type as available in PvCameraIf.CAMERA_...public PdVector[] getBounds()
The two returned bounding box vectors are 3-dimensional. If dimension of vertices is less than 3 then remaining components are zeroed.
Note, transformation not supported yet.
getBounds
in class PgGeometry
PgGeometry.getAmbientBounds()
public void setBounds(PdVector[] bndbox)
public void pickCamera(PvCameraEvent pos)
pickCamera
in interface PvCameraListenerIf
pos
- Pick event issued by the displayPvCameraListenerIf
public void dragCamera(PvCameraEvent pos)
dragCamera
in interface PvCameraListenerIf
pos
- Drag event issued by the displayPvCameraListenerIf
"