#include <renderwindow.h>
Inheritance diagram for RenderWindow:
Public Member Functions | |
RenderWindow (QGLFormat glf, QWidget *parent=0, const char *name=0) | |
Constructs a new RenderWindow. | |
RenderWindow (QWidget *parent=0, const char *name=0) | |
Constructs a new RenderWindow. | |
~RenderWindow () | |
Destructs the RenderWindow. | |
vtkRenderer * | GetRenderer () |
returns the vtkRenderer used | |
vtkRenderWindow * | GetRenderWindow () |
returns the vtkRenderWindow used | |
Protected Member Functions | |
virtual void | paintGL () |
Render the scene. | |
virtual void | initializeGL () |
Initialize the OpenGL Window. | |
virtual void | resizeGL (int w, int h) |
Resize the OpenGL Window. | |
Private Member Functions | |
void | InitRenderWindow () |
Initialize the RenderWindow. | |
Private Attributes | |
bool | initNeeded |
vtkRenderer * | renderer |
vtkRenderWindow * | renderWindow |
vtkLight * | light |
This class combines the great GUI toolkit qt (www.troll.no) with the great visualization toolkit vtk (www.kitware.com/vtk).
$Log: renderwindow.cpp,v $ Revision 1.3 2000/09/14 14:56:10 jstifter Changes proposed from Kent Vander Velden <graphix@iastate.edu> CameraRotate, CameraTranslate, CameraZoom problems fixed (mostly due to incorrect clipping) Revision 1.2 2000/09/14 13:25:43 jstifter Added Support for *parent, *name in the constructors Revision 1.1.1.1 2000/08/15 09:36:39 jstifter first cvs import
Definition at line 14 of file renderwindow.h.
|
Constructs a new RenderWindow. The new RenderWindow has a vtkRenderWindow, a vtkRenderer and a vtkLight initialized
Definition at line 48 of file renderwindow.cpp. References InitRenderWindow().
00049 : QGLWidget(glf, parent, name) { 00050 this->InitRenderWindow(); 00051 } |
Here is the call graph for this function:
|
Constructs a new RenderWindow. The new RenderWindow has a vtkRenderWindow, a vtkRenderer and a vtkLight initialized
Definition at line 62 of file renderwindow.cpp. References InitRenderWindow().
00063 : QGLWidget(parent, name) { 00064 this->InitRenderWindow(); 00065 } |
Here is the call graph for this function:
|
Destructs the RenderWindow.
Definition at line 93 of file renderwindow.cpp. References renderer, and renderWindow.
00093 { 00094 this->renderer->Delete(); 00095 this->renderWindow->Delete(); 00096 } |
|
returns the vtkRenderer used
Definition at line 101 of file renderwindow.cpp. References renderer. Referenced by RenderWindowInteractor::ActorPlaneRoll(), RenderWindowInteractor::ActorRoll(), RenderWindowInteractor::ActorRotate(), RenderWindowInteractor::CameraRoll(), RenderWindowInteractor::CameraRotate(), RenderWindowInteractor::CameraZoom(), RenderWindowInteractor::DisplayToWorld(), RenderWindowInteractor::InitRenderWindowInteractor(), MainWindow::newSubdivision(), and RenderWindowInteractor::WorldToDisplay().
00101 { 00102 return this->renderer; 00103 } |
|
returns the vtkRenderWindow used
Definition at line 108 of file renderwindow.cpp. References renderWindow. Referenced by RenderWindowInteractor::ActorRotate(), and RenderWindowInteractor::CameraRotate().
00108 { 00109 return this->renderWindow; 00110 } |
|
Initialize the OpenGL Window.
Definition at line 115 of file renderwindow.cpp.
00115 { 00116 glClearColor(1.0, 1.0, 1.0, 1.0); 00117 glColor3f(1.0, 0.0, 0.0); 00118 } |
|
Initialize the RenderWindow. This method is called from the two Constructors Definition at line 72 of file renderwindow.cpp. References initNeeded, light, renderer, and renderWindow. Referenced by RenderWindow().
00072 { 00073 this->initNeeded = true; 00074 this->renderWindow = vtkRenderWindow::New(); 00075 this->renderer = vtkRenderer::New(); 00076 this->renderWindow->AddRenderer( this->renderer ); 00077 this->light = vtkLight::New(); 00078 this->renderer->AddLight( this->light ); 00079 // just enable one double buffering 00080 // by default, we use the one of vtk 00081 #ifdef QT_DOUBLEBUFFER 00082 // use the double buffering of QT 00083 this->renderWindow->SetSwapBuffers(0); 00084 #else 00085 // use the double buffering of vtk 00086 this->setAutoBufferSwap( false ); 00087 #endif 00088 } |
|
Render the scene.
Definition at line 135 of file renderwindow.cpp. References initNeeded, and renderWindow.
00136 { 00137 // Get the native window ID and pass it 00138 // to the VTK render window 00139 // before we render for the first time... 00140 if (this->initNeeded) { 00141 WId nId = winId(); 00142 this->renderWindow->SetWindowId( (void*) nId ); 00143 this->initNeeded = false; 00144 } 00145 else { 00146 this->renderWindow->Render(); 00147 } 00148 } |
|
Resize the OpenGL Window.
Definition at line 123 of file renderwindow.cpp.
00123 { 00124 glMatrixMode( GL_PROJECTION ); 00125 glLoadIdentity(); 00126 gluOrtho2D( 0.0, w, 0.0, h ); 00127 glMatrixMode( GL_MODELVIEW ); 00128 00129 updateGL(); 00130 } |
|
Definition at line 34 of file renderwindow.h. Referenced by InitRenderWindow(), and paintGL(). |
|
Definition at line 37 of file renderwindow.h. Referenced by InitRenderWindow(). |
|
Definition at line 35 of file renderwindow.h. Referenced by GetRenderer(), InitRenderWindow(), and ~RenderWindow(). |
|
Definition at line 36 of file renderwindow.h. Referenced by GetRenderWindow(), InitRenderWindow(), paintGL(), and ~RenderWindow(). |