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 
47 class vtkFloatArray;
48 class vtkIceTContext;
49 class vtkMatrix4x4;
51 class vtkOpenGLHelper;
55 class vtkTextureObject;
57 
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(OrderedCompositingHelper, vtkOrderedCompositingHelper);
148  virtual void SetOrderedCompositingHelper(vtkOrderedCompositingHelper* helper);
150 
152 
156  vtkGetMacro(RenderEmptyImages, bool);
157  vtkSetMacro(RenderEmptyImages, bool);
158  vtkBooleanMacro(RenderEmptyImages, bool);
160 
162 
170  vtkGetMacro(UseOrderedCompositing, bool);
171  vtkSetMacro(UseOrderedCompositing, bool);
172  vtkBooleanMacro(UseOrderedCompositing, bool);
174 
179  void GetLastRenderedTile(vtkSynchronizedRenderers::vtkRawImage& tile);
180 
185  vtkFloatArray* GetLastRenderedDepths();
186 
188 
192  vtkSetMacro(EnableFloatValuePass, bool);
194 
200  vtkFloatArray* GetLastRenderedRGBA32F();
201 
206  void PushIceTDepthBufferToScreen(const vtkRenderState* render_state);
207 
209 
218  vtkSetMacro(DisplayRGBAResults, bool);
219  vtkGetMacro(DisplayRGBAResults, bool);
220  vtkSetMacro(DisplayDepthResults, bool);
221  vtkGetMacro(DisplayDepthResults, bool);
223 
225 
228  struct IceTDrawParams;
229  void Draw(const vtkRenderState* render_state, const IceTDrawParams&);
231 
232 protected:
234  ~vtkIceTCompositePass() override;
235 
237 
240  virtual void SetupContext(const vtkRenderState*);
241  virtual void CleanupContext(const vtkRenderState*);
243 
249  void ReadyProgram(vtkOpenGLRenderWindow* context);
250 
254  void UpdateTileInformation(const vtkRenderState*);
255 
261  void DisplayResultsIfNeeded(const vtkRenderState*);
262 
267  void UpdateMatrices(const vtkRenderState*, double aspect);
268 
273 
278  int TileDimensions[2];
279  int TileMullions[2];
280 
282 
285 
287 
289 
293 
294  std::unique_ptr<vtkSynchronizedRenderers::vtkRawImage> LastRenderedRGBAColors;
295 
296 private:
298  void operator=(const vtkIceTCompositePass&) = delete;
299 
300  vtkNew<vtkMatrix4x4> ModelView;
301  vtkNew<vtkMatrix4x4> Projection;
302  vtkNew<vtkMatrix4x4> IceTProjection;
303 };
304 
305 #endif
#define VTKREMOTINGVIEWS_EXPORT
vtkIceTContext * IceTContext
std::unique_ptr< vtkSynchronizedRenderers::vtkRawImage > LastRenderedRGBAColors
vtkOrderedCompositingHelper * OrderedCompositingHelper
void PrintSelf(ostream &os, vtkIndent indent)
vtkNew< vtkFloatArray > LastRenderedRGBA32F
vtkTextureObject * ZTexture
vtkNew< vtkFloatArray > LastRenderedDepths
virtual void Render(const vtkRenderState *s)=0
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
helper to assist in determine process order when rendering