SOFA API  cba138a4
Open source framework for multi-physics simuation
sofa::core::visual::VisualParams Class Reference

#include <VisualParams.h>

Class gathering parameters used by visual components and by the draw method of each component. Transmitted by visitors. More...

Inheritance diagram for sofa::core::visual::VisualParams:

Detailed Description

Class gathering parameters used by visual components and by the draw method of each component. Transmitted by visitors.

Protected Attributes

sofa::defaulttype::BoundingBox m_sceneBoundingBox
 
helper::gl::Transformation m_sceneTransform
 
Viewport m_viewport
 
SReal m_zNear
 
SReal m_zFar
 
CameraType m_cameraType
 
Pass m_pass
 
DisplayFlags m_displayFlags
 
DrawToolm_drawTool
 
helper::gl::FrameBufferObjectm_boundFrameBuffer
 
ConstMultiVecCoordId m_x
 Ids of position vector. More...
 
ConstMultiVecDerivId m_v
 Ids of velocity vector. More...
 
unsigned int m_supportedAPIs
 Mask of supported graphics API. More...
 
SReal m_modelViewMatrix [16]
 model view matrix. More...
 
SReal m_projectionMatrix [16]
 projection matrix. More...
 

Public Member Functions

 VisualParams ()
 
const Viewportviewport () const
 
Viewportviewport ()
 
const SRealzNear () const
 
const SRealzFar () const
 
SRealzNear ()
 
SRealzFar ()
 
const CameraTypecameraType () const
 
CameraTypecameraType ()
 
const Passpass () const
 
Passpass ()
 
DrawTool *& drawTool ()
 
DrawTool *& drawTool () const
 
helper::gl::FrameBufferObject *& frameBufferObject ()
 
helper::gl::FrameBufferObject *& frameBufferObject () const
 
DisplayFlagsdisplayFlags ()
 
const DisplayFlagsdisplayFlags () const
 
sofa::defaulttype::BoundingBoxsceneBBox ()
 
const sofa::defaulttype::BoundingBoxsceneBBox () const
 
void setModelViewMatrix (const double m[16])
 Store the ModelView matrix used to draw the scene. This OpenGL matrix defines the world coordinate system with respect to the camera. More...
 
void getModelViewMatrix (double m[16]) const
 Get the ModelView matrix used to draw the scene. This OpenGL matrix defines the world coordinate system with respect to the camera. More...
 
void setProjectionMatrix (const double m[16])
 Store the projection matrix used to draw the scene. This OpenGL matrix defines the camera coordinate system with respect to the viewport, including perspective if any. More...
 
void getProjectionMatrix (double m[16]) const
 Get the projection matrix used to draw the scene. This OpenGL matrix defines the camera coordinate system with respect to the viewport, including perspective if any. More...
 
sofa::helper::gl::TransformationsceneTransform ()
 
const sofa::helper::gl::TransformationsceneTransform () const
 
bool isSupported (unsigned int api) const
 
void setSupported (unsigned int api, bool val=true)
 
Access to vectors from a given state container (i.e. State or MechanicalState)
template<class S >
const Data< typename S::VecCoord > * readX (const S *state) const
 Read access to current position vector. More...
 
template<class S >
const Data< typename S::VecDeriv > * readV (const S *state) const
 Read access to current velocity vector. More...
 
Setup methods

Called by the OdeSolver from which the mechanical computations originate. They all return a reference to this MechanicalParam instance, to ease chaining multiple setup calls.

const ConstMultiVecCoordIdx () const
 
ConstMultiVecCoordIdx ()
 
const ConstMultiVecDerivIdv () const
 
ConstMultiVecDerivIdv ()
 
VisualParamssetX (ConstVecCoordId v)
 Set the IDs of position vector. More...
 
VisualParamssetX (ConstMultiVecCoordId v)
 
template<class StateSet >
VisualParamssetX (const StateSet &g, ConstVecCoordId v)
 
VisualParamssetV (ConstVecDerivId v)
 Set the IDs of velocity vector. More...
 
VisualParamssetV (ConstMultiVecDerivId v)
 
template<class StateSet >
VisualParamssetV (const StateSet &g, ConstVecDerivId v)
 
- Public Member Functions inherited from sofa::core::ExecParams
bool checkValidStorage () const
 
ExecMode execMode () const
 Mode of execution requested. More...
 
int threadID () const
 Index of current thread (0 corresponding to the only thread in sequential mode, or first thread in parallel mode) More...
 
int nbThreads () const
 Number of threads currently known to Sofa. More...
 
 ExecParams ()
 
void update ()
 Make sure this instance is up-to-date relative to the current thread. More...
 
ExecParamssetExecMode (ExecMode v)
 Request a specific mode of execution. More...
 
ExecParamssetThreadID (int v)
 Specify the index of the current thread. More...
 
int aspectID () const
 
ExecParamssetAspectID (int)
 Specify the aspect index of the current thread. More...
 

Static Public Member Functions

static VisualParamsdefaultInstance ()
 Get the default VisualParams, to be used to provide a default values for method parameters. More...
 
- Static Public Member Functions inherited from sofa::core::ExecParams
static ExecParamsdefaultInstance ()
 Get the default ExecParams, to be used to provide a default values for method parameters. More...
 
static int currentAspect ()
 
static int currentAspect (const core::ExecParams *)
 

Attribute details

helper::gl::FrameBufferObject* sofa::core::visual::VisualParams::m_boundFrameBuffer
mutableprotected
CameraType sofa::core::visual::VisualParams::m_cameraType
protected
DisplayFlags sofa::core::visual::VisualParams::m_displayFlags
protected
DrawTool* sofa::core::visual::VisualParams::m_drawTool
mutableprotected
SReal sofa::core::visual::VisualParams::m_modelViewMatrix[16]
protected

model view matrix.

Pass sofa::core::visual::VisualParams::m_pass
protected
SReal sofa::core::visual::VisualParams::m_projectionMatrix[16]
protected

projection matrix.

sofa::defaulttype::BoundingBox sofa::core::visual::VisualParams::m_sceneBoundingBox
protected
helper::gl::Transformation sofa::core::visual::VisualParams::m_sceneTransform
protected
unsigned int sofa::core::visual::VisualParams::m_supportedAPIs
protected

Mask of supported graphics API.

ConstMultiVecDerivId sofa::core::visual::VisualParams::m_v
protected

Ids of velocity vector.

Viewport sofa::core::visual::VisualParams::m_viewport
protected
ConstMultiVecCoordId sofa::core::visual::VisualParams::m_x
protected

Ids of position vector.

SReal sofa::core::visual::VisualParams::m_zFar
protected
SReal sofa::core::visual::VisualParams::m_zNear
protected

Constructor details

sofa::core::visual::VisualParams::VisualParams ( )

Function details

const CameraType& sofa::core::visual::VisualParams::cameraType ( ) const
inline
CameraType& sofa::core::visual::VisualParams::cameraType ( )
inline
VisualParams * sofa::core::visual::VisualParams::defaultInstance ( )
static

Get the default VisualParams, to be used to provide a default values for method parameters.

DisplayFlags& sofa::core::visual::VisualParams::displayFlags ( )
inline
const DisplayFlags& sofa::core::visual::VisualParams::displayFlags ( ) const
inline
DrawTool*& sofa::core::visual::VisualParams::drawTool ( )
inline
DrawTool*& sofa::core::visual::VisualParams::drawTool ( ) const
inline
helper::gl::FrameBufferObject*& sofa::core::visual::VisualParams::frameBufferObject ( )
inline
helper::gl::FrameBufferObject*& sofa::core::visual::VisualParams::frameBufferObject ( ) const
inline
void sofa::core::visual::VisualParams::getModelViewMatrix ( double  m[16]) const
inline

Get the ModelView matrix used to draw the scene. This OpenGL matrix defines the world coordinate system with respect to the camera.

void sofa::core::visual::VisualParams::getProjectionMatrix ( double  m[16]) const
inline

Get the projection matrix used to draw the scene. This OpenGL matrix defines the camera coordinate system with respect to the viewport, including perspective if any.

bool sofa::core::visual::VisualParams::isSupported ( unsigned int  api) const
inline
const Pass& sofa::core::visual::VisualParams::pass ( ) const
inline
Pass& sofa::core::visual::VisualParams::pass ( )
inline
template<class S >
const Data<typename S::VecDeriv>* sofa::core::visual::VisualParams::readV ( const S *  state) const
inline

Read access to current velocity vector.

template<class S >
const Data<typename S::VecCoord>* sofa::core::visual::VisualParams::readX ( const S *  state) const
inline

Read access to current position vector.

sofa::defaulttype::BoundingBox& sofa::core::visual::VisualParams::sceneBBox ( )
inline
const sofa::defaulttype::BoundingBox& sofa::core::visual::VisualParams::sceneBBox ( ) const
inline
sofa::helper::gl::Transformation& sofa::core::visual::VisualParams::sceneTransform ( )
inline
const sofa::helper::gl::Transformation& sofa::core::visual::VisualParams::sceneTransform ( ) const
inline
void sofa::core::visual::VisualParams::setModelViewMatrix ( const double  m[16])
inline

Store the ModelView matrix used to draw the scene. This OpenGL matrix defines the world coordinate system with respect to the camera.

void sofa::core::visual::VisualParams::setProjectionMatrix ( const double  m[16])
inline

Store the projection matrix used to draw the scene. This OpenGL matrix defines the camera coordinate system with respect to the viewport, including perspective if any.

void sofa::core::visual::VisualParams::setSupported ( unsigned int  api,
bool  val = true 
)
inline
VisualParams& sofa::core::visual::VisualParams::setV ( ConstVecDerivId  v)
inline

Set the IDs of velocity vector.

VisualParams& sofa::core::visual::VisualParams::setV ( ConstMultiVecDerivId  v)
inline
template<class StateSet >
VisualParams& sofa::core::visual::VisualParams::setV ( const StateSet &  g,
ConstVecDerivId  v 
)
inline
VisualParams& sofa::core::visual::VisualParams::setX ( ConstVecCoordId  v)
inline

Set the IDs of position vector.

VisualParams& sofa::core::visual::VisualParams::setX ( ConstMultiVecCoordId  v)
inline
template<class StateSet >
VisualParams& sofa::core::visual::VisualParams::setX ( const StateSet &  g,
ConstVecCoordId  v 
)
inline
const ConstMultiVecDerivId& sofa::core::visual::VisualParams::v ( ) const
inline
ConstMultiVecDerivId& sofa::core::visual::VisualParams::v ( )
inline
const Viewport& sofa::core::visual::VisualParams::viewport ( ) const
inline
Viewport& sofa::core::visual::VisualParams::viewport ( )
inline
const ConstMultiVecCoordId& sofa::core::visual::VisualParams::x ( ) const
inline
ConstMultiVecCoordId& sofa::core::visual::VisualParams::x ( )
inline
const SReal& sofa::core::visual::VisualParams::zFar ( ) const
inline
SReal& sofa::core::visual::VisualParams::zFar ( )
inline
const SReal& sofa::core::visual::VisualParams::zNear ( ) const
inline
SReal& sofa::core::visual::VisualParams::zNear ( )
inline

Enum details

The enumeration used to describe the type of camera transform.

Enumerator
PERSPECTIVE_TYPE 

Perspective camera.

ORTHOGRAPHIC_TYPE 

Orthographic camera.

The enumeration used to describe each step of the rendering.

Enumerator
Std 

Standard pass.

Transparent 

Transparent pass.

Shadow 

Shadow pass.