33#ifndef vtkParallelRenderManager_h
34#define vtkParallelRenderManager_h
37#include "vtkRenderingParallelModule.h"
39VTK_ABI_NAMESPACE_BEGIN
159 vtkSetMacro(ParallelRendering,
int);
160 vtkGetMacro(ParallelRendering,
int);
161 vtkBooleanMacro(ParallelRendering,
int);
171 vtkSetMacro(RenderEventPropagation,
int);
172 vtkGetMacro(RenderEventPropagation,
int);
173 vtkBooleanMacro(RenderEventPropagation,
int);
196 vtkSetMacro(UseCompositing,
int);
197 vtkGetMacro(UseCompositing,
int);
198 vtkBooleanMacro(UseCompositing,
int);
216 vtkGetMacro(ImageReductionFactor,
double);
219 vtkSetMacro(MaxImageReductionFactor,
double);
220 vtkGetMacro(MaxImageReductionFactor,
double);
236 vtkSetMacro(AutoImageReductionFactor,
int);
237 vtkGetMacro(AutoImageReductionFactor,
int);
238 vtkBooleanMacro(AutoImageReductionFactor,
int);
245 vtkGetMacro(RenderTime,
double);
246 vtkGetMacro(ImageProcessingTime,
double);
259 vtkGetMacro(SyncRenderWindowRenderers,
int);
260 vtkSetMacro(SyncRenderWindowRenderers,
int);
261 vtkBooleanMacro(SyncRenderWindowRenderers,
int);
277 vtkSetMacro(WriteBackImages,
int);
278 vtkGetMacro(WriteBackImages,
int);
279 vtkBooleanMacro(WriteBackImages,
int);
288 vtkSetMacro(MagnifyImages,
int);
289 vtkGetMacro(MagnifyImages,
int);
290 vtkBooleanMacro(MagnifyImages,
int);
306 vtkGetMacro(MagnifyImageMethod,
int);
317 const int fullImageViewport[4] =
nullptr,
const int reducedImageViewport[4] =
nullptr);
320 const int fullImageViewport[4] =
nullptr,
const int reducedImageViewport[4] =
nullptr);
323 const int fullImageViewport[4] =
nullptr,
const int reducedImageViewport[4] =
nullptr);
354 vtkGetVector2Macro(FullImageSize,
int);
360 vtkGetVector2Macro(ReducedImageSize,
int);
374 vtkSetMacro(UseRGBA,
int);
375 vtkGetMacro(UseRGBA,
int);
383 vtkSetMacro(ForceRenderWindowSize,
int);
384 vtkGetMacro(ForceRenderWindowSize,
int);
392 vtkSetVector2Macro(ForcedRenderWindowSize,
int);
393 vtkGetVector2Macro(ForcedRenderWindowSize,
int);
398 RENDER_RMI_TAG = 34532,
399 COMPUTE_VISIBLE_PROP_BOUNDS_RMI_TAG = 54636,
400 WIN_INFO_TAG = 87834,
401 REN_INFO_TAG = 87836,
402 LIGHT_INFO_TAG = 87838,
417 vtkSetMacro(UseBackBuffer,
int);
418 vtkGetMacro(UseBackBuffer,
int);
419 vtkBooleanMacro(UseBackBuffer,
int);
428 vtkSetMacro(SynchronizeTileProperties,
int);
429 vtkGetMacro(SynchronizeTileProperties,
int);
430 vtkBooleanMacro(SynchronizeTileProperties,
int);
462 int ForcedRenderWindowSize[2];
493 int FullImageSize[2];
494 int ReducedImageSize[2];
616 double TileViewport[4];
629 int NumberOfLights = 0;
630 double Viewport[4] = { 0., 0., 0., 0. };
631 double CameraPosition[3] = { 0., 0., 0. };
632 double CameraFocalPoint[3] = { 0., 0., 0. };
633 double CameraViewUp[3] = { 0., 0., 0. };
634 double WindowCenter[2] = { 0., 0. };
635 double CameraClippingRange[2] = { 0., 0. };
636 double CameraViewAngle = 0.;
637 double Background[3] = { 0., 0., 0. };
638 double Background2[3] = { 0., 0., 0. };
639 bool GradientBackground =
false;
641 double ParallelScale = 0.;
654 double FocalPoint[3];
dynamic, self-adjusting array of double
a simple class to control print indentation
Multiprocessing communication superclass.
stream used to pass data across processes using vtkMultiProcessController.
abstract base class for most VTK objects
An object to control parallel rendering.
static void MagnifyImageNearest(vtkUnsignedCharArray *fullImage, const int fullImageSize[2], vtkUnsignedCharArray *reducedImage, const int reducedImageSize[2], const int fullImageViewport[4]=nullptr, const int reducedImageViewport[4]=nullptr)
Convenience functions for magnifying images.
virtual vtkRenderer * MakeRenderer()
Builds a vtkRenderer compatible with this render manager.
void RemoveRenderWindowEventHandlers()
Add/Remove event handlers for the render window.
virtual void PreRenderProcessing()=0
Here is a good place to handle processing of data before and after render.
virtual void ReceiveWindowInformation()
virtual void EndRender()
Callbacks that initialize and finish rendering and other tasks.
virtual int ImageReduceRenderer(vtkRenderer *)
Returns true if the image for the given renderer should be rendered at a reduced size to be magnified...
unsigned long StartRenderTag
virtual void ComputeVisiblePropBoundsRMI(int renderId)
Callbacks that initialize and finish rendering and other tasks.
static bool GetDefaultRenderEventPropagation()
double ImageProcessingTime
virtual void ResetCameraClippingRange(vtkRenderer *ren)
Callbacks that initialize and finish rendering and other tasks.
vtkParallelRenderManager()
virtual void SendRendererInformation(vtkRenderer *)
virtual void InitializeOffScreen()
Make all rendering windows not viewable set as off screen rendering.
int RenderWindowImageUpToDate
virtual void MagnifyReducedImage()
When called, fills FullImage.
virtual void SendWindowInformation()
Used to synchronize rendering information per frame.
virtual bool ProcessWindowInformation(vtkMultiProcessStream &)
virtual bool ProcessRendererInformation(vtkRenderer *, vtkMultiProcessStream &)
void SetMagnifyImageMethodToLinear()
Sets the method used to magnify images.
int AutoImageReductionFactor
int SynchronizeTileProperties
static bool DefaultRenderEventPropagation
virtual void GetPixelData(vtkUnsignedCharArray *data)
The most appropriate way to retrieve full size image data after a render.
virtual vtkRenderWindow * MakeRenderWindow()
Builds a vtkRenderWindow compatible with this render manager.
virtual int LastRenderInFrontBuffer()
Returns 1 if the RenderWindow's last image is in the front buffer, 0 if it is in the back.
virtual void RenderRMI()
Callbacks that initialize and finish rendering and other tasks.
virtual void SetImageReductionFactor(double factor)
Set/Get the reduction factor (for sort-last based parallel renderers).
virtual void GetReducedPixelData(int x1, int y1, int x2, int y2, vtkUnsignedCharArray *data)
The most appropriate way to retrieve reduced size image data after a render.
virtual void PostRenderProcessing()=0
Here is a good place to handle processing of data before and after render.
virtual void InitializePieces()
This method sets the piece and number of pieces for each actor with a polydata mapper.
unsigned long AbortRenderCheckTag
virtual void SetRenderWindowPixelData(vtkUnsignedCharArray *pixels, const int pixelDimensions[2])
Sets the current render window's pixel data.
static void MagnifyImageLinear(vtkUnsignedCharArray *fullImage, const int fullImageSize[2], vtkUnsignedCharArray *reducedImage, const int reducedImageSize[2], const int fullImageViewport[4]=nullptr, const int reducedImageViewport[4]=nullptr)
Convenience functions for magnifying images.
virtual void ReceiveRendererInformation(vtkRenderer *)
virtual void WriteFullImage()
Write the full image back to the RenderWindow.
virtual void GetPixelData(int x1, int y1, int x2, int y2, vtkUnsignedCharArray *data)
The most appropriate way to retrieve full size image data after a render.
virtual void GenericEndRenderCallback()
INTERNAL METHODS (DON NOT USE).
virtual void ReadReducedImage()
Reads in the reduced image from the RenderWindow.
vtkRendererCollection * Renderers
virtual void CollectWindowInformation(vtkMultiProcessStream &)
Subclass should override these methods (instead of SendWindowInformation/ReceiveWindowInformation or ...
static void SetDefaultRenderEventPropagation(bool val)
Get/Set the default value used for RenderEventPropagation when a new instance of vtkParallelRenderMan...
virtual void InitializeRMIs()
virtual void AddRenderer(vtkRenderer *)
By default, the state of all renderers in the root's render window is propagated to the rest of the p...
virtual void RemoveAllRenderers()
By default, the state of all renderers in the root's render window is propagated to the rest of the p...
vtkUnsignedCharArray * ReducedImage
void TileWindows(int xsize, int ysize, int nColumns)
Given the x and y size of the render windows, reposition them in a tile of n columns.
double AverageTimePerPixel
Used by SetImageReductionFactorForUpdateRate to smooth transitions transitions between image reductio...
virtual void GetReducedPixelData(vtkUnsignedCharArray *data)
The most appropriate way to retrieve reduced size image data after a render.
virtual void ResetAllCameras()
Resets the camera of each renderer contained in the RenderWindow.
virtual void MagnifyImage(vtkUnsignedCharArray *fullImage, const int fullImageSize[2], vtkUnsignedCharArray *reducedImage, const int reducedImageSize[2], const int fullImageViewport[4]=nullptr, const int reducedImageViewport[4]=nullptr)
Convenience functions for magnifying images.
virtual void SetRenderWindowSize()
Called in satellites to set the render window size to the current FullImageSize and ReducedImageSize ...
int RootProcessId
The "root" node's process id.
int ObservingRenderWindow
virtual void SetImageReductionFactorForUpdateRate(double DesiredUpdateRate)
Sets the ReductionFactor based on the given desired update rate and the rendering metrics taken from ...
virtual void SetRenderWindow(vtkRenderWindow *renWin)
Set/Get the RenderWindow to use for compositing.
unsigned long BoundsRMIId
vtkMultiProcessController * Controller
virtual void CollectRendererInformation(vtkRenderer *, vtkMultiProcessStream &)
virtual void SatelliteStartRender()
Callbacks that initialize and finish rendering and other tasks.
virtual void GenericStartRenderCallback()
INTERNAL METHODS (DON NOT USE).
int ForceRenderWindowSize
vtkRenderWindow * RenderWindow
vtkDoubleArray * Viewports
void AddRenderWindowEventHandlers()
Add/Remove event handlers for the render window.
vtkUnsignedCharArray * FullImage
int RenderEventPropagation
virtual void SetMagnifyImageMethod(int method)
Sets the method used to magnify images.
virtual void StartServices()
If on node other than root, starts serving RMI requests for parallel renders.
virtual void StartInteractor()
Initializes the RMIs and then, if on root node, starts the interactor on the attached render window.
virtual void SatelliteEndRender()
Callbacks that initialize and finish rendering and other tasks.
virtual void ComputeVisiblePropBounds(vtkRenderer *ren, double bounds[6])
Calculates the bounds by gathering information from all processes.
~vtkParallelRenderManager() override
virtual void SetController(vtkMultiProcessController *controller)
Set/Get the vtkMultiProcessController which will handle communications for the parallel rendering.
unsigned long EndRenderTag
unsigned long ResetCameraClippingRangeTag
virtual int CheckForAbortComposite()
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
virtual void StopServices()
If on root node, stops the RMI processing on all service nodes.
virtual void LocalComputeVisiblePropBounds(vtkRenderer *ren, double bounds[6])
Called by ComputeVisiblePropBoundsRMI to get the bounds of a local renderer.
virtual void CheckForAbortRender()
virtual vtkRendererCollection * GetRenderers()
void SetMagnifyImageMethodToNearest()
Sets the method used to magnify images.
unsigned long RenderRMIId
int SyncRenderWindowRenderers
virtual void StartRender()
Callbacks that initialize and finish rendering and other tasks.
virtual void RemoveRenderer(vtkRenderer *)
By default, the state of all renderers in the root's render window is propagated to the rest of the p...
double ImageReductionFactor
double MaxImageReductionFactor
virtual int ChooseBuffer()
Select buffer to read from / render into.
virtual void ResetCamera(vtkRenderer *ren)
Callbacks that initialize and finish rendering and other tasks.
unsigned long ResetCameraTag
create a window for renderers to draw into
an ordered list of renderers
abstract specification for renderers
Timer support and logging.
dynamic, self-adjusting array of unsigned char
void Save(vtkMultiProcessStream &stream)
bool Restore(vtkMultiProcessStream &stream)
bool Restore(vtkMultiProcessStream &stream)
RenderWindowInfo()=default
double ImageReductionFactor
void Save(vtkMultiProcessStream &stream)
void Save(vtkMultiProcessStream &stream)
bool Restore(vtkMultiProcessStream &stream)