vrecko
virtual reality framework
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
AP_LSystem::MovingTurtle Class Reference

#include <movingturtle.h>

Inheritance diagram for AP_LSystem::MovingTurtle:
AP_LSystem::AbstractTurtle AP_LSystem::LoftTurtle AP_LSystem::QueryTurtle AP_LSystem::Rectangle AP_LSystem::JointedPipe AP_LSystem::StraightPipe AP_LSystem::HermitPipe

Public Member Functions

virtual int turnLeft (std::vector< Parameter > &p)
 
virtual int turnRight (std::vector< Parameter > &p)
 
virtual int pitchDown (std::vector< Parameter > &p)
 
virtual int pitchUp (std::vector< Parameter > &p)
 
virtual int rollLeft (std::vector< Parameter > &p)
 
virtual int rollRight (std::vector< Parameter > &p)
 
virtual int turnArround ()
 
virtual int rollArround ()
 
virtual int rollUntilHorizontal ()
 
virtual int randomTurnPitchRoll (std::vector< Parameter > &p)
 
virtual int multiplyLength (std::vector< Parameter > &p)
 
virtual int multiplyRadius (std::vector< Parameter > &p)
 
virtual int multiplyAngle (std::vector< Parameter > &p)
 
virtual int multiplyTropismElasticity (std::vector< Parameter > &p)
 
virtual int multiplyGravitropismElasticity (std::vector< Parameter > &p)
 
virtual int drawForward (std::vector< Parameter > &p)
 
virtual int drawForwardHalf ()
 
virtual int moveForward (std::vector< Parameter > &p)
 
virtual int moveForwardHalf ()
 
- Public Member Functions inherited from AP_LSystem::AbstractTurtle
virtual int initialize ()
 
virtual int finalize ()
 
virtual int resetValues ()
 
TurtlePropertiesgetProperties ()
 
virtual void setProperties (TurtleProperties p)
 
virtual void inheritProperties (TurtleProperties p)
 
void bindGeode (LSGeode *geode)
 
LSGeodegetGeode ()
 
osg::Matrixd getMatrix ()
 
virtual void drawVector (const osg::Vec3d &vector, osg::Matrixd &matrix, osg::Vec4d &color)
 
double toRad (double angle)
 
double rand (double angle)
 

Protected Member Functions

virtual int makeRotate (osg::Quat &)
 
virtual int preRotate ()
 
virtual int postRotate ()
 
virtual int doStep (double dist)
 
virtual int drawStep (double)
 
virtual int preStep ()
 
virtual int postStep ()
 
virtual void drawFrame (osg::Matrixd &, osg::Vec4d *=NULL)
 
virtual void adjustMatrices ()
 

Additional Inherited Members

- Protected Attributes inherited from AP_LSystem::AbstractTurtle
TurtleProperties properties
 properties of turtle is used for getting parameters for generation of geometry More...
 
LSGeodegeode
 all geometry generated by turtle is stored to this output geode More...
 

Member Function Documentation

void MovingTurtle::adjustMatrices ( )
protectedvirtual

Adjust position matrix after each step. This method applies effects like tropism and minimizing twist. It makes some corrections of position matrix depending on L-system parameters.

int MovingTurtle::doStep ( double  dist)
protectedvirtual

Do a non-drawing forward move of predefined length.

Parameters
distlength of step
Returns
error code
int MovingTurtle::drawForward ( std::vector< Parameter > &  p)
virtual

Move forward and generate a geometry

Parameters
pvector with parameters
  • 0 parameters: use a default distance/length for a movement
  • 1 parameter: use this parameter as distance for a movement. Type is double.
Returns
error code

Implements AP_LSystem::AbstractTurtle.

int MovingTurtle::drawForwardHalf ( )
virtual

Move forward and generate a geometry. Use half of default length value for movement.

Returns
error code

Implements AP_LSystem::AbstractTurtle.

void MovingTurtle::drawFrame ( osg::Matrixd &  matrix,
osg::Vec4d *  color = NULL 
)
protectedvirtual

For debugging. Draw a turtle frame.

Parameters
matrixposition matrix of turtle
colorcolor of all vectors. Default is red for heading, green for up and blue for left vector.

Implements AP_LSystem::AbstractTurtle.

int MovingTurtle::drawStep ( double  dist)
protectedvirtual

Do a drawing forward move of predefined length.

Parameters
distlength of step
Returns
error code

Reimplemented in AP_LSystem::Rectangle, AP_LSystem::LoftTurtle, and AP_LSystem::HermitPipe.

int MovingTurtle::makeRotate ( osg::Quat &  q)
protectedvirtual
int MovingTurtle::moveForward ( std::vector< Parameter > &  p)
virtual

Move forward and without generating a geometry

Parameters
pvector with parameters
  • 0 parameters: use a default distance/length for a movement
  • 1 parameter: use this parameter as distance for a movement. Type is double.
Returns
error code

Implements AP_LSystem::AbstractTurtle.

int MovingTurtle::moveForwardHalf ( )
virtual

Move forward without generating a geometry. Use half of default length value for movement.

Returns
error code

Implements AP_LSystem::AbstractTurtle.

int MovingTurtle::multiplyAngle ( std::vector< Parameter > &  p)
virtual

Multiply a default angle.

Parameters
pvector with parameters
  • 0 parameters: multiply by default value
  • 1 parameter: use this parameter as multiplier. Type is double.
Returns
error code

Implements AP_LSystem::AbstractTurtle.

int MovingTurtle::multiplyGravitropismElasticity ( std::vector< Parameter > &  p)
virtual

Multiply a gravitropism/geotropism elasticity.

Parameters
pvector with parameters
  • 0 parameters: multiply by default value
  • 1 parameter: use this parameter as multiplier. Type is double.
Returns
error code

Implements AP_LSystem::AbstractTurtle.

int MovingTurtle::multiplyLength ( std::vector< Parameter > &  p)
virtual

Multiply a default lenght.

Parameters
pvector with parameters
  • 0 parameters: multiply by default value
  • 1 parameter: use this parameter as multiplier. Type is double.
Returns
error code

Implements AP_LSystem::AbstractTurtle.

int MovingTurtle::multiplyRadius ( std::vector< Parameter > &  p)
virtual

Multiply a default radius/thickness.

Parameters
pvector with parameters
  • 0 parameters: multiply by default value
  • 1 parameter: use this parameter as multiplier. Type is double.
Returns
error code

Implements AP_LSystem::AbstractTurtle.

int MovingTurtle::multiplyTropismElasticity ( std::vector< Parameter > &  p)
virtual

Multiply a diatropism elasticity.

Parameters
pvector with parameters
  • 0 parameters: multiply by default value
  • 1 parameter: use this parameter as multiplier. Type is double.
Returns
error code

Implements AP_LSystem::AbstractTurtle.

int MovingTurtle::pitchDown ( std::vector< Parameter > &  p)
virtual

Make a rotation around vector L down.

Parameters
pvector with parameters
  • 0 parameters: use default angle
  • 1 parameter: use this parameter as angle. Type is double.
Returns
error code

Implements AP_LSystem::AbstractTurtle.

int MovingTurtle::pitchUp ( std::vector< Parameter > &  p)
virtual

Make a rotation around vector L up.

Parameters
pvector with parameters
  • 0 parameters: use default angle
  • 1 parameter: use this parameter as angle. Type is double.
Returns
error code

Implements AP_LSystem::AbstractTurtle.

virtual int AP_LSystem::MovingTurtle::postRotate ( )
inlineprotectedvirtual
virtual int AP_LSystem::MovingTurtle::postStep ( )
inlineprotectedvirtual

This method is called after each step.

Returns
error code

Reimplemented in AP_LSystem::JointedPipe.

virtual int AP_LSystem::MovingTurtle::preRotate ( )
inlineprotectedvirtual
virtual int AP_LSystem::MovingTurtle::preStep ( )
inlineprotectedvirtual

This method is called before each step.

Returns
error code

Reimplemented in AP_LSystem::JointedPipe, and AP_LSystem::StraightPipe.

int MovingTurtle::randomTurnPitchRoll ( std::vector< Parameter > &  p)
virtual

Make a random rotation.

Todo:
Not implemented
Returns
error code

Implements AP_LSystem::AbstractTurtle.

int MovingTurtle::rollArround ( )
virtual

Make a 180° rotation around vector U.

Todo:
Not implemented
Returns
error code

Implements AP_LSystem::AbstractTurtle.

int MovingTurtle::rollLeft ( std::vector< Parameter > &  p)
virtual

Make a rotation around vector H to the left.

Parameters
pvector with parameters
  • 0 parameters: use default angle
  • 1 parameter: use this parameter as angle. Type is double.
Returns
error code

Implements AP_LSystem::AbstractTurtle.

int MovingTurtle::rollRight ( std::vector< Parameter > &  p)
virtual

Make a rotation around vector H to the right.

Parameters
pvector with parameters
  • 0 parameters: use default angle
  • 1 parameter: use this parameter as angle. Type is double.
Returns
error code

Implements AP_LSystem::AbstractTurtle.

int MovingTurtle::rollUntilHorizontal ( )
virtual

Make a rotation around vector H until left vector is in horizontal position.

Returns
error code

Implements AP_LSystem::AbstractTurtle.

int MovingTurtle::turnArround ( )
virtual

Make a 180° rotation around vector U.

Returns
error code

Implements AP_LSystem::AbstractTurtle.

int MovingTurtle::turnLeft ( std::vector< Parameter > &  p)
virtual

Make a rotation around vector U to the left.

Parameters
pvector with parameters
  • 0 parameters: use default angle
  • 1 parameter: use this parameter as angle. Type is double.
Returns
error code

Implements AP_LSystem::AbstractTurtle.

int MovingTurtle::turnRight ( std::vector< Parameter > &  p)
virtual

Make a rotation around vector U to the right.

Parameters
pvector with parameters
  • 0 parameters: use default angle
  • 1 parameter: use this parameter as angle. Type is double.
Returns
error code

Implements AP_LSystem::AbstractTurtle.


The documentation for this class was generated from the following files: