sofa::core::VisualModel Class Reference

An interface which all VisualModel inherit. More...

#include <VisualModel.h>

Inheritance diagram for sofa::core::VisualModel:

Inheritance graph
[legend]
Collaboration diagram for sofa::core::VisualModel:

Collaboration graph
[legend]

Public Types

enum  Pass { Std, Transparent, Shadow }
 The enumeration used to describe each step of the rendering. More...

Public Member Functions

virtual ~VisualModel ()
 Destructor.
virtual void initVisual ()
 Initialize the textures, or other graphical resources.
virtual void initTextures ()
 Initialize the textures, or other graphical resources.
virtual void fwdDraw (Pass=Std)
 Called before objects in the current branch are displayed.
virtual void bwdDraw (Pass=Std)
 Called after objects in the current branch are displayed.
virtual void drawVisual ()
 Display the VisualModel object.
virtual void drawTransparent ()
 Display transparent surfaces.
virtual void drawShadow ()
 Display shadow-casting surfaces.
virtual void updateVisual ()
 used to update the model if necessary.
virtual void update ()
 used to update the model if necessary.
virtual bool addBBox (double *, double *)
 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.
virtual void applyTranslation (const double, const double, const double)
 Translate the positions.
virtual void applyRotation (const double, const double, const double)
 Rotate the positions using Euler Angles in degree.
virtual void applyRotation (const defaulttype::Quat)
 Rotate the positions.
virtual void applyScale (const double)
 Scale the positions.
virtual void exportOBJ (std::string, std::ostream *, std::ostream *, int &, int &, int &)
 Append this mesh to an OBJ format stream.

Detailed Description

An interface which all VisualModel inherit.

This Interface is used for the VisualModel, which all visible objects must implement.

VisualModels are drawn by calling their draw method. The method update is used to recompute some internal data (such as normals) after the simulation has computed a new timestep.

Most VisualModel are bound by a Mapping to a BehaviorModel or MechanicalState.

Definition at line 53 of file VisualModel.h.


Member Enumeration Documentation

The enumeration used to describe each step of the rendering.

Enumerator:
Std  Standard pass.
Transparent  Transparent pass.
Shadow  Shadow pass.

Definition at line 75 of file VisualModel.h.


Constructor & Destructor Documentation

virtual sofa::core::VisualModel::~VisualModel (  )  [inline, virtual]

Destructor.

Definition at line 57 of file VisualModel.h.


Member Function Documentation

virtual bool sofa::core::VisualModel::addBBox ( double *  ,
double *   
) [inline, 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 in sofa::component::behaviormodel::eulerianfluid::Fluid2D, sofa::component::behaviormodel::eulerianfluid::Fluid3D, sofa::component::visualmodel::DrawV, sofa::component::visualmodel::OglTetrahedralModel< DataTypes >, sofa::component::visualmodel::VisualModelImpl, and sofa::component::visualmodel::OglTetrahedralModel< gpu::cuda::CudaVectorTypes< TCoord, TDeriv, TReal > >.

Definition at line 138 of file VisualModel.h.

Referenced by sofa::simulation::VisualComputeBBoxVisitor::processVisualModel().

virtual void sofa::core::VisualModel::applyRotation ( const defaulttype::Quat   )  [inline, virtual]

Rotate the positions.

This method is optional, it is used when the user want to interactively change the position of an object

Reimplemented in sofa::component::visualmodel::VisualModelImpl.

Definition at line 160 of file VisualModel.h.

virtual void sofa::core::VisualModel::applyRotation ( const   double,
const   double,
const   double 
) [inline, virtual]

Rotate the positions using Euler Angles in degree.

This method is optional, it is used when the user want to interactively change the position of an object

Reimplemented in sofa::component::visualmodel::VisualModelImpl.

Definition at line 153 of file VisualModel.h.

Referenced by sofa::simulation::TransformationVisitor::processVisualModel().

virtual void sofa::core::VisualModel::applyScale ( const   double  )  [inline, virtual]

Scale the positions.

This method is optional, it is used when the user want to interactively change the position of an object

Reimplemented in sofa::component::visualmodel::VisualModelImpl.

Definition at line 167 of file VisualModel.h.

Referenced by sofa::simulation::TransformationVisitor::processVisualModel().

virtual void sofa::core::VisualModel::applyTranslation ( const   double,
const   double,
const   double 
) [inline, virtual]

Translate the positions.

This method is optional, it is used when the user want to interactively change the position of an object

Reimplemented in sofa::component::visualmodel::VisualModelImpl.

Definition at line 146 of file VisualModel.h.

Referenced by sofa::simulation::TransformationVisitor::processVisualModel().

virtual void sofa::core::VisualModel::bwdDraw ( Pass  = Std  )  [inline, virtual]

Called after objects in the current branch are displayed.

Reimplemented in sofa::component::visualmodel::ClipPlane, and sofa::component::visualmodel::OglTexture.

Definition at line 88 of file VisualModel.h.

Referenced by sofa::simulation::VisualDrawVisitor::bwdVisualModel().

virtual void sofa::core::VisualModel::drawShadow (  )  [inline, 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 in sofa::component::visualmodel::DrawV, and sofa::component::visualmodel::VisualModelImpl.

Definition at line 111 of file VisualModel.h.

References drawVisual().

Referenced by sofa::simulation::VisualDrawVisitor::processVisualModel().

virtual void sofa::core::VisualModel::drawTransparent (  )  [inline, virtual]

virtual void sofa::core::VisualModel::drawVisual (  )  [inline, virtual]

virtual void sofa::core::VisualModel::exportOBJ ( std::string  ,
std::ostream *  ,
std::ostream *  ,
int &  ,
int &  ,
int &   
) [inline, virtual]

Append this mesh to an OBJ format stream.

The number of vertices position, normal, and texture coordinates already written is given as parameters. This method should update them.

Reimplemented in sofa::component::behaviormodel::eulerianfluid::Fluid3D, and sofa::component::visualmodel::VisualModelImpl.

Definition at line 177 of file VisualModel.h.

Referenced by sofa::simulation::ExportOBJVisitor::processVisualModel().

virtual void sofa::core::VisualModel::fwdDraw ( Pass  = Std  )  [inline, virtual]

Called before objects in the current branch are displayed.

Reimplemented in sofa::component::misc::Monitor< DataTypes >, sofa::component::visualmodel::ClipPlane, and sofa::component::visualmodel::OglTexture.

Definition at line 83 of file VisualModel.h.

Referenced by sofa::simulation::VisualDrawVisitor::fwdVisualModel().

virtual void sofa::core::VisualModel::initTextures (  )  [inline, virtual]

virtual void sofa::core::VisualModel::initVisual (  )  [inline, 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 in sofa::component::behaviormodel::eulerianfluid::Fluid2D, sofa::component::behaviormodel::eulerianfluid::Fluid3D, sofa::component::visualmodel::DrawV, sofa::component::visualmodel::Light, sofa::component::visualmodel::DirectionalLight, sofa::component::visualmodel::PositionalLight, sofa::component::visualmodel::SpotLight, sofa::component::visualmodel::LightManager, sofa::component::visualmodel::OglModel, sofa::component::visualmodel::OglShader, sofa::component::visualmodel::OglTexture, sofa::component::visualmodel::OglTexture2D, sofa::component::visualmodel::OglVariable, sofa::component::visualmodel::OglIntVariable, sofa::component::visualmodel::OglInt2Variable, sofa::component::visualmodel::OglInt3Variable, sofa::component::visualmodel::OglInt4Variable, sofa::component::visualmodel::OglFloatVariable, sofa::component::visualmodel::OglFloat2Variable, sofa::component::visualmodel::OglFloat3Variable, sofa::component::visualmodel::OglFloat4Variable, sofa::component::visualmodel::OglIntVectorVariable, sofa::component::visualmodel::OglIntVector2Variable, sofa::component::visualmodel::OglIntVector3Variable, sofa::component::visualmodel::OglIntVector4Variable, sofa::component::visualmodel::OglFloatVectorVariable, sofa::component::visualmodel::OglFloatVector2Variable, sofa::component::visualmodel::OglFloatVector3Variable, sofa::component::visualmodel::OglFloatVector4Variable, and sofa::component::visualmodel::VisualModelImpl.

Definition at line 65 of file VisualModel.h.

References initTextures().

Referenced by sofa::simulation::VisualInitVisitor::processVisualModel().

virtual void sofa::core::VisualModel::update (  )  [inline, virtual]

virtual void sofa::core::VisualModel::updateVisual (  )  [inline, virtual]


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

Generated on Sun Nov 23 04:22:09 2008 for Sofa by  doxygen 1.5.7.1