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 
33 class vtkRenderWindow;
35 class vtkCommand;
37 
38 class VTKRENDERINGPARALLEL_EXPORT vtkSynchronizedRenderWindows : public vtkObject
39 {
40 public:
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  };
118 protected:
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 
153 private:
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 
vtkSynchronizedRenderWindows::New
static vtkSynchronizedRenderWindows * New()
vtkCommand
superclass for callback/observer methods
Definition: vtkCommand.h:342
vtkSynchronizedRenderWindows::RenderEventPropagation
bool RenderEventPropagation
Definition: vtkSynchronizedRenderWindows.h:147
vtkSynchronizedRenderWindows::RenderWindowInfo::CopyFrom
void CopyFrom(vtkRenderWindow *)
vtkSynchronizedRenderWindows::HandleAbortRender
virtual void HandleAbortRender()
Definition: vtkSynchronizedRenderWindows.h:140
vtkSynchronizedRenderWindows::RootProcessId
int RootProcessId
Definition: vtkSynchronizedRenderWindows.h:148
vtkSynchronizedRenderWindows::ParallelController
vtkMultiProcessController * ParallelController
Definition: vtkSynchronizedRenderWindows.h:151
vtkSynchronizedRenderWindows::SetRenderWindow
void SetRenderWindow(vtkRenderWindow *)
Set the render window to be synchronized by this vtkSynchronizedRenderWindows instance.
vtkSynchronizedRenderWindows::HandleEndRender
virtual void HandleEndRender()
Definition: vtkSynchronizedRenderWindows.h:139
vtkMultiProcessStream
stream used to pass data across processes using vtkMultiProcessController.
Definition: vtkMultiProcessStream.h:41
vtkObject
abstract base class for most VTK objects
Definition: vtkObject.h:60
vtkSynchronizedRenderWindows::~vtkSynchronizedRenderWindows
~vtkSynchronizedRenderWindows()
vtkSynchronizedRenderWindows::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent)
Methods invoked by print to print information about the object including superclasses.
vtkSynchronizedRenderWindows::HandleStartRender
virtual void HandleStartRender()
vtkSynchronizedRenderWindows::AbortRender
virtual void AbortRender()
This method call be called while a render is in progress to abort the rendering.
vtkSynchronizedRenderWindows::RenderWindowInfo::Save
void Save(vtkMultiProcessStream &stream)
vtkSynchronizedRenderWindows::MasterStartRender
virtual void MasterStartRender()
vtkSynchronizedRenderWindows::SetParallelController
void SetParallelController(vtkMultiProcessController *)
Set the parallel message communicator.
vtkMultiProcessController
Multiprocessing communication superclass.
Definition: vtkMultiProcessController.h:83
vtkSynchronizedRenderWindows::ParallelRendering
bool ParallelRendering
Definition: vtkSynchronizedRenderWindows.h:146
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:40
vtkSynchronizedRenderWindows::RenderWindowInfo
Definition: vtkSynchronizedRenderWindows.h:123
vtkSynchronizedRenderWindows::SlaveStartRender
virtual void SlaveStartRender()
vtkSynchronizedRenderWindows::Identifier
unsigned int Identifier
Definition: vtkSynchronizedRenderWindows.h:145
vtkSynchronizedRenderWindows::RenderWindowInfo::Restore
bool Restore(vtkMultiProcessStream &stream)
vtkObject.h
vtkBooleanMacro
vtkBooleanMacro(IgnoreDriverBugs, bool)
Updates the extensions string.
vtkSynchronizedRenderWindows
synchronizes render windows across processess.
Definition: vtkSynchronizedRenderWindows.h:39
vtkSetMacro
vtkSetMacro(IgnoreDriverBugs, bool)
Updates the extensions string.
vtkSynchronizedRenderWindows::RenderWindowInfo::DesiredUpdateRate
double DesiredUpdateRate
Definition: vtkSynchronizedRenderWindows.h:127
vtkRenderWindow
create a window for renderers to draw into
Definition: vtkRenderWindow.h:87
vtkSynchronizedRenderWindows::vtkSynchronizedRenderWindows
vtkSynchronizedRenderWindows()
vtkSynchronizedRenderWindows::RenderWindow
vtkRenderWindow * RenderWindow
Definition: vtkSynchronizedRenderWindows.h:150
vtkSynchronizedRenderWindows::RenderWindowInfo::CopyTo
void CopyTo(vtkRenderWindow *)
vtkSynchronizedRenderWindows::SetIdentifier
void SetIdentifier(unsigned int id)
It's acceptable to have multiple instances on vtkSynchronizedRenderWindows on each processes to synch...