mathcomp.gui.cfd
Class Branch

java.lang.Object
  extended by 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)
           
 
Method Summary
 void addNodeWithDiam(Node n, double diam)
           
 void deleteNode(int index)
           
 int getBranchingPointer()
           
 double getDiamAt(int i)
           
 java.util.Vector getDiams()
           
 double getLength()
          caluculates the branch length from bottom to top
 double getLengthUntil(int index)
          caluclates the branch length from bottom to node with number index.
 Node getNodeAt(int i)
           
 java.util.Vector getNodes()
           
 int getNumNodes()
           
 void insertNewDataAfter(Node n, double diam, int index)
           
 void insertNodeAt(Node n, double diam, int index)
           
 void insertNodeBetween(int index)
           
 boolean isBranchingNode(int nodeNum)
           
 void printData()
           
 void printPhantomNodes()
           
 void resetPhantomData()
          whenever added a node via skeleton.addPoint this last point of this branch becomes the first and only phantom node
 void scaleToLengthFromTop(double toScaleLen)
           
 void scaleWithRespectTo(double factor, Node anchor)
           
 void setBranchingNode(int nn, int bp)
           
 void setDiamAt(double value, int i)
           
 void setDiams(java.util.Vector diams)
           
 void setNodeAt(Node n, int i)
           
 void setNodes(java.util.Vector nodes)
           
 int size()
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Branch

public Branch()

Branch

public Branch(java.util.Vector nodes,
              java.util.Vector diams)
Method Detail

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()