Studierstube Documentation Project

   Main Page       Modules       Class Hierarchy       Alphabetical List       Compound List       File List       Compound Members       Related Pages   

SoBotanicalBranch Class Reference
[BotanicVis]

implements a branch of a botanic tree. More...

#include <SoBotanicalBranch.h>

Inheritance diagram for SoBotanicalBranch:

SoBotanicalBase List of all members.

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 NamePart TypeDefault TypeNULL Default
geometry SoSeparatorSoSeparatorYES
hiddenGeometry SoAbortGroupSoAbortGroupYES
subbranches SoNodeKitListPart---NO
rotBranch SoRotationXYZSoRotationXYZNO
extSoSeparatorSoSeparatorNO
shear SoMatrixTransformSoMatrixTransformNO
transCone SoTranslationSoTranslationNO
extBranch SoConeSoConeNO
rotAlpha SoRotationXYZSoRotationXYZNO
transAfter SoTranslationSoTranslationNO
branch SoCylinderSoCylinderNO
rotBeta SoRotationXYZSoRotationXYZNO
transBefore SoTranslationSoTranslationNO
subgeometry SoCylinderSoCylinderNO

Extra Information for List Parts from Above Table

Part NameContainer TypePossible Types
subbranchesSoGroupSoBotanicalBase

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

SoBotanicalBranch::SoBotanicalBranch  
 

constructor

virtual SoBotanicalBranch::~SoBotanicalBranch   [protected, virtual]
 

destructor


Member Function Documentation

int SoBotanicalBranch::adjustSubbranches  
 

calculates the correct parameters for its subbranches and sets their fields.

void SoBotanicalBranch::angleSensorCB void *   ,
SoSensor *   
[static, protected]
 

adapts rotAlpha, rotBranch and the shearing transformation of the cone

void SoBotanicalBranch::initClass   [static]
 

inventor class initialization

Reimplemented from SoBotanicalBase.

void SoBotanicalBranch::previousStrandSensorCB void *   ,
SoSensor *   
[static, protected]
 

adapts the bottom radius, the height and the translation of the cone

virtual void SoBotanicalBranch::resizeHeightCB   [protected, virtual]
 

adapts all parts depending on the length of the branch

Reimplemented from SoBotanicalBase.

virtual void SoBotanicalBranch::resizeThicknessCB   [protected, virtual]
 

adapts all parts depending on the thickness of the branch

Reimplemented from SoBotanicalBase.

void SoBotanicalBranch::setAlpha float    angle [inline]
 

sets the alpha of this branch

void SoBotanicalBranch::setThickness float    size [inline]
 

sets the scaling value for the radius of this branch

virtual SbBool SoBotanicalBranch::setUpConnections SbBool    onOff,
SbBool    doItAlways = FALSE
[virtual]
 

sets the connections of the sensors

Reimplemented from SoBotanicalBase.


Member Data Documentation

SoSFFloat SoBotanicalBranch::alpha
 

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.

SoFieldSensor SoBotanicalBranch::alphaSensor [protected]
 

field sensor attached to alpha; calls angleSensorCB

float SoBotanicalBranch::alphaStart [protected]
 

rotation angle of rotAlpha

SoSFFloat SoBotanicalBranch::beta
 

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.

SoSFNode SoBotanicalBranch::branch [protected]
 

SoCylinder representing the branch.

SoSFFloat SoBotanicalBranch::direction
 

rotation angle of THIS branch around the Y-axis.

Is chosen such that the branches are distributed equally around the previous branch.

SoFieldSensor SoBotanicalBranch::directionSensor [protected]
 

field sensor attached to direction; calls angleSensorCB

SoSFNode SoBotanicalBranch::ext [protected]
 

geometry of the cone making the connection between this and the previous branch

SoSFNode SoBotanicalBranch::extBranch [protected]
 

the cone itself

SoSFNode SoBotanicalBranch::hiddenGeometry [protected]
 

in this part the information is stored that shouldn't be rendered

bool SoBotanicalBranch::isFruit
 

if TRUE this branch has as only child a SoBotanicalFruit

SoSFInt32 SoBotanicalBranch::previousStrand
 

this field stores the number of strands of the father branch.

Is used to calculate rotAlpha and the bottom radius of the cone.

SoFieldSensor SoBotanicalBranch::previousStrandSensor [protected]
 

field sensor attached to previousStrand; calls previousStrandSensorCB

SoSFNode SoBotanicalBranch::rotAlpha [protected]
 

rotation of this branch around the Z-axis.

The angle of rotation depends on the number of strands and on the field alpha

SoSFNode SoBotanicalBranch::rotBeta [protected]
 

rotation of all the branches of this hierarchical level around the Y-axis, relative to the branches of the previous hierarchical level

SoSFNode SoBotanicalBranch::rotBranch [protected]
 

rotation of this branch around the Y-axis, relative to the first branch of this hierarchical level

SoSFNode SoBotanicalBranch::rotExtBranch [protected]
 

rotation of the cone around the Y-axis

SoSFNode SoBotanicalBranch::shear [protected]
 

the shearing of the cone: the peak of the cone is sheared in direction of the rotation of the branch

SoSFNode SoBotanicalBranch::subbranches [protected]
 

children of this branch

SoSFNode SoBotanicalBranch::subgeometry [protected]
 

pointers of the elements of "subbranches" are stored here to ensure that the above transformations will be performed on these children too.

float SoBotanicalBranch::thickness [protected]
 

thickness of this branch

SoSFNode SoBotanicalBranch::transAfter [protected]
 

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.

SoSFNode SoBotanicalBranch::transBefore [protected]
 

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.

SoSFNode SoBotanicalBranch::transCone [protected]
 

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:
 This page was generated at Sat Jun 26 21:29:48 2004 for BotanicVis by Doxygen.
 If you have any comments, please send a message to schmalstieg@ims.tuwien.ac.at.
www.studierstube.org