sofa::gui::qt::viewer::qt::QtViewer Class Reference

#include <QtViewer.h>

Inheritance diagram for sofa::gui::qt::viewer::qt::QtViewer:

Inheritance graph
[legend]
Collaboration diagram for sofa::gui::qt::viewer::qt::QtViewer:

Collaboration graph
[legend]

Public Slots

void resetView ()
virtual void saveView ()
virtual void setSizeW (int)
virtual void setSizeH (int)

Signals

void redrawn ()
void resizeW (int)
void resizeH (int)

Public Member Functions

 QtViewer (QWidget *parent, const char *name="")
 ~QtViewer ()
QWidget * getQWidget ()
bool ready ()
void wait ()
void setScene (sofa::simulation::tree::GNode *scene, const char *filename=NULL, bool keepParams=false)
sofa::simulation::tree::GNode * getScene ()
int GetWidth ()
int GetHeight ()
void UpdateOBJ (void)
void moveRayPickInteractor (int eventX, int eventY)
void ApplyMouseInteractorTransformation (int x, int y)
QString helpString ()

Static Public Member Functions

static int EnableViewer ()
 Activate this class of viewer.
static int DisableViewer ()
 Disable this class of viewer.

Data Fields

bool _mouseInteractorTranslationMode
bool _mouseInteractorRotationMode
int _translationMode
Quaternion _mouseInteractorCurrentQuat
Vector3 _mouseInteractorAbsolutePosition
Trackball _mouseInteractorTrackball

Static Public Attributes

static Quaternion _mouseInteractorNewQuat
static Vector3 _mouseInteractorRelativePosition
static Quaternion _newQuat
static Quaternion _currentQuat
static bool _mouseTrans = false
static bool _mouseRotate = false

Protected Member Functions

void calcProjection ()
void initializeGL ()
void paintGL ()
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)
virtual void mouseEvent (QMouseEvent *e)

Private Types

enum  { TRACKBALL_MODE = 1, PAN_MODE = 2, ZOOM_MODE = 3 }
enum  { XY_TRANSLATION = 1, Z_TRANSLATION = 2 }
enum  { MINMOVE = 10 }

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 (SReal *minBBox, SReal *maxBBox, SReal 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 ()
void ApplySceneTransformation (int x, int y)

Private Attributes

QTimer * timerAnimate
int _W
int _H
int _clearBuffer
bool _lightModelTwoSides
float _lightPosition [4]
Trackball _currentTrackball
Trackball _newTrackball
int _mouseX
int _mouseY
int _savedMouseX
int _savedMouseY
bool _spinning
bool _moving
float _zoomSpeed
float _panSpeed
Transformation _sceneTransform
Vector3 _previousEyePos
GLUquadricObj * _arrow
GLUquadricObj * _tube
GLUquadricObj * _sphere
GLUquadricObj * _disk
GLuint _numOBJmodels
GLuint _materialMode
GLboolean _facetNormal
float _zoom
int _renderingMode
bool _waitForRender
Texture * texLogo
ctime_t _beginTime
double lastProjectionMatrix [16]
double lastModelviewMatrix [16]
GLint lastViewport [4]
Vector3 sceneMinBBox
Vector3 sceneMaxBBox

Detailed Description

Definition at line 73 of file QtViewer.h.


Member Enumeration Documentation

anonymous enum [private]

Enumerator:
TRACKBALL_MODE 
PAN_MODE 
ZOOM_MODE 

Definition at line 79 of file QtViewer.h.

anonymous enum [private]

Enumerator:
XY_TRANSLATION 
Z_TRANSLATION 

Definition at line 85 of file QtViewer.h.

anonymous enum [private]

Enumerator:
MINMOVE 

Definition at line 90 of file QtViewer.h.


Constructor & Destructor Documentation

sofa::gui::qt::viewer::qt::QtViewer::QtViewer ( QWidget *  parent,
const char *  name = "" 
)

sofa::gui::qt::viewer::qt::QtViewer::~QtViewer (  ) 

Definition at line 249 of file QtViewer.cpp.


Member Function Documentation

void sofa::gui::qt::viewer::qt::QtViewer::ApplyMouseInteractorTransformation ( int  x,
int  y 
)

void sofa::gui::qt::viewer::qt::QtViewer::ApplySceneTransformation ( int  x,
int  y 
) [private]

void sofa::gui::qt::viewer::qt::QtViewer::ApplyShadowMap (  )  [protected]

void sofa::gui::qt::viewer::qt::QtViewer::calcProjection (  )  [protected]

void sofa::gui::qt::viewer::qt::QtViewer::CreateOBJmodelDisplayList ( int  material_mode  )  [private]

void sofa::gui::qt::viewer::qt::QtViewer::CreateRenderTexture ( GLuint &  textureID,
int  sizeX,
int  sizeY,
int  channels,
int  type 
) [protected]

Definition at line 492 of file QtViewer.cpp.

Referenced by initializeGL().

int sofa::gui::qt::viewer::qt::QtViewer::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 154 of file QtViewer.cpp.

References sofa::gui::qt::viewer::qt::classVisualModel, sofa::gui::qt::viewer::qt::enabled, and sofa::core::ObjectFactory::ResetAlias().

Referenced by sofa::gui::qt::RealGUI::setViewer().

void sofa::gui::qt::viewer::qt::QtViewer::Display3DText ( float  x,
float  y,
float  z,
char *  string 
) [private]

Definition at line 600 of file QtViewer.cpp.

void sofa::gui::qt::viewer::qt::QtViewer::DisplayMenu ( void   )  [private]

Definition at line 978 of file QtViewer.cpp.

References _H, and _W.

Referenced by DrawScene().

void sofa::gui::qt::viewer::qt::QtViewer::DisplayOBJs ( bool  shadowPass = false  )  [private]

void sofa::gui::qt::viewer::qt::QtViewer::DrawAxis ( double  xpos,
double  ypos,
double  zpos,
double  arrowSize 
) [private]

Definition at line 617 of file QtViewer.cpp.

References _arrow, and _tube.

Referenced by DisplayOBJs().

void sofa::gui::qt::viewer::qt::QtViewer::DrawBox ( SReal *  minBBox,
SReal *  maxBBox,
SReal  r = 0.0 
) [private]

Definition at line 700 of file QtViewer.cpp.

References _sphere, _tube, and norm().

Referenced by DisplayOBJs().

void sofa::gui::qt::viewer::qt::QtViewer::DrawLogo ( void   )  [private]

void sofa::gui::qt::viewer::qt::QtViewer::DrawScene ( void   )  [private]

void sofa::gui::qt::viewer::qt::QtViewer::DrawXYPlane ( double  zo,
double  xmin,
double  xmax,
double  ymin,
double  ymax,
double  step 
) [private]

Definition at line 805 of file QtViewer.cpp.

void sofa::gui::qt::viewer::qt::QtViewer::DrawXZPlane ( double  yo,
double  xmin,
double  xmax,
double  zmin,
double  zmax,
double  step 
) [private]

Definition at line 863 of file QtViewer.cpp.

void sofa::gui::qt::viewer::qt::QtViewer::DrawYZPlane ( double  xo,
double  ymin,
double  ymax,
double  zmin,
double  zmax,
double  step 
) [private]

Definition at line 834 of file QtViewer.cpp.

int sofa::gui::qt::viewer::qt::QtViewer::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 140 of file QtViewer.cpp.

References sofa::core::ObjectFactory::AddAlias(), sofa::gui::qt::viewer::qt::classVisualModel, and sofa::gui::qt::viewer::qt::enabled.

Referenced by sofa::gui::qt::RealGUI::InitGUI(), and sofa::gui::qt::RealGUI::setViewer().

int sofa::gui::qt::viewer::qt::QtViewer::GetHeight (  )  [inline]

Definition at line 192 of file QtViewer.h.

References _H.

Referenced by DrawScene().

QWidget* sofa::gui::qt::viewer::qt::QtViewer::getQWidget (  )  [inline, virtual]

Implements sofa::gui::qt::viewer::SofaViewer.

Definition at line 151 of file QtViewer.h.

sofa::simulation::tree::GNode* sofa::gui::qt::viewer::qt::QtViewer::getScene (  )  [inline, virtual]

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

Definition at line 181 of file QtViewer.h.

References sofa::gui::qt::viewer::SofaViewer::groot.

int sofa::gui::qt::viewer::qt::QtViewer::GetWidth (  )  [inline]

Definition at line 188 of file QtViewer.h.

References _W.

Referenced by DrawScene().

QString sofa::gui::qt::viewer::qt::QtViewer::helpString (  )  [virtual]

Implements sofa::gui::qt::viewer::SofaViewer.

Definition at line 2087 of file QtViewer.cpp.

void sofa::gui::qt::viewer::qt::QtViewer::InitGFX ( void   )  [private]

void sofa::gui::qt::viewer::qt::QtViewer::initializeGL ( void   )  [protected]

void sofa::gui::qt::viewer::qt::QtViewer::keyPressEvent ( QKeyEvent *  e  )  [protected, virtual]

void sofa::gui::qt::viewer::qt::QtViewer::keyReleaseEvent ( QKeyEvent *  e  )  [protected, virtual]

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

Definition at line 1618 of file QtViewer.cpp.

void sofa::gui::qt::viewer::qt::QtViewer::mouseEvent ( QMouseEvent *  e  )  [protected, virtual]

void sofa::gui::qt::viewer::qt::QtViewer::mouseMoveEvent ( QMouseEvent *  e  )  [protected, virtual]

Definition at line 1657 of file QtViewer.cpp.

References mouseEvent().

void sofa::gui::qt::viewer::qt::QtViewer::mousePressEvent ( QMouseEvent *  e  )  [protected, virtual]

Definition at line 1647 of file QtViewer.cpp.

References mouseEvent().

void sofa::gui::qt::viewer::qt::QtViewer::mouseReleaseEvent ( QMouseEvent *  e  )  [protected, virtual]

Definition at line 1652 of file QtViewer.cpp.

References mouseEvent().

void sofa::gui::qt::viewer::qt::QtViewer::moveRayPickInteractor ( int  eventX,
int  eventY 
) [virtual]

void sofa::gui::qt::viewer::qt::QtViewer::paintGL (  )  [protected]

void sofa::gui::qt::viewer::qt::QtViewer::PrintString ( void *  font,
char *  string 
) [private]

Definition at line 586 of file QtViewer.cpp.

bool sofa::gui::qt::viewer::qt::QtViewer::ready (  )  [inline, virtual]

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

Definition at line 153 of file QtViewer.h.

References _waitForRender.

void sofa::gui::qt::viewer::qt::QtViewer::redrawn (  )  [virtual, signal]

Implements sofa::gui::qt::viewer::SofaViewer.

Definition at line 92 of file moc_QtViewer.cpp.

Referenced by paintGL().

void sofa::gui::qt::viewer::qt::QtViewer::resetView (  )  [virtual, slot]

void sofa::gui::qt::viewer::qt::QtViewer::resizeGL ( int  w,
int  h 
) [protected]

Definition at line 1228 of file QtViewer.cpp.

References _H, _W, calcProjection(), resizeH(), and resizeW().

Referenced by setSizeH(), and setSizeW().

void sofa::gui::qt::viewer::qt::QtViewer::resizeH ( int  _t1  )  [virtual, signal]

Implements sofa::gui::qt::viewer::SofaViewer.

Definition at line 105 of file moc_QtViewer.cpp.

Referenced by resizeGL().

void sofa::gui::qt::viewer::qt::QtViewer::resizeW ( int  _t1  )  [virtual, signal]

Implements sofa::gui::qt::viewer::SofaViewer.

Definition at line 98 of file moc_QtViewer.cpp.

Referenced by resizeGL().

void sofa::gui::qt::viewer::qt::QtViewer::saveView (  )  [virtual, slot]

void sofa::gui::qt::viewer::qt::QtViewer::setScene ( sofa::simulation::tree::GNode *  scene,
const char *  filename = NULL,
bool  keepParams = false 
) [virtual]

void sofa::gui::qt::viewer::qt::QtViewer::setSizeH ( int  size  )  [virtual, slot]

Implements sofa::gui::qt::viewer::SofaViewer.

Definition at line 2080 of file QtViewer.cpp.

References _W, and resizeGL().

void sofa::gui::qt::viewer::qt::QtViewer::setSizeW ( int  size  )  [virtual, slot]

Implements sofa::gui::qt::viewer::SofaViewer.

Definition at line 2074 of file QtViewer.cpp.

References _H, and resizeGL().

void sofa::gui::qt::viewer::qt::QtViewer::StoreLightMatrices (  )  [protected]

void sofa::gui::qt::viewer::qt::QtViewer::UpdateOBJ ( void   ) 

void sofa::gui::qt::viewer::qt::QtViewer::wait (  )  [inline, virtual]

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

Definition at line 154 of file QtViewer.h.

References _waitForRender.

void sofa::gui::qt::viewer::qt::QtViewer::wheelEvent ( QWheelEvent *  e  )  [protected, virtual]


Field Documentation

Definition at line 112 of file QtViewer.h.

Referenced by DrawAxis(), and QtViewer().

Definition at line 129 of file QtViewer.h.

Referenced by initializeGL().

Definition at line 95 of file QtViewer.h.

Referenced by initializeGL(), and paintGL().

Definition at line 214 of file QtViewer.h.

Referenced by ApplySceneTransformation(), and mouseEvent().

Definition at line 99 of file QtViewer.h.

Referenced by ApplySceneTransformation().

Definition at line 115 of file QtViewer.h.

Referenced by QtViewer().

Definition at line 118 of file QtViewer.h.

Referenced by QtViewer().

Definition at line 96 of file QtViewer.h.

Referenced by initializeGL().

Definition at line 97 of file QtViewer.h.

Referenced by DrawScene(), initializeGL(), mouseEvent(), and StoreLightMatrices().

Definition at line 117 of file QtViewer.h.

Referenced by QtViewer().

Definition at line 207 of file QtViewer.h.

Referenced by ApplyMouseInteractorTransformation().

Definition at line 206 of file QtViewer.h.

Referenced by ApplyMouseInteractorTransformation().

Definition at line 211 of file QtViewer.h.

Referenced by ApplyMouseInteractorTransformation(), and QtViewer().

Definition at line 212 of file QtViewer.h.

Referenced by ApplyMouseInteractorTransformation().

Definition at line 208 of file QtViewer.h.

Referenced by ApplyMouseInteractorTransformation(), and QtViewer().

Definition at line 216 of file QtViewer.h.

Referenced by ApplyMouseInteractorTransformation().

Definition at line 215 of file QtViewer.h.

Referenced by ApplyMouseInteractorTransformation().

Definition at line 103 of file QtViewer.h.

Referenced by ApplySceneTransformation(), mouseEvent(), and wheelEvent().

Definition at line 103 of file QtViewer.h.

Referenced by ApplySceneTransformation(), mouseEvent(), and wheelEvent().

Definition at line 106 of file QtViewer.h.

Referenced by ApplySceneTransformation(), mouseEvent(), QtViewer(), and wheelEvent().

Definition at line 100 of file QtViewer.h.

Referenced by mouseEvent(), and QtViewer().

Definition at line 116 of file QtViewer.h.

Referenced by QtViewer().

Definition at line 109 of file QtViewer.h.

Referenced by ApplySceneTransformation(), calcProjection(), QtViewer(), and setScene().

Definition at line 111 of file QtViewer.h.

Referenced by ApplySceneTransformation(), mouseEvent(), QtViewer(), and wheelEvent().

Definition at line 120 of file QtViewer.h.

Referenced by DrawScene(), and QtViewer().

Definition at line 104 of file QtViewer.h.

Referenced by ApplySceneTransformation(), and mouseEvent().

Definition at line 104 of file QtViewer.h.

Referenced by ApplySceneTransformation(), and mouseEvent().

Definition at line 114 of file QtViewer.h.

Referenced by DrawBox(), and QtViewer().

Definition at line 105 of file QtViewer.h.

Referenced by mouseEvent(), QtViewer(), and wheelEvent().

Definition at line 205 of file QtViewer.h.

Referenced by ApplyMouseInteractorTransformation(), and mouseEvent().

Definition at line 113 of file QtViewer.h.

Referenced by DrawAxis(), DrawBox(), and QtViewer().

Definition at line 122 of file QtViewer.h.

Referenced by paintGL(), QtViewer(), ready(), and wait().

Definition at line 119 of file QtViewer.h.

Referenced by QtViewer().

Definition at line 108 of file QtViewer.h.

Referenced by ApplySceneTransformation(), calcProjection(), QtViewer(), and setScene().

Definition at line 132 of file QtViewer.h.

Referenced by ApplyShadowMap(), DrawScene(), and moveRayPickInteractor().

Definition at line 131 of file QtViewer.h.

Referenced by calcProjection(), DrawScene(), moveRayPickInteractor(), and StoreLightMatrices().

Definition at line 133 of file QtViewer.h.

Referenced by calcProjection(), and moveRayPickInteractor().

Definition at line 126 of file QtViewer.h.

Referenced by DrawLogo(), initializeGL(), and QtViewer().

Definition at line 93 of file QtViewer.h.

Referenced by mouseEvent(), and QtViewer().


The documentation for this class was generated from the following files:

Generated on Sun Nov 23 04:24:14 2008 for Sofa by  doxygen 1.5.7.1