vgp.iterate.pythagoreanTree
Class PjPythagoreanTree
- java.lang.Object
-
- jv.object.PsObject
-
- jv.project.PjProject
-
- vgp.iterate.pythagoreanTree.PjPythagoreanTree
-
- All Implemented Interfaces:
- java.io.Serializable, java.lang.Cloneable, PsTimeListenerIf, PsUpdateIf, PvPickListenerIf
public class PjPythagoreanTree extends PjProject
Computes a Pythagorean tree which is recursively generated from a simple trunk.- Since:
- JavaView 3.95
- See Also:
- Serialized Form
- Author:
- Andreas Haferburg, Konrad Polthier
- Version:
- 04.11.06, 2.00 revised (kp) Full revision (new functionality and sync with JavaView).
29.03.06, 1.00 created (ah)
-
-
Field Summary
-
Fields inherited from class jv.object.PsObject
HAS_BOUNDARY_PANEL, HAS_CONFIG_PANEL, HAS_INFO_PANEL, HAS_LABEL_PANEL, HAS_MATERIAL_PANEL, HAS_TEXTURE_PANEL, HAS_VECTOR_PANEL, INSPECTOR_INFO, INSPECTOR_INFO_EXT, IS_DELETED, IS_FIXED, IS_FOCUSSED, IS_PICKED, IS_SELECTED, IS_USED, NUM_TAGS
-
-
Constructor Summary
Constructors Constructor and Description PjPythagoreanTree()Creates a new instance of PjPythagoreanTree
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description intgetAge()Returns the age of the tree which is the number of consecutive branches.voidinit()Initialization.booleanisEnabledRightTriangle()Returns true if the triangle above trunk is kept right.booleanisEnabledSquareTrunk()Returns true if the trunk is kept square.voidpickVertex(PgGeometryIf geom, int picked, PdVector pickedVertex)Drags a picked vertex of m_trunk.voidreset()Reset project to initial state by calling project.init().voidsetAge(int age)Sets the age of the tree which is the number of consecutive branches.voidsetEnabledRightTriangle(boolean bRightTriangle)Determines if the triangle above trunk is a right triangle.voidsetEnabledSquareTrunk(boolean bSquareTrunk)Determines if the trunk should be a square.voidstart()Initializes display, geometries.booleanupdate(java.lang.Object event)Update the class whenever a child has changed.-
Methods inherited from class jv.project.PjProject
addDisplay, addGeometry, addGeometry, dispose, dragDisplay, dragInitial, dragVertex, fitDisplays, getAnimation, getDisplay, getDisplays, getGeometry, getGeometry, getNumGeometries, getParameter, getParameterInfo, getViewer, hasAnimation, hasDisplay, isEnabledAutoFit, markVertices, pickDisplay, pickInitial, removeDisplay, removeGeometries, removeGeometry, selectDisplay, selectGeometry, setAnimation, setBackColor, setBorderType, setDisplay, setEnabledAutoFit, setGeometry, setParameterInfo, setTime, setViewer, stop, unmarkVertices
-
Methods inherited from class jv.object.PsObject
addInspector, addUpdateListener, assureInspector, clearTag, clone, clone, clone, copy, getFather, getInfoPanel, getInspector, getName, getNumObjects, getSymbol, hasInspector, hasTag, hasUpdateListener, instanceOf, instanceOf, newInspector, newInspector, removeInspector, removeInspector, removeUpdateListener, setName, setParent, setSymbol, setTag, toString, updatePanels
-
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface jv.anim.PsTimeListenerIf
getName
-
Methods inherited from interface jv.project.PvPickListenerIf
getName
-
-
-
-
Constructor Detail
-
PjPythagoreanTree
public PjPythagoreanTree()
Creates a new instance of PjPythagoreanTree
-
-
Method Detail
-
start
public void start()
Initializes display, geometries.- Overrides:
startin classPjProject- See Also:
PvViewerIf.start(),PjProject.isEnabledAutoFit()
-
reset
public void reset()
Reset project to initial state by calling project.init(). Must call project.update(project) after calling reset().
-
update
public boolean update(java.lang.Object event)
Update the class whenever a child has changed. Method is usually invoked from the children.- Specified by:
updatein interfacePsUpdateIf- Overrides:
updatein classPsObject- Parameters:
event- carries a lot of information- Returns:
- true if event has been handled, otherwise false
- See Also:
PsObject.setParent(PsUpdateIf),PsObject.getFather(),PsObject.addUpdateListener(PsUpdateIf)
-
pickVertex
public void pickVertex(PgGeometryIf geom, int picked, PdVector pickedVertex)
Drags a picked vertex of m_trunk.- Specified by:
pickVertexin interfacePvPickListenerIf- Overrides:
pickVertexin classPjProject- Parameters:
geom- Picked geometry on which vertex liespicked- Index of picked vertex in vertex array of geometrypickedVertex- 3d coordinates of vertex position- See Also:
PvPickListenerIf
-
getAge
public int getAge()
Returns the age of the tree which is the number of consecutive branches.- Returns:
- the age of the tree.
-
setAge
public void setAge(int age)
Sets the age of the tree which is the number of consecutive branches. Main allocation method, allocates tree element set.- Parameters:
age- New age of the tree.
-
isEnabledRightTriangle
public boolean isEnabledRightTriangle()
Returns true if the triangle above trunk is kept right.- Returns:
trueif the triangle is kept right.
-
setEnabledRightTriangle
public void setEnabledRightTriangle(boolean bRightTriangle)
Determines if the triangle above trunk is a right triangle.- Parameters:
bRightTriangle- use right triangle above trunk
-
isEnabledSquareTrunk
public boolean isEnabledSquareTrunk()
Returns true if the trunk is kept square.- Returns:
trueif the rectangle is kept square.
-
setEnabledSquareTrunk
public void setEnabledSquareTrunk(boolean bSquareTrunk)
Determines if the trunk should be a square.- Parameters:
bSquareTrunk- use square trunk
-
-
"