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 -------------------------------------------------------------------------*/
55 #ifndef vtkDataRepresentation_h
56 #define vtkDataRepresentation_h
57 
58 #include "vtkViewsCoreModule.h" // For export macro
60 
61 class vtkAlgorithmOutput;
63 class vtkAnnotationLink;
64 class vtkDataObject;
65 class vtkSelection;
66 class vtkStringArray;
67 class vtkTrivialProducer;
68 class vtkView;
69 class vtkViewTheme;
70 
72 {
73 public:
74  static vtkDataRepresentation *New();
76  void PrintSelf(ostream& os, vtkIndent indent);
77 
79 
82  { return this->Superclass::GetInputConnection(port, index); }
84 
86 
89  { return this->AnnotationLinkInternal; }
90  void SetAnnotationLink(vtkAnnotationLink* link);
92 
95  virtual void ApplyViewTheme(vtkViewTheme* vtkNotUsed(theme)) { }
96 
98 
105  void Select(vtkView* view, vtkSelection* selection)
106  { this->Select(view, selection, false); }
107  void Select(vtkView* view, vtkSelection* selection, bool extend);
109 
111 
120  void Annotate(vtkView* view, vtkAnnotationLayers* annotations)
121  { this->Annotate(view, annotations, false); }
122  void Annotate(vtkView* view, vtkAnnotationLayers* annotations, bool extend);
124 
126 
128  vtkSetMacro(Selectable, bool);
129  vtkGetMacro(Selectable, bool);
130  vtkBooleanMacro(Selectable, bool);
132 
134 
139  void UpdateSelection(vtkSelection* selection)
140  { this->UpdateSelection(selection, false); }
141  void UpdateSelection(vtkSelection* selection, bool extend);
143 
145 
151  { this->UpdateAnnotations(annotations, false); }
152  void UpdateAnnotations(vtkAnnotationLayers* annotations, bool extend);
154 
156 
160  { return this->GetInternalAnnotationOutputPort(0); }
162  { return this->GetInternalAnnotationOutputPort(port, 0); }
163  virtual vtkAlgorithmOutput* GetInternalAnnotationOutputPort(int port, int conn);
165 
167 
171  { return this->GetInternalSelectionOutputPort(0); }
173  { return this->GetInternalSelectionOutputPort(port, 0); }
174  virtual vtkAlgorithmOutput* GetInternalSelectionOutputPort(int port, int conn);
176 
178 
182  { return this->GetInternalOutputPort(0); }
184  { return this->GetInternalOutputPort(port, 0); }
185  virtual vtkAlgorithmOutput* GetInternalOutputPort(int port, int conn);
187 
189 
193  vtkSetMacro(SelectionType, int);
194  vtkGetMacro(SelectionType, int);
196 
198 
199  virtual void SetSelectionArrayNames(vtkStringArray* names);
200  vtkGetObjectMacro(SelectionArrayNames, vtkStringArray);
202 
204 
205  virtual void SetSelectionArrayName(const char* name);
206  virtual const char* GetSelectionArrayName();
208 
215  virtual vtkSelection* ConvertSelection(vtkView* view, vtkSelection* selection);
216 
217 protected:
220 
222 
231  virtual int RequestData(
235  { return 1; }
237 
240  virtual void ProcessEvents(vtkObject *caller, unsigned long eventId, void *callData);
241 
243 
244  virtual void SetAnnotationLinkInternal(vtkAnnotationLink* link);
247 
248  // Whether is represenation can handle a selection.
250 
253 
256 
257  //BTX
258  friend class vtkView;
259  friend class vtkRenderView;
260  class Command;
261  friend class Command;
262  Command* Observer;
263  //ETX
264 
265  // ------------------------------------------------------------------------
266  // Methods to override in subclasses
267  // ------------------------------------------------------------------------
268 
272  virtual bool AddToView(vtkView* vtkNotUsed(view)) { return true; }
273 
277  virtual bool RemoveFromView(vtkView* vtkNotUsed(view)) { return true; }
278 
282  virtual vtkAnnotationLayers* ConvertAnnotations(vtkView* view, vtkAnnotationLayers* annotations);
283 
284  vtkTrivialProducer* GetInternalInput(int port, int conn);
285  void SetInternalInput(int port, int conn, vtkTrivialProducer* producer);
286 
287 private:
288  vtkDataRepresentation(const vtkDataRepresentation&); // Not implemented.
289  void operator=(const vtkDataRepresentation&); // Not implemented.
290 
291  //BTX
292  class Internals;
293  Internals* Implementation;
294  //ETX
295 };
296 
297 #endif
virtual vtkAlgorithmOutput * GetInternalOutputPort()
virtual void ApplyViewTheme(vtkViewTheme *vtkNotUsed(theme))
abstract base class for most VTK objects
Definition: vtkObject.h:61
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:44
virtual bool AddToView(vtkView *vtkNotUsed(view))
Proxy object to connect input/output ports.
Sets theme colors for a graphical view.
Definition: vtkViewTheme.h:47
Producer for stand-alone data objects.
The superclass for all views.
Definition: vtkView.h:62
vtkAlgorithmOutput * GetInputConnection(int port=0, int index=0)
vtkStringArray * SelectionArrayNames
a simple class to control print indentation
Definition: vtkIndent.h:38
virtual bool RemoveFromView(vtkView *vtkNotUsed(view))
The superclass for all representations.
#define VTKVIEWSCORE_EXPORT
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:63
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:64
void UpdateSelection(vtkSelection *selection)
static vtkPassInputTypeAlgorithm * New()