VTK
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 "vtkRenderingParallelModule.h" // For export macro
31#include "vtkObject.h"
32
33class vtkRenderWindow;
35class vtkCommand;
37
38class VTKRENDERINGPARALLEL_EXPORT vtkSynchronizedRenderWindows : public vtkObject
39{
40public:
43 void PrintSelf(ostream& os, vtkIndent indent);
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 };
118protected:
121
123 {
124 int WindowSize[2];
125 int TileScale[2];
126 double TileViewport[4];
128
129 // Save/restore the struct to/from a stream.
134 };
135
136 // These methods are called on all processes as a consequence of corresponding
137 // events being called on the render window.
138 virtual void HandleStartRender();
139 virtual void HandleEndRender() {}
140 virtual void HandleAbortRender() {}
141
142 virtual void MasterStartRender();
143 virtual void SlaveStartRender();
144
145 unsigned int Identifier;
149
152
153private:
155 void operator=(const vtkSynchronizedRenderWindows&) VTK_DELETE_FUNCTION;
156
157 class vtkObserver;
158 vtkObserver* Observer;
159 friend class vtkObserver;
160
161};
162
163#endif
164
165
superclass for callback/observer methods
Definition: vtkCommand.h:342
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:60
create a window for renderers to draw into
synchronizes render windows across processess.
vtkMultiProcessController * ParallelController
virtual void AbortRender()
This method call be called while a render is in progress to abort the rendering.
virtual void MasterStartRender()
static vtkSynchronizedRenderWindows * New()
virtual void HandleStartRender()
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.
void PrintSelf(ostream &os, vtkIndent indent)
Methods invoked by print to print information about the object including superclasses.
bool Restore(vtkMultiProcessStream &stream)
void Save(vtkMultiProcessStream &stream)
vtkSetMacro(IgnoreDriverBugs, bool)
Updates the extensions string.
vtkBooleanMacro(IgnoreDriverBugs, bool)
Updates the extensions string.