Class FlyPathBehavior.BranchState
- java.lang.Object
-
- gov.nih.mipav.view.renderer.J3D.surfaceview.flythruview.FlyPathBehavior.BranchState
-
- All Implemented Interfaces:
java.lang.Cloneable
- Enclosing class:
- FlyPathBehavior
private class FlyPathBehavior.BranchState extends java.lang.Object implements java.lang.CloneableDOCUMENT ME!
-
-
Field Summary
Fields Modifier and Type Field Description float[]m_afBranchPointList of branch points (normalized path distances where one or more branches starts).booleanm_bMoveForwardCurrent direction.private floatm_fDistUnvisitedMaxDOCUMENT ME!private floatm_fDistUnvisitedMinRange of normalized path distances that have not been visited.floatm_fNormalizedPathDistCurrent position along the path.floatm_fParentBranchPointDOCUMENT ME!intm_iBranchIndexIdentifies the current curve in the path graph.intm_iParentBranchIndexInformation about the parent branch, if one exists.WildMagic.LibFoundation.Curves.Curve3fm_kBranchCurveDOCUMENT ME!
-
Constructor Summary
Constructors Constructor Description BranchState(int iBranchIndex, FlyPathGraphCurve kFlyPathGraph)Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected java.lang.Objectclone()Clone the current branch state.FlyPathBehavior.BranchStatecreateCopy()Create a copy of this instance.FlyPathBehavior.BranchStatecreateReverseCopy()Create a copy of this instance which has the same information except that the state of the moving forward is inverted.intgetBranchPointSegment(float fNormalizedPathDist)Return an index which identifies segment the specified normalized path distance belongs.javax.vecmath.Point3fgetForwardNormalizedPosition(float fDist)Return the position of the curve of the point further down the curve the specified distance in the current heading.floatgetForwardNormalizedTime(float fForwardDist)Return the normalized path distance of a point further down the branch curve in the current heading.voidstart()Reset parameters to start at the beginning of the path moving in the forward direction.voidupdateDistUnvisited(float fNewNormalizedPathDistance)Update the range of normalized path distances that have not been visited.
-
-
-
Field Detail
-
m_afBranchPoint
public float[] m_afBranchPoint
List of branch points (normalized path distances where one or more branches starts).
-
m_bMoveForward
public boolean m_bMoveForward
Current direction. True if forward, false if reverse.
-
m_fNormalizedPathDist
public float m_fNormalizedPathDist
Current position along the path.
-
m_fParentBranchPoint
public float m_fParentBranchPoint
DOCUMENT ME!
-
m_iBranchIndex
public int m_iBranchIndex
Identifies the current curve in the path graph.
-
m_iParentBranchIndex
public int m_iParentBranchIndex
Information about the parent branch, if one exists.
-
m_kBranchCurve
public WildMagic.LibFoundation.Curves.Curve3f m_kBranchCurve
DOCUMENT ME!
-
m_fDistUnvisitedMax
private float m_fDistUnvisitedMax
DOCUMENT ME!
-
m_fDistUnvisitedMin
private float m_fDistUnvisitedMin
Range of normalized path distances that have not been visited.
-
-
Constructor Detail
-
BranchState
public BranchState(int iBranchIndex, FlyPathGraphCurve kFlyPathGraph)Constructor.- Parameters:
iBranchIndex- int Index which identifies the branch.kFlyPathGraph- FlyPathGraphCurve Data structure which contains all of the information about each branch and its connections.
-
-
Method Detail
-
createCopy
public FlyPathBehavior.BranchState createCopy()
Create a copy of this instance.- Returns:
- BranchState New instance which is a copy of this instance.
-
createReverseCopy
public FlyPathBehavior.BranchState createReverseCopy()
Create a copy of this instance which has the same information except that the state of the moving forward is inverted.- Returns:
- BranchState New instance which is a copy of this instance except that the moving forward flag is inverted.
-
getBranchPointSegment
public int getBranchPointSegment(float fNormalizedPathDist)
Return an index which identifies segment the specified normalized path distance belongs.- Parameters:
fNormalizedPathDist- float Normalized path distance in the range [0,1] along the branch path.- Returns:
- int An index of zero is returned if the distance is before the first branch point or if there are no branch points. An index of one is returned if the distance is greater than or equal to the first branch point but less than or equal to second branch point.
-
getForwardNormalizedPosition
public javax.vecmath.Point3f getForwardNormalizedPosition(float fDist)
Return the position of the curve of the point further down the curve the specified distance in the current heading.- Parameters:
fDist- float Distance further down the branch curve in the current heading. This value can be negative for a point in the reverse heading.- Returns:
- Point3f Coordinates of the 3D point further down along the curve.
-
getForwardNormalizedTime
public float getForwardNormalizedTime(float fForwardDist)
Return the normalized path distance of a point further down the branch curve in the current heading.- Parameters:
fForwardDist- float Distance further down the branch curve in the current heading. This value can be negative for a point in the reverse heading.- Returns:
- float Normalized path distance in the [0,1] range for the requested point.
-
start
public void start()
Reset parameters to start at the beginning of the path moving in the forward direction.
-
updateDistUnvisited
public void updateDistUnvisited(float fNewNormalizedPathDistance)
Update the range of normalized path distances that have not been visited. Call this method before changing the current normalized path distance!- Parameters:
fNewNormalizedPathDistance- float Normalized path distance about to be set for this branch.
-
clone
protected java.lang.Object clone()
Clone the current branch state. Used by the mouse recording process.- Overrides:
clonein classjava.lang.Object- Returns:
- Object
- Throws:
java.lang.InternalError- DOCUMENT ME!
-
-