mathcomp.gui.cfd
Class Branch
java.lang.Object
mathcomp.gui.cfd.Branch
public class Branch
- extends java.lang.Object
- Author:
- chwust
The Branch class represents an object to model a branch.
It contains the nodes and diameters of its nodes in the explicit order from bottom to top.
If along a branch another branching occurs (can only happen once) branchingPointer and -NodeNum store this special data.
Constructor Summary |
Branch()
|
Branch(java.util.Vector nodes,
java.util.Vector diams)
|
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Branch
public Branch()
Branch
public Branch(java.util.Vector nodes,
java.util.Vector diams)
getLength
public double getLength()
- caluculates the branch length from bottom to top
- Returns:
- branch length
getLengthUntil
public double getLengthUntil(int index)
- caluclates the branch length from bottom to node with number index.
- Parameters:
index
-
- Returns:
- specified branch length
deleteNode
public void deleteNode(int index)
insertNodeBetween
public void insertNodeBetween(int index)
insertNewDataAfter
public void insertNewDataAfter(Node n,
double diam,
int index)
insertNodeAt
public void insertNodeAt(Node n,
double diam,
int index)
setBranchingNode
public void setBranchingNode(int nn,
int bp)
isBranchingNode
public boolean isBranchingNode(int nodeNum)
getBranchingPointer
public int getBranchingPointer()
addNodeWithDiam
public void addNodeWithDiam(Node n,
double diam)
size
public int size()
getNodes
public java.util.Vector getNodes()
- Returns:
- Returns the nodes.
setNodes
public void setNodes(java.util.Vector nodes)
- Parameters:
nodes
- The nodes to set.
printData
public void printData()
getDiams
public java.util.Vector getDiams()
- Returns:
- Returns the diams.
setDiams
public void setDiams(java.util.Vector diams)
- Parameters:
diams
- The diams to set.
setDiamAt
public void setDiamAt(double value,
int i)
getDiamAt
public double getDiamAt(int i)
setNodeAt
public void setNodeAt(Node n,
int i)
getNodeAt
public Node getNodeAt(int i)
getNumNodes
public int getNumNodes()
- Returns:
scaleWithRespectTo
public void scaleWithRespectTo(double factor,
Node anchor)
scaleToLengthFromTop
public void scaleToLengthFromTop(double toScaleLen)
resetPhantomData
public void resetPhantomData()
- whenever added a node via skeleton.addPoint this last point of this branch
becomes the first and only phantom node
printPhantomNodes
public void printPhantomNodes()