|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.jscience.biology.lsystems.growing.Plant
public class Plant
This class represents a plant which can be built with a lindenmayer system.
| Constructor Summary | |
|---|---|
Plant(java.io.File fileLsy,
int iX,
int iY)
Constructor. |
|
| Method Summary | |
|---|---|
javax.media.j3d.TransformGroup |
build()
Builds the scene graph from the input file. |
javax.vecmath.Matrix3f |
buildMatrix(javax.vecmath.Vector3f v3fCol0,
javax.vecmath.Vector3f v3fCol1,
javax.vecmath.Vector3f v3fCol2)
Builds a new 3x3 matrix with the given three vectors by inserting the vector values in the matrix columns. |
int |
compareTo(java.lang.Object obj)
Compares a plant to another. |
java.util.Vector |
getAnimationList()
Gets the list of AnimtionGroup objects. |
java.lang.String |
getName()
Gets the name of the plant. |
static Plant |
getSelected()
Retrieves the selectedd plant. |
int |
getX()
Gets the X position of this plant. |
int |
getY()
Gets the Y position of this plant. |
boolean |
isSelected()
Checks if this plant is selected. |
void |
parseRule(javax.media.j3d.TransformGroup tgPrevious,
char cID,
float fStartAge,
int iDepth,
float fThickness)
Searches the rule for the specified id and adds the scenegraph subtree. |
javax.vecmath.Matrix3f |
rotationMatrix(javax.vecmath.Vector3f v3fAxe,
float fAngle)
Calculates the rotation matrix for a 3D rotation around the axe going through the point 0,0,0 with the direction described by the vector of the given angle. |
void |
setSelected()
Sets this plant instance as the selected one. |
void |
setX(int iX)
Sets the X position of this plant. |
void |
setY(int iY)
Sets the Y position of this plant. |
java.lang.String |
toString()
Returns a string representation of this plant. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public Plant(java.io.File fileLsy,
int iX,
int iY)
throws java.lang.Exception
fileLsy - A file descriptor to the .lsy file for this LSystem.iX - The X position in the scene.iY - The Y position in the scene.
java.lang.Exception - an exception if the file could not be opened.| Method Detail |
|---|
public javax.media.j3d.TransformGroup build()
public void parseRule(javax.media.j3d.TransformGroup tgPrevious,
char cID,
float fStartAge,
int iDepth,
float fThickness)
tgPrevious - The transformgroup where to add the subtree.cID - The char of the rule which has to be searched.fStartAge - The start age of the next elements.iDepth - The recursion depth at this time. Apply rules until iDepth
is equal to the depth of the LSystem.fThickness - The bottom thicknes of a branch. Top is fThickness
minus the decrement stored in the LSystem.
public javax.vecmath.Matrix3f rotationMatrix(javax.vecmath.Vector3f v3fAxe,
float fAngle)
v3fAxe - The vector describing the axis going through the origin
(0,0,0).fAngle - The angle describing the rotation value.
public javax.vecmath.Matrix3f buildMatrix(javax.vecmath.Vector3f v3fCol0,
javax.vecmath.Vector3f v3fCol1,
javax.vecmath.Vector3f v3fCol2)
v3fCol0 - The vector to be inserted in the first column.v3fCol1 - The vector to be inserted in the second column.v3fCol2 - The vector to be inserted in the third column.
public java.util.Vector getAnimationList()
public int getX()
public int getY()
public void setX(int iX)
iX - The X position.public void setY(int iY)
iY - The Y position.public java.lang.String toString()
toString in class java.lang.Objectpublic void setSelected()
public boolean isSelected()
public static Plant getSelected()
public java.lang.String getName()
public int compareTo(java.lang.Object obj)
compareTo in interface java.lang.Comparableobj - Object to compare with. Must be an instance of Plant.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||