jv.thirdParty.ruler
Class PgRuler
- java.lang.Object
-
- jv.object.PsObject
-
- jv.project.PgGeometry
-
- jv.project.PgJvxSrc
-
- jv.thirdParty.ruler.PgRuler
-
- All Implemented Interfaces:
- java.io.Serializable, java.lang.Cloneable, PsUpdateIf, PgGeometryIf
public final class PgRuler extends PgJvxSrc
A ruler is 2d or higher dimensional space is determined by an origin, a direction of its axis and a normal for drawing hashings. The spacing and labeling of hashings may be controlled or automatically computed by a ruler.Rulers are used as components of PgAxes but additionally may be used individually to measure distances.
- See Also:
PgAxes, Serialized Form- Author:
- Steve Dugaro, Konrad Polthier
- Version:
- 04.05.14, 4.01 revised (kp) Geometry type mentioned in constructor.
20.03.04, 4.00 revised (kp) Full revision of API interface and internal algorithms.
14.08.03, 3.50 revised (kp) Remove internal vector allocations.
19.07.03, 3.40 revised (kp) Correct assignment of brighter colors for minor hashings.
13.03.03, 3.30 revised (kp) Hashing color is now adjusted when global polygon color is changed.
16.11.02, 3.20 revised (kp) Only enable showing of vertex labels instead of all indices.
26.09.02, 3.10 revised (kp) Allow more fractional digits if axis is small.
16.05.01, 3.00 revised (kp) Superclass changed to PgJvxSrc.
31.03.01, 2.00 revised (kp) Major revision to increase update speed.
27.09.00, 1.01 revised (spd) Measure was added to make the ruler act as a measuring tape. Set the origin for the anchor point with setInitPoint then pass this the endpoint.
07.07.00, 1.00 created (spd)
-
-
Field Summary
Fields Modifier and Type Field and Description static intHASH_FIXEDFixed spacing of hashings at automatically or assigned ticks.static intHASH_PARTITIONEDDynamic spacing of hashings at equal distances from a reference tick.static intMODE_FIXEDDeprecated.since JavaView 3.13, use HASH_FIXEDstatic intMODE_PARTITIONEDDeprecated.since JavaView 3.13, use HASH_PARTITIONEDstatic intNORMAL_DIRECTIONstatic intRULER_NAME_ALIGN_CENTERstatic intRULER_NAME_ALIGN_LEFTstatic intRULER_NAME_ALIGN_RIGHTstatic intUP_VECTOR_DIRECTION-
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 PgRuler()Create a ruler in 3D space.PgRuler(int dim)Create a ruler in given space dimension which is by default oriented along the x-axis.PgRuler(PdVector rulerDir, PdVector rulerNormal)Deprecated.since JavaView 3.12.002, use setDirection and setNormal
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method and Description intgetHashMode()Get hashing mode of a ruler is either partitioned or fixed, see HASH_FIXED or HASH_PARTITIONED.doublegetMajorUnit()doublegetMaxParameter()doublegetMinorUnit()doublegetMinParameter()intgetMode()Deprecated.since JavaView 3.12.002, use getHashMode()intgetNumMajorPartitions()intgetNumMinorPartitions()java.lang.StringgetRulerName()Get name of ruler as it appears at an axis, for example.voidinit()Initialization method.booleanisEnabledAutoBounds()Check if automatic adjustment of size of axes to varying bounding box is enabled.booleanisEnabledAutoHashing()Check if axes is automatically adjusted to varying size of the shown shape.booleanisShowingArrow()booleanisShowingFixedMode()Deprecated.use getHashMode() which returns HASH_FIXED or HASH_PARTITIONEDbooleanisShowingHashingsInNormalDir()booleanisShowingHashingsInUpDir()booleanisShowingLabels()booleanisShowingMajorHashings()Determines whether the ruler should be partitioned as fixed or dynamic and then sets m_tiMajor accordingly.booleanisShowingMinorHashings()booleanisShowingRulerName()Check whether showing of name of ruler is switched on.voidsetDefaultHashSizes(int orthoType)Reset minor and major hash extents to default values.voidsetDirection(double x, double y, double z)Set direction of the baseline of the ruler.voidsetDirection(PdVector dir)Set direction of the baseline of the ruler.voidsetEnabledAutoBounds(boolean flag)Enable automatic adjustment of size of axes to varying bounding box.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().voidsetEndPoint(PdVector endPnt, PdVector viewDir)Measure, is a way of using the ruler as a Tape measure.voidsetFixedHashing(double major, double minor)voidsetGlobalPolygonColor(java.awt.Color color)This method assigns the global polygon color of superclass and sets the default color for hashings.voidsetGlobalPolygonSize(double size)This method assigns the global polygon color of superclass and sets the default color for hashings.voidsetHashLabel(int xoff, int yoff, int labelhSide, int labelvSide)Customizes the positioning of the label at hashings.voidsetHashMode(int mode)Set hashing mode of a ruler which is either partitioned or fixed, see HASH_FIXED or HASH_PARTITIONED.voidsetHashOffsetInNormalDir(double xoff, double yoff, double zoff)voidsetHashOffsetInUpDir(double xoff, double yoff, double zoff)voidsetMajorColor(java.awt.Color color)voidsetMajorHashSize(double pt1, double pt2, int orthoType)Set the extent size of major hashings along the up or normal vectorsvoidsetMinMax(double min, double max)Set maximum and minimum value of this ruler.voidsetMinorColor(java.awt.Color color)voidsetMinorHashSize(double pt1, double pt2, int orthoType)Set the extent size of minor hashings along the up or normal vectorsvoidsetMode(int mode)Deprecated.since JavaView 3.12.002, use setHashMode(int)voidsetNameAlignment(int align, int labelhSide, int xoff, int yoff)Customizes the positioning of the name of the ruler.voidsetNormal(double x, double y, double z)Set direction of the normal vector along which the hashings will be drawn.voidsetNormal(PdVector nor)Set direction of the normal vector along which the hashings will be drawn.voidsetOrigin(double x, double y, double z)Set the origin of the ruler to the specific point in space.voidsetOrigin(PdVector orig)Set the origin of the ruler to the specific point in space.voidsetPartitionedHashing(int major, int minor)voidsetRulerName(java.lang.String name)Set the name of ruler as it appears at an axis, for example.voidsetRulerName(java.lang.String name, boolean show)Set the name of ruler as it appears at an axis, for example.voidsetRulerName(java.lang.String name, int pos)Set the name of ruler as it appears at an axis, for example.voidsetRulerName(java.lang.String name, int pos, boolean show)Set the name of ruler as it appears at an axis, for example.voidsetUpVector(PdVector up)Deprecated.since JavaView 3.12.002, upVector is automatically computed when dir or normal is assigned.voidshowArrow(boolean flag)voidshowFixedMode(boolean flag)Deprecated.use setHashMode(int) with HASH_FIXED or HASH_PARTITIONEDvoidshowHashingsInNormalDir(boolean flag)voidshowHashingsInUpDir(boolean flag)voidshowLabels(boolean flag)voidshowMajorHashings(boolean flag)voidshowMinorHashings(boolean flag)voidshowRulerName(boolean flag)Enable and disable showing of name of ruler in display.booleanupdate(java.lang.Object event)Update method of geometry updates registered panels, update listeners, and invokes a repaint in the registered displays.-
Methods inherited from class jv.project.PgJvxSrc
addElement, addPolygon, addVertex, assureEdgeColors, assureEdgeSizes, assureElementBackColors, assureElementColors, assureElementEdges, assureElementNormals, assureElementTextures, assureNeighbours, assurePolygonColors, assurePolygonNormals, assurePolygonSizes, assureVectorColors, assureVertexColors, assureVertexNormals, assureVertexSizes, assureVertexTextures, clearTagVertex, clone, copy, getAmbientBounds, getBlendingMode, getBndColor, getBndElementInd, getBndName, getBndNeighbourLocInd, getBndNumVertices, getBndSize, getBndVertexInd, getBndVertices, getBounds, getCreaseAngle, getDimOfElements, getDimOfPolygons, getDimOfTextures, getDimOfVectors, getEdgeColors, getEdges, getEdgeSizes, getElement, getElementBackColors, getElementColors, getElementEdges, getElementNormals, getElements, getElementTextures, getFilterType, getGlobalBndColor, getGlobalBndSize, getGlobalBndTagColor, getGlobalEdgeColor, getGlobalEdgeNormalColor, getGlobalEdgeNormalLength, getGlobalEdgeNormalSize, getGlobalEdgeSize, getGlobalEdgeTagColor, getGlobalElementBackColor, getGlobalElementColor, getGlobalElementNormalColor, getGlobalElementNormalLength, getGlobalElementNormalSize, getGlobalElementTagColor, getGlobalPolygonColor, getGlobalPolygonNormalColor, getGlobalPolygonNormalLength, getGlobalPolygonNormalSize, getGlobalPolygonSize, getGlobalPolygonTagColor, getGlobalVectorColor, getGlobalVectorLength, getGlobalVectorSize, getGlobalVertexColor, getGlobalVertexNormalColor, getGlobalVertexNormalLength, getGlobalVertexNormalSize, getGlobalVertexSize, getGlobalVertexTagColor, getJvx, getNeighbours, getNumBndPolygons, getNumEdges, getNumElements, getNumPolygons, getNumVectorFields, getNumVectors, getNumVertices, getPolygon, getPolygonColors, getPolygonNormals, getPolygons, getPolygonSizes, getShininess, getSpecularColor, getTextureImage, getTextureImageBnd, getTextureImageName, getTexturePeriodic, getTextureSide, getTextureTiling, getTransparency, getVectorFieldColors, getVectorFieldName, getVectors, getVertex, getVertexColors, getVertexFunctions, getVertexNormals, getVertexSizes, getVertexTextures, getVertices, hasEdgeColors, hasElementBackColors, hasElementColors, hasElementNormals, hasElementTextures, hasPolygonColors, hasPolygonNormals, hasTagVertex, hasVertexColors, hasVertexNormals, hasVertexSizes, hasVertexTextures, isDefaultLabelEnabled, isEnabledIndexLabels, isShowingBackface, isShowingBnd, isShowingBndMaterials, isShowingBoundaries, isShowingEdgeColorFromElements, isShowingEdgeColorFromVertices, isShowingEdgeColors, isShowingEdgeLabels, isShowingEdges, isShowingEdgeSizes, isShowingElementBackColor, isShowingElementBackColors, isShowingElementColorFromVertices, isShowingElementColors, isShowingElementFromVertexColors, isShowingElementLabels, isShowingElementNormalArrow, isShowingElementNormals, isShowingElements, isShowingElementTexture, isShowingIndices, isShowingIndividualMaterial, isShowingPolygonColors, isShowingPolygonEndArrow, isShowingPolygonLabels, isShowingPolygonNormalArrow, isShowingPolygonNormals, isShowingPolygons, isShowingPolygonSizes, isShowingPolygonStartArrow, isShowingSilhouette, isShowingSmoothEdgeColors, isShowingSmoothElementColors, isShowingSmoothLighting, isShowingTaggedElements, isShowingTaggedPolygons, isShowingTaggedVertices, isShowingTransparency, isShowingVectorArrows, isShowingVectorColors, isShowingVectorField, isShowingVectorFieldMaterials, isShowingVectorFields, isShowingVertexColors, isShowingVertexLabels, isShowingVertexNormalArrow, isShowingVertexNormals, isShowingVertexOutline, isShowingVertexSizes, isShowingVertexTexture, isShowingVertices, isVectorElementBased, makeElementColorsFromXYZ, makeElementFromVertexColors, makeElementNormals, makeQuadrConn, makeVertexNormals, paint, reflect, removePolygonSizes, setBlendingMode, setBndColor, setBndElementInd, setBndName, setBndNeighbourLocInd, setBndNumVertices, setBndSize, setBndVertexInd, setBndVertices, setCreaseAngle, setDefaultLabelEnabled, setDimOfElements, setDimOfPolygons, setDimOfTextures, setDimOfVertices, setEdgeColors, setEdges, setEdgeSizes, setElement, setElementBackColors, setElementColors, setElementEdges, setElementNormals, setElements, setElementTextures, setEnabledIndexLabels, setFilterType, setGlobalBndColor, setGlobalBndSize, setGlobalBndTagColor, setGlobalEdgeColor, setGlobalEdgeNormalColor, setGlobalEdgeNormalLength, setGlobalEdgeNormalSize, setGlobalEdgeSize, setGlobalEdgeTagColor, setGlobalElementBackColor, setGlobalElementColor, setGlobalElementNormalColor, setGlobalElementNormalLength, setGlobalElementNormalSize, setGlobalElementTagColor, setGlobalPolygonNormalColor, setGlobalPolygonNormalLength, setGlobalPolygonNormalSize, setGlobalPolygonTagColor, setGlobalVectorColor, setGlobalVectorLength, setGlobalVectorSize, setGlobalVertexColor, setGlobalVertexNormalColor, setGlobalVertexNormalLength, setGlobalVertexNormalSize, setGlobalVertexSize, setGlobalVertexTagColor, setJvx, setNeighbours, setNumBndPolygons, setNumEdges, setNumElements, setNumPolygons, setNumVectorFields, setNumVectors, setNumVertices, setPolygon, setPolygonColors, setPolygonNormals, setPolygons, setPolygonSizes, setShininess, setSpecularColor, setState, setTagVertex, setTextureImage, setTextureImageBnd, setTextureImageName, setTexturePeriodic, setTextureSide, setTextureTiling, setTransparency, setVectorColors, setVectorElementBased, setVectorFieldName, setVectors, setVertex, setVertexColors, setVertexFunctions, setVertexNormals, setVertexSizes, setVertexTextures, setVertices, showBackface, showBnd, showBndMaterials, showBoundaries, showEdgeColorFromElements, showEdgeColorFromVertices, showEdgeColors, showEdgeLabels, showEdges, showEdgeSizes, showElementBackColor, showElementBackColors, showElementColorFromVertices, showElementColors, showElementFromVertexColors, showElementLabels, showElementNormalArrow, showElementNormals, showElements, showElementTexture, showIndices, showIndividualMaterial, showPolygonColors, showPolygonEndArrow, showPolygonLabels, showPolygonNormalArrow, showPolygonNormals, showPolygons, showPolygonSizes, showPolygonStartArrow, showSilhouette, showSmoothEdgeColors, showSmoothElementColors, showSmoothLighting, showTaggedElements, showTaggedPolygons, showTaggedVertices, showTransparency, showVectorArrows, showVectorColors, showVectorField, showVectorFieldMaterials, showVectorFields, showVertexColors, showVertexLabels, showVertexNormalArrow, showVertexNormals, showVertexOutline, showVertexSizes, showVertexTexture, showVertices
-
Methods inherited from class jv.project.PgGeometry
addDisplay, applyAmbientMatrix, applyModelingMatrix, blend, clearTagElement, clearTagPolygon, convertWorldToModel, copy, fillMethodMenu, fillMethodMenu, getAmbientInvMatrix, getAmbientMatrix, getAmbientProjection, getAmbientSpace, getAuthorInfo, getAuthors, getCenter, getCenterOfElement, getControlPanel, getDiameter, getDimOfSimplex, getDimOfVertices, getDisplayList, getDisplays, getGeometryInfo, getLabelAttribute, getLabelColor, getLabelFont, getLabelSize, getLabelStyle, getMaterialPanel, getModelMatrix, getState, getTitle, getType, getVersion, getVersionType, hasAmbientMatrix, hasDisplay, hasModelMatrix, hasTagElement, hasTagPolygon, intersectionWithLine, isConfigurable, isEnabledInstanceSharing, isShowingBndBox, isShowingCenter, isShowingName, isShowingTitle, isVisible, merge, projectFromAmbientSpace, removeDisplay, removeElement, removeMethodMenus, removePolygon, removeVertex, setAmbientMatrix, setAmbientProjection, setAmbientSpace, setAuthorInfo, setAuthors, setCenter, setDimOfSimplex, setEnabledInstanceSharing, setGeometryInfo, setLabelAttribute, setLabelAttribute, setLabelColor, setLabelFont, setLabelSize, setLabelStyle, setModelMatrix, setTagElement, setTagPolygon, setTitle, setType, setVersion, setVersionType, 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.PgGeometryIf
assureInspector, getInfoPanel, getName, hasTag, setName
-
Methods inherited from interface jv.object.PsUpdateIf
getFather, setParent
-
-
-
-
Field Detail
-
HASH_FIXED
public static final int HASH_FIXED
Fixed spacing of hashings at automatically or assigned ticks.- See Also:
- Constant Field Values
-
MODE_FIXED
public static final int MODE_FIXED
Deprecated. since JavaView 3.13, use HASH_FIXEDFixed spacing of hashings at automatically or assigned ticks.- See Also:
- Constant Field Values
-
HASH_PARTITIONED
public static final int HASH_PARTITIONED
Dynamic spacing of hashings at equal distances from a reference tick.- See Also:
- Constant Field Values
-
MODE_PARTITIONED
public static final int MODE_PARTITIONED
Deprecated. since JavaView 3.13, use HASH_PARTITIONEDDynamic spacing of hashings at equal distances from a reference tick.- See Also:
- Constant Field Values
-
NORMAL_DIRECTION
public static final int NORMAL_DIRECTION
- See Also:
- Constant Field Values
-
UP_VECTOR_DIRECTION
public static final int UP_VECTOR_DIRECTION
- See Also:
- Constant Field Values
-
RULER_NAME_ALIGN_LEFT
public static final int RULER_NAME_ALIGN_LEFT
- See Also:
- Constant Field Values
-
RULER_NAME_ALIGN_RIGHT
public static final int RULER_NAME_ALIGN_RIGHT
- See Also:
- Constant Field Values
-
RULER_NAME_ALIGN_CENTER
public static final int RULER_NAME_ALIGN_CENTER
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
PgRuler
public PgRuler()
Create a ruler in 3D space.
-
PgRuler
public PgRuler(int dim)
Create a ruler in given space dimension which is by default oriented along the x-axis.
-
PgRuler
public PgRuler(PdVector rulerDir, PdVector rulerNormal)
Deprecated. since JavaView 3.12.002, use setDirection and setNormalCreate a new ruler with given direction and normal direction for hashings. Both vectors must be orthogonal but need not be normalized.- Parameters:
rulerDir- direction of baseline of rulerrulerNormal- vector orthogonal to direction of baseline
-
-
Method Detail
-
init
public void init()
Initialization method.
-
setGlobalPolygonColor
public void setGlobalPolygonColor(java.awt.Color color)
This method assigns the global polygon color of superclass and sets the default color for hashings.- Overrides:
setGlobalPolygonColorin classPgJvxSrc- Since:
- JavaView 2.60.002
- Version:
- 13.03.03, 1.00 created (kp)
-
setGlobalPolygonSize
public void setGlobalPolygonSize(double size)
This method assigns the global polygon color of superclass and sets the default color for hashings.- Overrides:
setGlobalPolygonSizein classPgJvxSrc- Since:
- JavaView 3.62.013
- Version:
- 28.11.04, 1.00 created (kp)
-
update
public boolean update(java.lang.Object event)
Description copied from class:PgGeometryUpdate method of geometry updates registered panels, update listeners, and invokes a repaint in the registered displays.Usage:
- 1. event == this : geometry has changed, all panels will be updated.
- 2. event == null : geometry has changed, no need to update a panel.
- 3. event == a panel : geometry has changed, all panels except 'panel' will be updated.
- 4. event == else : unhandled event, error.
Any update is forwarded to the parent of the geometry with the geometry as event.
Any update is forwarded to each registered display with the geometry as event which leads to a repaint of the display.
- 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)
-
isShowingMajorHashings
public boolean isShowingMajorHashings()
Determines whether the ruler should be partitioned as fixed or dynamic and then sets m_tiMajor accordingly. Also if the ruler does not have a positive length FAIL is returned meaning m_tiMajor has not been changed thus the hashing computations can be avoided alltogether.
-
isShowingMinorHashings
public boolean isShowingMinorHashings()
-
isShowingHashingsInNormalDir
public boolean isShowingHashingsInNormalDir()
-
isShowingHashingsInUpDir
public boolean isShowingHashingsInUpDir()
-
isShowingLabels
public boolean isShowingLabels()
-
getMaxParameter
public double getMaxParameter()
-
getMinParameter
public double getMinParameter()
-
getNumMajorPartitions
public int getNumMajorPartitions()
-
getNumMinorPartitions
public int getNumMinorPartitions()
-
getMajorUnit
public double getMajorUnit()
-
getMinorUnit
public double getMinorUnit()
-
showLabels
public void showLabels(boolean flag)
-
isShowingArrow
public boolean isShowingArrow()
-
showArrow
public void showArrow(boolean flag)
-
isShowingFixedMode
public boolean isShowingFixedMode()
Deprecated. use getHashMode() which returns HASH_FIXED or HASH_PARTITIONEDMode of a ruler is either partitioned or fixed.
-
showFixedMode
public void showFixedMode(boolean flag)
Deprecated. use setHashMode(int) with HASH_FIXED or HASH_PARTITIONEDMode of a ruler is either partitioned or fixed.
-
getHashMode
public int getHashMode()
Get hashing mode of a ruler is either partitioned or fixed, see HASH_FIXED or HASH_PARTITIONED.- Since:
- JavaView 2.47
- Version:
- 05.12.02, 1.00 created (kp)
-
setHashMode
public void setHashMode(int mode)
Set hashing mode of a ruler which is either partitioned or fixed, see HASH_FIXED or HASH_PARTITIONED.- Since:
- JavaView 2.47
- Version:
- 05.12.02, 1.00 created (kp)
-
getMode
public int getMode()
Deprecated. since JavaView 3.12.002, use getHashMode()Get hashing mode of a ruler is either partitioned or fixed, see PgRuler#HASH_FIXED or PgRuler#HASH_PARTITIONED.
-
setMode
public void setMode(int mode)
Deprecated. since JavaView 3.12.002, use setHashMode(int)Set hashing mode of a ruler which is either partitioned or fixed, see PgRuler#HASH_FIXED or PgRuler#HASH_PARTITIONED.
-
showMajorHashings
public void showMajorHashings(boolean flag)
-
showMinorHashings
public void showMinorHashings(boolean flag)
-
showHashingsInNormalDir
public void showHashingsInNormalDir(boolean flag)
-
showHashingsInUpDir
public void showHashingsInUpDir(boolean flag)
-
isShowingRulerName
public boolean isShowingRulerName()
Check whether showing of name of ruler is switched on. On default, showing of name is disabled.In contrast to the usual name of an object, the ruler name is shown in the center of an axis with some fake trick.
- Since:
- JavaView 2.47
- See Also:
PgGeometry.showTitle(boolean),PsObject.setName(String)- Version:
- 26.11.02, 1.00 created (kp)
-
showRulerName
public void showRulerName(boolean flag)
Enable and disable showing of name of ruler in display. On default, showing of title is disabled.In contrast to the usual name of an object, the ruler name is shown in the center of an axis with some fake trick.
- Since:
- JavaView 2.47
- See Also:
PgGeometry.showTitle(boolean),PsObject.setName(String)- Version:
- 26.11.02, 1.00 created (kp)
-
setEndPoint
public void setEndPoint(PdVector endPnt, PdVector viewDir)
Measure, is a way of using the ruler as a Tape measure. To use this method you simply need to pass it an endpoint from which a measurement is made from the currently defined ruler origin set via #setOrigin(). Hashings will only be automatically visible if measurements are made in the xy,yz, or xz perspectives. For the arbitrary perspective case you must explicity give a direction in which to draw the hash, else results may be unpredictable.
-
setOrigin
public void setOrigin(double x, double y, double z)Set the origin of the ruler to the specific point in space.- Parameters:
x- new x-component of origin of rulery- new y-component of origin of rulerz- new z-component of origin of ruler
-
setOrigin
public void setOrigin(PdVector orig)
Set the origin of the ruler to the specific point in space.- Parameters:
orig- new origin of ruler
-
setDirection
public void setDirection(double x, double y, double z)Set direction of the baseline of the ruler. Normalization will be done within this method.- Parameters:
x- new x-component of direction vector of the baseline of the rulery- new y-component of direction vector of the baseline of the rulerz- new z-component of direction vector of the baseline of the ruler
-
setDirection
public void setDirection(PdVector dir)
Set direction of the baseline of the ruler. Normalization will be done within this method.- Parameters:
dir- direction vector of the baseline of the ruler
-
setNormal
public void setNormal(double x, double y, double z)Set direction of the normal vector along which the hashings will be drawn. Normalization will be done within this method.- Parameters:
x- new x-component of a 3d vector (based at the origin) specifying the direction in which to draw the hashingsy- new y-component of a 3d vector (based at the origin) specifying the direction in which to draw the hashingsz- new z-component of a 3d vector (based at the origin) specifying the direction in which to draw the hashings
-
setNormal
public void setNormal(PdVector nor)
Set direction of the normal vector along which the hashings will be drawn. Normalization will be done within this method.- Parameters:
nor- a 3d vector (based at the origin) specifying the direction in which to draw the hashings
-
setUpVector
public void setUpVector(PdVector up)
Deprecated. since JavaView 3.12.002, upVector is automatically computed when dir or normal is assigned.For rulers in 3D space, set direction of the up vector along which a secondary set of hashings will be drawn. Normalization will be done within this method.- Parameters:
up- a 3d vector (based at the origin) specifying the direction in which to draw the hashings
-
setDefaultHashSizes
public void setDefaultHashSizes(int orthoType)
Reset minor and major hash extents to default values.- Parameters:
orthoType- specify which of 2 perpendicular directions (PgRuler#NORMAL_DIRECTION or PgRuler#UP_VECTOR_DIRECTION) that hashing occurs.
-
setMajorHashSize
public void setMajorHashSize(double pt1, double pt2, int orthoType)Set the extent size of major hashings along the up or normal vectors- Parameters:
pt1- a scalar multiple of the hash vector representing one endpoint of the hash linept2- a scalar multiple of the hash vector representing the other endpoint of the hash lineorthoType- specify which of 2 perpendicular directions (PgRuler#NORMAL_DIRECTION or PgRuler#UP_VECTOR_DIRECTION) that hashing occurs.
-
setMinorHashSize
public void setMinorHashSize(double pt1, double pt2, int orthoType)Set the extent size of minor hashings along the up or normal vectors- Parameters:
pt1- a scalar multiple of the hash vector representing one endpoint of the hash linept2- a scalar multiple of the hash vector representing the other endpoint of the hash lineorthoType- specify which of 2 perpendicular directions that hashing occurs.
-
setFixedHashing
public void setFixedHashing(double major, double minor)
-
setPartitionedHashing
public void setPartitionedHashing(int major, int minor)
-
setMinMax
public void setMinMax(double min, double max)Set maximum and minimum value of this ruler.
-
setMajorColor
public void setMajorColor(java.awt.Color color)
-
setMinorColor
public void setMinorColor(java.awt.Color color)
-
getRulerName
public java.lang.String getRulerName()
Get name of ruler as it appears at an axis, for example. Note, the name is identical to the name of the underlying geometry.- Returns:
- name of ruler
-
setRulerName
public void setRulerName(java.lang.String name)
Set the name of ruler as it appears at an axis, for example.- Parameters:
name- the title to be shown for the ruler- See Also:
setRulerName(String,int,boolean)
-
setRulerName
public void setRulerName(java.lang.String name, int pos)Set the name of ruler as it appears at an axis, for example.- Parameters:
name- the title to be shown for the rulerpos- the positioning of the label with respect to the ruler baseline :={RULER_NAME_ALIGN_LEFT,RULER_NAME_ALIGN_RIGHT,RULER_NAME_ALIGN_CENTER}- See Also:
setRulerName(String,int,boolean)
-
setRulerName
public void setRulerName(java.lang.String name, boolean show)Set the name of ruler as it appears at an axis, for example.- Parameters:
name- the title to be shown for the rulershow- whether or not to show the ruler name/title- See Also:
setRulerName(String,int,boolean)
-
setRulerName
public void setRulerName(java.lang.String name, int pos, boolean show)Set the name of ruler as it appears at an axis, for example.- Parameters:
name- the title to be shown for the rulerpos- the positioning of the label with respect to the ruler baseline :={RULER_NAME_ALIGN_LEFT,RULER_NAME_ALIGN_RIGHT,RULER_NAME_ALIGN_CENTER}show- whether or not to show the ruler name/title
-
setHashLabel
public void setHashLabel(int xoff, int yoff, int labelhSide, int labelvSide)Customizes the positioning of the label at hashings.- Parameters:
xoff- how much to offset the label from the label origin in the x directionyoff- how much to offset the label from the label origin in the y directionlabelhSide- horizontal position at label to align with, {PgGeometryIf.LABEL_HEAD, PgGeometryIf.LABEL_CENTER, PgGeometryIf.LABEL_TAIL}labelvSide- vertical position at label to align with, {PgGeometryIf.LABEL_BASE, PgGeometryIf.LABEL_MIDDLE, PgGeometryIf.LABEL_TOP}
-
setNameAlignment
public void setNameAlignment(int align, int labelhSide, int xoff, int yoff)Customizes the positioning of the name of the ruler.- Parameters:
align- {RULER_NAME_ALIGN_LEFT,RULER_NAME_ALIGN_RIGHT,RULER_NAME_ALIGN_CENTER} with base, center or tip of ruler's baseline.labelhSide- the side of the label to bound to given point, {PgGeometryIf.LABEL_HEAD, PgGeometryIf.LABEL_CENTER, PgGeometryIf.LABEL_TAIL}xoff- how much to offset the label from the label origin in the x direction.yoff- how much to offset the label from the label origin in the y direction.
-
setHashOffsetInNormalDir
public void setHashOffsetInNormalDir(double xoff, double yoff, double zoff)
-
setHashOffsetInUpDir
public void setHashOffsetInUpDir(double xoff, double yoff, double zoff)
-
isEnabledAutoHashing
public boolean isEnabledAutoHashing()
Check if axes is automatically adjusted to varying size of the shown shape.- Since:
- JavaView 3.62.013
- Version:
- 28.11.04, 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 streched 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.- Since:
- JavaView 3.62.013
- Version:
- 28.11.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.62.013
- Version:
- 28.11.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.62.013
- Version:
- 28.11.04, 1.00 created (kp)
-
-
"