00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00051 #ifndef __vtkIceTRenderManager_h
00052 #define __vtkIceTRenderManager_h
00053
00054 #include "vtkParallelRenderManager.h"
00055
00056 class vtkIceTRenderer;
00057 class vtkIntArray;
00058 class vtkPerspectiveTransform;
00059 class vtkPKdTree;
00060
00061 class VTK_EXPORT vtkIceTRenderManager : public vtkParallelRenderManager
00062 {
00063 public:
00064 static vtkIceTRenderManager *New();
00065 vtkTypeRevisionMacro(vtkIceTRenderManager, vtkParallelRenderManager);
00066 virtual void PrintSelf(ostream &os, vtkIndent indent);
00067
00068 virtual vtkRenderer *MakeRenderer();
00069
00070 virtual void SetController(vtkMultiProcessController *controller);
00071
00072 virtual void SetRenderWindow(vtkRenderWindow *renwin);
00073
00075
00080 virtual void SetTileDimensions(int tilesX, int tilesY);
00081 void SetTileDimensions(int dims[2])
00082 { this->SetTileDimensions(dims[0], dims[1]); }
00083 vtkGetVector2Macro(TileDimensions, int);
00085
00087
00092 virtual int GetTileRank(int x, int y);
00093 virtual void SetTileRank(int x, int y, int rank);
00095
00096 virtual double GetRenderTime();
00097 virtual double GetImageProcessingTime();
00098 virtual double GetBufferReadTime();
00099 virtual double GetBufferWriteTime();
00100 virtual double GetCompositeTime();
00101
00102
00103 enum StrategyType {
00104 DEFAULT, REDUCE, VTREE, SPLIT, SERIAL, DIRECT
00105 };
00106
00107
00109
00111 virtual void SetStrategy(int strategy);
00112 virtual void SetStrategy(const char *strategy);
00113 void SetStrategyToDefault() { this->SetStrategy(DEFAULT); }
00114 void SetStrategyToReduce() { this->SetStrategy(REDUCE); }
00115 void SetStrategyToVtree() { this->SetStrategy(VTREE); }
00116 void SetStrategyToSplit() { this->SetStrategy(SPLIT); }
00117 void SetStrategyToSerial() { this->SetStrategy(SERIAL); }
00118 void SetStrategyToDirect() { this->SetStrategy(DIRECT); }
00120
00121
00122 enum ComposeOperationType {
00123 ComposeOperationClosest = 0,
00124 ComposeOperationOver = 1
00125 };
00126
00127
00129
00132 virtual void SetComposeOperation(int operation);
00133
00134
00135
00136
00137 void SetComposeOperationToClosest() {
00138 this->SetComposeOperation(ComposeOperationClosest);
00139 }
00140
00141
00142
00143
00144 void SetComposeOperationToOver() {
00145 this->SetComposeOperation(ComposeOperationOver);
00146 }
00148
00161 virtual void SetSortingKdTree(vtkPKdTree *tree);
00162
00174 virtual void SetDataReplicationGroup(vtkIntArray *group);
00175
00181 virtual void SetDataReplicationGroupColor(int color);
00182
00185 virtual void RecordIceTImage(vtkIceTRenderer *);
00186
00189 virtual void ForceImageWriteback();
00190
00191 protected:
00192 vtkIceTRenderManager();
00193 virtual ~vtkIceTRenderManager();
00194
00195 virtual void UpdateIceTContext();
00196
00197 virtual void SendWindowInformation();
00198 virtual void ReceiveWindowInformation();
00199
00200 virtual void SendRendererInformation(vtkRenderer *);
00201 virtual void ReceiveRendererInformation(vtkRenderer *);
00202
00203 virtual void PreRenderProcessing();
00204 virtual void PostRenderProcessing();
00205
00206 int ContextDirty;
00207 vtkTimeStamp ContextUpdateTime;
00208
00209 int TileDimensions[2];
00210 int **TileRanks;
00211 int TilesDirty;
00212 int CleanScreenWidth;
00213 int CleanScreenHeight;
00214
00217 double LastKnownImageReductionFactor;
00218
00219 vtkCommand *RecordIceTImageCallback;
00220 vtkCommand *FixRenderWindowCallback;
00221
00223
00224 vtkPerspectiveTransform *TileViewportTransform;
00225 vtkGetObjectMacro(TileViewportTransform, vtkPerspectiveTransform);
00226 virtual void SetTileViewportTransform(vtkPerspectiveTransform *arg);
00228
00229 virtual void ComputeTileViewportTransform();
00230
00231 virtual int ImageReduceRenderer(vtkRenderer *);
00232
00235 vtkDoubleArray *LastViewports;
00236
00237 vtkUnsignedCharArray *InflateImageBuffer;
00238
00240
00242 void GetGlobalViewport(int viewport[4]);
00243 void GetTileViewport(int x, int y, int viewport[4]);
00245
00246 private:
00247 vtkIceTRenderManager(const vtkIceTRenderManager&);
00248 void operator=(const vtkIceTRenderManager&);
00249 };
00250
00251
00252 #endif //__vtkIceTRenderManager_h