sofa::gui::qt::viewer::qgl::QtGLViewer Class Reference

#include <QtGLViewer.h>

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

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

Collaboration graph
[legend]

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

Detailed Description

Definition at line 72 of file QtGLViewer.h.


Member Typedef Documentation

Definition at line 74 of file QtGLViewer.h.


Constructor & Destructor Documentation

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

sofa::gui::qt::viewer::qgl::QtGLViewer::~QtGLViewer (  ) 

Definition at line 238 of file QtGLViewer.cpp.


Member Function Documentation

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]

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

Definition at line 516 of file QtGLViewer.cpp.

Referenced by init().

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]

Definition at line 1000 of file QtGLViewer.cpp.

References _H, and _W.

Referenced by DrawScene().

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

void sofa::gui::qt::viewer::qgl::QtGLViewer::draw (  )  [protected, virtual]

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

Definition at line 637 of file QtGLViewer.cpp.

References _arrow, and _tube.

Referenced by DisplayOBJs().

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]

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

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]

Definition at line 154 of file QtGLViewer.h.

References _H.

Referenced by DrawScene().

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

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

Definition at line 132 of file QtGLViewer.h.

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

Definition at line 150 of file QtGLViewer.h.

References _W.

Referenced by DrawScene().

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

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

Definition at line 1539 of file QtGLViewer.cpp.

void sofa::gui::qt::viewer::qgl::QtGLViewer::init ( void   )  [protected]

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

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

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]

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

Definition at line 1400 of file QtGLViewer.cpp.

References mouseEvent().

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

Definition at line 1388 of file QtGLViewer.cpp.

References mouseEvent().

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

Definition at line 1394 of file QtGLViewer.cpp.

References mouseEvent().

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

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]

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

Referenced by draw().

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

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

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]

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

Referenced by resizeGL().

void sofa::gui::qt::viewer::qgl::QtGLViewer::resizeW ( int   )  [virtual, signal]

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

Referenced by resizeGL().

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

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]

void sofa::gui::qt::viewer::qgl::QtGLViewer::UpdateOBJ ( void   ) 

void sofa::gui::qt::viewer::qgl::QtGLViewer::viewAll (  )  [protected]

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]


Field Documentation

Definition at line 95 of file QtGLViewer.h.

Referenced by DrawAxis(), and QtGLViewer().

Definition at line 108 of file QtGLViewer.h.

Referenced by init().

Definition at line 80 of file QtGLViewer.h.

Referenced by draw(), and init().

Definition at line 98 of file QtGLViewer.h.

Referenced by QtGLViewer().

Definition at line 101 of file QtGLViewer.h.

Referenced by QtGLViewer().

Definition at line 79 of file QtGLViewer.h.

Referenced by DisplayMenu(), DrawLogo(), GetHeight(), resizeGL(), and setSizeW().

Definition at line 81 of file QtGLViewer.h.

Referenced by init().

Definition at line 82 of file QtGLViewer.h.

Referenced by DrawScene(), init(), and StoreLightMatrices().

Definition at line 100 of file QtGLViewer.h.

Referenced by QtGLViewer().

Definition at line 99 of file QtGLViewer.h.

Referenced by QtGLViewer().

Definition at line 103 of file QtGLViewer.h.

Referenced by DrawScene(), and QtGLViewer().

Definition at line 97 of file QtGLViewer.h.

Referenced by DrawBox(), and QtGLViewer().

Definition at line 96 of file QtGLViewer.h.

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

Definition at line 79 of file QtGLViewer.h.

Referenced by DisplayMenu(), DrawLogo(), GetWidth(), resizeGL(), and setSizeH().

Definition at line 111 of file QtGLViewer.h.

Referenced by draw(), ready(), and wait().

Definition at line 86 of file QtGLViewer.h.

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

Definition at line 85 of file QtGLViewer.h.

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

Definition at line 87 of file QtGLViewer.h.

Referenced by DrawScene(), and moveRayPickInteractor().

Definition at line 115 of file QtGLViewer.h.

Referenced by DisplayOBJs(), and viewAll().

Definition at line 114 of file QtGLViewer.h.

Referenced by DisplayOBJs(), and viewAll().

Definition at line 105 of file QtGLViewer.h.

Referenced by DrawLogo(), init(), and QtGLViewer().

Definition at line 78 of file QtGLViewer.h.

Referenced by QtGLViewer().


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

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