SoBotanicalBranch Class Reference
[BotanicVis]
implements a branch of a botanic tree.
More...
#include <SoBotanicalBranch.h>
Inheritance diagram for SoBotanicalBranch:
Public Methods | |
SoBotanicalBranch () | |
virtual SbBool | setUpConnections (SbBool onOff, SbBool doItAlways=FALSE) |
void | setThickness (float size) |
void | setAlpha (float angle) |
int | adjustSubbranches () |
Static Public Methods | |
void | initClass () |
Public Attributes | |
SoSFFloat | direction |
SoSFFloat | alpha |
SoSFFloat | beta |
SoSFInt32 | previousStrand |
bool | isFruit |
Protected Methods | |
virtual | ~SoBotanicalBranch () |
virtual void | resizeHeightCB () |
virtual void | resizeThicknessCB () |
Static Protected Methods | |
void | angleSensorCB (void *, SoSensor *) |
void | previousStrandSensorCB (void *, SoSensor *) |
Protected Attributes | |
SoSFNode | subbranches |
SoSFNode | hiddenGeometry |
SoSFNode | rotBranch |
SoSFNode | transBefore |
SoSFNode | rotAlpha |
SoSFNode | rotBeta |
SoSFNode | transAfter |
SoSFNode | branch |
SoSFNode | ext |
SoSFNode | rotExtBranch |
SoSFNode | extBranch |
SoSFNode | transCone |
SoSFNode | shear |
SoSFNode | subgeometry |
SoFieldSensor | alphaSensor |
SoFieldSensor | directionSensor |
SoFieldSensor | previousStrandSensor |
float | thickness |
float | alphaStart |
Detailed Description
implements a branch of a botanic tree.Each branch is defined with means of a SoCylinder and a SoCone making the connection between this and the previous branch. The bottom radius of the SoCone corresponds to the radius of the SoCylinder and its peak is sheared in the direction of the branch.
The direction of the branch is definded with 3 rotations. rotBranch defines the rotation of THIS branch around the Y-axis, rotBeta defines the rotation of ALL the branches of this hierarchy around the Y-axis. rotAlpha defines the rotation or this branch around the Z-axis.
CATALOG PARTS
All Parts
Part Name | Part Type | Default Type | NULL Default |
geometry | SoSeparator | SoSeparator | YES |
hiddenGeometry | SoAbortGroup | SoAbortGroup | YES |
subbranches | SoNodeKitListPart | --- | NO |
rotBranch | SoRotationXYZ | SoRotationXYZ | NO |
ext | SoSeparator | SoSeparator | NO |
shear | SoMatrixTransform | SoMatrixTransform | NO |
transCone | SoTranslation | SoTranslation | NO |
extBranch | SoCone | SoCone | NO |
rotAlpha | SoRotationXYZ | SoRotationXYZ | NO |
transAfter | SoTranslation | SoTranslation | NO |
branch | SoCylinder | SoCylinder | NO |
rotBeta | SoRotationXYZ | SoRotationXYZ | NO |
transBefore | SoTranslation | SoTranslation | NO |
subgeometry | SoCylinder | SoCylinder | NO |
Extra Information for List Parts from Above Table
Part Name | Container Type | Possible Types |
subbranches | SoGroup | SoBotanicalBase |
File Format / defaults:
SoBotanicalBranch { SoSFFloat direction 0 SoSFFloat alpha 0 SoSFFloat beta 1.62 #golden section SoSFInt32 strands 0 # from SoBotanicalBase SoSFInt32 strands 0 SoSFFloat lengthOfBranch 10.0 }
Constructor & Destructor Documentation
|
constructor
|
|
destructor
|
Member Function Documentation
|
calculates the correct parameters for its subbranches and sets their fields.
|
|
adapts rotAlpha, rotBranch and the shearing transformation of the cone
|
|
inventor class initialization
Reimplemented from SoBotanicalBase. |
|
adapts the bottom radius, the height and the translation of the cone
|
|
adapts all parts depending on the length of the branch
Reimplemented from SoBotanicalBase. |
|
adapts all parts depending on the thickness of the branch
Reimplemented from SoBotanicalBase. |
|
sets the alpha of this branch
|
|
sets the scaling value for the radius of this branch
|
|
sets the connections of the sensors
Reimplemented from SoBotanicalBase. |
Member Data Documentation
|
this angle constitutes a reference for the rotation of each branch around the Z-axis. The angles of rotAlpha are chosen such that their sum equals the angle alpha. |
|
field sensor attached to alpha; calls angleSensorCB
|
|
rotation angle of rotAlpha
|
|
rotation angle of ALL the branches of this level around the Y-axis. Often the angle 360/phi is chosen where phi = (1 + sqrt(5)/2) is the golden section. |
|
SoCylinder representing the branch.
|
|
rotation angle of THIS branch around the Y-axis. Is chosen such that the branches are distributed equally around the previous branch. |
|
field sensor attached to direction; calls angleSensorCB
|
|
geometry of the cone making the connection between this and the previous branch
|
|
the cone itself
|
|
in this part the information is stored that shouldn't be rendered
|
|
if TRUE this branch has as only child a SoBotanicalFruit
|
|
this field stores the number of strands of the father branch. Is used to calculate rotAlpha and the bottom radius of the cone. |
|
field sensor attached to previousStrand; calls previousStrandSensorCB
|
|
rotation of this branch around the Z-axis. The angle of rotation depends on the number of strands and on the field alpha |
|
rotation of all the branches of this hierarchical level around the Y-axis, relative to the branches of the previous hierarchical level
|
|
rotation of this branch around the Y-axis, relative to the first branch of this hierarchical level
|
|
rotation of the cone around the Y-axis
|
|
the shearing of the cone: the peak of the cone is sheared in direction of the rotation of the branch
|
|
children of this branch
|
|
pointers of the elements of "subbranches" are stored here to ensure that the above transformations will be performed on these children too.
|
|
thickness of this branch
|
|
translation of the cylinder AFTER all rotations have been performed. This translation goes in Y-direction with a value of half of the height of the cylinder. |
|
translation of the cylinder BEFORE any rotations are performed. This translation goes in Y-direction with a value of half of the height of the cylinder. |
|
the translation of the cone in Y-direction, to put it at the bottom of the cylinder. This translation corresponds to half the height of the cylinder |
The documentation for this class was generated from the following files: