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 =========================================================================*/
38 #ifndef vtkIceTCompositePass_h
39 #define vtkIceTCompositePass_h
40 
41 #include "vtkNew.h" // needed for vtkWeakPointer.
42 #include "vtkRemotingViewsModule.h" // needed for export macro
43 #include "vtkRenderPass.h"
44 #include "vtkSynchronizedRenderers.h" // needed for vtkRawImage.
45 #include <memory> // for std::unique_pt
46 
49 class vtkIceTContext;
51 class vtkTextureObject;
54 class vtkFloatArray;
55 class vtkOpenGLHelper;
56 class vtkMatrix4x4;
57 
58 class VTKREMOTINGVIEWS_EXPORT vtkIceTCompositePass : public vtkRenderPass
59 {
60 public:
61  static vtkIceTCompositePass* New();
63  void PrintSelf(ostream& os, vtkIndent indent) override;
64 
69  virtual void Render(const vtkRenderState* s) override;
70 
76  void ReleaseGraphicsResources(vtkWindow* w) override;
77 
79 
84  vtkGetObjectMacro(Controller, vtkMultiProcessController);
85  virtual void SetController(vtkMultiProcessController* controller);
87 
89 
94  void SetRenderPass(vtkRenderPass*);
95  vtkGetObjectMacro(RenderPass, vtkRenderPass);
97 
99 
103  vtkSetVector2Macro(TileDimensions, int);
104  vtkGetVector2Macro(TileDimensions, int);
106 
108 
113  vtkSetVector2Macro(TileMullions, int);
114  vtkGetVector2Macro(TileMullions, int);
116 
118 
124  vtkSetMacro(DataReplicatedOnAllProcesses, bool);
125  vtkGetMacro(DataReplicatedOnAllProcesses, bool);
126  vtkBooleanMacro(DataReplicatedOnAllProcesses, bool);
128 
130 
138  vtkSetClampMacro(ImageReductionFactor, int, 1, 50);
139  vtkGetMacro(ImageReductionFactor, int);
141 
143 
147  vtkGetObjectMacro(PartitionOrdering, vtkPartitionOrderingInterface);
148  virtual void SetPartitionOrdering(vtkPartitionOrderingInterface* partitionOrdering);
150 
152 
156  vtkGetMacro(RenderEmptyImages, bool);
157  vtkSetMacro(RenderEmptyImages, bool);
158  vtkBooleanMacro(RenderEmptyImages, bool);
160 
162 
169  vtkGetMacro(UseOrderedCompositing, bool);
170  vtkSetMacro(UseOrderedCompositing, bool);
171  vtkBooleanMacro(UseOrderedCompositing, bool);
173 
178  void GetLastRenderedTile(vtkSynchronizedRenderers::vtkRawImage& tile);
179 
184  vtkFloatArray* GetLastRenderedDepths();
185 
187 
191  vtkSetMacro(EnableFloatValuePass, bool);
193 
199  vtkFloatArray* GetLastRenderedRGBA32F();
200 
205  void PushIceTDepthBufferToScreen(const vtkRenderState* render_state);
206 
208 
217  vtkSetMacro(DisplayRGBAResults, bool);
218  vtkGetMacro(DisplayRGBAResults, bool);
219  vtkSetMacro(DisplayDepthResults, bool);
220  vtkGetMacro(DisplayDepthResults, bool);
222 
224 
227  struct IceTDrawParams;
228  void Draw(const vtkRenderState* render_state, const IceTDrawParams&);
230 
231 protected:
233  ~vtkIceTCompositePass() override;
234 
236 
239  virtual void SetupContext(const vtkRenderState*);
240  virtual void CleanupContext(const vtkRenderState*);
242 
248  void ReadyProgram(vtkOpenGLRenderWindow* context);
249 
253  void UpdateTileInformation(const vtkRenderState*);
254 
260  void DisplayResultsIfNeeded(const vtkRenderState*);
261 
266  void UpdateMatrices(const vtkRenderState*, double aspect);
267 
272 
277  int TileDimensions[2];
278  int TileMullions[2];
279 
281 
284 
286 
288 
292 
293  std::unique_ptr<vtkSynchronizedRenderers::vtkRawImage> LastRenderedRGBAColors;
294 
295 private:
297  void operator=(const vtkIceTCompositePass&) = delete;
298 
299  vtkNew<vtkMatrix4x4> ModelView;
300  vtkNew<vtkMatrix4x4> Projection;
301  vtkNew<vtkMatrix4x4> IceTProjection;
302 };
303 
304 #endif
vtkIceTContext * IceTContext
std::unique_ptr< vtkSynchronizedRenderers::vtkRawImage > LastRenderedRGBAColors
void PrintSelf(ostream &os, vtkIndent indent)
vtkPartitionOrderingInterface * PartitionOrdering
vtkNew< vtkFloatArray > LastRenderedRGBA32F
vtkTextureObject * ZTexture
vtkNew< vtkFloatArray > LastRenderedDepths
virtual void Render(const vtkRenderState *s)=0
Interface for ordering compositing.
This is a helper class for vtkIceTRenderManager and vtkOpenGLIceTRenderer.
virtual void ReleaseGraphicsResources(vtkWindow *w)
vtkMultiProcessController * Controller
static vtkObject * New()
void operator=(const vtkObjectBase &)
IceT enabled render pass for distributed rendering.
vtkOpenGLHelper * Program
vtkPixelBufferObject * PBO