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 
89  vtkAnnotationLink* GetAnnotationLink()
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 
151  void UpdateAnnotations(vtkAnnotationLayers* annotations)
152  { this->UpdateAnnotations(annotations, false); }
153  void UpdateAnnotations(vtkAnnotationLayers* annotations, bool extend);
155 
157 
160  virtual vtkAlgorithmOutput* GetInternalAnnotationOutputPort()
161  { return this->GetInternalAnnotationOutputPort(0); }
162  virtual vtkAlgorithmOutput* GetInternalAnnotationOutputPort(int port)
163  { return this->GetInternalAnnotationOutputPort(port, 0); }
164  virtual vtkAlgorithmOutput* GetInternalAnnotationOutputPort(int port, int conn);
166 
168 
171  virtual vtkAlgorithmOutput* GetInternalSelectionOutputPort()
172  { return this->GetInternalSelectionOutputPort(0); }
173  virtual vtkAlgorithmOutput* GetInternalSelectionOutputPort(int port)
174  { return this->GetInternalSelectionOutputPort(port, 0); }
175  virtual vtkAlgorithmOutput* GetInternalSelectionOutputPort(int port, int conn);
177 
179 
182  virtual vtkAlgorithmOutput* GetInternalOutputPort()
183  { return this->GetInternalOutputPort(0); }
184  virtual vtkAlgorithmOutput* GetInternalOutputPort(int port)
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