VTK  9.1.0
vtkPSurfaceLICComposite.h
Go to the documentation of this file.
1/*=========================================================================
2
3 Program: Visualization Toolkit
4 Module: vtkPSurfaceLICComposite.h
5
6 Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
7 All rights reserved.
8 See Copyright.txt or http://www.kitware.com/Copyright.htm 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=========================================================================*/
25#ifndef vtkPSurfaceLICComposite_h
26#define vtkPSurfaceLICComposite_h
27
28#include "vtkOpenGLRenderWindow.h" // for context
29#include "vtkPPixelTransfer.h" // for pixel transfer
30#include "vtkPixelExtent.h" // for pixel extent
31#include "vtkRenderingParallelLICModule.h" // for export macro
33#include "vtkWeakPointer.h" // for ren context
34#include <deque> // for deque
35#include <list> // for list
36#include <vector> // for vector
37
38class vtkFloatArray;
39class vtkRenderWindow;
43class vtkPPixelExtentOps;
44
45class vtkOpenGLHelper;
47
48class VTKRENDERINGPARALLELLIC_EXPORT vtkPSurfaceLICComposite : public vtkSurfaceLICComposite
49{
50public:
53 void PrintSelf(ostream& os, vtkIndent indent) override;
54
60 void SetContext(vtkOpenGLRenderWindow* rwin) override;
61 vtkOpenGLRenderWindow* GetContext() override { return this->Context; }
62
68
73 int BuildProgram(float* vectors) override;
74
79 int Gather(void* pSendPBO, int dataType, int nComps, vtkTextureObject*& newImage) override;
80
85 int Scatter(void* pSendPBO, int dataType, int nComps, vtkTextureObject*& newImage) override;
86
87protected:
90
91private:
95 int InitializeCompositeShader(vtkOpenGLRenderWindow* context);
96
100 int ExecuteShader(const vtkPixelExtent& ext, vtkTextureObject* tex);
101
107 double EstimateCommunicationCost(const std::deque<std::deque<vtkPixelExtent>>& srcExts,
108 const std::deque<std::deque<vtkPixelExtent>>& destExts);
109
115 double EstimateDecompEfficiency(const std::deque<std::deque<vtkPixelExtent>>& exts,
116 const std::deque<std::deque<vtkPixelExtent>>& guardExts);
117
122 int DecomposeScreenExtent(std::deque<std::deque<vtkPixelExtent>>& newExts, float* vectors);
123
128 int DecomposeExtent(vtkPixelExtent& in, int nPieces, std::list<vtkPixelExtent>& out);
129
138 int MakeDecompDisjoint(const std::deque<std::deque<vtkPixelExtent>>& in,
139 std::deque<std::deque<vtkPixelExtent>>& out, float* vectors);
140
141 // decomp set of extents
142 int MakeDecompLocallyDisjoint(
143 const std::deque<std::deque<vtkPixelExtent>>& in, std::deque<std::deque<vtkPixelExtent>>& out);
144
146
152 int AllGatherExtents(const std::deque<vtkPixelExtent>& localExts,
153 std::deque<std::deque<vtkPixelExtent>>& remoteExts, vtkPixelExtent& dataSetExt);
154
158 int AllReduceVectorMax(const std::deque<vtkPixelExtent>& originalExts,
159 const std::deque<std::deque<vtkPixelExtent>>& newExts, float* vectors,
160 std::vector<std::vector<float>>& vectorMax);
161
165 int AddGuardPixels(const std::deque<std::deque<vtkPixelExtent>>& exts,
166 std::deque<std::deque<vtkPixelExtent>>& guardExts,
167 std::deque<std::deque<vtkPixelExtent>>& disjointGuardExts, float* vectors);
168
169private:
170 vtkPPainterCommunicator* PainterComm; // mpi state
171 vtkPPixelExtentOps* PixelOps;
172 int CommRank;
173 int CommSize;
174
175 vtkWeakPointer<vtkOpenGLRenderWindow> Context; // rendering context
176
177 vtkOpenGLFramebufferObject* FBO; // Framebuffer object
178 vtkOpenGLHelper* CompositeShader;
179
180 std::deque<vtkPPixelTransfer> GatherProgram; // ordered steps required to move data to new decomp
181 std::deque<vtkPPixelTransfer>
182 ScatterProgram; // ordered steps required to unmove data from new decomp
183
184 friend VTKRENDERINGPARALLELLIC_EXPORT ostream& operator<<(
185 ostream& os, vtkPSurfaceLICComposite& ss);
186
188 void operator=(const vtkPSurfaceLICComposite&) = delete;
189};
190
191VTKRENDERINGPARALLELLIC_EXPORT
192ostream& operator<<(ostream& os, vtkPSurfaceLICComposite& ss);
193
194#endif
dynamic, self-adjusting array of float
a simple class to control print indentation
Definition: vtkIndent.h:113
Internal class which encapsulates OpenGL FramebufferObject.
OpenGL rendering window.
This class decomposes the image space and shuffles image space data onto the new decomposition with t...
~vtkPSurfaceLICComposite() override
int Gather(void *pSendPBO, int dataType, int nComps, vtkTextureObject *&newImage) override
Move a single buffer from the geometry decomp to the LIC decomp.
void SetCommunicator(vtkPainterCommunicator *comm) override
Set the communicator for parallel communication.
void SetContext(vtkOpenGLRenderWindow *rwin) override
Set the rendering context.
int BuildProgram(float *vectors) override
Build programs to move data to the new decomp THIS IS A COLLECTIVE OPERATION.
vtkOpenGLRenderWindow * GetContext() override
int Scatter(void *pSendPBO, int dataType, int nComps, vtkTextureObject *&newImage) override
Move a single buffer from the LIC decomp to the geometry decomp THIS IS A COLLECTIVE OPERATION.
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
static vtkPSurfaceLICComposite * New()
friend VTKRENDERINGPARALLELLIC_EXPORT ostream & operator<<(ostream &os, vtkPSurfaceLICComposite &ss)
A communicator that can safely be used inside a painter.
Representation of a cartesian pixel plane and common operations on it.
create a window for renderers to draw into
This class decomposes the image space and shuffles image space data onto the new decomposition with t...
int AddGuardPixels(const std::deque< vtkPixelExtent > &exts, std::deque< vtkPixelExtent > &guardExts, std::deque< vtkPixelExtent > &disjointGuardExts, float *vectors)
Add guard pixels (Serial run)
static int MakeDecompDisjoint(std::deque< vtkPixelExtent > &in, std::deque< vtkPixelExtent > &out)
Make a decomposition disjoint with respect to itself.
abstracts an OpenGL texture object.
@ vector
Definition: vtkX3D.h:243
VTKRENDERINGPARALLELLIC_EXPORT ostream & operator<<(ostream &os, vtkPSurfaceLICComposite &ss)