SOFA API  99934cbc
Open source framework for multi-physics simuation
sofa::gui::BaseViewer Class Referenceabstract

#include <BaseViewer.h>

Inheritance diagram for sofa::gui::BaseViewer:

Protected Attributes

sofa::simulation::Node::SPtr groot
 the sofa root note of the current scene More...
 
sofa::component::visualmodel::BaseCamera::SPtr currentCamera
 
std::string sceneFileName
 
bool _video
 
bool m_isVideoButtonPressed
 
bool m_bShowAxis
 
bool _fullScreen
 
int _background
 
bool initTexturesDone
 
sofa::defaulttype::Vector3 backgroundColour
 
std::string backgroundImageFile
 
sofa::defaulttype::Vector3 ambientColour
 
PickHandlerpick
 
int _navigationMode
 
bool _mouseInteractorMoving
 
int _mouseInteractorSavedPosX
 
int _mouseInteractorSavedPosY
 
std::string _screenshotDirectory
 

Public Member Functions

 BaseViewer ()
 
virtual ~BaseViewer ()
 
virtual void drawColourPicking (ColourPickingVisitor::ColourCode)
 
virtual sofa::simulation::NodegetScene ()
 
virtual const std::string & getSceneFileName ()
 
virtual void setSceneFileName (const std::string &f)
 
virtual void setScene (sofa::simulation::Node::SPtr scene, const char *filename=nullptr, bool=false)
 
virtual void setCameraMode (core::visual::VisualParams::CameraType)
 
virtual bool ready ()
 
virtual void wait ()
 ask the viewer to resume its activity More...
 
virtual bool load (void)
 Load the viewer. It's the initialisation. More...
 
virtual bool unload (void)
 unload the viewer without delete More...
 
virtual void viewAll (void)=0
 Recompute viewer's home position so it encompass the whole scene and apply it. More...
 
virtual void configure (sofa::component::configurationsetting::ViewerSetting *viewerConf)
 
virtual const std::string screenshotName ()
 
virtual void setPrefix (const std::string &prefix, bool prependDirectory=true)
 
virtual void screenshot (const std::string &filename, int compression_level=-1)
 
virtual void getView (sofa::defaulttype::Vector3 &pos, sofa::defaulttype::Quat &ori) const
 
virtual void setView (const sofa::defaulttype::Vector3 &pos, const sofa::defaulttype::Quat &ori)
 
virtual void moveView (const sofa::defaulttype::Vector3 &pos, const sofa::defaulttype::Quat &ori)
 
virtual void newView ()
 
virtual void resetView ()
 
virtual void setBackgroundColour (float r, float g, float b)
 
virtual void setBackgroundImage (std::string imageFileName=std::string("textures/SOFA_logo.bmp"))
 
std::string getBackgroundImage ()
 
virtual void saveView ()=0
 
virtual void setSizeW (int)=0
 
virtual void setSizeH (int)=0
 
virtual int getWidth ()=0
 
virtual int getHeight ()=0
 
virtual void captureEvent ()
 
virtual void fitObjectBBox (sofa::core::objectmodel::BaseObject *)
 
virtual void fitNodeBBox (sofa::core::objectmodel::BaseNode *)
 
virtual void setFullScreen (bool)
 
virtual void moveRayPickInteractor (int, int)
 RayCasting PickHandler. More...
 
PickHandlergetPickHandler ()
 
virtual void drawScene (void)=0
 the rendering pass is done here (have to be called in a loop) More...
 

Protected Member Functions

virtual void redraw ()=0
 internally called while the actual viewer needs a redraw (ie the camera changed) More...
 

Attribute details

int sofa::gui::BaseViewer::_background
protected
bool sofa::gui::BaseViewer::_fullScreen
protected
bool sofa::gui::BaseViewer::_mouseInteractorMoving
protected
int sofa::gui::BaseViewer::_mouseInteractorSavedPosX
protected
int sofa::gui::BaseViewer::_mouseInteractorSavedPosY
protected
int sofa::gui::BaseViewer::_navigationMode
protected
std::string sofa::gui::BaseViewer::_screenshotDirectory
protected
bool sofa::gui::BaseViewer::_video
protected
sofa::defaulttype::Vector3 sofa::gui::BaseViewer::ambientColour
protected
sofa::defaulttype::Vector3 sofa::gui::BaseViewer::backgroundColour
protected
std::string sofa::gui::BaseViewer::backgroundImageFile
protected
sofa::component::visualmodel::BaseCamera::SPtr sofa::gui::BaseViewer::currentCamera
protected
sofa::simulation::Node::SPtr sofa::gui::BaseViewer::groot
protected

the sofa root note of the current scene

bool sofa::gui::BaseViewer::initTexturesDone
protected
bool sofa::gui::BaseViewer::m_bShowAxis
protected
bool sofa::gui::BaseViewer::m_isVideoButtonPressed
protected
PickHandler* sofa::gui::BaseViewer::pick
protected
std::string sofa::gui::BaseViewer::sceneFileName
protected

Constructor details

sofa::gui::BaseViewer::BaseViewer ( )
sofa::gui::BaseViewer::~BaseViewer ( )
virtual

Function details

virtual void sofa::gui::BaseViewer::captureEvent ( )
inlinevirtual
void sofa::gui::BaseViewer::configure ( sofa::component::configurationsetting::ViewerSetting viewerConf)
virtual
virtual void sofa::gui::BaseViewer::drawColourPicking ( ColourPickingVisitor::ColourCode  )
inlinevirtual
virtual void sofa::gui::BaseViewer::drawScene ( void  )
pure virtual

the rendering pass is done here (have to be called in a loop)

Implemented in sofa::gui::qt::viewer::qgl::QtGLViewer.

void sofa::gui::BaseViewer::fitNodeBBox ( sofa::core::objectmodel::BaseNode node)
virtual
void sofa::gui::BaseViewer::fitObjectBBox ( sofa::core::objectmodel::BaseObject object)
virtual
std::string sofa::gui::BaseViewer::getBackgroundImage ( )
virtual int sofa::gui::BaseViewer::getHeight ( )
pure virtual
PickHandler * sofa::gui::BaseViewer::getPickHandler ( )
sofa::simulation::Node * sofa::gui::BaseViewer::getScene ( )
virtual
const std::string & sofa::gui::BaseViewer::getSceneFileName ( )
virtual
void sofa::gui::BaseViewer::getView ( sofa::defaulttype::Vector3 &  pos,
sofa::defaulttype::Quat ori 
) const
virtual
virtual int sofa::gui::BaseViewer::getWidth ( )
pure virtual
bool sofa::gui::BaseViewer::load ( void  )
virtual

Load the viewer. It's the initialisation.

virtual void sofa::gui::BaseViewer::moveRayPickInteractor ( int  ,
int   
)
inlinevirtual
void sofa::gui::BaseViewer::moveView ( const sofa::defaulttype::Vector3 &  pos,
const sofa::defaulttype::Quat ori 
)
virtual
void sofa::gui::BaseViewer::newView ( )
virtual
bool sofa::gui::BaseViewer::ready ( )
virtual

true when the viewer keep the hand on the render false when it's not in activity

Reimplemented in sofa::gui::qt::viewer::qt::QtViewer, and sofa::gui::qt::viewer::qgl::QtGLViewer.

virtual void sofa::gui::BaseViewer::redraw ( )
protectedpure virtual

internally called while the actual viewer needs a redraw (ie the camera changed)

Implemented in sofa::gui::qt::viewer::SofaViewer.

void sofa::gui::BaseViewer::resetView ( )
virtual
virtual void sofa::gui::BaseViewer::saveView ( )
pure virtual
void sofa::gui::BaseViewer::screenshot ( const std::string &  filename,
int  compression_level = -1 
)
virtual
const std::string sofa::gui::BaseViewer::screenshotName ( )
virtual
void sofa::gui::BaseViewer::setBackgroundColour ( float  r,
float  g,
float  b 
)
virtual
void sofa::gui::BaseViewer::setBackgroundImage ( std::string  imageFileName = std::string("textures/SOFA_logo.bmp"))
virtual
void sofa::gui::BaseViewer::setCameraMode ( core::visual::VisualParams::CameraType  mode)
virtual
virtual void sofa::gui::BaseViewer::setFullScreen ( bool  )
inlinevirtual
void sofa::gui::BaseViewer::setPrefix ( const std::string &  prefix,
bool  prependDirectory = true 
)
virtual
void sofa::gui::BaseViewer::setScene ( sofa::simulation::Node::SPtr  scene,
const char *  filename = nullptr,
bool  = false 
)
virtual
void sofa::gui::BaseViewer::setSceneFileName ( const std::string &  f)
virtual
virtual void sofa::gui::BaseViewer::setSizeH ( int  )
pure virtual
virtual void sofa::gui::BaseViewer::setSizeW ( int  )
pure virtual
void sofa::gui::BaseViewer::setView ( const sofa::defaulttype::Vector3 &  pos,
const sofa::defaulttype::Quat ori 
)
virtual
bool sofa::gui::BaseViewer::unload ( void  )
virtual

unload the viewer without delete

virtual void sofa::gui::BaseViewer::viewAll ( void  )
pure virtual

Recompute viewer's home position so it encompass the whole scene and apply it.

Implemented in sofa::gui::qt::viewer::qt::QtViewer, and sofa::gui::qt::viewer::qgl::QtGLViewer.

void sofa::gui::BaseViewer::wait ( )
virtual

ask the viewer to resume its activity

Reimplemented in sofa::gui::qt::viewer::qt::QtViewer, and sofa::gui::qt::viewer::qgl::QtGLViewer.