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
00058 #ifndef __vtkCompositeManager_h
00059 #define __vtkCompositeManager_h
00060
00061 #include "vtkObject.h"
00062 #include "vtkRenderWindow.h"
00063 #include "vtkRenderWindowInteractor.h"
00064 #include "vtkRenderer.h"
00065 #include "vtkMultiProcessController.h"
00066
00067 class vtkTimerLog;
00068
00069
00070 class VTK_PARALLEL_EXPORT vtkCompositeManager : public vtkObject
00071 {
00072 public:
00073 vtkTypeMacro(vtkCompositeManager,vtkObject);
00074 void PrintSelf(ostream& os, vtkIndent indent);
00075
00077
00079 vtkGetObjectMacro(RenderWindow, vtkRenderWindow);
00080 void SetRenderWindow(vtkRenderWindow *renWin);
00082
00086 void InitializePieces();
00087
00089 void InitializeOffScreen();
00090
00092
00093 void StartInteractor();
00094 void ExitInteractor();
00095 void StartRender();
00096 void EndRender();
00097 void RenderRMI();
00098 void ResetCamera(vtkRenderer *ren);
00099 void ResetCameraClippingRange(vtkRenderer *ren);
00100 void ComputeVisiblePropBoundsRMI();
00102
00105 void InitializeRMIs();
00106
00108
00113 void SetReductionFactor(int factor);
00114 vtkGetMacro(ReductionFactor, int);
00116
00118
00121 vtkSetMacro(UseChar, int);
00122 vtkGetMacro(UseChar, int);
00123 vtkBooleanMacro(UseChar, int);
00125
00127
00128 vtkSetMacro(UseCompositing, int);
00129 vtkGetMacro(UseCompositing, int);
00130 vtkBooleanMacro(UseCompositing, int);
00132
00134
00136 vtkGetMacro(GetBuffersTime, double);
00137 vtkGetMacro(SetBuffersTime, double);
00138 vtkGetMacro(CompositeTime, double);
00139 vtkGetMacro(MaxRenderTime, double);
00141
00143 float GetZ(int x, int y);
00144
00146
00149 vtkSetObjectMacro(Controller, vtkMultiProcessController);
00150 vtkGetObjectMacro(Controller, vtkMultiProcessController);
00152
00153
00154
00155 enum Tags {
00156 RENDER_RMI_TAG=12721,
00157 COMPUTE_VISIBLE_PROP_BOUNDS_RMI_TAG=56563,
00158 WIN_INFO_TAG=22134,
00159 REN_INFO_TAG=22135,
00160 BOUNDS_TAG=94135
00161 };
00162
00164
00167 virtual void CheckForAbortRender() {}
00168 virtual int CheckForAbortComposite() {return 0;}
00170
00171
00172 protected:
00173 vtkCompositeManager();
00174 ~vtkCompositeManager();
00175 vtkCompositeManager(const vtkCompositeManager&);
00176 void operator=(const vtkCompositeManager&);
00177
00178
00179 virtual void CompositeBuffer(int width, int height, int useCharFlag,
00180 void *pBuf, float *zBuf,
00181 void *pTmp, float *zTmp) = 0;
00182
00183 void Composite();
00184 virtual void ComputeVisiblePropBounds(vtkRenderer *ren, float bounds[6]);
00185 void SetRendererSize(int x, int y);
00186 float* MagnifyBuffer(float *localPdata, int windowSize[2]);
00187
00188 vtkRenderWindow* RenderWindow;
00189 vtkRenderWindowInteractor* RenderWindowInteractor;
00190 vtkMultiProcessController* Controller;
00191
00192 unsigned long StartInteractorTag;
00193 unsigned long EndInteractorTag;
00194 unsigned long StartTag;
00195 unsigned long EndTag;
00196 unsigned long ResetCameraTag;
00197 unsigned long ResetCameraClippingRangeTag;
00198 int UseChar;
00199 int UseCompositing;
00200
00201
00202
00203
00204 void SetRenderWindowInteractor(vtkRenderWindowInteractor *iren);
00205
00206
00207 float *PData;
00208 float *ZData;
00209 int RendererSize[2];
00210
00211
00212 int ReductionFactor;
00213
00214
00215
00216
00217
00218
00219 int Lock;
00220
00221 double GetBuffersTime;
00222 double SetBuffersTime;
00223 double CompositeTime;
00224 double MaxRenderTime;
00225
00226
00227 vtkTimerLog *Timer;
00228 };
00229
00230 #endif