#include <QtGLViewer.h>


Public Slots | |
| void | resetView () |
| void | saveView () |
| void | setSizeW (int) |
| void | setSizeH (int) |
Signals | |
| void | redrawn () |
| void | resizeW (int) |
| void | resizeH (int) |
Public Member Functions | |
| QtGLViewer (QWidget *parent, const char *name="") | |
| ~QtGLViewer () | |
| QWidget * | getQWidget () |
| int | GetWidth () |
| int | GetHeight () |
| bool | ready () |
| void | wait () |
| void | UpdateOBJ (void) |
| void | moveRayPickInteractor (int eventX, int eventY) |
| QString | helpString () |
Static Public Member Functions | |
| static int | EnableViewer () |
| Activate this class of viewer. | |
| static int | DisableViewer () |
| Disable this class of viewer. | |
Protected Member Functions | |
| void | init () |
| virtual void | draw () |
| void | viewAll () |
| void | resizeGL (int w, int h) |
| void | ApplyShadowMap () |
| void | CreateRenderTexture (GLuint &textureID, int sizeX, int sizeY, int channels, int type) |
| void | StoreLightMatrices () |
| virtual void | keyPressEvent (QKeyEvent *e) |
| virtual void | keyReleaseEvent (QKeyEvent *e) |
| virtual void | mousePressEvent (QMouseEvent *e) |
| virtual void | mouseReleaseEvent (QMouseEvent *e) |
| virtual void | mouseMoveEvent (QMouseEvent *e) |
| virtual void | wheelEvent (QWheelEvent *e) |
| bool | mouseEvent (QMouseEvent *e) |
Private Types | |
| typedef Vector3::value_type | Real |
Private Member Functions | |
| void | InitGFX (void) |
| void | PrintString (void *font, char *string) |
| void | Display3DText (float x, float y, float z, char *string) |
| void | DrawAxis (double xpos, double ypos, double zpos, double arrowSize) |
| void | DrawBox (Real *minBBox, Real *maxBBox, Real r=0.0) |
| void | DrawXYPlane (double zo, double xmin, double xmax, double ymin, double ymax, double step) |
| void | DrawYZPlane (double xo, double ymin, double ymax, double zmin, double zmax, double step) |
| void | DrawXZPlane (double yo, double xmin, double xmax, double zmin, double zmax, double step) |
| void | CreateOBJmodelDisplayList (int material_mode) |
| void | DrawLogo (void) |
| void | DisplayOBJs (bool shadowPass=false) |
| void | DisplayMenu (void) |
| void | DrawScene () |
Private Attributes | |
| QTimer * | timerAnimate |
| int | _W |
| int | _H |
| int | _clearBuffer |
| bool | _lightModelTwoSides |
| float | _lightPosition [4] |
| double | lastProjectionMatrix [16] |
| double | lastModelviewMatrix [16] |
| GLint | lastViewport [4] |
| GLUquadricObj * | _arrow |
| GLUquadricObj * | _tube |
| GLUquadricObj * | _sphere |
| GLUquadricObj * | _disk |
| GLuint | _numOBJmodels |
| GLuint | _materialMode |
| GLboolean | _facetNormal |
| int | _renderingMode |
| Texture * | texLogo |
| ctime_t | _beginTime |
| bool | _waitForRender |
| Vector3 | sceneMinBBox |
| Vector3 | sceneMaxBBox |
Definition at line 72 of file QtGLViewer.h.
typedef Vector3::value_type sofa::gui::qt::viewer::qgl::QtGLViewer::Real [private] |
Definition at line 74 of file QtGLViewer.h.
| sofa::gui::qt::viewer::qgl::QtGLViewer::QtGLViewer | ( | QWidget * | parent, | |
| const char * | name = "" | |||
| ) |
Definition at line 163 of file QtGLViewer.cpp.
References _arrow, sofa::gui::qt::viewer::SofaViewer::_axis, sofa::gui::qt::viewer::SofaViewer::_background, _disk, _facetNormal, sofa::gui::qt::viewer::SofaViewer::_gl_shadow, _materialMode, sofa::gui::qt::viewer::SofaViewer::_mouseInteractorMoving, sofa::gui::qt::viewer::SofaViewer::_mouseInteractorSavedPosX, sofa::gui::qt::viewer::SofaViewer::_mouseInteractorSavedPosY, _numOBJmodels, _renderingMode, sofa::gui::qt::viewer::SofaViewer::_shadow, _sphere, _tube, sofa::gui::qt::viewer::SofaViewer::_video, sofa::gui::qt::viewer::SofaViewer::groot, sofa::gui::qt::viewer::SofaViewer::initTexturesDone, sofa::gui::qt::viewer::SofaViewer::interactor, sofa::gui::qt::viewer::SofaViewer::m_isControlPressed, sofa::gui::qt::viewer::SofaViewer::sceneBBoxIsValid, texLogo, and timerAnimate.
| sofa::gui::qt::viewer::qgl::QtGLViewer::~QtGLViewer | ( | ) |
Definition at line 238 of file QtGLViewer.cpp.
| void sofa::gui::qt::viewer::qgl::QtGLViewer::ApplyShadowMap | ( | ) | [protected] |
Definition at line 537 of file QtGLViewer.cpp.
References DisplayOBJs(), and lastModelviewMatrix.
Referenced by DrawScene().
| void sofa::gui::qt::viewer::qgl::QtGLViewer::CreateOBJmodelDisplayList | ( | int | material_mode | ) | [private] |
| int sofa::gui::qt::viewer::qgl::QtGLViewer::DisableViewer | ( | ) | [static] |
Disable this class of viewer.
This method is called after the viewer is destroyed and can be used to unregister classes associated with in the the ObjectFactory.
This method is called after the viewer is destroyed and can be used to unregister classes associated with in the the ObjectFactory.
Definition at line 150 of file QtGLViewer.cpp.
References sofa::gui::qt::viewer::qgl::classVisualModel, sofa::gui::qt::viewer::qgl::enabled, and sofa::core::ObjectFactory::ResetAlias().
Referenced by sofa::gui::qt::RealGUI::setViewer().
| void sofa::gui::qt::viewer::qgl::QtGLViewer::Display3DText | ( | float | x, | |
| float | y, | |||
| float | z, | |||
| char * | string | |||
| ) | [private] |
Definition at line 620 of file QtGLViewer.cpp.
| void sofa::gui::qt::viewer::qgl::QtGLViewer::DisplayMenu | ( | void | ) | [private] |
| void sofa::gui::qt::viewer::qgl::QtGLViewer::DisplayOBJs | ( | bool | shadowPass = false |
) | [private] |
Definition at line 960 of file QtGLViewer.cpp.
References sofa::gui::qt::viewer::SofaViewer::_axis, sofa::simulation::tree::Simulation::draw(), DrawAxis(), DrawBox(), sofa::simulation::tree::Simulation::drawShadows(), sofa::simulation::tree::getSimulation(), sofa::gui::qt::viewer::SofaViewer::groot, sofa::simulation::tree::Simulation::initTextures(), sofa::gui::qt::viewer::SofaViewer::initTexturesDone, sceneMaxBBox, and sceneMinBBox.
Referenced by ApplyShadowMap(), and DrawScene().
| void sofa::gui::qt::viewer::qgl::QtGLViewer::draw | ( | ) | [protected, virtual] |
Definition at line 1283 of file QtGLViewer.cpp.
References sofa::gui::qt::viewer::SofaViewer::_background, _clearBuffer, sofa::gui::qt::viewer::SofaViewer::_video, _waitForRender, sofa::gui::qt::viewer::SofaViewer::capture, DrawScene(), sofa::helper::gl::Capture::findFilename(), redrawn(), and sofa::gui::qt::viewer::SofaViewer::screenshot().
| void sofa::gui::qt::viewer::qgl::QtGLViewer::DrawAxis | ( | double | xpos, | |
| double | ypos, | |||
| double | zpos, | |||
| double | arrowSize | |||
| ) | [private] |
| void sofa::gui::qt::viewer::qgl::QtGLViewer::DrawBox | ( | Real * | minBBox, | |
| Real * | maxBBox, | |||
| Real | r = 0.0 | |||
| ) | [private] |
Definition at line 720 of file QtGLViewer.cpp.
References _sphere, _tube, and norm().
Referenced by DisplayOBJs().
| void sofa::gui::qt::viewer::qgl::QtGLViewer::DrawLogo | ( | void | ) | [private] |
Definition at line 909 of file QtGLViewer.cpp.
References _H, _W, sofa::helper::gl::Texture::bind(), sofa::helper::io::Image::getHeight(), sofa::helper::gl::Texture::getImage(), sofa::helper::io::Image::getWidth(), and texLogo.
Referenced by DrawScene().
| void sofa::gui::qt::viewer::qgl::QtGLViewer::DrawScene | ( | void | ) | [private] |
Definition at line 1026 of file QtGLViewer.cpp.
References sofa::gui::qt::viewer::SofaViewer::_background, _lightPosition, _renderingMode, sofa::gui::qt::viewer::SofaViewer::_shadow, ApplyShadowMap(), DisplayMenu(), DisplayOBJs(), DrawLogo(), GetHeight(), GetWidth(), lastModelviewMatrix, lastProjectionMatrix, lastViewport, and StoreLightMatrices().
Referenced by draw().
| void sofa::gui::qt::viewer::qgl::QtGLViewer::DrawXYPlane | ( | double | zo, | |
| double | xmin, | |||
| double | xmax, | |||
| double | ymin, | |||
| double | ymax, | |||
| double | step | |||
| ) | [private] |
Definition at line 825 of file QtGLViewer.cpp.
| void sofa::gui::qt::viewer::qgl::QtGLViewer::DrawXZPlane | ( | double | yo, | |
| double | xmin, | |||
| double | xmax, | |||
| double | zmin, | |||
| double | zmax, | |||
| double | step | |||
| ) | [private] |
Definition at line 883 of file QtGLViewer.cpp.
| void sofa::gui::qt::viewer::qgl::QtGLViewer::DrawYZPlane | ( | double | xo, | |
| double | ymin, | |||
| double | ymax, | |||
| double | zmin, | |||
| double | zmax, | |||
| double | step | |||
| ) | [private] |
Definition at line 854 of file QtGLViewer.cpp.
| int sofa::gui::qt::viewer::qgl::QtGLViewer::EnableViewer | ( | ) | [static] |
Activate this class of viewer.
This method is called before the viewer is actually created and can be used to register classes associated with in the the ObjectFactory.
This method is called before the viewer is actually created and can be used to register classes associated with in the the ObjectFactory.
Definition at line 136 of file QtGLViewer.cpp.
References sofa::core::ObjectFactory::AddAlias(), sofa::gui::qt::viewer::qgl::classVisualModel, and sofa::gui::qt::viewer::qgl::enabled.
Referenced by sofa::gui::qt::RealGUI::InitGUI(), and sofa::gui::qt::RealGUI::setViewer().
| int sofa::gui::qt::viewer::qgl::QtGLViewer::GetHeight | ( | ) | [inline] |
| QWidget* sofa::gui::qt::viewer::qgl::QtGLViewer::getQWidget | ( | ) | [inline, virtual] |
| int sofa::gui::qt::viewer::qgl::QtGLViewer::GetWidth | ( | ) | [inline] |
| QString sofa::gui::qt::viewer::qgl::QtGLViewer::helpString | ( | ) | [virtual] |
| void sofa::gui::qt::viewer::qgl::QtGLViewer::init | ( | void | ) | [protected] |
Definition at line 246 of file QtGLViewer.cpp.
References _beginTime, _clearBuffer, sofa::gui::qt::viewer::SofaViewer::_gl_shadow, _lightModelTwoSides, _lightPosition, CreateRenderTexture(), sofa::helper::system::DataRepository, sofa::helper::system::thread::CTime::getTime(), sofa::helper::gl::Texture::init(), sofa::helper::gl::GLSLShader::InitGLSL(), resetView(), and texLogo.
| void sofa::gui::qt::viewer::qgl::QtGLViewer::InitGFX | ( | void | ) | [private] |
| void sofa::gui::qt::viewer::qgl::QtGLViewer::keyPressEvent | ( | QKeyEvent * | e | ) | [protected, virtual] |
Reimplemented from sofa::gui::qt::viewer::SofaViewer.
Definition at line 1337 of file QtGLViewer.cpp.
References sofa::gui::qt::viewer::SofaViewer::groot, sofa::gui::qt::viewer::SofaViewer::isControlPressed(), sofa::simulation::Node::propagateEvent(), and viewAll().
| void sofa::gui::qt::viewer::qgl::QtGLViewer::keyReleaseEvent | ( | QKeyEvent * | e | ) | [protected, virtual] |
Reimplemented from sofa::gui::qt::viewer::SofaViewer.
Definition at line 1382 of file QtGLViewer.cpp.
| bool sofa::gui::qt::viewer::qgl::QtGLViewer::mouseEvent | ( | QMouseEvent * | e | ) | [protected] |
Reimplemented from sofa::gui::qt::viewer::SofaViewer.
Definition at line 1406 of file QtGLViewer.cpp.
References sofa::gui::qt::viewer::SofaViewer::interactor, sofa::gui::qt::viewer::SofaViewer::moveLaparoscopic(), and sofa::component::collision::RayPickInteractor::newEvent().
Referenced by mouseMoveEvent(), mousePressEvent(), and mouseReleaseEvent().
| void sofa::gui::qt::viewer::qgl::QtGLViewer::mouseMoveEvent | ( | QMouseEvent * | e | ) | [protected, virtual] |
| void sofa::gui::qt::viewer::qgl::QtGLViewer::mousePressEvent | ( | QMouseEvent * | e | ) | [protected, virtual] |
| void sofa::gui::qt::viewer::qgl::QtGLViewer::mouseReleaseEvent | ( | QMouseEvent * | e | ) | [protected, virtual] |
| void sofa::gui::qt::viewer::qgl::QtGLViewer::moveRayPickInteractor | ( | int | eventX, | |
| int | eventY | |||
| ) | [virtual] |
Reimplemented from sofa::gui::qt::viewer::SofaViewer.
Definition at line 1434 of file QtGLViewer.cpp.
References sofa::helper::Quater< Real >::fromMatrix(), sofa::defaulttype::Mat< L, C, real >::identity(), sofa::gui::qt::viewer::SofaViewer::interactor, lastModelviewMatrix, lastProjectionMatrix, lastViewport, sofa::component::collision::RayPickInteractor::newPosition(), and sofa::defaulttype::Vec< N, real >::normalize().
| void sofa::gui::qt::viewer::qgl::QtGLViewer::PrintString | ( | void * | font, | |
| char * | string | |||
| ) | [private] |
Definition at line 606 of file QtGLViewer.cpp.
| bool sofa::gui::qt::viewer::qgl::QtGLViewer::ready | ( | ) | [inline, virtual] |
Reimplemented from sofa::gui::qt::viewer::SofaViewer.
Definition at line 158 of file QtGLViewer.h.
References _waitForRender.
| void sofa::gui::qt::viewer::qgl::QtGLViewer::redrawn | ( | ) | [virtual, signal] |
| void sofa::gui::qt::viewer::qgl::QtGLViewer::resetView | ( | ) | [virtual, slot] |
Implements sofa::gui::qt::viewer::SofaViewer.
Definition at line 1471 of file QtGLViewer.cpp.
References sofa::helper::Quater< Real >::normalize(), sofa::gui::qt::viewer::SofaViewer::sceneFileName, and viewAll().
Referenced by init().
Definition at line 1265 of file QtGLViewer.cpp.
References _H, _W, resizeH(), and resizeW().
Referenced by setSizeH(), and setSizeW().
| void sofa::gui::qt::viewer::qgl::QtGLViewer::resizeH | ( | int | ) | [virtual, signal] |
| void sofa::gui::qt::viewer::qgl::QtGLViewer::resizeW | ( | int | ) | [virtual, signal] |
| void sofa::gui::qt::viewer::qgl::QtGLViewer::saveView | ( | ) | [virtual, slot] |
Implements sofa::gui::qt::viewer::SofaViewer.
Definition at line 1508 of file QtGLViewer.cpp.
References sofa::gui::qt::viewer::SofaViewer::sceneFileName.
| void sofa::gui::qt::viewer::qgl::QtGLViewer::setSizeH | ( | int | size | ) | [virtual, slot] |
Implements sofa::gui::qt::viewer::SofaViewer.
Definition at line 1531 of file QtGLViewer.cpp.
References _W, and resizeGL().
| void sofa::gui::qt::viewer::qgl::QtGLViewer::setSizeW | ( | int | size | ) | [virtual, slot] |
Implements sofa::gui::qt::viewer::SofaViewer.
Definition at line 1525 of file QtGLViewer.cpp.
References _H, and resizeGL().
| void sofa::gui::qt::viewer::qgl::QtGLViewer::StoreLightMatrices | ( | ) | [protected] |
Definition at line 420 of file QtGLViewer.cpp.
References _lightPosition, sofa::defaulttype::Vec< N, real >::cross(), lastProjectionMatrix, and sofa::defaulttype::Vec< N, real >::normalize().
Referenced by DrawScene().
| void sofa::gui::qt::viewer::qgl::QtGLViewer::UpdateOBJ | ( | void | ) |
| void sofa::gui::qt::viewer::qgl::QtGLViewer::viewAll | ( | ) | [protected] |
Definition at line 1245 of file QtGLViewer.cpp.
References sofa::simulation::tree::Simulation::computeBBox(), sofa::simulation::tree::getSimulation(), sofa::gui::qt::viewer::SofaViewer::groot, sofa::gui::qt::viewer::SofaViewer::sceneBBoxIsValid, sceneMaxBBox, and sceneMinBBox.
Referenced by keyPressEvent(), and resetView().
| void sofa::gui::qt::viewer::qgl::QtGLViewer::wait | ( | ) | [inline, virtual] |
Reimplemented from sofa::gui::qt::viewer::SofaViewer.
Definition at line 159 of file QtGLViewer.h.
References _waitForRender.
| void sofa::gui::qt::viewer::qgl::QtGLViewer::wheelEvent | ( | QWheelEvent * | e | ) | [protected, virtual] |
Definition at line 1426 of file QtGLViewer.cpp.
References sofa::gui::qt::viewer::SofaViewer::moveLaparoscopic().
GLUquadricObj* sofa::gui::qt::viewer::qgl::QtGLViewer::_arrow [private] |
ctime_t sofa::gui::qt::viewer::qgl::QtGLViewer::_beginTime [private] |
GLUquadricObj* sofa::gui::qt::viewer::qgl::QtGLViewer::_disk [private] |
GLboolean sofa::gui::qt::viewer::qgl::QtGLViewer::_facetNormal [private] |
Definition at line 79 of file QtGLViewer.h.
Referenced by DisplayMenu(), DrawLogo(), GetHeight(), resizeGL(), and setSizeW().
float sofa::gui::qt::viewer::qgl::QtGLViewer::_lightPosition[4] [private] |
Definition at line 82 of file QtGLViewer.h.
Referenced by DrawScene(), init(), and StoreLightMatrices().
GLuint sofa::gui::qt::viewer::qgl::QtGLViewer::_materialMode [private] |
GLuint sofa::gui::qt::viewer::qgl::QtGLViewer::_numOBJmodels [private] |
GLUquadricObj* sofa::gui::qt::viewer::qgl::QtGLViewer::_sphere [private] |
GLUquadricObj* sofa::gui::qt::viewer::qgl::QtGLViewer::_tube [private] |
Definition at line 79 of file QtGLViewer.h.
Referenced by DisplayMenu(), DrawLogo(), GetWidth(), resizeGL(), and setSizeH().
double sofa::gui::qt::viewer::qgl::QtGLViewer::lastModelviewMatrix[16] [private] |
Definition at line 86 of file QtGLViewer.h.
Referenced by ApplyShadowMap(), DrawScene(), and moveRayPickInteractor().
double sofa::gui::qt::viewer::qgl::QtGLViewer::lastProjectionMatrix[16] [private] |
Definition at line 85 of file QtGLViewer.h.
Referenced by DrawScene(), moveRayPickInteractor(), and StoreLightMatrices().
GLint sofa::gui::qt::viewer::qgl::QtGLViewer::lastViewport[4] [private] |
Vector3 sofa::gui::qt::viewer::qgl::QtGLViewer::sceneMaxBBox [private] |
Vector3 sofa::gui::qt::viewer::qgl::QtGLViewer::sceneMinBBox [private] |
QTimer* sofa::gui::qt::viewer::qgl::QtGLViewer::timerAnimate [private] |
1.5.7.1