00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00041
#ifndef __vtkCompositeManager_h
00042
#define __vtkCompositeManager_h
00043
00044
#include "vtkObject.h"
00045
00046
class vtkTimerLog;
00047
class vtkFloatArray;
00048
class vtkDataArray;
00049
class vtkRenderWindow;
00050
class vtkRenderWindowInteractor;
00051
class vtkMultiProcessController;
00052
class vtkRenderer;
00053
class vtkCompositer;
00054
class vtkUnsignedCharArray;
00055
00056 class VTK_PARALLEL_EXPORT vtkCompositeManager :
public vtkObject
00057 {
00058
public:
00059
static vtkCompositeManager *
New();
00060 vtkTypeRevisionMacro(vtkCompositeManager,
vtkObject);
00061
void PrintSelf(ostream& os,
vtkIndent indent);
00062
00064
00066 vtkGetObjectMacro(RenderWindow,
vtkRenderWindow);
00067
virtual void SetRenderWindow(
vtkRenderWindow *renWin);
00069
00073
void InitializePieces();
00074
00076
void InitializeOffScreen();
00077
00079
00080
void StartInteractor();
00081
void ExitInteractor();
00082
virtual void StartRender();
00083
virtual void EndRender();
00084
virtual void SatelliteStartRender();
00085
virtual void SatelliteEndRender();
00086
void RenderRMI();
00087
void ResetCamera(
vtkRenderer *ren);
00088
void ResetCameraClippingRange(
vtkRenderer *ren);
00089
void ComputeVisiblePropBoundsRMI();
00091
00094
virtual void InitializeRMIs();
00095
00097
00102
void SetReductionFactor(
int factor);
00103 vtkGetMacro(ReductionFactor,
int);
00105
00107
00110
void SetUseChar(
int useChar);
00111 vtkGetMacro(UseChar,
int);
00112 vtkBooleanMacro(UseChar,
int);
00114
00116
00121
void SetUseRGB(
int useRGB);
00122 vtkGetMacro(UseRGB,
int);
00123 vtkBooleanMacro(UseRGB,
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
void SetController(
vtkMultiProcessController* controller);
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
00173
virtual void ComputeVisiblePropBounds(
vtkRenderer *ren,
float bounds[6]);
00174
00176
00180 vtkSetMacro(Manual,
int);
00181 vtkGetMacro(Manual,
int);
00182 vtkBooleanMacro(Manual,
int);
00183
void Composite();
00185
00187
00189
virtual void SetCompositer(
vtkCompositer*);
00190 vtkGetObjectMacro(Compositer,
vtkCompositer);
00192
00194
00195
static void DeleteArray(
vtkDataArray* da);
00196
static void ResizeFloatArray(
vtkFloatArray* fa,
int numComp,
00197
vtkIdType size);
00198
static void ResizeUnsignedCharArray(
vtkUnsignedCharArray* uca,
00199
int numComp,
vtkIdType size);
00201
00203
00206
void SetNumberOfProcesses(
int numProcs);
00207 vtkGetMacro(NumberOfProcesses,
int);
00209
00210
protected:
00211 vtkCompositeManager();
00212 ~vtkCompositeManager();
00213
00214
void SetRendererSize(
int x,
int y);
00215
void MagnifyBuffer(
vtkDataArray *localPdata,
vtkDataArray* magPdata,
00216
int windowSize[2]);
00217
00218
void ReallocPDataArrays();
00219
00220 vtkRenderWindow* RenderWindow;
00221 vtkRenderWindowInteractor* RenderWindowInteractor;
00222 vtkMultiProcessController* Controller;
00223
00224 unsigned long StartInteractorTag;
00225 unsigned long EndInteractorTag;
00226 unsigned long StartTag;
00227 unsigned long EndTag;
00228 unsigned long ResetCameraTag;
00229 unsigned long ResetCameraClippingRangeTag;
00230 int UseChar;
00231 int UseRGB;
00232 int UseCompositing;
00233
00234
00235
00236
00237
void SetRenderWindowInteractor(
vtkRenderWindowInteractor *iren);
00238
00239
00240 vtkCompositer *Compositer;
00241 int NumberOfProcesses;
00242
00243
00244 vtkDataArray *PData;
00245 vtkFloatArray *ZData;
00246 vtkDataArray *LocalPData;
00247 vtkFloatArray *LocalZData;
00248 int RendererSize[2];
00249
00250
00251 int ReductionFactor;
00252
00253
00254
00255
00256
00257
00258 int Lock;
00259
00260 double GetBuffersTime;
00261 double SetBuffersTime;
00262 double CompositeTime;
00263 double MaxRenderTime;
00264
00265
00266 vtkTimerLog *Timer;
00267
00268
00269 int Manual;
00270
00271 int FirstRender;
00272
00273
private:
00274 vtkCompositeManager(
const vtkCompositeManager&);
00275
void operator=(
const vtkCompositeManager&);
00276 };
00277
00278
#endif