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 -------------------------------------------------------------------------*/
41 #ifndef vtkView_h
42 #define vtkView_h
43 
44 #include "vtkViewsCoreModule.h" // For export macro
45 #include "vtkObject.h"
46 
47 class vtkAlgorithmOutput;
48 class vtkCommand;
49 class vtkDataObject;
51 class vtkSelection;
52 class vtkViewTheme;
53 
54 class VTKVIEWSCORE_EXPORT vtkView : public vtkObject
55 {
56 public:
57  static vtkView *New();
58  vtkTypeMacro(vtkView, vtkObject);
59  void PrintSelf(ostream& os, vtkIndent indent) VTK_OVERRIDE;
60 
64  void AddRepresentation(vtkDataRepresentation* rep);
65 
69  void SetRepresentation(vtkDataRepresentation* rep);
70 
79  vtkDataRepresentation* AddRepresentationFromInputConnection(vtkAlgorithmOutput* conn);
80 
89  vtkDataRepresentation* SetRepresentationFromInputConnection(vtkAlgorithmOutput* conn);
90 
98  vtkDataRepresentation* AddRepresentationFromInput(vtkDataObject* input);
99 
107  vtkDataRepresentation* SetRepresentationFromInput(vtkDataObject* input);
108 
112  void RemoveRepresentation(vtkDataRepresentation* rep);
113 
117  void RemoveRepresentation(vtkAlgorithmOutput* rep);
118 
122  void RemoveAllRepresentations();
123 
127  int GetNumberOfRepresentations();
128 
132  vtkDataRepresentation* GetRepresentation(int index = 0);
133 
137  bool IsRepresentationPresent(vtkDataRepresentation* rep);
138 
142  virtual void Update();
143 
147  virtual void ApplyViewTheme(vtkViewTheme* vtkNotUsed(theme)) { }
148 
154  vtkCommand* GetObserver();
155 
157 
162  {
163  const char* Message;
164  double Progress;
166 
167  public:
168  ViewProgressEventCallData(const char* msg, double progress)
169  {
170  this->Message = msg;
171  this->Progress = progress;
172  }
174  {
175  this->Message = 0;
176  }
177 
181  const char* GetProgressMessage() const
182  { return this->Message; }
183 
187  double GetProgress() const
188  { return this->Progress; }
189  };
190 
200  void RegisterProgress(vtkObject* algorithm, const char* message=NULL);
201 
205  void UnRegisterProgress(vtkObject* algorithm);
206 
207 protected:
208  vtkView();
209  ~vtkView() VTK_OVERRIDE;
210 
216  virtual void ProcessEvents(vtkObject* caller, unsigned long eventId,
217  void* callData);
218 
225  virtual vtkDataRepresentation* CreateDefaultRepresentation(vtkAlgorithmOutput* conn);
226 
231  virtual void AddRepresentationInternal(vtkDataRepresentation* vtkNotUsed(rep)) {}
232  virtual void RemoveRepresentationInternal(vtkDataRepresentation* vtkNotUsed(rep)) {}
233 
235 
239  vtkSetMacro(ReuseSingleRepresentation, bool);
240  vtkGetMacro(ReuseSingleRepresentation, bool);
241  vtkBooleanMacro(ReuseSingleRepresentation, bool);
244 
245 private:
246  vtkView(const vtkView&) VTK_DELETE_FUNCTION;
247  void operator=(const vtkView&) VTK_DELETE_FUNCTION;
248 
249  class vtkImplementation;
250  vtkImplementation* Implementation;
251 
252  class Command;
253  friend class Command;
254  Command* Observer;
255 
256  class vtkInternal;
257  vtkInternal* Internal;
258 
259 };
260 
261 #endif
virtual void ApplyViewTheme(vtkViewTheme *vtkNotUsed(theme))
Apply a theme to the view.
Definition: vtkView.h:147
abstract base class for most VTK objects
Definition: vtkObject.h:53
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
ViewProgressEventCallData(const char *msg, double progress)
Definition: vtkView.h:168
const char * GetProgressMessage() const
Get the message.
Definition: vtkView.h:181
A node in a selection tree.
Definition: vtkSelection.h:37
virtual void Update()
Updates the extensions string.
Proxy object to connect input/output ports.
Sets theme colors for a graphical view.
Definition: vtkViewTheme.h:42
superclass for callback/observer methods
Definition: vtkCommand.h:354
The superclass for all views.
Definition: vtkView.h:54
a simple class to control print indentation
Definition: vtkIndent.h:33
A ptr to an instance of ViewProgressEventCallData is provided in the call data when vtkCommand::ViewP...
Definition: vtkView.h:161
The superclass for all representations.
vtkSetMacro(IgnoreDriverBugs, bool)
When set known driver bugs are ignored during driver feature detection.
bool ReuseSingleRepresentation
Meant for use by subclasses and vtkRepresentation subclasses.
Definition: vtkView.h:241
vtkBooleanMacro(IgnoreDriverBugs, bool)
When set known driver bugs are ignored during driver feature detection.
static vtkObject * New()
Create an object with Debug turned off, modified time initialized to zero, and reference counting on...
general representation of visualization data
Definition: vtkDataObject.h:58
virtual void RemoveRepresentationInternal(vtkDataRepresentation *vtkNotUsed(rep))
Meant for use by subclasses and vtkRepresentation subclasses.
Definition: vtkView.h:232
double GetProgress() const
Get the progress value in range [0.0, 1.0].
Definition: vtkView.h:187