SOFA API  c76874b7
Open source framework for multi-physics simuation
sofa::gui::qt::viewer::qgl::QtGLViewer Class Reference

#include <QtGLViewer.h>

Inheritance diagram for sofa::gui::qt::viewer::qgl::QtGLViewer:

Public Member Functions

virtual void drawColourPicking (ColourPickingVisitor::ColourCode code) override
 
 QtGLViewer (QWidget *parent, const char *name="", const unsigned int nbMSAASamples=1)
 
 ~QtGLViewer () override
 
QWidgetgetQWidget () override
 
int getWidth () override
 
int getHeight () override
 
bool ready () override
 
void wait () override
 ask the viewer to resume its activity More...
 
void UpdateOBJ (void)
 
void moveRayPickInteractor (int eventX, int eventY) override
 RayCasting PickHandler. More...
 
void setCameraMode (core::visual::VisualParams::CameraType mode) override
 
QString helpString () const override
 
- Public Member Functions inherited from sofa::gui::qt::viewer::CustomPolicySofaViewer< VisualModelPolicyType >
 CustomPolicySofaViewer ()
 
 ~CustomPolicySofaViewer () override
 
- Public Member Functions inherited from sofa::gui::qt::viewer::SofaViewer
 SofaViewer ()
 
 ~SofaViewer () override
 
virtual void removeViewerTab (QTabWidget *)
 Optional QTabWidget GUI for a concreate viewer. More...
 
virtual void configureViewerTab (QTabWidget *)
 Optional QTabWidget GUI for a concreate viewer. More...
 
void captureEvent () override
 
bool isControlPressed () const
 
virtual void configure (sofa::component::configurationsetting::ViewerSetting *viewerConf) override
 
const std::string screenshotName () override
 
void setPrefix (const std::string &prefix, bool prependDirectory=true) override
 
virtual void screenshot (const std::string &filename, int compression_level=-1) override
 
virtual void setBackgroundImage (std::string imageFileName=std::string("textures/SOFA_logo.bmp")) override
 
- Public Member Functions inherited from sofa::gui::BaseViewer
 BaseViewer ()
 
virtual ~BaseViewer ()
 
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 bool load (void)
 Load the viewer. It's the initialisation. More...
 
virtual bool unload (void)
 unload the viewer without delete More...
 
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)
 
std::string getBackgroundImage ()
 
virtual void saveView ()=0
 
virtual void setSizeW (int)=0
 
virtual void setSizeH (int)=0
 
virtual void fitObjectBBox (sofa::core::objectmodel::BaseObject *)
 
virtual void fitNodeBBox (sofa::core::objectmodel::BaseNode *)
 
virtual void setFullScreen (bool)
 
PickHandlergetPickHandler ()
 

Static Public Member Functions

static QtGLViewercreate (QtGLViewer *, sofa::gui::BaseViewerArgument &arg)
 
static const char * viewerName ()
 
static const char * acceleratedName ()
 

Protected Member Functions

void init () override
 
void draw () override
 Overloaded from QGLViewer to render the scene. More...
 
virtual void viewAll () override
 Overloaded from SofaViewer. More...
 
void resizeGL (int w, int h) override
 
virtual void drawScene () override
 the rendering pass is done here (have to be called in a loop) More...
 
virtual void DrawLogo (void)
 
void keyPressEvent (QKeyEvent *e) override
 
void keyReleaseEvent (QKeyEvent *e) override
 
void mousePressEvent (QMouseEvent *e) override
 
void mouseReleaseEvent (QMouseEvent *e) override
 
void mouseMoveEvent (QMouseEvent *e) override
 
void wheelEvent (QWheelEvent *e) override
 
bool mouseEvent (QMouseEvent *e) override
 
- Protected Member Functions inherited from sofa::gui::qt::viewer::SofaViewer
void redraw () override
 internally called while the actual viewer needs a redraw (ie the camera changed) More...
 

Static Protected Member Functions

static QGLFormat setupGLFormat (const unsigned int nbMSAASamples=1)
 

Signals

void redrawn () override
 
void resizeW (int) override
 
void resizeH (int) override
 
void quit ()
 
- Signals inherited from sofa::gui::qt::viewer::SofaViewer
virtual void redrawn ()=0
 
virtual void resizeW (int)=0
 
virtual void resizeH (int)=0
 

Public Slots

void resetView () override
 
void saveView () override
 
void setSizeW (int) override
 
void setSizeH (int) override
 
virtual void getView (defaulttype::Vec3d &pos, defaulttype::Quat &ori) const override
 
virtual void setView (const defaulttype::Vec3d &pos, const defaulttype::Quat &ori) override
 
virtual void captureEvent () override
 
void fitObjectBBox (sofa::core::objectmodel::BaseObject *object) override
 
void fitNodeBBox (sofa::core::objectmodel::BaseNode *node) override
 

Additional Inherited Members

- Protected Attributes inherited from sofa::gui::qt::viewer::SofaViewer
std::unique_ptr< EngineBackendm_backend
 
QTimer captureTimer
 
bool m_isControlPressed
 
ColourPickingRenderCallBack colourPickingRenderCallBack
 
- Protected Attributes inherited from sofa::gui::BaseViewer
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
 

Constructor details

sofa::gui::qt::viewer::qgl::QtGLViewer::QtGLViewer ( QWidget parent,
const char *  name = "",
const unsigned int  nbMSAASamples = 1 
)
sofa::gui::qt::viewer::qgl::QtGLViewer::~QtGLViewer ( )
override

Function details

static const char* sofa::gui::qt::viewer::qgl::QtGLViewer::acceleratedName ( )
inlinestatic
virtual void sofa::gui::qt::viewer::qgl::QtGLViewer::captureEvent ( )
inlineoverridevirtualslot
static QtGLViewer* sofa::gui::qt::viewer::qgl::QtGLViewer::create ( QtGLViewer ,
sofa::gui::BaseViewerArgument arg 
)
inlinestatic
void sofa::gui::qt::viewer::qgl::QtGLViewer::draw ( )
overrideprotected

Overloaded from QGLViewer to render the scene.

void sofa::gui::qt::viewer::qgl::QtGLViewer::drawColourPicking ( ColourPickingVisitor::ColourCode  code)
overridevirtual

Reimplemented from sofa::gui::BaseViewer.

void sofa::gui::qt::viewer::qgl::QtGLViewer::DrawLogo ( void  )
protectedvirtual
void sofa::gui::qt::viewer::qgl::QtGLViewer::drawScene ( )
overrideprotectedvirtual

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

Implements sofa::gui::BaseViewer.

void sofa::gui::qt::viewer::qgl::QtGLViewer::fitNodeBBox ( sofa::core::objectmodel::BaseNode node)
inlineoverrideslot
void sofa::gui::qt::viewer::qgl::QtGLViewer::fitObjectBBox ( sofa::core::objectmodel::BaseObject object)
inlineoverrideslot
int sofa::gui::qt::viewer::qgl::QtGLViewer::getHeight ( )
inlineoverridevirtual

Implements sofa::gui::BaseViewer.

QWidget* sofa::gui::qt::viewer::qgl::QtGLViewer::getQWidget ( )
inlineoverridevirtual
void sofa::gui::qt::viewer::qgl::QtGLViewer::getView ( defaulttype::Vec3d &  pos,
defaulttype::Quat ori 
) const
overridevirtualslot
int sofa::gui::qt::viewer::qgl::QtGLViewer::getWidth ( )
inlineoverridevirtual

Implements sofa::gui::BaseViewer.

QString sofa::gui::qt::viewer::qgl::QtGLViewer::helpString ( ) const
overridevirtual
void sofa::gui::qt::viewer::qgl::QtGLViewer::init ( void  )
overrideprotected
void sofa::gui::qt::viewer::qgl::QtGLViewer::keyPressEvent ( QKeyEvent *  e)
overrideprotectedvirtual

Reimplemented from sofa::gui::qt::viewer::SofaViewer.

void sofa::gui::qt::viewer::qgl::QtGLViewer::keyReleaseEvent ( QKeyEvent *  e)
overrideprotectedvirtual

Reimplemented from sofa::gui::qt::viewer::SofaViewer.

bool sofa::gui::qt::viewer::qgl::QtGLViewer::mouseEvent ( QMouseEvent *  e)
overrideprotectedvirtual

Reimplemented from sofa::gui::qt::viewer::SofaViewer.

void sofa::gui::qt::viewer::qgl::QtGLViewer::mouseMoveEvent ( QMouseEvent *  e)
overrideprotectedvirtual

Reimplemented from sofa::gui::qt::viewer::SofaViewer.

void sofa::gui::qt::viewer::qgl::QtGLViewer::mousePressEvent ( QMouseEvent *  e)
overrideprotectedvirtual

Reimplemented from sofa::gui::qt::viewer::SofaViewer.

void sofa::gui::qt::viewer::qgl::QtGLViewer::mouseReleaseEvent ( QMouseEvent *  e)
overrideprotectedvirtual

Reimplemented from sofa::gui::qt::viewer::SofaViewer.

void sofa::gui::qt::viewer::qgl::QtGLViewer::moveRayPickInteractor ( int  ,
int   
)
overridevirtual

RayCasting PickHandler.

Reimplemented from sofa::gui::BaseViewer.

void sofa::gui::qt::viewer::qgl::QtGLViewer::quit ( )
signal
bool sofa::gui::qt::viewer::qgl::QtGLViewer::ready ( )
inlineoverridevirtual

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

Reimplemented from sofa::gui::BaseViewer.

void sofa::gui::qt::viewer::qgl::QtGLViewer::redrawn ( )
overridesignal
void sofa::gui::qt::viewer::qgl::QtGLViewer::resetView ( )
overrideslot
void sofa::gui::qt::viewer::qgl::QtGLViewer::resizeGL ( int  w,
int  h 
)
overrideprotected
void sofa::gui::qt::viewer::qgl::QtGLViewer::resizeH ( int  )
overridesignal
void sofa::gui::qt::viewer::qgl::QtGLViewer::resizeW ( int  )
overridesignal
void sofa::gui::qt::viewer::qgl::QtGLViewer::saveView ( )
overrideslot
void sofa::gui::qt::viewer::qgl::QtGLViewer::setCameraMode ( core::visual::VisualParams::CameraType  mode)
overridevirtual

Reimplemented from sofa::gui::BaseViewer.

void sofa::gui::qt::viewer::qgl::QtGLViewer::setSizeH ( int  size)
overrideslot
void sofa::gui::qt::viewer::qgl::QtGLViewer::setSizeW ( int  size)
overrideslot
QGLFormat sofa::gui::qt::viewer::qgl::QtGLViewer::setupGLFormat ( const unsigned int  nbMSAASamples = 1)
staticprotected
void sofa::gui::qt::viewer::qgl::QtGLViewer::setView ( const defaulttype::Vec3d &  pos,
const defaulttype::Quat ori 
)
overridevirtualslot
void sofa::gui::qt::viewer::qgl::QtGLViewer::UpdateOBJ ( void  )
void sofa::gui::qt::viewer::qgl::QtGLViewer::viewAll ( void  )
overrideprotectedvirtual

Overloaded from SofaViewer.

Implements sofa::gui::BaseViewer.

static const char* sofa::gui::qt::viewer::qgl::QtGLViewer::viewerName ( )
inlinestatic
void sofa::gui::qt::viewer::qgl::QtGLViewer::wait ( )
inlineoverridevirtual

ask the viewer to resume its activity

Reimplemented from sofa::gui::BaseViewer.

void sofa::gui::qt::viewer::qgl::QtGLViewer::wheelEvent ( QWheelEvent *  e)
overrideprotectedvirtual

Reimplemented from sofa::gui::qt::viewer::SofaViewer.