ParaView
vtkIceTCompositePass.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: ParaView
4  Module: $RCSfile$
5 
6  Copyright (c) Kitware, Inc.
7  All rights reserved.
8  See Copyright.txt or http://www.paraview.org/HTML/Copyright.html for details.
9 
10  This software is distributed WITHOUT ANY WARRANTY; without even
11  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
12  PURPOSE. See the above copyright notice for more information.
13 
14 =========================================================================*/
39 #ifndef vtkIceTCompositePass_h
40 #define vtkIceTCompositePass_h
41 
42 #include "vtkNew.h" // needed for vtkWeakPointer.
43 #include "vtkPVVTKExtensionsRenderingModule.h" // needed for export macro
44 #include "vtkRenderPass.h"
45 #include "vtkSynchronizedRenderers.h" // needed for vtkRawImage.
46 #include <IceT.h> // for icet types
47 
48 class vtkMultiProcessController;
50 class vtkIceTContext;
51 class vtkPixelBufferObject;
52 class vtkTextureObject;
53 class vtkOpenGLRenderWindow;
54 class vtkUnsignedCharArray;
55 class vtkFloatArray;
56 #ifdef VTKGL2
57 class vtkOpenGLHelper;
58 #else
59 class vtkShaderProgram2;
60 #endif
61 
62 class VTKPVVTKEXTENSIONSRENDERING_EXPORT vtkIceTCompositePass : public vtkRenderPass
63 {
64 public:
65  static vtkIceTCompositePass* New();
66  vtkTypeMacro(vtkIceTCompositePass, vtkRenderPass);
67  void PrintSelf(ostream& os, vtkIndent indent);
68 
73  virtual void Render(const vtkRenderState* s);
74 
80  void ReleaseGraphicsResources(vtkWindow* w);
81 
83 
88  vtkGetObjectMacro(Controller, vtkMultiProcessController);
89  virtual void SetController(vtkMultiProcessController* controller);
91 
93 
98  void SetRenderPass(vtkRenderPass*);
99  vtkGetObjectMacro(RenderPass, vtkRenderPass);
101 
103 
107  vtkSetVector2Macro(TileDimensions, int);
108  vtkGetVector2Macro(TileDimensions, int);
110 
112 
117  vtkSetVector2Macro(TileMullions, int);
118  vtkGetVector2Macro(TileMullions, int);
120 
122 
128  vtkSetMacro(DataReplicatedOnAllProcesses, bool);
129  vtkGetMacro(DataReplicatedOnAllProcesses, bool);
130  vtkBooleanMacro(DataReplicatedOnAllProcesses, bool);
132 
134 
142  vtkSetClampMacro(ImageReductionFactor, int, 1, 50);
143  vtkGetMacro(ImageReductionFactor, int);
145 
147 
151  vtkGetObjectMacro(PartitionOrdering, vtkPartitionOrderingInterface);
152  virtual void SetPartitionOrdering(vtkPartitionOrderingInterface* partitionOrdering);
154 
156 
160  vtkGetMacro(RenderEmptyImages, bool);
161  vtkSetMacro(RenderEmptyImages, bool);
162  vtkBooleanMacro(RenderEmptyImages, bool);
164 
166 
173  vtkGetMacro(UseOrderedCompositing, bool);
174  vtkSetMacro(UseOrderedCompositing, bool);
175  vtkBooleanMacro(UseOrderedCompositing, bool);
177 
179 
185  vtkGetMacro(DepthOnly, bool);
186  vtkSetMacro(DepthOnly, bool);
188 
190 
196  vtkGetMacro(FixBackground, bool);
197  vtkSetMacro(FixBackground, bool);
199 
204  void GetLastRenderedTile(vtkSynchronizedRenderers::vtkRawImage& tile);
205 
210  vtkFloatArray* GetLastRenderedDepths();
211 
213 
217  vtkSetMacro(EnableFloatValuePass, bool);
219 
225  vtkFloatArray* GetLastRenderedRGBA32F();
226 
231  void PushIceTDepthBufferToScreen(const vtkRenderState* render_state);
232 
237  void PushIceTColorBufferToScreen(const vtkRenderState* render_state);
238 
240 
244  vtkGetVector4Macro(PhysicalViewport, double);
246 
248 
251  virtual void GLDraw(const vtkRenderState*);
252  virtual void Draw(const vtkRenderState*, const IceTDouble* proj_matrix,
253  const IceTDouble* mv_matrix, const IceTFloat* background_color, const IceTInt* viewport,
254  IceTImage result);
256 
257 protected:
260 
262 
265  virtual void SetupContext(const vtkRenderState*);
266  virtual void CleanupContext(const vtkRenderState*);
268 
275  void CreateProgram(vtkOpenGLRenderWindow* context);
276 
280  void UpdateTileInformation(const vtkRenderState*);
281 
282  vtkMultiProcessController* Controller;
284  vtkRenderPass* RenderPass;
286 
289  bool DepthOnly;
292  int TileDimensions[2];
293  int TileMullions[2];
294 
295  int LastTileDimensions[2];
296  int LastTileMullions[2];
297  int LastTileViewport[4];
298  double PhysicalViewport[4];
299 
301 
302  vtkNew<vtkFloatArray> LastRenderedDepths;
303 
304  vtkNew<vtkFloatArray> LastRenderedRGBA32F;
305 
306  vtkPixelBufferObject* PBO;
307  vtkTextureObject* ZTexture;
308 #ifdef VTKGL2
309  vtkOpenGLHelper* Program;
310 #else
311  vtkShaderProgram2* Program;
312 #endif
313 
315  vtkTextureObject* BackgroundTexture;
316  vtkTextureObject* IceTTexture;
317 
318  // Stereo Render support requires us
319  // to have to raw image one for each eye so that we
320  // don't overwrite the left eye with the right eyes image
321  // will point at the last rendered eye
322  vtkSynchronizedRenderers::vtkRawImage* LastRenderedRGBAColors;
323 
324  // actual rendered raw images for stereo. Left Eye is index 0
325  // and Right Eye is index 1
326  vtkSynchronizedRenderers::vtkRawImage* LastRenderedEyes[2];
327 
328 private:
329  vtkIceTCompositePass(const vtkIceTCompositePass&) VTK_DELETE_FUNCTION;
330  void operator=(const vtkIceTCompositePass&) VTK_DELETE_FUNCTION;
331 };
332 
333 #endif
vtkIceTContext * IceTContext
vtkTextureObject * BackgroundTexture
vtkPartitionOrderingInterface * PartitionOrdering
vtkSynchronizedRenderers::vtkRawImage * LastRenderedRGBAColors
vtkNew< vtkFloatArray > LastRenderedRGBA32F
vtkTextureObject * ZTexture
vtkNew< vtkFloatArray > LastRenderedDepths
vtkTextureObject * IceTTexture
Interface for ordering compositing.
This is a helper class for vtkIceTRenderManager and vtkOpenGLIceTRenderer.
vtkMultiProcessController * Controller
vtkShaderProgram2 * Program
vtkRenderPass subclass for compositing renderings across processes using IceT.
vtkPixelBufferObject * PBO