SOFA API  b5aefb45
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::type::BoundingBox m_sceneBoundingBox
 
Viewport m_viewport
 
SReal m_zNear
 
SReal m_zFar
 
CameraType m_cameraType
 
Pass m_pass
 
DisplayFlags m_displayFlags
 
helper::visual::DrawToolm_drawTool
 
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 SReal & zNear () const
 
const SReal & zFar () const
 
SReal & zNear ()
 
SReal & zFar ()
 
const CameraTypecameraType () const
 
CameraTypecameraType ()
 
const Passpass () const
 
Passpass ()
 
helper::visual::DrawTool *& drawTool ()
 
helper::visual::DrawTool *& drawTool () const
 
DisplayFlagsdisplayFlags ()
 
const DisplayFlagsdisplayFlags () const
 
sofa::type::BoundingBoxsceneBBox ()
 
const sofa::type::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...
 
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...
 

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...
 

Attribute details

◆ m_cameraType

CameraType sofa::core::visual::VisualParams::m_cameraType
protected

◆ m_displayFlags

DisplayFlags sofa::core::visual::VisualParams::m_displayFlags
protected

◆ m_drawTool

helper::visual::DrawTool* sofa::core::visual::VisualParams::m_drawTool
mutableprotected

◆ m_modelViewMatrix

SReal sofa::core::visual::VisualParams::m_modelViewMatrix[16]
protected

model view matrix.

◆ m_pass

Pass sofa::core::visual::VisualParams::m_pass
protected

◆ m_projectionMatrix

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

projection matrix.

◆ m_sceneBoundingBox

sofa::type::BoundingBox sofa::core::visual::VisualParams::m_sceneBoundingBox
protected

◆ m_supportedAPIs

unsigned int sofa::core::visual::VisualParams::m_supportedAPIs
protected

Mask of supported graphics API.

◆ m_v

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

Ids of velocity vector.

◆ m_viewport

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

◆ m_x

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

Ids of position vector.

◆ m_zFar

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

◆ m_zNear

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

Constructor details

◆ VisualParams()

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

Function details

◆ cameraType() [1/2]

CameraType& sofa::core::visual::VisualParams::cameraType ( )
inline

◆ cameraType() [2/2]

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

◆ defaultInstance()

VisualParams * sofa::core::visual::VisualParams::defaultInstance ( )
static

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

◆ displayFlags() [1/2]

DisplayFlags& sofa::core::visual::VisualParams::displayFlags ( )
inline

◆ displayFlags() [2/2]

const DisplayFlags& sofa::core::visual::VisualParams::displayFlags ( ) const
inline

◆ drawTool() [1/2]

helper::visual::DrawTool*& sofa::core::visual::VisualParams::drawTool ( )
inline

◆ drawTool() [2/2]

helper::visual::DrawTool*& sofa::core::visual::VisualParams::drawTool ( ) const
inline

◆ getModelViewMatrix()

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.

◆ getProjectionMatrix()

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.

◆ isSupported()

bool sofa::core::visual::VisualParams::isSupported ( unsigned int  api) const
inline

◆ pass() [1/2]

Pass& sofa::core::visual::VisualParams::pass ( )
inline

◆ pass() [2/2]

const Pass& sofa::core::visual::VisualParams::pass ( ) const
inline

◆ readV()

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

Read access to current velocity vector.

◆ readX()

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

Read access to current position vector.

◆ sceneBBox() [1/2]

sofa::type::BoundingBox& sofa::core::visual::VisualParams::sceneBBox ( )
inline

◆ sceneBBox() [2/2]

const sofa::type::BoundingBox& sofa::core::visual::VisualParams::sceneBBox ( ) const
inline

◆ setModelViewMatrix()

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.

◆ setProjectionMatrix()

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.

◆ setSupported()

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

◆ setV() [1/3]

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

◆ setV() [2/3]

VisualParams& sofa::core::visual::VisualParams::setV ( ConstMultiVecDerivId  v)
inline

◆ setV() [3/3]

VisualParams& sofa::core::visual::VisualParams::setV ( ConstVecDerivId  v)
inline

Set the IDs of velocity vector.

◆ setX() [1/3]

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

◆ setX() [2/3]

VisualParams& sofa::core::visual::VisualParams::setX ( ConstMultiVecCoordId  v)
inline

◆ setX() [3/3]

VisualParams& sofa::core::visual::VisualParams::setX ( ConstVecCoordId  v)
inline

Set the IDs of position vector.

◆ v() [1/2]

ConstMultiVecDerivId& sofa::core::visual::VisualParams::v ( )
inline

◆ v() [2/2]

const ConstMultiVecDerivId& sofa::core::visual::VisualParams::v ( ) const
inline

◆ viewport() [1/2]

Viewport& sofa::core::visual::VisualParams::viewport ( )
inline

◆ viewport() [2/2]

const Viewport& sofa::core::visual::VisualParams::viewport ( ) const
inline

◆ x() [1/2]

ConstMultiVecCoordId& sofa::core::visual::VisualParams::x ( )
inline

◆ x() [2/2]

const ConstMultiVecCoordId& sofa::core::visual::VisualParams::x ( ) const
inline

◆ zFar() [1/2]

SReal& sofa::core::visual::VisualParams::zFar ( )
inline

◆ zFar() [2/2]

const SReal& sofa::core::visual::VisualParams::zFar ( ) const
inline

◆ zNear() [1/2]

SReal& sofa::core::visual::VisualParams::zNear ( )
inline

◆ zNear() [2/2]

const SReal& sofa::core::visual::VisualParams::zNear ( ) const
inline

Enum details

◆ CameraType

The enumeration used to describe the type of camera transform.

Enumerator
PERSPECTIVE_TYPE 

Perspective camera.

ORTHOGRAPHIC_TYPE 

Orthographic camera.

◆ Pass

The enumeration used to describe each step of the rendering.

Enumerator
Std 

Standard pass.

Transparent 

Transparent pass.

Shadow 

Shadow pass.