sofa::component::visualmodel::DrawV Class Reference

#include <DrawV.h>

Inheritance diagram for sofa::component::visualmodel::DrawV:

Inheritance graph
[legend]
Collaboration diagram for sofa::component::visualmodel::DrawV:

Collaboration graph
[legend]

Public Member Functions

 DrawV ()
void initVisual ()
 Initialize the textures, or other graphical resources.
void updateVisual ()
 used to update the model if necessary.
bool isTransparent ()
float getVScale ()
void drawVisual ()
 Display the VisualModel object.
void drawTransparent ()
 Display transparent surfaces.
void drawShadow ()
 Display shadow-casting surfaces.
bool addBBox (double *minBBox, double *maxBBox)
 used to add the bounding-box of this visual model to the given bounding box in order to compute the scene bounding box or cull hidden objects.
const VecCoord * getX () const
 Return the current position vector (read-only access).
const VecDeriv * getV () const
 Return the current velocity vector (read-only access).
VecCoord * getX ()
 Return the current position vector (read-write access).
VecDeriv * getV ()
 Return the current velocity vector (read-write access).

Data Fields

Data< bool > castShadow
 True if object cast shadows.
Data< bool > useAlpha
 True if velocity displayed using alpha blending.
Data< double > vscale
 Scaling of veloity vectors.

Protected Member Functions

void internalDraw ()

Protected Attributes

ResizableExtVector< Coord > inputX
ResizableExtVector< Deriv > inputV

Detailed Description

Definition at line 47 of file DrawV.h.


Constructor & Destructor Documentation

sofa::component::visualmodel::DrawV::DrawV (  ) 

Definition at line 48 of file DrawV.cpp.


Member Function Documentation

bool sofa::component::visualmodel::DrawV::addBBox ( double *  ,
double *   
) [virtual]

used to add the bounding-box of this visual model to the given bounding box in order to compute the scene bounding box or cull hidden objects.

Returns:
false if the visual model does not define any bounding box, which should only be the case for "debug" objects, as this lack of information might affect performances and leads to incorrect scene bounding box.

Reimplemented from sofa::core::VisualModel.

Definition at line 137 of file DrawV.cpp.

References getVScale(), inputV, inputX, sofa::defaulttype::ExtVector< T >::size(), and vscale.

void sofa::component::visualmodel::DrawV::drawShadow (  )  [virtual]

Display shadow-casting surfaces.

This method default to calling draw(). Object that do not cast any shadows, or that use a different LOD for them should reimplement it.

Reimplemented from sofa::core::VisualModel.

Definition at line 80 of file DrawV.cpp.

References castShadow, sofa::core::objectmodel::Data< T >::getValue(), internalDraw(), and isTransparent().

void sofa::component::visualmodel::DrawV::drawTransparent (  )  [virtual]

Display transparent surfaces.

Transparent objects should use this method to get a correct display order.

Reimplemented from sofa::core::VisualModel.

Definition at line 74 of file DrawV.cpp.

References internalDraw(), and isTransparent().

void sofa::component::visualmodel::DrawV::drawVisual (  )  [virtual]

Display the VisualModel object.

Reimplemented from sofa::core::VisualModel.

Definition at line 68 of file DrawV.cpp.

References internalDraw(), and isTransparent().

VecDeriv* sofa::component::visualmodel::DrawV::getV (  )  [inline, virtual]

Return the current velocity vector (read-write access).

Implements sofa::core::componentmodel::behavior::State< TDataTypes >.

Definition at line 71 of file DrawV.h.

References inputV.

const VecDeriv* sofa::component::visualmodel::DrawV::getV (  )  const [inline, virtual]

Return the current velocity vector (read-only access).

Implements sofa::core::componentmodel::behavior::State< TDataTypes >.

Definition at line 69 of file DrawV.h.

References inputV.

float sofa::component::visualmodel::DrawV::getVScale (  ) 

Definition at line 89 of file DrawV.cpp.

References sofa::core::objectmodel::Data< T >::getValue(), and vscale.

Referenced by addBBox(), and internalDraw().

VecCoord* sofa::component::visualmodel::DrawV::getX (  )  [inline, virtual]

Return the current position vector (read-write access).

Implements sofa::core::componentmodel::behavior::State< TDataTypes >.

Definition at line 70 of file DrawV.h.

References inputX.

const VecCoord* sofa::component::visualmodel::DrawV::getX (  )  const [inline, virtual]

Return the current position vector (read-only access).

Implements sofa::core::componentmodel::behavior::State< TDataTypes >.

Definition at line 68 of file DrawV.h.

References inputX.

void sofa::component::visualmodel::DrawV::initVisual (  )  [virtual]

Initialize the textures, or other graphical resources.

Called once before the first frame is drawn, and if the graphical context has been recreated.

Reimplemented from sofa::core::VisualModel.

Definition at line 55 of file DrawV.cpp.

void sofa::component::visualmodel::DrawV::internalDraw (  )  [protected]

bool sofa::component::visualmodel::DrawV::isTransparent (  ) 

void sofa::component::visualmodel::DrawV::updateVisual (  )  [virtual]

used to update the model if necessary.

Reimplemented from sofa::core::VisualModel.

Definition at line 59 of file DrawV.cpp.


Field Documentation

True if object cast shadows.

Definition at line 50 of file DrawV.h.

Referenced by drawShadow().

Definition at line 75 of file DrawV.h.

Referenced by addBBox(), getV(), and internalDraw().

Definition at line 74 of file DrawV.h.

Referenced by addBBox(), getX(), and internalDraw().

True if velocity displayed using alpha blending.

Definition at line 51 of file DrawV.h.

Referenced by sofa::component::collision::ContactMapper< RigidDistanceGridCollisionModel, DataTypes >::createMapping(), and isTransparent().


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

Generated on Sun Nov 23 04:21:42 2008 for Sofa by  doxygen 1.5.7.1