public final class PgRuler extends PgJvxSrc
Rulers are used as components of PgAxes but additionally may be used individually to measure distances.
PgAxes
,
Serialized FormModifier and Type | Field and Description |
---|---|
static int |
HASH_FIXED
Fixed spacing of hashings at automatically or assigned ticks.
|
static int |
HASH_PARTITIONED
Dynamic spacing of hashings at equal distances from a reference tick.
|
static int |
MODE_FIXED
Deprecated.
since JavaView 3.13, use HASH_FIXED
|
static int |
MODE_PARTITIONED
Deprecated.
since JavaView 3.13, use HASH_PARTITIONED
|
static int |
NORMAL_DIRECTION |
static int |
RULER_NAME_ALIGN_CENTER |
static int |
RULER_NAME_ALIGN_LEFT |
static int |
RULER_NAME_ALIGN_RIGHT |
static int |
UP_VECTOR_DIRECTION |
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 |
---|
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
|
Modifier and Type | Method and Description |
---|---|
int |
getHashMode()
Get hashing mode of a ruler is either partitioned or fixed, see HASH_FIXED or HASH_PARTITIONED.
|
double |
getMajorUnit() |
double |
getMaxParameter() |
double |
getMinorUnit() |
double |
getMinParameter() |
int |
getMode()
Deprecated.
since JavaView 3.12.002, use getHashMode()
|
int |
getNumMajorPartitions() |
int |
getNumMinorPartitions() |
java.lang.String |
getRulerName()
Get name of ruler as it appears at an axis, for example.
|
void |
init()
Initialization method.
|
boolean |
isEnabledAutoBounds()
Check if automatic adjustment of size of axes to varying bounding box is enabled.
|
boolean |
isEnabledAutoHashing()
Check if axes is automatically adjusted to varying size of the shown shape.
|
boolean |
isShowingArrow() |
boolean |
isShowingFixedMode()
Deprecated.
use getHashMode() which returns HASH_FIXED or HASH_PARTITIONED
|
boolean |
isShowingHashingsInNormalDir() |
boolean |
isShowingHashingsInUpDir() |
boolean |
isShowingLabels() |
boolean |
isShowingMajorHashings()
Determines whether the ruler should be partitioned as fixed or dynamic and then sets
m_tiMajor accordingly.
|
boolean |
isShowingMinorHashings() |
boolean |
isShowingRulerName()
Check whether showing of name of ruler is switched on.
|
void |
setDefaultHashSizes(int orthoType)
Reset minor and major hash extents to default values.
|
void |
setDirection(double x,
double y,
double z)
Set direction of the baseline of the ruler.
|
void |
setDirection(PdVector dir)
Set direction of the baseline of the ruler.
|
void |
setEnabledAutoBounds(boolean flag)
Enable automatic adjustment of size of axes to varying bounding box.
|
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 |
setEndPoint(PdVector endPnt,
PdVector viewDir)
Measure, is a way of using the ruler as a Tape measure.
|
void |
setFixedHashing(double major,
double minor) |
void |
setGlobalPolygonColor(java.awt.Color color)
This method assigns the global polygon color of superclass
and sets the default color for hashings.
|
void |
setGlobalPolygonSize(double size)
This method assigns the global polygon color of superclass
and sets the default color for hashings.
|
void |
setHashLabel(int xoff,
int yoff,
int labelhSide,
int labelvSide)
Customizes the positioning of the label at hashings.
|
void |
setHashMode(int mode)
Set hashing mode of a ruler which is either partitioned or fixed, see HASH_FIXED or HASH_PARTITIONED.
|
void |
setHashOffsetInNormalDir(double xoff,
double yoff,
double zoff) |
void |
setHashOffsetInUpDir(double xoff,
double yoff,
double zoff) |
void |
setMajorColor(java.awt.Color color) |
void |
setMajorHashSize(double pt1,
double pt2,
int orthoType)
Set the extent size of major hashings along the up or normal vectors
|
void |
setMinMax(double min,
double max)
Set maximum and minimum value of this ruler.
|
void |
setMinorColor(java.awt.Color color) |
void |
setMinorHashSize(double pt1,
double pt2,
int orthoType)
Set the extent size of minor hashings along the up or normal vectors
|
void |
setMode(int mode)
Deprecated.
since JavaView 3.12.002, use setHashMode(int)
|
void |
setNameAlignment(int align,
int labelhSide,
int xoff,
int yoff)
Customizes the positioning of the name of the ruler.
|
void |
setNormal(double x,
double y,
double z)
Set direction of the normal vector along which the hashings will be drawn.
|
void |
setNormal(PdVector nor)
Set direction of the normal vector along which the hashings will be drawn.
|
void |
setOrigin(double x,
double y,
double z)
Set the origin of the ruler to the specific point in space.
|
void |
setOrigin(PdVector orig)
Set the origin of the ruler to the specific point in space.
|
void |
setPartitionedHashing(int major,
int minor) |
void |
setRulerName(java.lang.String name)
Set the name of ruler as it appears at an axis, for example.
|
void |
setRulerName(java.lang.String name,
boolean show)
Set the name of ruler as it appears at an axis, for example.
|
void |
setRulerName(java.lang.String name,
int pos)
Set the name of ruler as it appears at an axis, for example.
|
void |
setRulerName(java.lang.String name,
int pos,
boolean show)
Set the name of ruler as it appears at an axis, for example.
|
void |
setUpVector(PdVector up)
Deprecated.
since JavaView 3.12.002, upVector is automatically computed when dir or normal is assigned.
|
void |
showArrow(boolean flag) |
void |
showFixedMode(boolean flag)
Deprecated.
use setHashMode(int) with HASH_FIXED or HASH_PARTITIONED
|
void |
showHashingsInNormalDir(boolean flag) |
void |
showHashingsInUpDir(boolean flag) |
void |
showLabels(boolean flag) |
void |
showMajorHashings(boolean flag) |
void |
showMinorHashings(boolean flag) |
void |
showRulerName(boolean flag)
Enable and disable showing of name of ruler in display.
|
boolean |
update(java.lang.Object event)
Update method of geometry updates registered panels, update listeners, and
invokes a repaint in the registered displays.
|
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, hasTagVertex, isDefaultLabelEnabled, isEnabledIndexLabels, isShowingBackface, isShowingBnd, isShowingBndMaterials, isShowingBoundaries, isShowingEdgeColorFromElements, isShowingEdgeColorFromVertices, isShowingEdgeColors, isShowingEdgeLabels, isShowingEdges, isShowingEdgeSizes, isShowingElementBackColor, isShowingElementBackColors, 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, 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
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
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
assureInspector, getInfoPanel, getName, hasTag, setName
getFather, setParent
public static final int HASH_FIXED
public static final int MODE_FIXED
public static final int HASH_PARTITIONED
public static final int MODE_PARTITIONED
public static final int NORMAL_DIRECTION
public static final int UP_VECTOR_DIRECTION
public static final int RULER_NAME_ALIGN_LEFT
public static final int RULER_NAME_ALIGN_RIGHT
public static final int RULER_NAME_ALIGN_CENTER
public PgRuler()
public PgRuler(int dim)
public PgRuler(PdVector rulerDir, PdVector rulerNormal)
rulerDir
- direction of baseline of rulerrulerNormal
- vector orthogonal to direction of baselinepublic void setGlobalPolygonColor(java.awt.Color color)
setGlobalPolygonColor
in class PgJvxSrc
public void setGlobalPolygonSize(double size)
setGlobalPolygonSize
in class PgJvxSrc
public boolean update(java.lang.Object event)
PgGeometry
update
in interface PsUpdateIf
update
in class PgGeometry
event
- carries a lot of informationPsObject.setParent(PsUpdateIf)
,
PsObject.getFather()
,
PsObject.addUpdateListener(PsUpdateIf)
public boolean isShowingMajorHashings()
public boolean isShowingMinorHashings()
public boolean isShowingHashingsInNormalDir()
public boolean isShowingHashingsInUpDir()
public boolean isShowingLabels()
public double getMaxParameter()
public double getMinParameter()
public int getNumMajorPartitions()
public int getNumMinorPartitions()
public double getMajorUnit()
public double getMinorUnit()
public void showLabels(boolean flag)
public boolean isShowingArrow()
public void showArrow(boolean flag)
public boolean isShowingFixedMode()
public void showFixedMode(boolean flag)
public int getHashMode()
public void setHashMode(int mode)
public int getMode()
public void setMode(int mode)
public void showMajorHashings(boolean flag)
public void showMinorHashings(boolean flag)
public void showHashingsInNormalDir(boolean flag)
public void showHashingsInUpDir(boolean flag)
public boolean isShowingRulerName()
In contrast to the usual name of an object, the ruler name is shown in the center of an axis with some fake trick.
PgGeometry.showTitle(boolean)
,
PsObject.setName(String)
public void showRulerName(boolean flag)
In contrast to the usual name of an object, the ruler name is shown in the center of an axis with some fake trick.
PgGeometry.showTitle(boolean)
,
PsObject.setName(String)
public void setEndPoint(PdVector endPnt, PdVector viewDir)
public void setOrigin(double x, double y, double z)
x
- new x-component of origin of rulery
- new y-component of origin of rulerz
- new z-component of origin of rulerpublic void setOrigin(PdVector orig)
orig
- new origin of rulerpublic void setDirection(double x, double y, double z)
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 rulerpublic void setDirection(PdVector dir)
dir
- direction vector of the baseline of the rulerpublic void setNormal(double x, double y, double z)
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 hashingspublic void setNormal(PdVector nor)
nor
- a 3d vector (based at the origin) specifying the direction in which to draw the hashingspublic void setUpVector(PdVector up)
up
- a 3d vector (based at the origin) specifying the direction in which to draw the hashingspublic void setDefaultHashSizes(int orthoType)
orthoType
- specify which of 2 perpendicular directions (PgRuler#NORMAL_DIRECTION or PgRuler#UP_VECTOR_DIRECTION) that hashing occurs.public void setMajorHashSize(double pt1, double pt2, int orthoType)
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.public void setMinorHashSize(double pt1, double pt2, int orthoType)
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.public void setFixedHashing(double major, double minor)
public void setPartitionedHashing(int major, int minor)
public void setMinMax(double min, double max)
public void setMajorColor(java.awt.Color color)
public void setMinorColor(java.awt.Color color)
public java.lang.String getRulerName()
public void setRulerName(java.lang.String name)
name
- the title to be shown for the rulersetRulerName(String,int,boolean)
public void setRulerName(java.lang.String name, int pos)
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}setRulerName(String,int,boolean)
public void setRulerName(java.lang.String name, boolean show)
name
- the title to be shown for the rulershow
- whether or not to show the ruler name/titlesetRulerName(String,int,boolean)
public void setRulerName(java.lang.String name, int pos, boolean show)
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/titlepublic void setHashLabel(int xoff, int yoff, int labelhSide, int labelvSide)
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}public void setNameAlignment(int align, int labelhSide, int xoff, int yoff)
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.public void setHashOffsetInNormalDir(double xoff, double yoff, double zoff)
public void setHashOffsetInUpDir(double xoff, double yoff, double zoff)
public boolean isEnabledAutoHashing()
public void setEnabledAutoHashing(boolean flag)
public boolean isEnabledAutoBounds()
public void setEnabledAutoBounds(boolean flag)
"