VTK  9.1.0
vtkSynchronizedRenderWindows.h
Go to the documentation of this file.
1/*=========================================================================
2
3 Program: Visualization Toolkit
4 Module: vtkSynchronizedRenderWindows.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=========================================================================*/
24#ifndef vtkSynchronizedRenderWindows_h
25#define vtkSynchronizedRenderWindows_h
26
27#include "vtkObject.h"
28#include "vtkRenderingParallelModule.h" // For export macro
29
30class vtkRenderWindow;
32class vtkCommand;
34
35class VTKRENDERINGPARALLEL_EXPORT vtkSynchronizedRenderWindows : public vtkObject
36{
37public:
40 void PrintSelf(ostream& os, vtkIndent indent) override;
41
43
49 vtkGetObjectMacro(RenderWindow, vtkRenderWindow);
51
53
58 vtkGetObjectMacro(ParallelController, vtkMultiProcessController);
60
62
72 void SetIdentifier(unsigned int id);
73 vtkGetMacro(Identifier, unsigned int);
75
77
82 vtkSetMacro(ParallelRendering, bool);
83 vtkGetMacro(ParallelRendering, bool);
84 vtkBooleanMacro(ParallelRendering, bool);
86
87 // Turns on/off render event propagation. When on (the default) and
88 // ParallelRendering is on, process 0 will send an RMI call to all remote
89 // processes to perform a synchronized render. When off, render must be
90 // manually called on each process.
91 vtkSetMacro(RenderEventPropagation, bool);
92 vtkGetMacro(RenderEventPropagation, bool);
93 vtkBooleanMacro(RenderEventPropagation, bool);
94
99 virtual void AbortRender();
100
102
107 vtkSetMacro(RootProcessId, int);
108 vtkGetMacro(RootProcessId, int);
110
111 enum
112 {
113 SYNC_RENDER_TAG = 15001,
114 };
115
116protected:
119
121 {
122 int WindowSize[2];
123 int TileScale[2];
124 double TileViewport[4];
126
127 // Save/restore the struct to/from a stream.
132 };
133
134 // These methods are called on all processes as a consequence of corresponding
135 // events being called on the render window.
136 virtual void HandleStartRender();
137 virtual void HandleEndRender() {}
138 virtual void HandleAbortRender() {}
139
140 virtual void MasterStartRender();
141 virtual void SlaveStartRender();
142
143 unsigned int Identifier;
147
150
151private:
153 void operator=(const vtkSynchronizedRenderWindows&) = delete;
154
155 class vtkObserver;
156 vtkObserver* Observer;
157 friend class vtkObserver;
158};
159
160#endif
superclass for callback/observer methods
Definition: vtkCommand.h:394
a simple class to control print indentation
Definition: vtkIndent.h:113
Multiprocessing communication superclass.
stream used to pass data across processes using vtkMultiProcessController.
abstract base class for most VTK objects
Definition: vtkObject.h:82
create a window for renderers to draw into
synchronizes render windows across processes.
vtkMultiProcessController * ParallelController
virtual void AbortRender()
This method call be called while a render is in progress to abort the rendering.
~vtkSynchronizedRenderWindows() override
virtual void MasterStartRender()
static vtkSynchronizedRenderWindows * New()
virtual void HandleStartRender()
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
virtual void SlaveStartRender()
void SetParallelController(vtkMultiProcessController *)
Set the parallel message communicator.
void SetIdentifier(unsigned int id)
It's acceptable to have multiple instances on vtkSynchronizedRenderWindows on each processes to synch...
void SetRenderWindow(vtkRenderWindow *)
Set the render window to be synchronized by this vtkSynchronizedRenderWindows instance.
bool Restore(vtkMultiProcessStream &stream)
void Save(vtkMultiProcessStream &stream)