|
JavaView® v2.00.008 | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object
|
+--jv.object.PsObject
|
+--jv.project.PgGeometry
|
+--jv.geom.PgPointSet
|
+--jv.geom.PgPolygonSet
|
+--jv.thirdParty.ruler.PgRuler
A Ruler has an origin in 3-space, a direction in 3-space, and min and max exents along this so-defined line - thus we allow for the origin, direction, and extents of the ruler to be externally controlled. Based on this data, the ruler itself will configure its' appearance according to specifications given in its configuration panel.
PgRuler, Serialized Form| Field Summary | |
static int |
ALIGNCENTER
|
static int |
ALIGNLEFT
|
static int |
ALIGNRIGHT
|
protected boolean |
m_bFixedMode
state of ruler ruler style |
protected boolean |
m_bHashInNormalDir
Flag for showing hashings in direction of normal vector |
protected boolean |
m_bHashInUpDir
Flag for showing hashings in direction of up vector |
protected boolean |
m_bMajorMode
Flag for showing major hashings |
protected boolean |
m_bMinorMode
Flag for showing minor hashings |
protected boolean |
m_bShowLabels
Flag for showing the labels on each hash |
protected boolean |
m_bShowRulerName
Flag for showing the title of the ruler |
protected double[] |
m_hMajor
|
protected java.awt.Color |
m_hMajorColor
|
protected double[] |
m_hMinor
|
protected java.awt.Color |
m_hMinorColor
|
protected PuDouble |
m_majorHashUnits
Major Units |
protected PdVector |
m_minMax
0 holds min param unit, 1 holds max hash unit |
protected PuDouble |
m_minorHashUnits
Minor Units |
protected PdVector |
m_n
Normal hash vector direction |
protected PdVector |
m_normalOffset
Up hash vector origin |
protected PuInteger |
m_numMajorHashings
Number of Major grid lines in interval. |
protected PuInteger |
m_numMinorHashings
Number of Minor grid lines in interval. |
protected PdVector |
m_origin
Intial endpoint of the ruler (A) |
protected java.lang.String |
m_rulerName
Title of axis |
protected int |
m_rulerNamePos
Align title 0=left, 1=center, 2= right |
protected double[] |
m_tiMajor
An array of t parameters representing the hashings on the line |
protected double[] |
m_tiMinor
|
protected PdVector |
m_u
Up hash vector direction |
protected PdVector |
m_upOffset
Normal hash vector origin for normal Vector direction |
protected PdVector |
m_v
ruler direction |
static int |
NORMAL_DIRECTION
|
static int |
UP_VECTOR_DIRECTION
|
| Fields inherited from class jv.project.PgGeometry |
m_ambientProj, m_ambientSpace, m_authorInfo, m_bShowBndBox, m_bShowCenter, m_bShowing, m_bShowTitle, m_center, m_dim, m_dimOfSimplex, m_displayList, m_geometryInfo, m_labelAttribute, m_methodMenu, m_modelMatrix, m_title, m_version, m_versionType |
| Fields inherited from class jv.object.PsObject |
HAS_CONFIG_PANEL, HAS_INFO_PANEL, HAS_MATERIAL_PANEL, INSPECTOR_INFO, INSPECTOR_INFO_EXT, IS_DELETED, IS_FIXED, IS_SELECTED, IS_USED, m_infoPanel, m_name, m_panelList, m_parent, m_tag, m_updateList, NUM_TAGS |
| Constructor Summary | |
PgRuler()
|
|
PgRuler(PdVector rulerDir,
PdVector rulerNormal)
|
|
PgRuler(PdVector rulerDir,
PdVector rulerNormal,
double tmin,
double tmax)
|
|
PgRuler(PdVector rulerOrigin,
PdVector rulerDir,
PdVector rulerNormal)
|
|
PgRuler(PdVector rulerOrigin,
PdVector rulerDir,
PdVector rulerNormal,
double tmin,
double tmax)
|
|
| Method Summary | |
protected int |
computeBaseLine()
Determines whether the ruler should be partitioned as fixed or dynamic & then sets m_tiMajor accordingly. |
protected void |
computeDynamicHashings(int orthogonalType)
|
protected void |
computeFixedHashings(int orthogonalType)
|
protected void |
computeHashings()
|
protected void |
computeUpVector()
|
protected void |
constructHashSet(PgPolygonSet P,
PdVector p0,
PdVector v,
PdVector vperp,
double[] T,
double[] h,
boolean isMajor)
|
void |
flipNormal()
|
void |
flipUpVector()
|
double |
getMajorUnit()
|
PdVector |
getMaxCoordinate()
|
double |
getMaxParameter()
|
PdVector |
getMinCoordinate()
|
double |
getMinorUnit()
|
double |
getMinParameter()
|
PdVector |
getNormal()
|
int |
getNumMajorPartitions()
|
int |
getNumMinorPartitions()
|
PdVector |
getUpVector()
|
protected double[] |
HashInterval(double incr,
double tmin,
boolean closedAtMin,
double tmax,
boolean closedAtMax)
Given an interval on the Real Line @return all of the hashings of that interval in an array That is, every multiple of incr between min and max |
void |
init()
Initialize and reset instance variables after call to super.init(). |
boolean |
isShowingFixedMode()
|
boolean |
isShowingHashingsInNormalDir()
|
boolean |
isShowingHashingsInUpDir()
|
boolean |
isShowingLabels()
|
boolean |
isShowingMajorHashings()
|
boolean |
isShowingMinorHashings()
|
boolean |
isShowingRulerName()
|
void |
measure(PdVector P)
Measure, is a way of using the ruler as a Tape measure. |
void |
measure(PdVector P,
PdVector N)
|
void |
moveRulerOrigin(PdVector d)
move the origin of the ruler to the specific point in space given by d call update externally! |
protected double[] |
PartitionInterval(int numPartitions,
double tmin,
boolean closedAtMin,
double tmax,
boolean closedAtMax)
Subdivide the interval |
void |
setDefaultHashSizes(int orthogonalType)
|
void |
setDefDynamicHashing()
|
void |
setDefFixedHashing()
|
void |
setDirection(PdVector InitPt,
PdVector FinalPt)
give the direction of baseline of the ruler Normalization will be done within this method |
void |
setDynamicHashing(int major,
int minor)
|
void |
setFixedHashing(double major,
double minor)
|
void |
setHashLabel(int p1,
int p2,
int alignment)
|
void |
setHashOffsetInNormalDir(double xoff,
double yoff,
double zoff)
|
void |
setHashOffsetInUpDir(double xoff,
double yoff,
double zoff)
|
void |
setInitPoint(PdVector P)
set the origin of the ruler |
void |
setMajorColor(java.awt.Color C)
|
void |
setMajorHashSize(double pt1,
double pt2,
int orthogonalType)
Set the endpoints of the hashings along the up or normal vectors |
void |
setMinMax(double min,
double max)
|
void |
setMinorColor(java.awt.Color C)
|
void |
setMinorHashSize(double pt1,
double pt2,
int orthogonalType)
Set the endpoints of the hashings along the up or normal vectors |
void |
setNameAlignment(int labelside,
int xoff,
int yoff)
This method customizes the positioning of the label after affixed to the side of the ruler via setRulerName(pos) |
void |
setNameAlignment(int align,
int labelside,
int xoff,
int yoff)
This method customizes the positioning of the label and allows you to specify where to affix the label origin to on the ruler |
void |
setNormal(PdVector N)
give the direction of the normal vector along which the hashings will be drawn - Normalization will be done within this method |
void |
setRulerName(java.lang.String s)
|
void |
setRulerName(java.lang.String s,
boolean show)
see setRulerName(s,pos,show) |
void |
setRulerName(java.lang.String s,
int pos)
|
void |
setRulerName(java.lang.String s,
int pos,
boolean show)
|
void |
setUpVector(PdVector U)
give the direction of the up vector along which a secondary set of hashings will be drawn - Normalization will be done within this method |
void |
showFixedMode(boolean flag)
|
void |
showHashingsInNormalDir(boolean flag)
|
void |
showHashingsInUpDir(boolean flag)
|
void |
showLabels(boolean flag)
|
void |
showMajorHashings(boolean flag)
|
void |
showMinorHashings(boolean flag)
|
void |
showRulerName(boolean flag)
|
boolean |
update(java.lang.Object event)
Update the class whenever a child has changed. |
| Methods inherited from class jv.object.PsObject |
addInspector, addUpdateListener, clearTag, clone, clone, copy, getFather, getInfoPanel, getInspector, getName, getNumObjects, hasInspector, hasTag, hasUpdateListener, instanceOf, instanceOf, removeInspector, removeUpdateListener, setName, setParent, setTag, updatePanels |
| Methods inherited from class java.lang.Object |
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface jv.project.PgGeometryIf |
getInfoPanel, getName, setName |
| Methods inherited from interface jv.object.PsUpdateIf |
getFather, setParent |
| Field Detail |
public static final int NORMAL_DIRECTION
public static final int UP_VECTOR_DIRECTION
public static final int ALIGNLEFT
public static final int ALIGNRIGHT
public static final int ALIGNCENTER
protected boolean m_bFixedMode
protected boolean m_bMajorMode
protected boolean m_bMinorMode
protected boolean m_bHashInNormalDir
protected boolean m_bHashInUpDir
protected boolean m_bShowLabels
protected boolean m_bShowRulerName
protected java.lang.String m_rulerName
protected int m_rulerNamePos
protected PdVector m_minMax
protected double[] m_tiMajor
protected double[] m_tiMinor
protected PdVector m_origin
protected PdVector m_normalOffset
protected PdVector m_upOffset
protected PdVector m_v
protected PdVector m_n
protected PdVector m_u
protected double[] m_hMinor
protected double[] m_hMajor
protected java.awt.Color m_hMajorColor
protected java.awt.Color m_hMinorColor
protected PuInteger m_numMajorHashings
protected PuInteger m_numMinorHashings
protected PuDouble m_majorHashUnits
protected PuDouble m_minorHashUnits
| Constructor Detail |
public PgRuler()
public PgRuler(PdVector rulerDir,
PdVector rulerNormal)
public PgRuler(PdVector rulerDir,
PdVector rulerNormal,
double tmin,
double tmax)
public PgRuler(PdVector rulerOrigin,
PdVector rulerDir,
PdVector rulerNormal)
public PgRuler(PdVector rulerOrigin,
PdVector rulerDir,
PdVector rulerNormal,
double tmin,
double tmax)
| Method Detail |
public void init()
PgPolygonSetinit in class PgPolygonSetpublic boolean update(java.lang.Object event)
PgPolygonSetupdate in class PgPolygonSetjv.object.PsUpdateIfevent - carries a lot of informationPsObject,
PsUpdateIf.getFather(),
PsUpdateIf.setParent(PsUpdateIf)protected void computeHashings()
protected int computeBaseLine()
protected void computeFixedHashings(int orthogonalType)
protected void computeDynamicHashings(int orthogonalType)
protected void constructHashSet(PgPolygonSet P,
PdVector p0,
PdVector v,
PdVector vperp,
double[] T,
double[] h,
boolean isMajor)
P - is the input Polygonset to which to add the hash lines to --passed by refrence it is filled
P may be empty or partially filled, this method just appends polys to the existing polyset.P0 - is the base point of the hash vector directionv - is a unit vector in the direction of the this rulers base linevperp - is a unit vector perpendicular to the direction of this ruler's base lineT - is the array of parameters that pick out points on our line (through 0)h - is an array of size 2 holding the initial and final points of the hash offset from the lineisMajor - true: label & tag; true: dont label & dont tag
protected double[] HashInterval(double incr,
double tmin,
boolean closedAtMin,
double tmax,
boolean closedAtMax)
incr: - the absolute incrementtmin: - the min of intervalclosedAtMin: - specify whether the interval is closed at min (includes min)tmax: - the max of intervalclosedAtMax: - specify whether the interval is closed at max (includes max)
protected double[] PartitionInterval(int numPartitions,
double tmin,
boolean closedAtMin,
double tmax,
boolean closedAtMax)
numpartitions: - number of hashes dividing up [min,max]tmin: - the min of intervalclosedAtMin: - specify whether the interval is closed at mintmax: - the max of intervalclosedAtMax: - specify whether the interval is closed at maxprotected void computeUpVector()
public boolean isShowingMajorHashings()
public boolean isShowingMinorHashings()
public boolean isShowingHashingsInNormalDir()
public boolean isShowingHashingsInUpDir()
public boolean isShowingLabels()
public boolean isShowingRulerName()
public boolean isShowingFixedMode()
public PdVector getMaxCoordinate()
public PdVector getMinCoordinate()
public PdVector getNormal()
public PdVector getUpVector()
public double getMaxParameter()
public double getMinParameter()
public int getNumMajorPartitions()
public int getNumMinorPartitions()
public double getMajorUnit()
public double getMinorUnit()
public void showRulerName(boolean flag)
public void showLabels(boolean flag)
public void showFixedMode(boolean flag)
public void showMajorHashings(boolean flag)
public void showMinorHashings(boolean flag)
public void showHashingsInNormalDir(boolean flag)
public void showHashingsInUpDir(boolean flag)
public void setInitPoint(PdVector P)
public void measure(PdVector P)
public void measure(PdVector P,
PdVector N)
public void setDirection(PdVector InitPt,
PdVector FinalPt)
InitPt: - the origin of the ruler's baselineFinalPt: - another point toward which the ruler should direct iteselfpublic void setNormal(PdVector N)
N: - a 3d vector (based at the origin) specifying the direction in which to draw the hashingspublic void setUpVector(PdVector U)
U: - a 3d vector (based at the origin) specifying the direction in which to draw the hashings
public void setMajorHashSize(double pt1,
double pt2,
int orthogonalType)
orthogonalType: - specify which of 2 perpendicular directions that hashing occurs.pt1: - a scalar muliple 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 linepublic void setDefaultHashSizes(int orthogonalType)
public void setMinorHashSize(double pt1,
double pt2,
int orthogonalType)
orthogonalType: - specify which of 2 perpendicular directions that hashing occurs.pt1: - a scalar muliple 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 line
public void setFixedHashing(double major,
double minor)
public void setDynamicHashing(int major,
int minor)
public void setDefDynamicHashing()
public void setDefFixedHashing()
public void setMinMax(double min,
double max)
public void setHashLabel(int p1,
int p2,
int alignment)
public void setMajorColor(java.awt.Color C)
public void setMinorColor(java.awt.Color C)
public void setRulerName(java.lang.String s)
setRulerName(s,pos,show)
public void setRulerName(java.lang.String s,
int pos)
setRulerName(s,pos,show)
public void setRulerName(java.lang.String s,
boolean show)
public void setRulerName(java.lang.String s,
int pos,
boolean show)
s: - the title to be shown for the rulerpos: - the positioning of the label with respect to the ruler baseline :={ALIGNLEFT,ALIGNRIGHT,ALIGNCENTER}show: - whether or not to show the ruler name/title
public void setNameAlignment(int labelside,
int xoff,
int yoff)
labelside: - which side of the label to attach to the label origin :={ALIGNLEFT(0),ALIGNRIGHT(1)}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 direction
public void setNameAlignment(int align,
int labelside,
int xoff,
int yoff)
align:=:={ALIGNLEFT,ALIGNRIGHT,ALIGNCENTER} - labelside: - which side of the label to attach to the label origin :={ALIGNLEFT(0),ALIGNRIGHT(1)}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 directionpublic void flipNormal()
public void flipUpVector()
public void moveRulerOrigin(PdVector d)
public void setHashOffsetInNormalDir(double xoff,
double yoff,
double zoff)
public void setHashOffsetInUpDir(double xoff,
double yoff,
double zoff)
|
JavaView® v2.00.008 | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||