VTK
vtkView.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkView.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 =========================================================================*/
15 /*-------------------------------------------------------------------------
16  Copyright 2008 Sandia Corporation.
17  Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation,
18  the U.S. Government retains certain rights in this software.
19 -------------------------------------------------------------------------*/
47 #ifndef vtkView_h
48 #define vtkView_h
49 
50 #include "vtkViewsCoreModule.h" // For export macro
51 #include "vtkObject.h"
52 
53 class vtkAlgorithmOutput;
54 class vtkCommand;
55 class vtkDataObject;
57 class vtkSelection;
58 class vtkViewTheme;
59 
60 class VTKVIEWSCORE_EXPORT vtkView : public vtkObject
61 {
62 public:
63  static vtkView *New();
64  vtkTypeMacro(vtkView, vtkObject);
65  void PrintSelf(ostream& os, vtkIndent indent);
66 
70  void AddRepresentation(vtkDataRepresentation* rep);
71 
75  void SetRepresentation(vtkDataRepresentation* rep);
76 
85  vtkDataRepresentation* AddRepresentationFromInputConnection(vtkAlgorithmOutput* conn);
86 
95  vtkDataRepresentation* SetRepresentationFromInputConnection(vtkAlgorithmOutput* conn);
96 
104  vtkDataRepresentation* AddRepresentationFromInput(vtkDataObject* input);
105 
113  vtkDataRepresentation* SetRepresentationFromInput(vtkDataObject* input);
114 
118  void RemoveRepresentation(vtkDataRepresentation* rep);
119 
123  void RemoveRepresentation(vtkAlgorithmOutput* rep);
124 
128  void RemoveAllRepresentations();
129 
133  int GetNumberOfRepresentations();
134 
138  vtkDataRepresentation* GetRepresentation(int index = 0);
139 
143  bool IsRepresentationPresent(vtkDataRepresentation* rep);
144 
148  virtual void Update();
149 
153  virtual void ApplyViewTheme(vtkViewTheme* vtkNotUsed(theme)) { }
154 
160  vtkCommand* GetObserver();
161 
163 
168  {
169  const char* Message;
170  double Progress;
172 
173  public:
174  ViewProgressEventCallData(const char* msg, double progress)
175  {
176  this->Message = msg;
177  this->Progress = progress;
178  }
180  {
181  this->Message = 0;
182  }
183 
187  const char* GetProgressMessage() const
188  { return this->Message; }
189 
193  double GetProgress() const
194  { return this->Progress; }
195  };
196 
206  void RegisterProgress(vtkObject* algorithm, const char* message=NULL);
207 
211  void UnRegisterProgress(vtkObject* algorithm);
212 
213 protected:
214  vtkView();
215  ~vtkView();
216 
222  virtual void ProcessEvents(vtkObject* caller, unsigned long eventId,
223  void* callData);
224 
231  virtual vtkDataRepresentation* CreateDefaultRepresentation(vtkAlgorithmOutput* conn);
232 
237  virtual void AddRepresentationInternal(vtkDataRepresentation* vtkNotUsed(rep)) {}
238  virtual void RemoveRepresentationInternal(vtkDataRepresentation* vtkNotUsed(rep)) {}
239 
241 
245  vtkSetMacro(ReuseSingleRepresentation, bool);
246  vtkGetMacro(ReuseSingleRepresentation, bool);
247  vtkBooleanMacro(ReuseSingleRepresentation, bool);
250 
251 private:
252  vtkView(const vtkView&) VTK_DELETE_FUNCTION;
253  void operator=(const vtkView&) VTK_DELETE_FUNCTION;
254 
255  class vtkImplementation;
256  vtkImplementation* Implementation;
257 
258  class Command;
259  friend class Command;
260  Command* Observer;
261 
262  class vtkInternal;
263  vtkInternal* Internal;
264 
265 };
266 
267 #endif
vtkCommand
superclass for callback/observer methods
Definition: vtkCommand.h:341
vtkView::ReuseSingleRepresentation
bool ReuseSingleRepresentation
Definition: vtkView.h:247
vtkView::ViewProgressEventCallData::GetProgressMessage
const char * GetProgressMessage() const
Get the message.
Definition: vtkView.h:187
vtkView::ViewProgressEventCallData::GetProgress
double GetProgress() const
Get the progress value in range [0.0, 1.0].
Definition: vtkView.h:193
vtkObject::New
static vtkObject * New()
Create an object with Debug turned off, modified time initialized to zero, and reference counting on.
vtkObject
abstract base class for most VTK objects
Definition: vtkObject.h:59
vtkView::AddRepresentationInternal
virtual void AddRepresentationInternal(vtkDataRepresentation *vtkNotUsed(rep))
Subclass "hooks" for notifying subclasses of vtkView when representations are added or removed.
Definition: vtkView.h:237
vtkSelection
A node in a selection tree. Used to store selection results.
Definition: vtkSelection.h:43
vtkView
The superclass for all views.
Definition: vtkView.h:60
vtkViewTheme
Sets theme colors for a graphical view.
Definition: vtkViewTheme.h:48
Update
virtual void Update()
Updates the extensions string.
vtkView::ViewProgressEventCallData::ViewProgressEventCallData
ViewProgressEventCallData(const char *msg, double progress)
Definition: vtkView.h:174
vtkView::ViewProgressEventCallData::~ViewProgressEventCallData
~ViewProgressEventCallData()
Definition: vtkView.h:179
vtkDataRepresentation
The superclass for all representations.
Definition: vtkDataRepresentation.h:69
vtkView::ViewProgressEventCallData
A ptr to an instance of ViewProgressEventCallData is provided in the call data when vtkCommand::ViewP...
Definition: vtkView.h:167
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:39
vtkView::ApplyViewTheme
virtual void ApplyViewTheme(vtkViewTheme *vtkNotUsed(theme))
Apply a theme to the view.
Definition: vtkView.h:153
vtkObject::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkObject.h
vtkBooleanMacro
vtkBooleanMacro(IgnoreDriverBugs, bool)
Updates the extensions string.
vtkSetMacro
vtkSetMacro(IgnoreDriverBugs, bool)
Updates the extensions string.
vtkAlgorithmOutput
Proxy object to connect input/output ports.
Definition: vtkAlgorithmOutput.h:39
vtkView::RemoveRepresentationInternal
virtual void RemoveRepresentationInternal(vtkDataRepresentation *vtkNotUsed(rep))
Definition: vtkView.h:238
vtkX3D::progress
Definition: vtkX3D.h:452
vtkDataObject
general representation of visualization data
Definition: vtkDataObject.h:64
vtkX3D::index
Definition: vtkX3D.h:246