jv.thirdParty.ruler
Class PgAxes
- java.lang.Object
-
- jv.object.PsObject
-
- jv.project.PgGeometry
-
- jv.thirdParty.ruler.PgAxes
-
- All Implemented Interfaces:
- java.io.Serializable, java.lang.Cloneable, PsUpdateIf, PgGeometryIf, PvCameraListenerIf
public final class PgAxes extends PgGeometry implements PvCameraListenerIf
A group of coordinates axes is a collection of individual rulers. This object constructs a variety of customizable 2D and 3D axes. A 1D axes is a ruler alone, so instantiate from that the ruler.PgRuler class.- See Also:
PgRuler, Serialized Form- Author:
- Steve Dugaro, Konrad Polthier
- Version:
- 21.03.04, 3.01 revised (kp) Default axis configuration changed to CENTRAL from BOUNDINGBOX.
20.03.04, 3.00 revised (kp) Full revision of API interface and internal algorithms.
17.08.03, 2.50 revised (kp) Handling of associated display slightly improved.
14.08.03, 2.20 revised (kp) Central mode now adjusts the origin to avoid disconnected axes.
21.08.02, 2.10 revised (kp) Implement PvCameraListenerIf.
31.03.01, 2.00 revised (kp) Major revision to increase update speed.
08.08.00, 1.00 created (spd)
-
-
Field Summary
Fields Modifier and Type Field and Description static intAXES_2DBOUNDINGBOXNot supported yet.static intAXES_2DXY_CENTERstatic intAXES_2DXY_CORNERstatic intAXES_2DYZ_CENTERstatic intAXES_2DYZ_CORNERstatic intAXES_2DZX_CENTERstatic intAXES_2DZX_CORNERstatic intAXES_3DBOUNDINGBOXstatic intAXES_3DCENTRALstatic intAXES_3DCORNERstatic intAXES_NONEstatic intCOORD_ADJUSTIndicates that axes adjusts to ambient transformation.static intCOORD_AMBIENTAmbient coordinate system, not implemented yet.static intCOORD_MODELModelling coordinate system.static intCOORD_SCENEScene respectively camera coordinate system.static intOPT_HASH_NUMBERPreferred number of major hash ticks on an axis.static doubleOPT_HASH_RATIOPreferred ratio of major unit to minor unit.-
Fields inherited from class jv.object.PsObject
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
-
Fields inherited from interface jv.project.PgGeometryIf
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 Summary
Constructors Constructor and Description PgAxes(int dim)Constructs an axes object which handles the axis of a right handed coordinate system.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method and Description voidconfigure(PdVector[] bndBox, PdVector viewDir)Assign new camera viewing direction and scene bounding box, and, if autoHashing is enabled, recompute hashing units.voiddragCamera(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.intgetCoordSystem()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.intgetHashMode()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().intgetMode()Get the axes type which is currently displayed.java.lang.String[]getNames()Get names of all axes showing at one of their midpoints.intgetNumRulers()Get number of individual axis, respectively rulers.java.lang.String[]getTitles()Deprecated.use getNames().voidinit()Initialization of axis object.booleanisEnabledAutoBounds()Check if automatic adjustment of size of axes to varying bounding box is enabled.booleanisEnabledAutoConfigure()Deprecated.since JavaView 3.12.002, use isEnabledAutoHashing()booleanisEnabledAutoHashing()Check if axes is automatically adjusted to varying size of the shown shape.booleanisEnabledAutoLayout()Check if automatic positioning of axes is enabled.booleanisShowing()Determine if all axes are visible in the display.booleanisShowingFixedMode()Deprecated.since JavaView 3.12.002, use getHashMode() which returns PgRuler#HASH_FIXED or PgRuler#HASH_PARTITIONEDbooleanisShowingLabels()Determine if numbers are shown at hashings of this axis.booleanisShowingMajorHashings()Get showing of major hashing ticks of this axis and all rulers.booleanisShowingMinorHashings()Get showing of minor hashing ticks of this axis and all rulers.booleanisShowingNames()Determine if names of axes are shown at the middle of axes.booleanisShowingXYGrid()Get visibility of xy grid.booleanisShowingYZGrid()Get visibility of yz grid.booleanisShowingZXGrid()Get visibility of zx grid.voidpickCamera(PvCameraEvent pos)Get camera events resulting from picking the mouse.voidreset()Reset the current axes and rulers, re-construct axes and recompute hashings of rulers.voidsetAutoConfigure(boolean flag)Deprecated.use setEnabledAutoHashing(boolean)voidsetAxesColor(java.awt.Color col)Assign color of all individual axes.voidsetAxesSize(double size)Assign color of all individual axes.voidsetBounds(PdVector[] bndbox)Update the bounding box used to configure these axes.voidsetBoxRatio(PdVector boxRatio)Enable usage of a variable aspect ratio for the viewing frustum of this camera.voidsetCameraType(int type)Determines the current projection in the display where this axis is used.voidsetCoordSystem(int coord)Set coordinate system to which axes is attached, e.g. to scene, individual geometry or ambient space.voidsetDisplay(PvDisplayIf disp)Display must be assigned right after creating an axes object.voidsetEnabledAutoBounds(boolean flag)Enable automatic adjustment of size of axes to varying bounding box.voidsetEnabledAutoConfigure(boolean flag)Deprecated.since JavaView 3.12.002, use setEnabledAutoHashing(boolean)voidsetEnabledAutoHashing(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().voidsetEnabledAutoLayout(boolean flag)Enable automatic positioning of axes.voidsetEnabledBoxRatio(boolean flag)Enable usage of a variable aspect ratio for the viewing frustum of this camera.voidsetFixedHashings(double major, double minor)Set major and minor hashing units of this axis.voidsetHashingsFlags(boolean[] flags)Enable state of showing of grid xy, yz, and zx planes.voidsetHashMode(int mode)Set hashing mode of a ruler which is either partitioned or fixed, see PgRuler#HASH_FIXED or PgRuler#HASH_PARTITIONED.voidsetLabelColors(java.awt.Color col)Assign label color of all individual axes.voidsetLabels(java.lang.String[] axisName)Deprecated.use setNames(String []).voidsetLabelSize(int size)Assign label size of all individual axes labels.voidsetLabelStyles(int style)Assign label style of all individual axes labels.voidsetMode(int mode)Set the axes type which is currently displayed.voidsetNameAlignments(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.voidsetNames(java.lang.String[] axisName)Set names of all axes showing at one of their midpoints.voidsetNumRulers(int num)Set number of individual axis, respectively rulers.voidsetPartitionedHashing(int major, int minor)Set number of major and minor hashing ticks.voidsetShowing(boolean flag)Set visibility of this axes geometry.voidsetTitles(java.lang.String[] axisName)Deprecated.use setNames(String []).voidshowFixedMode(boolean flag)Deprecated.since JavaView 3.12.002, use setHashMode(int) with PgRuler#HASH_FIXED or PgRuler#HASH_PARTITIONEDvoidshowLabels(boolean flag)Enable showing of numbers at hashings of this axis and all rulers.voidshowMajorHashings(boolean flag)Enable showing of major hashing ticks of this axis and all rulers.voidshowMinorHashings(boolean flag)Enable showing of minor hashing ticks of this axis and all rulers.voidshowNames(boolean flag)Show names of all axes at one of their midpoint.voidshowTitles(boolean flag)Deprecated.use showNames(boolean).voidshowXYGrid(boolean flag)Enable showing of grid in xy-plane which is spaced at major and minor hashing ticks.voidshowYZGrid(boolean flag)Enable showing of grid in yz-plane which is spaced at major and minor hashing ticks.voidshowZXGrid(boolean flag)Enable showing of grid in zx-plane which is spaced at major and minor hashing ticks.booleanupdate(java.lang.Object event)Update calculations when the axes object or its children such as slider change.-
Methods inherited from class jv.project.PgGeometry
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
-
Methods inherited from class jv.object.PsObject
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
-
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface jv.project.PvCameraListenerIf
getName
-
Methods inherited from interface jv.project.PgGeometryIf
assureInspector, getInfoPanel, getName, hasTag, setName
-
Methods inherited from interface jv.object.PsUpdateIf
getFather, setParent
-
-
-
-
Field Detail
-
AXES_NONE
public static final int AXES_NONE
- See Also:
- Constant Field Values
-
AXES_3DCENTRAL
public static final int AXES_3DCENTRAL
- See Also:
- Constant Field Values
-
AXES_3DCORNER
public static final int AXES_3DCORNER
- See Also:
- Constant Field Values
-
AXES_3DBOUNDINGBOX
public static final int AXES_3DBOUNDINGBOX
- See Also:
- Constant Field Values
-
AXES_2DXY_CENTER
public static final int AXES_2DXY_CENTER
- See Also:
- Constant Field Values
-
AXES_2DYZ_CENTER
public static final int AXES_2DYZ_CENTER
- See Also:
- Constant Field Values
-
AXES_2DZX_CENTER
public static final int AXES_2DZX_CENTER
- See Also:
- Constant Field Values
-
AXES_2DXY_CORNER
public static final int AXES_2DXY_CORNER
- See Also:
- Constant Field Values
-
AXES_2DYZ_CORNER
public static final int AXES_2DYZ_CORNER
- See Also:
- Constant Field Values
-
AXES_2DZX_CORNER
public static final int AXES_2DZX_CORNER
- See Also:
- Constant Field Values
-
AXES_2DBOUNDINGBOX
public static final int AXES_2DBOUNDINGBOX
Not supported yet.- See Also:
- Constant Field Values
-
COORD_ADJUST
public static final int COORD_ADJUST
Indicates that axes adjusts to ambient transformation.- See Also:
- Constant Field Values
-
COORD_SCENE
public static final int COORD_SCENE
Scene respectively camera coordinate system.- See Also:
- Constant Field Values
-
COORD_MODEL
public static final int COORD_MODEL
Modelling coordinate system.- See Also:
- Constant Field Values
-
COORD_AMBIENT
public static final int COORD_AMBIENT
Ambient coordinate system, not implemented yet.- See Also:
- Constant Field Values
-
OPT_HASH_NUMBER
public static int OPT_HASH_NUMBER
Preferred number of major hash ticks on an axis.
-
OPT_HASH_RATIO
public static double OPT_HASH_RATIO
Preferred ratio of major unit to minor unit.
-
-
Constructor Detail
-
PgAxes
public PgAxes(int dim)
Constructs an axes object which handles the axis of a right handed coordinate system.HACK: Internally we currently allocate always 3 rulers even if dim==2. A user may not notice this behaviour.
-
-
Method Detail
-
init
public void init()
Initialization of axis object.- Overrides:
initin classPgGeometry
-
reset
public void reset()
Reset the current axes and rulers, re-construct axes and recompute hashings of rulers.- Since:
- JavaView 2.48
- Version:
- 09.12.02, 1.00 created (kp).
-
setEnabledBoxRatio
public void setEnabledBoxRatio(boolean flag)
Enable usage of a variable aspect ratio for the viewing frustum of this camera.
-
setBoxRatio
public void setBoxRatio(PdVector boxRatio)
Enable usage of a variable aspect ratio for the viewing frustum of this camera.
-
update
public boolean update(java.lang.Object event)
Update calculations when the axes object or its children such as slider change.- Specified by:
updatein interfacePsUpdateIf- Overrides:
updatein classPgGeometry- Parameters:
event- carries a lot of information- Returns:
- true if event has been handled, otherwise false
- See Also:
PsObject.setParent(PsUpdateIf),PsObject.getFather(),PsObject.addUpdateListener(PsUpdateIf)
-
setDisplay
public void setDisplay(PvDisplayIf disp)
Display must be assigned right after creating an axes object. Axes object is not able to configure without a display.- Since:
- JavaView 2.99.001
- Version:
- 17.08.03, 1.00 created (kp)
-
setAxesColor
public void setAxesColor(java.awt.Color col)
Assign color of all individual axes.
-
setAxesSize
public void setAxesSize(double size)
Assign color of all individual axes.
-
isShowing
public boolean isShowing()
Determine if all axes are visible in the display. Does not affect individual visibility setting of each axes.
-
setShowing
public void setShowing(boolean flag)
Set visibility of this axes geometry.- Since:
- JavaView 2.99.001
- Version:
- 17.08.03, 1.00 created (kp)
-
getNumRulers
public int getNumRulers()
Get number of individual axis, respectively rulers. HACK: currently not working, it always returns 3.
-
setNumRulers
public void setNumRulers(int num)
Set number of individual axis, respectively rulers. HACK: currently not working, must be 3.
-
getHashingFlags
public boolean[] getHashingFlags()
Get state of showing of grid xy, yz, and zx planes.
-
setHashingsFlags
public void setHashingsFlags(boolean[] flags)
Enable state of showing of grid xy, yz, and zx planes.
-
isShowingXYGrid
public boolean isShowingXYGrid()
Get visibility of xy grid.
-
showXYGrid
public void showXYGrid(boolean flag)
Enable showing of grid in xy-plane which is spaced at major and minor hashing ticks.- See Also:
setHashingsFlags(boolean [])
-
isShowingYZGrid
public boolean isShowingYZGrid()
Get visibility of yz grid.
-
showYZGrid
public void showYZGrid(boolean flag)
Enable showing of grid in yz-plane which is spaced at major and minor hashing ticks.- See Also:
setHashingsFlags(boolean [])
-
isShowingZXGrid
public boolean isShowingZXGrid()
Get visibility of zx grid.
-
showZXGrid
public void showZXGrid(boolean flag)
Enable showing of grid in zx-plane which is spaced at major and minor hashing ticks.- See Also:
setHashingsFlags(boolean [])
-
isShowingFixedMode
public boolean isShowingFixedMode()
Deprecated. since JavaView 3.12.002, use getHashMode() which returns PgRuler#HASH_FIXED or PgRuler#HASH_PARTITIONEDDetermine if fixed or partition mode is enabled.
-
showFixedMode
public void showFixedMode(boolean flag)
Deprecated. since JavaView 3.12.002, use setHashMode(int) with PgRuler#HASH_FIXED or PgRuler#HASH_PARTITIONEDEnable fixed or partition mode.
-
getHashMode
public int getHashMode()
Get hashing mode of a ruler is either partitioned or fixed, see PgRuler#HASH_FIXED or PgRuler#HASH_PARTITIONED.- Since:
- JavaView 3.12.002
- Version:
- 20.03.04, 1.00 created (kp)
-
setHashMode
public void setHashMode(int mode)
Set hashing mode of a ruler which is either partitioned or fixed, see PgRuler#HASH_FIXED or PgRuler#HASH_PARTITIONED.- Since:
- JavaView 3.12.002
- Version:
- 20.03.04, 1.00 created (kp)
-
isShowingMajorHashings
public boolean isShowingMajorHashings()
Get showing of major hashing ticks of this axis and all rulers.
-
showMajorHashings
public void showMajorHashings(boolean flag)
Enable showing of major hashing ticks of this axis and all rulers.
-
isShowingMinorHashings
public boolean isShowingMinorHashings()
Get showing of minor hashing ticks of this axis and all rulers.
-
showMinorHashings
public void showMinorHashings(boolean flag)
Enable showing of minor hashing ticks of this axis and all rulers.
-
isShowingLabels
public boolean isShowingLabels()
Determine if numbers are shown at hashings of this axis.
-
showLabels
public void showLabels(boolean flag)
Enable showing of numbers at hashings of this axis and all rulers.
-
setLabelColors
public void setLabelColors(java.awt.Color col)
Assign label color of all individual axes.- Parameters:
col- Font color used to draw the label.
-
setLabelStyles
public void setLabelStyles(int style)
Assign label style of all individual axes labels.- Parameters:
style- Font style used to draw the label.
-
setLabelSize
public void setLabelSize(int size)
Assign label size of all individual axes labels.- Parameters:
size- Font size used to draw the label.
-
showTitles
public void showTitles(boolean flag)
Deprecated. use showNames(boolean).
-
getTitles
public java.lang.String[] getTitles()
Deprecated. use getNames().
-
setTitles
public void setTitles(java.lang.String[] axisName)
Deprecated. use setNames(String []).
-
getLabels
public java.lang.String[] getLabels()
Deprecated. use getNames().
-
setLabels
public void setLabels(java.lang.String[] axisName)
Deprecated. use setNames(String []).
-
isShowingNames
public boolean isShowingNames()
Determine if names of axes are shown at the middle of axes.
-
showNames
public void showNames(boolean flag)
Show names of all axes at one of their midpoint.- Parameters:
flag- enable showing of name- Since:
- JavaView 2.47
- Version:
- 26.11.02, 1.00 created (kp) Replacement for showTitles().
-
getNames
public java.lang.String[] getNames()
Get names of all axes showing at one of their midpoints.- Returns:
- array of names, one name per axis
- Since:
- JavaView 2.47
- Version:
- 26.11.02, 1.00 created (kp) Replacement for getTitles().
-
setNames
public void setNames(java.lang.String[] axisName)
Set names of all axes showing at one of their midpoints.- Parameters:
axisName- array of names, one name per axis- Since:
- JavaView 2.47
- Version:
- 26.11.02, 1.00 created (kp) Replacement for setTitles().
-
setNameAlignments
public 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.For axes in 2D, the last argument may be null.
-
setFixedHashings
public void setFixedHashings(double major, double minor)Set major and minor hashing units of this axis. If box ratio is disabled the hashing units of all rulers will be synchronized to the given values.- Parameters:
major- interval length between adjacent major hashing units in world coordinatesminor- interval length between adjacent minor hashing units in world coordinates
-
setPartitionedHashing
public void setPartitionedHashing(int major, int minor)Set number of major and minor hashing ticks. If box ratio is disabled the number of hashing ticks of all rulers will be synchronized to the given values.- Parameters:
major- total number of major hashing ticksminor- number of minor hashing ticks within a major interval.
-
isEnabledAutoHashing
public boolean isEnabledAutoHashing()
Check if axes is automatically adjusted to varying size of the shown shape.- Since:
- JavaView 2.47
- Version:
- 05.12.02, 1.00 created (kp)
-
setEnabledAutoHashing
public 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(). Essentially the scale jumps up or down by a factor of 10 if any length of the bounding box is stretched to 10*currentscale + 10*currentscale/2 or squashed to currentscale/10-currentscale/10*2. In other words, an attempt is made to maintain approximately 10 hashings over each ruler. This need not apply to the "partitioned ruler mode" as the ruler is already subdivided. This is true by default-set to false if many more hashings are needed. Note that in this mode a single minor hashing will be placed between each major hashings whenever a reconfiguration is needed.
-
isEnabledAutoConfigure
public boolean isEnabledAutoConfigure()
Deprecated. since JavaView 3.12.002, use isEnabledAutoHashing()Check if axes is automatically adjusted to varying size of the shown shape.
-
setEnabledAutoConfigure
public void setEnabledAutoConfigure(boolean flag)
Deprecated. since JavaView 3.12.002, use setEnabledAutoHashing(boolean)Flag is axes in "absolute unit mode" will automatically adjust to a 'good' viewing scale based on the bounding box passed into configure(). Essentially the scale jumps up or down by a factor of 10 if any length of the bounding box is stretched to 10*currentscale + 10*currentscale/2 or squashed to currentscale/10-currentscale/10*2. In other words, an attempt is made to maintain approximately 10 hashings over each ruler. This need not apply to the "partitioned ruler mode" as the ruler is already subdivided. This is true by default-set to false if many more hashings are needed. Note that in this mode a single minor hashing will be placed between each major hashings whenever a reconfiguration is needed.
-
setAutoConfigure
public void setAutoConfigure(boolean flag)
Deprecated. use setEnabledAutoHashing(boolean)
-
isEnabledAutoLayout
public boolean isEnabledAutoLayout()
Check if automatic positioning of axes is enabled.- Since:
- JavaView 3.12.002
- Version:
- 21.03.04, 1.00 created (kp)
-
setEnabledAutoLayout
public void setEnabledAutoLayout(boolean flag)
Enable automatic positioning of axes.- Since:
- JavaView 3.12.002
- Version:
- 21.03.04, 1.00 created (kp)
-
isEnabledAutoBounds
public boolean isEnabledAutoBounds()
Check if automatic adjustment of size of axes to varying bounding box is enabled.- Since:
- JavaView 3.12.002
- Version:
- 19.03.04, 1.00 created (kp)
-
setEnabledAutoBounds
public void setEnabledAutoBounds(boolean flag)
Enable automatic adjustment of size of axes to varying bounding box.- Since:
- JavaView 3.12.002
- Version:
- 19.03.04, 1.00 created (kp)
-
getCoordSystem
public int getCoordSystem()
Check if axes is attached to scene, individual geometry or ambient coordinate system. If attached to geometries, then axes configuration will be in same coordinates system as the current camera.- Returns:
- integer value like PgAxes#COORD_ADJUST etc.
- Since:
- JavaView 3.12.002
- Version:
- 21.03.04, 1.00 created (kp)
-
setCoordSystem
public void setCoordSystem(int coord)
Set coordinate system to which axes is attached, e.g. to scene, individual geometry or ambient space. If attached to geometries, then axes configuration will be in same coordinates system as the current camera.- Parameters:
coord- integer value like PgAxes#COORD_ADJUST etc.- Since:
- JavaView 3.12.002
- Version:
- 21.03.04, 1.00 created (kp)
-
getMode
public int getMode()
Get the axes type which is currently displayed. One of the values like PgAxes#AXES_3DCORNER.
-
setMode
public void setMode(int mode)
Set the axes type which is currently displayed. Depending on the mode the axes are shown either in drawing order back or front (default).Only in mode AXES_3DCORNER axes are shown in back drawing order.
- Parameters:
mode- one of the values like PgAxes#AXES_3DCORNER- Version:
- 14.10.00, 1.10 revised (kp) Switch layering in display depending on mode.
08.08.00, 1.00 created (sd)
-
getAxes
public PgRuler[] getAxes()
Set of axis will be returned. The ones you add to the display are up to you, but computations will be done for all assuming all will be displayed.
-
configure
public void configure(PdVector[] bndBox, PdVector viewDir)
Assign new camera viewing direction and scene bounding box, and, if autoHashing is enabled, recompute hashing units.Hashing units are computed for each ruler individually if boxRatio is enabled.
- Parameters:
bndBox- current bounding box of scene in display.viewDir- normalized viewing direction of current camera.- Version:
- 25.12.04, 1.10 revised (kp) In boxRatio mode compute individual hash units.
-
setCameraType
public void setCameraType(int type)
Determines the current projection in the display where this axis is used. For example, in 2D projection mode not all axes are needed, so the camera type determines which axes must be switched off.- Parameters:
type- camera type as available in PvCameraIf.CAMERA_...- Since:
- JavaView 2.92.000
- Version:
- 14.08.03, 1.00 created (kp)
-
getBounds
public PdVector[] getBounds()
Compute bounding box of the vertices which are transformed with ambient and model matrix.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.
- Overrides:
getBoundsin classPgGeometry- Returns:
- two 3d vectors which are the extremal corners of the bounding cube
- Since:
- 21.03.04, 1.10 revised (kp) Dimension of bounding box vector now always 3.
, JavaView 3.12.002 - See Also:
PgGeometry.getAmbientBounds()- Version:
- 30.01.05, 2.00 revised (kp) Returns a copy and no longer the internal variable.
-
setBounds
public void setBounds(PdVector[] bndbox)
Update the bounding box used to configure these axes.
-
pickCamera
public void pickCamera(PvCameraEvent pos)
Get camera events resulting from picking the mouse. Use information about camera in one display to adjust the camera in the other window. But previously rotate the camera position around the line given by interest+t*upVector by -6 degrees.- Specified by:
pickCamerain interfacePvCameraListenerIf- Parameters:
pos- Pick event issued by the display- See Also:
PvCameraListenerIf
-
dragCamera
public void dragCamera(PvCameraEvent pos)
Get camera events resulting from dragging the mouse. This method just calls the method pickCamera which does all the work.- Specified by:
dragCamerain interfacePvCameraListenerIf- Parameters:
pos- Drag event issued by the display- See Also:
PvCameraListenerIf
-
-
"