|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.jscience.biology.lsystems.growing.LSystem
public class LSystem
This class represents an LSystem as we know it in text form. It can read values from a file and store them in this class. The file must respect some definitions: All codewords listed in the Def class must stand at the beginning of the line and be written in the right case. As separator to the value only the specified symbol may be used. The order of the lines does not matter. Lines which do not begin with a codeword are ignored. White spaces may be used or not. See the design for an exact description on the keywords.
Example:name = Red depth = 12 angle = 22.5 thickness = 0.3 decrement = 0.025 length = 0.8 branch = brown leaf = green flower = red scale = 0.3 axiom = (a,0) rule = (a,0) -> (b,5) rule = (b,1) -> [////(b,4)][&////(c,4)]^////(c,4) rule = (b,0) -> [&&&{-^ff&+ff+&ff^-|-ff+ff+ff}]//////[&&&{-^ff&+ff+&ff^-|-ff+ff+ff}]//////[&&&{-^ff&+ff+&ff^-|-ff+ff+ff}] rule = (c,1) -> (z,2)[&////(d,3)]^////(d,3) rule = (c,2) -> [&&&{-^ff&+ff+&ff^-|-ff+ff+ff}]///////&&&{-^ff&+ff+&ff^-|-ff+ff+ff} rule = (d,2) -> (z,1)[&////(e,2)]^////(e,2) rule = (d,2) -> [&&&{-^f&+f+&f^-|-f+f+f}]/////[&&&{-^f&+f+&f^-|-f+f+f}]/////[&&&{-^f&+f+&f^-|-f+f+f}] rule = (e,3) -> [&&&{!-f++f-|-f++f}]//[&&{!-f++f-|-f++f}]//[&&&{!-f++f-|-f++f}]//[&&{!-f++f-|-f++f}]//[&&&{!-f++f-|-f++f}]//[&&{!-f++f-|-f++f}]//[&&&{!-f++f-|-f++f}]//[&&{!-f++f-|-f++f}] rule = (z,2) -> //[&&{!-f++f-|-f++f}]//[&&&{!-f++f-|-f++f}]//[&&{!-f++f-|-f++f}]////[&&{!-f++f-|-f++f}]//[&&&{!-f++f-|-f++f}]//[&&{!-f++f-|-f++f}]
Constructor Summary | |
---|---|
LSystem(java.io.File fileLsy)
Constructor. |
Method Summary | |
---|---|
float |
getAngle()
Gets the angle of the LSystem |
java.lang.String |
getAxiom()
Returns the axiom of this class. |
javax.media.j3d.Appearance |
getBranchAppearance()
DOCUMENT ME! |
float |
getDecrement()
Gets the value of decrenentation of the thickness of a branch. |
int |
getDepth()
Gets the derivation depth for the LSystem. |
javax.media.j3d.Appearance |
getFlowerAppearance()
DOCUMENT ME! |
javax.media.j3d.Appearance |
getLeafAppearance()
DOCUMENT ME! |
float |
getLength()
Gets the length of the branch at beginning. |
java.lang.String |
getName()
Gets the name of the plant. |
java.util.Vector |
getRules()
Gets the rules of the plant. |
float |
getScale()
Gets the value of decrenentation of the thickness of a branch. |
float |
getThickness()
Get the thickness of the branch at beginning. |
javax.media.j3d.Appearance |
makeAppearance(java.lang.String strColor)
Makes a new appearance object with the string name of a color. |
void |
setAngle(float fAngle)
Sets the angle for the LSystem to the member field. |
void |
setAxiom(java.lang.String strAxiom)
Stores the new axiom for this class. |
void |
setDepth(int iDepth)
Sets the derivation depth for the LSystem. |
void |
setName(java.lang.String strName)
Gets the name of the plant. |
void |
setRules(java.util.Vector vRules)
Gets the name of the plant. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public LSystem(java.io.File fileLsy) throws java.lang.Exception
fileLsy
- The file to extract and store.
java.lang.Exception
Method Detail |
---|
public javax.media.j3d.Appearance makeAppearance(java.lang.String strColor)
strColor
- The color name as string.
public void setDepth(int iDepth)
iDepth
- The depth to set.public int getDepth()
public void setAngle(float fAngle)
fAngle
- The new value for the angle.public float getAngle()
public void setAxiom(java.lang.String strAxiom)
strAxiom
- The new axiom to set.public java.lang.String getAxiom()
public float getThickness()
public float getLength()
public float getDecrement()
public float getScale()
public java.lang.String getName()
public void setName(java.lang.String strName)
public java.util.Vector getRules()
public void setRules(java.util.Vector vRules)
public javax.media.j3d.Appearance getBranchAppearance()
public javax.media.j3d.Appearance getLeafAppearance()
public javax.media.j3d.Appearance getFlowerAppearance()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |