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 "vtkObject.h"
53 
54 class vtkAlgorithmOutput;
55 class vtkCommand;
56 class vtkDataObject;
58 class vtkSelection;
59 class vtkViewTheme;
60 
62 {
63 public:
64  static vtkView *New();
65  vtkTypeMacro(vtkView, vtkObject);
66  void PrintSelf(ostream& os, vtkIndent indent);
67 
69  void AddRepresentation(vtkDataRepresentation* rep);
70 
72  void SetRepresentation(vtkDataRepresentation* rep);
73 
79  vtkDataRepresentation* AddRepresentationFromInputConnection(vtkAlgorithmOutput* conn);
80 
86  vtkDataRepresentation* SetRepresentationFromInputConnection(vtkAlgorithmOutput* conn);
87 
93  vtkDataRepresentation* AddRepresentationFromInput(vtkDataObject* input);
94 
99  vtkDataRepresentation* SetRepresentationFromInput(vtkDataObject* input);
100 
102  void RemoveRepresentation(vtkDataRepresentation* rep);
103 
105  void RemoveRepresentation(vtkAlgorithmOutput* rep);
106 
108  void RemoveAllRepresentations();
109 
112  int GetNumberOfRepresentations();
113 
115  vtkDataRepresentation* GetRepresentation(int index = 0);
116 
118  bool IsRepresentationPresent(vtkDataRepresentation* rep);
119 
121  virtual void Update();
122 
124  virtual void ApplyViewTheme(vtkViewTheme* vtkNotUsed(theme)) { }
125 
126  //BTX
130  vtkCommand* GetObserver();
131 
133 
136  {
137  const char* Message;
138  double Progress;
140 
141  public:
142  ViewProgressEventCallData(const char* msg, double progress)
143  {
144  this->Message = msg;
145  this->Progress = progress;
146  }
148  {
149  this->Message = 0;
150  }
151 
153 
154  const char* GetProgressMessage() const
155  { return this->Message; }
157 
159 
160  double GetProgress() const
161  { return this->Progress; }
162  };
163  //ETX
165 
173  void RegisterProgress(vtkObject* algorithm, const char* message=NULL);
174 
176  void UnRegisterProgress(vtkObject* algorithm);
177 
178 //BTX
179 protected:
180  vtkView();
181  ~vtkView();
182 
184 
187  virtual void ProcessEvents(vtkObject* caller, unsigned long eventId,
188  void* callData);
190 
196  virtual vtkDataRepresentation* CreateDefaultRepresentation(vtkAlgorithmOutput* conn);
197 
199 
202  virtual void AddRepresentationInternal(vtkDataRepresentation* vtkNotUsed(rep)) {}
203  virtual void RemoveRepresentationInternal(vtkDataRepresentation* vtkNotUsed(rep)) {}
205 
207 
209  vtkSetMacro(ReuseSingleRepresentation, bool);
210  vtkGetMacro(ReuseSingleRepresentation, bool);
211  vtkBooleanMacro(ReuseSingleRepresentation, bool);
214 
215 private:
216  vtkView(const vtkView&); // Not implemented.
217  void operator=(const vtkView&); // Not implemented.
218 
219  class vtkImplementation;
220  vtkImplementation* Implementation;
221 
222  class Command;
223  friend class Command;
224  Command* Observer;
225 
226  class vtkInternal;
227  vtkInternal* Internal;
228 //ETX
229 };
230 
231 #endif
virtual void ApplyViewTheme(vtkViewTheme *vtkNotUsed(theme))
Definition: vtkView.h:124
abstract base class for most VTK objects
Definition: vtkObject.h:60
ViewProgressEventCallData(const char *msg, double progress)
Definition: vtkView.h:142
A node in a selection tree. Used to store selection results.
Definition: vtkSelection.h:43
virtual void AddRepresentationInternal(vtkDataRepresentation *vtkNotUsed(rep))
Definition: vtkView.h:202
#define VTK_VIEWS_EXPORT
Proxy object to connect input/output ports.
Sets theme colors for a graphical view.
Definition: vtkViewTheme.h:46
superclass for callback/observer methods
Definition: vtkCommand.h:211
virtual void PrintSelf(ostream &os, vtkIndent indent)
The superclass for all views.
Definition: vtkView.h:61
a simple class to control print indentation
Definition: vtkIndent.h:37
const char * GetProgressMessage() const
Definition: vtkView.h:154
The superclass for all representations.
bool ReuseSingleRepresentation
Definition: vtkView.h:211
static vtkObject * New()
general representation of visualization data
Definition: vtkDataObject.h:70
virtual void RemoveRepresentationInternal(vtkDataRepresentation *vtkNotUsed(rep))
Definition: vtkView.h:203