00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00069 #ifndef __vtkRenderWindow_h
00070 #define __vtkRenderWindow_h
00071
00072 #include "vtkWindow.h"
00073 #include "vtkRendererCollection.h"
00074 #include <stdio.h>
00075 #include "vtkGraphicsFactory.h"
00076
00077 class vtkRenderWindowInteractor;
00078
00079
00080
00081
00082 #define VTK_STEREO_CRYSTAL_EYES 1
00083 #define VTK_STEREO_RED_BLUE 2
00084 #define VTK_STEREO_INTERLACED 3
00085 #define VTK_STEREO_LEFT 4
00086 #define VTK_STEREO_RIGHT 5
00087 #define VTK_STEREO_DRESDEN 6
00088
00089 class VTK_RENDERING_EXPORT vtkRenderWindow : public vtkWindow
00090 {
00091 public:
00092 vtkTypeMacro(vtkRenderWindow,vtkWindow);
00093 void PrintSelf(ostream& os, vtkIndent indent);
00094
00098 static vtkRenderWindow *New();
00099
00101 void AddRenderer(vtkRenderer *);
00102
00104 void RemoveRenderer(vtkRenderer *);
00105
00107
00108 static const char *GetRenderLibrary() {
00109 return vtkGraphicsFactory::GetRenderLibrary();};
00111
00113 vtkRendererCollection *GetRenderers() {return this->Renderers;};
00114
00117 virtual void Render();
00118
00120 virtual void Start() {};
00121
00124 virtual void Frame() {};
00125
00128 virtual void CopyResultFrame();
00129
00133 virtual vtkRenderWindowInteractor *MakeRenderWindowInteractor();
00134
00136
00138 virtual void HideCursor() {};
00139 virtual void ShowCursor() {};
00141
00143
00144 virtual void SetFullScreen(int) {};
00145 vtkGetMacro(FullScreen,int);
00146 vtkBooleanMacro(FullScreen,int);
00148
00150
00153 vtkSetMacro(Borders,int);
00154 vtkGetMacro(Borders,int);
00155 vtkBooleanMacro(Borders,int);
00157
00159
00161 vtkGetMacro(StereoCapableWindow,int);
00162 vtkBooleanMacro(StereoCapableWindow,int);
00163 virtual void SetStereoCapableWindow(int capable);
00165
00167
00168 vtkGetMacro(StereoRender,int);
00169 void SetStereoRender(int stereo);
00170 vtkBooleanMacro(StereoRender,int);
00172
00174
00176 vtkSetMacro(PointSmoothing,int);
00177 vtkGetMacro(PointSmoothing,int);
00178 vtkBooleanMacro(PointSmoothing,int);
00180
00182
00184 vtkSetMacro(LineSmoothing,int);
00185 vtkGetMacro(LineSmoothing,int);
00186 vtkBooleanMacro(LineSmoothing,int);
00188
00190
00192 vtkSetMacro(PolygonSmoothing,int);
00193 vtkGetMacro(PolygonSmoothing,int);
00194 vtkBooleanMacro(PolygonSmoothing,int);
00196
00198
00199 vtkGetMacro(StereoType,int);
00200 vtkSetMacro(StereoType,int);
00201 void SetStereoTypeToCrystalEyes()
00202 {this->SetStereoType(VTK_STEREO_CRYSTAL_EYES);};
00203 void SetStereoTypeToRedBlue()
00204 {this->SetStereoType(VTK_STEREO_RED_BLUE);};
00205 void SetStereoTypeToInterlaced()
00206 {this->SetStereoType(VTK_STEREO_INTERLACED);};
00207 void SetStereoTypeToLeft()
00208 {this->SetStereoType(VTK_STEREO_LEFT);};
00209 void SetStereoTypeToRight()
00210 {this->SetStereoType(VTK_STEREO_RIGHT);};
00211 void SetStereoTypeToDresden()
00212 {this->SetStereoType(VTK_STEREO_DRESDEN);};
00213 char *GetStereoTypeAsString();
00215
00219 virtual void StereoUpdate();
00220
00223 virtual void StereoMidpoint();
00224
00227 virtual void StereoRenderComplete();
00228
00232 virtual void WindowRemap() {};
00233
00235
00236 vtkSetMacro(SwapBuffers,int);
00237 vtkGetMacro(SwapBuffers,int);
00238 vtkBooleanMacro(SwapBuffers,int);
00240
00249 virtual void SetPixelData(int, int, int, int, unsigned char *,int) {};
00250
00252
00257 virtual float *GetRGBAPixelData(int ,int ,int ,int ,int ) {
00258 return (float *)NULL;};
00259 virtual void SetRGBAPixelData(int ,int ,int ,int ,float *,int,
00260 int blend=0) { blend = blend;}
00261 virtual unsigned char *GetRGBACharPixelData(int ,int ,int ,int ,int ) {
00262 return (unsigned char*)NULL;}
00263 virtual void SetRGBACharPixelData(int ,int ,int ,int ,unsigned char *, int,
00264 int blend=0) { blend = blend;}
00266
00267
00269
00270 virtual float *GetZbufferData(int, int, int, int ) {return (float *)NULL;};
00271 virtual void SetZbufferData(int, int, int, int, float *) {};
00273
00275
00278 vtkGetMacro(AAFrames,int);
00279 vtkSetMacro(AAFrames,int);
00281
00283
00288 vtkGetMacro(FDFrames,int);
00289 vtkSetMacro(FDFrames,int);
00291
00293
00298 vtkGetMacro(SubFrames,int);
00299 vtkSetMacro(SubFrames,int);
00301
00303
00304 vtkGetMacro(NeverRendered,int);
00306
00308
00310 vtkGetMacro(AbortRender,int);
00311 vtkSetMacro(AbortRender,int);
00312 vtkGetMacro(InAbortCheck,int);
00313 vtkSetMacro(InAbortCheck,int);
00314 virtual int CheckAbortStatus();
00315 virtual int GetEventPending() { return 0;};
00317
00320 void SetAbortCheckMethod(void (*f)(void *), void *arg);
00321
00323 void SetAbortCheckMethodArgDelete(void (*f)(void *));
00324
00326
00331 void SetDesiredUpdateRate(float);
00332 vtkGetMacro(DesiredUpdateRate,float);
00334
00336
00340 vtkGetMacro(NumberOfLayers, int);
00341 vtkSetClampMacro(NumberOfLayers, int, 1, VTK_LARGE_INTEGER);
00343
00345
00346 vtkGetObjectMacro(Interactor,vtkRenderWindowInteractor);
00347 void SetInteractor(vtkRenderWindowInteractor *);
00349
00352 void UnRegister(vtkObject *o);
00353
00355
00356 virtual void SetDisplayId(void *) {}
00357 virtual void SetWindowId(void *) {}
00358 virtual void SetParentId(void *) {}
00359 virtual void *GetGenericDisplayId() {return NULL;}
00360 virtual void *GetGenericWindowId() {return NULL;}
00361 virtual void *GetGenericParentId() {return NULL;}
00362 virtual void *GetGenericContext() {return NULL;}
00363 virtual void *GetGenericDrawable() {return NULL;}
00364 virtual void SetWindowInfo(char *) {}
00365 virtual void SetParentInfo(char *) {};
00367
00369 virtual void MakeCurrent() {};
00370
00373 virtual int GetDepthBufferSize() {return -1;}
00374
00375 protected:
00376 vtkRenderWindow();
00377 ~vtkRenderWindow();
00378
00379 virtual void DoStereoRender();
00380 virtual void DoFDRender();
00381 virtual void DoAARender();
00382
00383 vtkRendererCollection *Renderers;
00384 int Borders;
00385 int FullScreen;
00386 int OldScreen[5];
00387 int PointSmoothing;
00388 int LineSmoothing;
00389 int PolygonSmoothing;
00390 int StereoRender;
00391 int StereoType;
00392 int StereoStatus;
00393 int StereoCapableWindow;
00394 vtkRenderWindowInteractor *Interactor;
00395 unsigned char* StereoBuffer;
00396 float *AccumulationBuffer;
00397 unsigned int AccumulationBufferSize;
00398 int AAFrames;
00399 int FDFrames;
00400 int SubFrames;
00401 int CurrentSubFrame;
00402 unsigned char *ResultFrame;
00403 int SwapBuffers;
00404 float DesiredUpdateRate;
00405 int AbortRender;
00406 int InAbortCheck;
00407 int InRender;
00408 int NeverRendered;
00409 int NumberOfLayers;
00410 void (*AbortCheckMethod)(void *);
00411 void (*AbortCheckMethodArgDelete)(void *);
00412 void *AbortCheckMethodArg;
00413 private:
00414 vtkRenderWindow(const vtkRenderWindow&);
00415 void operator=(const vtkRenderWindow&);
00416 };
00417
00419 inline char *vtkRenderWindow::GetStereoTypeAsString(void)
00420 {
00421 switch ( this->StereoType )
00422 {
00423 case VTK_STEREO_CRYSTAL_EYES:
00424 return (char *)"CrystalEyes";
00425 case VTK_STEREO_RED_BLUE:
00426 return (char *)"RedBlue";
00427 case VTK_STEREO_LEFT:
00428 return (char *)"Left";
00429 case VTK_STEREO_RIGHT:
00430 return (char *)"Right";
00431 case VTK_STEREO_DRESDEN:
00432 return (char *)"DresdenDisplay";
00433 default:
00434 return (char *)"";
00435 }
00436 }
00437
00438 #endif
00439
00440