VTK
vtkDataRepresentation.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkDataRepresentation.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 -------------------------------------------------------------------------*/
58 #ifndef __vtkDataRepresentation_h
59 #define __vtkDataRepresentation_h
60 
62 
63 class vtkAlgorithmOutput;
65 class vtkAnnotationLink;
66 class vtkDataObject;
67 class vtkSelection;
68 class vtkStringArray;
69 class vtkView;
70 class vtkViewTheme;
71 
73 {
74 public:
75  static vtkDataRepresentation *New();
77  void PrintSelf(ostream& os, vtkIndent indent);
78 
80 
83  { return this->Superclass::GetInputConnection(port, index); }
85 
87 
90  { return this->AnnotationLinkInternal; }
91  void SetAnnotationLink(vtkAnnotationLink* link);
93 
96  virtual void ApplyViewTheme(vtkViewTheme* vtkNotUsed(theme)) { }
97 
99 
106  void Select(vtkView* view, vtkSelection* selection)
107  { this->Select(view, selection, false); }
108  void Select(vtkView* view, vtkSelection* selection, bool extend);
110 
112 
121  void Annotate(vtkView* view, vtkAnnotationLayers* annotations)
122  { this->Annotate(view, annotations, false); }
123  void Annotate(vtkView* view, vtkAnnotationLayers* annotations, bool extend);
125 
127 
129  vtkSetMacro(Selectable, bool);
130  vtkGetMacro(Selectable, bool);
131  vtkBooleanMacro(Selectable, bool);
133 
135 
140  void UpdateSelection(vtkSelection* selection)
141  { this->UpdateSelection(selection, false); }
142  void UpdateSelection(vtkSelection* selection, bool extend);
144 
146 
152  { this->UpdateAnnotations(annotations, false); }
153  void UpdateAnnotations(vtkAnnotationLayers* annotations, bool extend);
155 
157 
161  { return this->GetInternalAnnotationOutputPort(0); }
163  { return this->GetInternalAnnotationOutputPort(port, 0); }
164  virtual vtkAlgorithmOutput* GetInternalAnnotationOutputPort(int port, int conn);
166 
168 
172  { return this->GetInternalSelectionOutputPort(0); }
174  { return this->GetInternalSelectionOutputPort(port, 0); }
175  virtual vtkAlgorithmOutput* GetInternalSelectionOutputPort(int port, int conn);
177 
179 
183  { return this->GetInternalOutputPort(0); }
185  { return this->GetInternalOutputPort(port, 0); }
186  virtual vtkAlgorithmOutput* GetInternalOutputPort(int port, int conn);
188 
190 
194  vtkSetMacro(SelectionType, int);
195  vtkGetMacro(SelectionType, int);
197 
199 
200  virtual void SetSelectionArrayNames(vtkStringArray* names);
201  vtkGetObjectMacro(SelectionArrayNames, vtkStringArray);
203 
205 
206  virtual void SetSelectionArrayName(const char* name);
207  virtual const char* GetSelectionArrayName();
209 
216  virtual vtkSelection* ConvertSelection(vtkView* view, vtkSelection* selection);
217 
218 protected:
221 
223 
232  virtual int RequestData(
236  { return 1; }
238 
241  virtual void ProcessEvents(vtkObject *caller, unsigned long eventId, void *callData);
242 
244 
245  virtual void SetAnnotationLinkInternal(vtkAnnotationLink* link);
248 
249  // Whether is represenation can handle a selection.
251 
254 
257 
258  //BTX
259  friend class vtkView;
260  friend class vtkRenderView;
261  class Command;
262  friend class Command;
263  Command* Observer;
264  //ETX
265 
266  // ------------------------------------------------------------------------
267  // Methods to override in subclasses
268  // ------------------------------------------------------------------------
269 
273  virtual bool AddToView(vtkView* vtkNotUsed(view)) { return true; }
274 
278  virtual bool RemoveFromView(vtkView* vtkNotUsed(view)) { return true; }
279 
283  virtual vtkAnnotationLayers* ConvertAnnotations(vtkView* view, vtkAnnotationLayers* annotations);
284 
285 private:
286  vtkDataRepresentation(const vtkDataRepresentation&); // Not implemented.
287  void operator=(const vtkDataRepresentation&); // Not implemented.
288 
289  //BTX
290  class Internals;
291  Internals* Implementation;
292  //ETX
293 };
294 
295 #endif
virtual vtkAlgorithmOutput * GetInternalOutputPort()
virtual void ApplyViewTheme(vtkViewTheme *vtkNotUsed(theme))
abstract base class for most VTK objects
Definition: vtkObject.h:60
Superclass for algorithms that produce output of the same type as input.
Store vtkAlgorithm input/output information.
virtual vtkAlgorithmOutput * GetInternalAnnotationOutputPort(int port)
virtual vtkAlgorithmOutput * GetInternalOutputPort(int port)
virtual vtkAlgorithmOutput * GetInternalAnnotationOutputPort()
void Select(vtkView *view, vtkSelection *selection)
virtual vtkAlgorithmOutput * GetInternalSelectionOutputPort(int port)
a vtkAbstractArray subclass for strings
A node in a selection tree. Used to store selection results.
Definition: vtkSelection.h:43
virtual bool AddToView(vtkView *vtkNotUsed(view))
#define VTK_VIEWS_EXPORT
Proxy object to connect input/output ports.
Sets theme colors for a graphical view.
Definition: vtkViewTheme.h:46
The superclass for all views.
Definition: vtkView.h:61
vtkAlgorithmOutput * GetInputConnection(int port=0, int index=0)
vtkStringArray * SelectionArrayNames
a simple class to control print indentation
Definition: vtkIndent.h:37
virtual bool RemoveFromView(vtkView *vtkNotUsed(view))
The superclass for all representations.
virtual int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *)
vtkAnnotationLink * GetAnnotationLink()
void PrintSelf(ostream &os, vtkIndent indent)
void Annotate(vtkView *view, vtkAnnotationLayers *annotations)
A view containing a renderer.
Definition: vtkRenderView.h:62
Stores a ordered collection of annotation sets.
virtual vtkAlgorithmOutput * GetInternalSelectionOutputPort()
vtkAnnotationLink * AnnotationLinkInternal
Store zero or more vtkInformation instances.
void UpdateAnnotations(vtkAnnotationLayers *annotations)
vtkAlgorithmOutput * GetInputConnection(int port, int index)
general representation of visualization data
Definition: vtkDataObject.h:70
void UpdateSelection(vtkSelection *selection)
static vtkPassInputTypeAlgorithm * New()