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:
76  void PrintSelf(ostream& os, vtkIndent indent);
77 
79 
82  { return this->Superclass::GetInputConnection(port, index); }
84 
86 
89  { return this->AnnotationLinkInternal; }
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); }
165 
167 
171  { return this->GetInternalSelectionOutputPort(0); }
173  { return this->GetInternalSelectionOutputPort(port, 0); }
176 
178 
182  { return this->GetInternalOutputPort(0); }
184  { return this->GetInternalOutputPort(port, 0); }
187 
189 
193  vtkSetMacro(SelectionType, int);
194  vtkGetMacro(SelectionType, int);
196 
198 
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 
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 
283 
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
vtkDataRepresentation::GetAnnotationLink
vtkAnnotationLink * GetAnnotationLink()
Definition: vtkDataRepresentation.h:88
vtkDataRepresentation::New
static vtkDataRepresentation * New()
vtkGetObjectMacro
#define vtkGetObjectMacro(name, type)
Definition: vtkSetGet.h:232
vtkDataRepresentation::AddToView
virtual bool AddToView(vtkView *vtkNotUsed(view))
Definition: vtkDataRepresentation.h:272
vtkRenderView
A view containing a renderer.
Definition: vtkRenderView.h:64
vtkDataRepresentation::UpdateAnnotations
void UpdateAnnotations(vtkAnnotationLayers *annotations, bool extend)
vtkPassInputTypeAlgorithm.h
VTKVIEWSCORE_EXPORT
#define VTKVIEWSCORE_EXPORT
Definition: vtkViewsCoreModule.h:15
vtkDataRepresentation::UpdateSelection
void UpdateSelection(vtkSelection *selection, bool extend)
vtkInformationVector
Store zero or more vtkInformation instances.
Definition: vtkInformationVector.h:41
vtkViewsCoreModule.h
vtkDataRepresentation::Observer
Command * Observer
Definition: vtkDataRepresentation.h:262
vtkDataRepresentation::SelectionType
int SelectionType
Definition: vtkDataRepresentation.h:252
vtkTypeMacro
#define vtkTypeMacro(thisClass, superclass)
Definition: vtkSetGet.h:642
vtkgl::names
GLuint GLuint * names
Definition: vtkgl.h:19215
vtkObject
abstract base class for most VTK objects
Definition: vtkObject.h:62
vtkDataRepresentation::RequestData
virtual int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *)
Definition: vtkDataRepresentation.h:231
vtkDataRepresentation::ProcessEvents
virtual void ProcessEvents(vtkObject *caller, unsigned long eventId, void *callData)
vtkSelection
A node in a selection tree. Used to store selection results.
Definition: vtkSelection.h:45
vtkDataRepresentation::GetInternalAnnotationOutputPort
virtual vtkAlgorithmOutput * GetInternalAnnotationOutputPort(int port)
Definition: vtkDataRepresentation.h:161
vtkDataRepresentation::~vtkDataRepresentation
~vtkDataRepresentation()
vtkTrivialProducer
Producer for stand-alone data objects.
Definition: vtkTrivialProducer.h:37
vtkDataRepresentation::RemoveFromView
virtual bool RemoveFromView(vtkView *vtkNotUsed(view))
Definition: vtkDataRepresentation.h:277
vtkDataRepresentation::GetInputConnection
vtkAlgorithmOutput * GetInputConnection(int port=0, int index=0)
Definition: vtkDataRepresentation.h:81
vtkDataRepresentation::GetInternalSelectionOutputPort
virtual vtkAlgorithmOutput * GetInternalSelectionOutputPort(int port)
Definition: vtkDataRepresentation.h:172
vtkDataRepresentation::Annotate
void Annotate(vtkView *view, vtkAnnotationLayers *annotations)
Definition: vtkDataRepresentation.h:120
vtkView
The superclass for all views.
Definition: vtkView.h:63
vtkDataRepresentation::Select
void Select(vtkView *view, vtkSelection *selection, bool extend)
vtkViewTheme
Sets theme colors for a graphical view.
Definition: vtkViewTheme.h:48
vtkDataRepresentation::SetSelectionArrayName
virtual void SetSelectionArrayName(const char *name)
vtkX3D::port
@ port
Definition: vtkX3D.h:447
vtkgl::name
GLuint const GLchar * name
Definition: vtkgl.h:11983
vtkNotUsed
#define vtkNotUsed(x)
Definition: vtkSetGet.h:557
vtkDataRepresentation::GetInternalAnnotationOutputPort
virtual vtkAlgorithmOutput * GetInternalAnnotationOutputPort(int port, int conn)
vtkAnnotationLayers
Stores a ordered collection of annotation sets.
Definition: vtkAnnotationLayers.h:42
vtkDataRepresentation::GetInternalOutputPort
virtual vtkAlgorithmOutput * GetInternalOutputPort(int port)
Definition: vtkDataRepresentation.h:183
vtkAlgorithm::GetInputConnection
vtkAlgorithmOutput * GetInputConnection(int port, int index)
vtkDataRepresentation
The superclass for all representations.
Definition: vtkDataRepresentation.h:72
vtkDataRepresentation::AnnotationLinkInternal
vtkAnnotationLink * AnnotationLinkInternal
Definition: vtkDataRepresentation.h:245
vtkDataRepresentation::Annotate
void Annotate(vtkView *view, vtkAnnotationLayers *annotations, bool extend)
vtkDataRepresentation::GetInternalSelectionOutputPort
virtual vtkAlgorithmOutput * GetInternalSelectionOutputPort(int port, int conn)
vtkDataRepresentation::Select
void Select(vtkView *view, vtkSelection *selection)
Definition: vtkDataRepresentation.h:105
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:39
vtkDataRepresentation::ConvertSelection
virtual vtkSelection * ConvertSelection(vtkView *view, vtkSelection *selection)
vtkDataRepresentation::UpdateSelection
void UpdateSelection(vtkSelection *selection)
Definition: vtkDataRepresentation.h:139
vtkGetMacro
#define vtkGetMacro(name, type)
Definition: vtkSetGet.h:93
vtkDataRepresentation::GetInternalInput
vtkTrivialProducer * GetInternalInput(int port, int conn)
vtkDataRepresentation::GetInternalAnnotationOutputPort
virtual vtkAlgorithmOutput * GetInternalAnnotationOutputPort()
Definition: vtkDataRepresentation.h:159
vtkDataRepresentation::GetInternalSelectionOutputPort
virtual vtkAlgorithmOutput * GetInternalSelectionOutputPort()
Definition: vtkDataRepresentation.h:170
vtkDataRepresentation::SetAnnotationLink
void SetAnnotationLink(vtkAnnotationLink *link)
vtkBooleanMacro
vtkBooleanMacro(IgnoreDriverBugs, bool)
vtkInformation
Store vtkAlgorithm input/output information.
Definition: vtkInformation.h:86
vtkDataRepresentation::GetInternalOutputPort
virtual vtkAlgorithmOutput * GetInternalOutputPort()
Definition: vtkDataRepresentation.h:181
vtkSetMacro
vtkSetMacro(IgnoreDriverBugs, bool)
vtkDataRepresentation::UpdateAnnotations
void UpdateAnnotations(vtkAnnotationLayers *annotations)
Definition: vtkDataRepresentation.h:150
vtkDataRepresentation::GetInternalOutputPort
virtual vtkAlgorithmOutput * GetInternalOutputPort(int port, int conn)
vtkgl::index
GLuint index
Definition: vtkgl.h:11983
vtkDataRepresentation::SelectionArrayNames
vtkStringArray * SelectionArrayNames
Definition: vtkDataRepresentation.h:255
vtkDataRepresentation::SetInternalInput
void SetInternalInput(int port, int conn, vtkTrivialProducer *producer)
vtkAlgorithmOutput
Proxy object to connect input/output ports.
Definition: vtkAlgorithmOutput.h:39
vtkDataRepresentation::SetSelectionArrayNames
virtual void SetSelectionArrayNames(vtkStringArray *names)
vtkDataRepresentation::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent)
vtkStringArray
a vtkAbstractArray subclass for strings
Definition: vtkStringArray.h:45
vtkDataRepresentation::Selectable
bool Selectable
Definition: vtkDataRepresentation.h:249
vtkDataRepresentation::ApplyViewTheme
virtual void ApplyViewTheme(vtkViewTheme *vtkNotUsed(theme))
Definition: vtkDataRepresentation.h:95
vtkDataRepresentation::GetSelectionArrayName
virtual const char * GetSelectionArrayName()
vtkDataRepresentation::vtkDataRepresentation
vtkDataRepresentation()
vtkDataObject
general representation of visualization data
Definition: vtkDataObject.h:65
vtkPassInputTypeAlgorithm
Superclass for algorithms that produce output of the same type as input.
Definition: vtkPassInputTypeAlgorithm.h:50
vtkDataRepresentation::SetAnnotationLinkInternal
virtual void SetAnnotationLinkInternal(vtkAnnotationLink *link)
vtkDataRepresentation::ConvertAnnotations
virtual vtkAnnotationLayers * ConvertAnnotations(vtkView *view, vtkAnnotationLayers *annotations)