00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00049 #ifndef __vtkRenderWindow_h
00050 #define __vtkRenderWindow_h
00051
00052 #include "vtkWindow.h"
00053
00054 class vtkFloatArray;
00055 class vtkRenderWindowInteractor;
00056 class vtkRenderer;
00057 class vtkRendererCollection;
00058 class vtkUnsignedCharArray;
00059
00060
00061 #define VTK_STEREO_CRYSTAL_EYES 1
00062 #define VTK_STEREO_RED_BLUE 2
00063 #define VTK_STEREO_INTERLACED 3
00064 #define VTK_STEREO_LEFT 4
00065 #define VTK_STEREO_RIGHT 5
00066 #define VTK_STEREO_DRESDEN 6
00067 #define VTK_STEREO_ANAGLYPH 7
00068
00069 #define VTK_CURSOR_DEFAULT 0
00070 #define VTK_CURSOR_ARROW 1
00071 #define VTK_CURSOR_SIZENE 2
00072 #define VTK_CURSOR_SIZENW 3
00073 #define VTK_CURSOR_SIZESW 4
00074 #define VTK_CURSOR_SIZESE 5
00075 #define VTK_CURSOR_SIZENS 6
00076 #define VTK_CURSOR_SIZEWE 7
00077 #define VTK_CURSOR_SIZEALL 8
00078 #define VTK_CURSOR_HAND 9
00079
00080 class VTK_RENDERING_EXPORT vtkRenderWindow : public vtkWindow
00081 {
00082 public:
00083 vtkTypeRevisionMacro(vtkRenderWindow,vtkWindow);
00084 void PrintSelf(ostream& os, vtkIndent indent);
00085
00089 static vtkRenderWindow *New();
00090
00092 virtual void AddRenderer(vtkRenderer *);
00093
00095 void RemoveRenderer(vtkRenderer *);
00096
00098 int HasRenderer(vtkRenderer *);
00099
00101 static const char *GetRenderLibrary();
00102
00104 vtkRendererCollection *GetRenderers() {return this->Renderers;};
00105
00108 virtual void Render();
00109
00111 virtual void Start() = 0;
00112
00114 virtual void Finalize() = 0;
00115
00118 virtual void Frame() = 0;
00119
00122 virtual void CopyResultFrame();
00123
00127 virtual vtkRenderWindowInteractor *MakeRenderWindowInteractor();
00128
00130
00133 virtual void HideCursor() = 0;
00134 virtual void ShowCursor() = 0;
00135 virtual void SetCursorPosition(int , int ) {};
00137
00139
00140 vtkSetMacro(CurrentCursor,int);
00141 vtkGetMacro(CurrentCursor,int);
00143
00145
00146 virtual void SetFullScreen(int) = 0;
00147 vtkGetMacro(FullScreen,int);
00148 vtkBooleanMacro(FullScreen,int);
00150
00152
00155 vtkSetMacro(Borders,int);
00156 vtkGetMacro(Borders,int);
00157 vtkBooleanMacro(Borders,int);
00159
00161
00163 vtkGetMacro(StereoCapableWindow,int);
00164 vtkBooleanMacro(StereoCapableWindow,int);
00165 virtual void SetStereoCapableWindow(int capable);
00167
00169
00170 vtkGetMacro(StereoRender,int);
00171 void SetStereoRender(int stereo);
00172 vtkBooleanMacro(StereoRender,int);
00174
00176
00177 vtkSetMacro(AlphaBitPlanes, int);
00178 vtkGetMacro(AlphaBitPlanes, int);
00179 vtkBooleanMacro(AlphaBitPlanes, int);
00181
00183
00185 vtkSetMacro(PointSmoothing,int);
00186 vtkGetMacro(PointSmoothing,int);
00187 vtkBooleanMacro(PointSmoothing,int);
00189
00191
00193 vtkSetMacro(LineSmoothing,int);
00194 vtkGetMacro(LineSmoothing,int);
00195 vtkBooleanMacro(LineSmoothing,int);
00197
00199
00201 vtkSetMacro(PolygonSmoothing,int);
00202 vtkGetMacro(PolygonSmoothing,int);
00203 vtkBooleanMacro(PolygonSmoothing,int);
00205
00207
00219 vtkGetMacro(StereoType,int);
00220 vtkSetMacro(StereoType,int);
00221 void SetStereoTypeToCrystalEyes()
00222 {this->SetStereoType(VTK_STEREO_CRYSTAL_EYES);};
00223 void SetStereoTypeToRedBlue()
00224 {this->SetStereoType(VTK_STEREO_RED_BLUE);};
00225 void SetStereoTypeToInterlaced()
00226 {this->SetStereoType(VTK_STEREO_INTERLACED);};
00227 void SetStereoTypeToLeft()
00228 {this->SetStereoType(VTK_STEREO_LEFT);};
00229 void SetStereoTypeToRight()
00230 {this->SetStereoType(VTK_STEREO_RIGHT);};
00231 void SetStereoTypeToDresden()
00232 {this->SetStereoType(VTK_STEREO_DRESDEN);};
00233 void SetStereoTypeToAnaglyph()
00234 {this->SetStereoType(VTK_STEREO_ANAGLYPH);};
00235 char *GetStereoTypeAsString();
00237
00241 virtual void StereoUpdate();
00242
00245 virtual void StereoMidpoint();
00246
00249 virtual void StereoRenderComplete();
00250
00252
00257 vtkSetClampMacro(AnaglyphColorSaturation,float, 0.0, 1.0);
00258 vtkGetMacro(AnaglyphColorSaturation,float);
00260
00262
00273 vtkSetVector2Macro(AnaglyphColorMask,int);
00274 vtkGetVectorMacro(AnaglyphColorMask,int,2);
00276
00280 virtual void WindowRemap() = 0;
00281
00283
00284 vtkSetMacro(SwapBuffers,int);
00285 vtkGetMacro(SwapBuffers,int);
00286 vtkBooleanMacro(SwapBuffers,int);
00288
00290
00298 virtual int SetPixelData(int, int, int, int, unsigned char *,int) = 0;
00299 virtual int SetPixelData(int, int, int, int, vtkUnsignedCharArray*,
00300 int ) = 0;
00302
00304
00309 virtual float *GetRGBAPixelData(int ,int ,int ,int ,int ) = 0;
00310 virtual int GetRGBAPixelData(int, int, int, int, int, vtkFloatArray* ) = 0;
00311 virtual int SetRGBAPixelData(int ,int ,int ,int ,float *,int,
00312 int blend=0) = 0;
00313 virtual int SetRGBAPixelData(int, int, int, int, vtkFloatArray*,
00314 int, int blend=0) = 0;
00315 virtual void ReleaseRGBAPixelData(float *data)=0;
00316 virtual unsigned char *GetRGBACharPixelData(int ,int ,int ,int ,int ) = 0;
00317 virtual int GetRGBACharPixelData(int ,int, int, int, int,
00318 vtkUnsignedCharArray*) = 0;
00319 virtual int SetRGBACharPixelData(int ,int ,int ,int ,unsigned char *, int,
00320 int blend=0) = 0;
00321 virtual int SetRGBACharPixelData(int, int, int, int,
00322 vtkUnsignedCharArray *,
00323 int, int blend=0) = 0;
00325
00327
00328 virtual float *GetZbufferData(int, int, int, int ) = 0;
00329 virtual int GetZbufferData( int, int, int, int, float*) = 0;
00330 virtual int GetZbufferData( int, int, int, int, vtkFloatArray*) = 0;
00331 virtual int SetZbufferData(int, int, int, int, float *) = 0;
00332 virtual int SetZbufferData( int, int, int, int, vtkFloatArray * ) = 0;
00334
00336
00339 vtkGetMacro(AAFrames,int);
00340 vtkSetMacro(AAFrames,int);
00342
00344
00349 vtkGetMacro(FDFrames,int);
00350 vtkSetMacro(FDFrames,int);
00352
00354
00360 vtkGetMacro(SubFrames,int);
00361 virtual void SetSubFrames(int subFrames);
00363
00365
00366 vtkGetMacro(NeverRendered,int);
00368
00370
00372 vtkGetMacro(AbortRender,int);
00373 vtkSetMacro(AbortRender,int);
00374 vtkGetMacro(InAbortCheck,int);
00375 vtkSetMacro(InAbortCheck,int);
00376 virtual int CheckAbortStatus();
00378
00379 vtkGetMacro(IsPicking,int);
00380 vtkSetMacro(IsPicking,int);
00381 vtkBooleanMacro(IsPicking,int);
00382
00387 virtual int GetEventPending() = 0;
00388
00390 virtual int CheckInRenderStatus() { return this->InRender; }
00391
00393 virtual void ClearInRenderStatus() { this->InRender = 0; }
00394
00396
00401 virtual void SetDesiredUpdateRate(double);
00402 vtkGetMacro(DesiredUpdateRate,double);
00404
00406
00410 vtkGetMacro(NumberOfLayers, int);
00411 vtkSetClampMacro(NumberOfLayers, int, 1, VTK_LARGE_INTEGER);
00413
00415
00416 vtkGetObjectMacro(Interactor,vtkRenderWindowInteractor);
00418
00420 void SetInteractor(vtkRenderWindowInteractor *);
00421
00424 virtual void UnRegister(vtkObjectBase *o);
00425
00427
00428 virtual void SetDisplayId(void *) = 0;
00429 virtual void SetWindowId(void *) = 0;
00430 virtual void SetNextWindowId(void *) = 0;
00431 virtual void SetParentId(void *) = 0;
00432 virtual void *GetGenericDisplayId() = 0;
00433 virtual void *GetGenericWindowId() = 0;
00434 virtual void *GetGenericParentId() = 0;
00435 virtual void *GetGenericContext() = 0;
00436 virtual void *GetGenericDrawable() = 0;
00437 virtual void SetWindowInfo(char *) = 0;
00438 virtual void SetNextWindowInfo(char *) = 0;
00439 virtual void SetParentInfo(char *) = 0;
00441
00443 virtual void MakeCurrent() = 0;
00444
00448 virtual void SetForceMakeCurrent() {};
00449
00451 virtual const char *ReportCapabilities() { return "Not Implemented";};
00452
00454 virtual int SupportsOpenGL() { return 0;};
00455
00457 virtual int IsDirect() { return 0;};
00458
00461 virtual int GetDepthBufferSize() = 0;
00462
00463 protected:
00464 vtkRenderWindow();
00465 ~vtkRenderWindow();
00466
00467 virtual void DoStereoRender();
00468 virtual void DoFDRender();
00469 virtual void DoAARender();
00470
00471 vtkRendererCollection *Renderers;
00472 int Borders;
00473 int FullScreen;
00474 int OldScreen[5];
00475 int PointSmoothing;
00476 int LineSmoothing;
00477 int PolygonSmoothing;
00478 int StereoRender;
00479 int StereoType;
00480 int StereoStatus;
00481 int StereoCapableWindow;
00482 int AlphaBitPlanes;
00483 vtkRenderWindowInteractor *Interactor;
00484 unsigned char* StereoBuffer;
00485 float *AccumulationBuffer;
00486 unsigned int AccumulationBufferSize;
00487 int AAFrames;
00488 int FDFrames;
00489 int SubFrames;
00490 int CurrentSubFrame;
00491 unsigned char *ResultFrame;
00492 int SwapBuffers;
00493 double DesiredUpdateRate;
00494 int AbortRender;
00495 int InAbortCheck;
00496 int InRender;
00497 int NeverRendered;
00498 int NumberOfLayers;
00499 int CurrentCursor;
00500 int IsPicking;
00501 float AnaglyphColorSaturation;
00502 int AnaglyphColorMask[2];
00503
00504 private:
00505 vtkRenderWindow(const vtkRenderWindow&);
00506 void operator=(const vtkRenderWindow&);
00507 };
00508
00510 inline char *vtkRenderWindow::GetStereoTypeAsString(void)
00511 {
00512 switch ( this->StereoType )
00513 {
00514 case VTK_STEREO_CRYSTAL_EYES:
00515 return (char *)"CrystalEyes";
00516 case VTK_STEREO_RED_BLUE:
00517 return (char *)"RedBlue";
00518 case VTK_STEREO_LEFT:
00519 return (char *)"Left";
00520 case VTK_STEREO_RIGHT:
00521 return (char *)"Right";
00522 case VTK_STEREO_DRESDEN:
00523 return (char *)"DresdenDisplay";
00524 case VTK_STEREO_ANAGLYPH:
00525 return (char *)"Anaglyph";
00526 default:
00527 return (char *)"";
00528 }
00529 }
00530
00531 #endif