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 -------------------------------------------------------------------------*/
49 #ifndef vtkView_h
50 #define vtkView_h
51 
52 #include "vtkViewsCoreModule.h" // For export macro
53 #include "vtkObject.h"
54 
55 class vtkAlgorithmOutput;
56 class vtkCommand;
57 class vtkDataObject;
59 class vtkSelection;
60 class vtkViewTheme;
61 
63 {
64 public:
65  static vtkView *New();
66  vtkTypeMacro(vtkView, vtkObject);
67  void PrintSelf(ostream& os, vtkIndent indent);
68 
70  void AddRepresentation(vtkDataRepresentation* rep);
71 
73  void SetRepresentation(vtkDataRepresentation* rep);
74 
80  vtkDataRepresentation* AddRepresentationFromInputConnection(vtkAlgorithmOutput* conn);
81 
87  vtkDataRepresentation* SetRepresentationFromInputConnection(vtkAlgorithmOutput* conn);
88 
94  vtkDataRepresentation* AddRepresentationFromInput(vtkDataObject* input);
95 
100  vtkDataRepresentation* SetRepresentationFromInput(vtkDataObject* input);
101 
103  void RemoveRepresentation(vtkDataRepresentation* rep);
104 
106  void RemoveRepresentation(vtkAlgorithmOutput* rep);
107 
109  void RemoveAllRepresentations();
110 
113  int GetNumberOfRepresentations();
114 
116  vtkDataRepresentation* GetRepresentation(int index = 0);
117 
119  bool IsRepresentationPresent(vtkDataRepresentation* rep);
120 
122  virtual void Update();
123 
125  virtual void ApplyViewTheme(vtkViewTheme* vtkNotUsed(theme)) { }
126 
127  //BTX
131  vtkCommand* GetObserver();
132 
134 
137  {
138  const char* Message;
139  double Progress;
141 
142  public:
143  ViewProgressEventCallData(const char* msg, double progress)
144  {
145  this->Message = msg;
146  this->Progress = progress;
147  }
149  {
150  this->Message = 0;
151  }
152 
154 
155  const char* GetProgressMessage() const
156  { return this->Message; }
158 
160 
161  double GetProgress() const
162  { return this->Progress; }
163  };
164  //ETX
166 
174  void RegisterProgress(vtkObject* algorithm, const char* message=NULL);
175 
177  void UnRegisterProgress(vtkObject* algorithm);
178 
179 //BTX
180 protected:
181  vtkView();
182  ~vtkView();
183 
185 
188  virtual void ProcessEvents(vtkObject* caller, unsigned long eventId,
189  void* callData);
191 
197  virtual vtkDataRepresentation* CreateDefaultRepresentation(vtkAlgorithmOutput* conn);
198 
200 
203  virtual void AddRepresentationInternal(vtkDataRepresentation* vtkNotUsed(rep)) {}
204  virtual void RemoveRepresentationInternal(vtkDataRepresentation* vtkNotUsed(rep)) {}
206 
208 
210  vtkSetMacro(ReuseSingleRepresentation, bool);
211  vtkGetMacro(ReuseSingleRepresentation, bool);
212  vtkBooleanMacro(ReuseSingleRepresentation, bool);
215 
216 private:
217  vtkView(const vtkView&); // Not implemented.
218  void operator=(const vtkView&); // Not implemented.
219 
220  class vtkImplementation;
221  vtkImplementation* Implementation;
222 
223  class Command;
224  friend class Command;
225  Command* Observer;
226 
227  class vtkInternal;
228  vtkInternal* Internal;
229 //ETX
230 };
231 
232 #endif
virtual void ApplyViewTheme(vtkViewTheme *vtkNotUsed(theme))
Definition: vtkView.h:125
abstract base class for most VTK objects
Definition: vtkObject.h:61
ViewProgressEventCallData(const char *msg, double progress)
Definition: vtkView.h:143
A node in a selection tree. Used to store selection results.
Definition: vtkSelection.h:44
virtual void AddRepresentationInternal(vtkDataRepresentation *vtkNotUsed(rep))
Definition: vtkView.h:203
virtual void Update()
Proxy object to connect input/output ports.
Sets theme colors for a graphical view.
Definition: vtkViewTheme.h:47
superclass for callback/observer methods
Definition: vtkCommand.h:325
virtual void PrintSelf(ostream &os, vtkIndent indent)
The superclass for all views.
Definition: vtkView.h:62
a simple class to control print indentation
Definition: vtkIndent.h:38
const char * GetProgressMessage() const
Definition: vtkView.h:155
The superclass for all representations.
#define VTKVIEWSCORE_EXPORT
bool ReuseSingleRepresentation
Definition: vtkView.h:212
static vtkObject * New()
general representation of visualization data
Definition: vtkDataObject.h:64
virtual void RemoveRepresentationInternal(vtkDataRepresentation *vtkNotUsed(rep))
Definition: vtkView.h:204