VTK  9.2.6
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=========================================================================*/
27#ifndef vtkSynchronizedRenderWindows_h
28#define vtkSynchronizedRenderWindows_h
29
30#include "vtkObject.h"
31#include "vtkRenderingParallelModule.h" // For export macro
32
33class vtkRenderWindow;
35class vtkCommand;
37
38class VTKRENDERINGPARALLEL_EXPORT vtkSynchronizedRenderWindows : public vtkObject
39{
40public:
43 void PrintSelf(ostream& os, vtkIndent indent) override;
44
46
52 vtkGetObjectMacro(RenderWindow, vtkRenderWindow);
54
56
61 vtkGetObjectMacro(ParallelController, vtkMultiProcessController);
63
65
75 void SetIdentifier(unsigned int id);
76 vtkGetMacro(Identifier, unsigned int);
78
80
85 vtkSetMacro(ParallelRendering, bool);
86 vtkGetMacro(ParallelRendering, bool);
87 vtkBooleanMacro(ParallelRendering, bool);
89
90 // Turns on/off render event propagation. When on (the default) and
91 // ParallelRendering is on, process 0 will send an RMI call to all remote
92 // processes to perform a synchronized render. When off, render must be
93 // manually called on each process.
94 vtkSetMacro(RenderEventPropagation, bool);
95 vtkGetMacro(RenderEventPropagation, bool);
96 vtkBooleanMacro(RenderEventPropagation, bool);
97
102 virtual void AbortRender();
103
105
110 vtkSetMacro(RootProcessId, int);
111 vtkGetMacro(RootProcessId, int);
113
114 enum
115 {
116 SYNC_RENDER_TAG = 15001,
117 };
118
119protected:
122
124 {
125 int WindowSize[2];
126 int TileScale[2];
127 double TileViewport[4];
129
130 // Save/restore the struct to/from a stream.
135 };
136
137 // These methods are called on all processes as a consequence of corresponding
138 // events being called on the render window.
139 virtual void HandleStartRender();
140 virtual void HandleEndRender() {}
141 virtual void HandleAbortRender() {}
142
143 virtual void MasterStartRender();
144 virtual void SlaveStartRender();
145
146 unsigned int Identifier;
150
153
154private:
156 void operator=(const vtkSynchronizedRenderWindows&) = delete;
157
158 class vtkObserver;
159 vtkObserver* Observer;
160 friend class vtkObserver;
161};
162
163#endif
superclass for callback/observer methods
Definition: vtkCommand.h:395
a simple class to control print indentation
Definition: vtkIndent.h:40
Multiprocessing communication superclass.
stream used to pass data across processes using vtkMultiProcessController.
abstract base class for most VTK objects
Definition: vtkObject.h:63
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)