VTK  9.2.6
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-------------------------------------------------------------------------*/
52
53#ifndef vtkDataRepresentation_h
54#define vtkDataRepresentation_h
55
57#include "vtkViewsCoreModule.h" // For export macro
58
62class vtkDataObject;
63class vtkSelection;
64class vtkStringArray;
66class vtkView;
67class vtkViewTheme;
68
69class VTKVIEWSCORE_EXPORT vtkDataRepresentation : public vtkPassInputTypeAlgorithm
70{
71public:
74 void PrintSelf(ostream& os, vtkIndent indent) override;
75
80 vtkAlgorithmOutput* GetInputConnection(int port = 0, int index = 0)
81 {
82 return this->Superclass::GetInputConnection(port, index);
83 }
84
92
97 virtual void ApplyViewTheme(vtkViewTheme* vtkNotUsed(theme)) {}
98
109 void Select(vtkView* view, vtkSelection* selection) { this->Select(view, selection, false); }
110 void Select(vtkView* view, vtkSelection* selection, bool extend);
111
123 void Annotate(vtkView* view, vtkAnnotationLayers* annotations)
124 {
125 this->Annotate(view, annotations, false);
126 }
127 void Annotate(vtkView* view, vtkAnnotationLayers* annotations, bool extend);
128
130
134 vtkSetMacro(Selectable, bool);
135 vtkGetMacro(Selectable, bool);
136 vtkBooleanMacro(Selectable, bool);
138
146 void UpdateSelection(vtkSelection* selection) { this->UpdateSelection(selection, false); }
147 void UpdateSelection(vtkSelection* selection, bool extend);
148
157 {
158 this->UpdateAnnotations(annotations, false);
159 }
160 void UpdateAnnotations(vtkAnnotationLayers* annotations, bool extend);
161
172 {
173 return this->GetInternalAnnotationOutputPort(port, 0);
174 }
176
187 {
188 return this->GetInternalSelectionOutputPort(port, 0);
189 }
191
199 {
200 return this->GetInternalOutputPort(port, 0);
201 }
202 virtual vtkAlgorithmOutput* GetInternalOutputPort(int port, int conn);
203
205
213 vtkSetMacro(SelectionType, int);
214 vtkGetMacro(SelectionType, int);
216
218
224
226
229 virtual void SetSelectionArrayName(const char* name);
230 virtual const char* GetSelectionArrayName();
232
242
243protected:
246
258 {
259 return 1;
260 }
261
265 virtual void ProcessEvents(vtkObject* caller, unsigned long eventId, void* callData);
266
268
274
275 // Whether its representation can handle a selection.
277
282
287
288 friend class vtkView;
289 friend class vtkRenderView;
290 class Command;
291 friend class Command;
293
294 // ------------------------------------------------------------------------
295 // Methods to override in subclasses
296 // ------------------------------------------------------------------------
297
303 virtual bool AddToView(vtkView* vtkNotUsed(view)) { return true; }
304
310 virtual bool RemoveFromView(vtkView* vtkNotUsed(view)) { return true; }
311
318
320 void SetInternalInput(int port, int conn, vtkTrivialProducer* producer);
321
322private:
324 void operator=(const vtkDataRepresentation&) = delete;
325
326 class Internals;
327 Internals* Implementation;
328};
329
330#endif
Proxy object to connect input/output ports.
vtkAlgorithmOutput * GetInputConnection(int port, int index)
Get the algorithm output port connected to an input port.
Stores a ordered collection of annotation sets.
general representation of visualization data
virtual vtkAlgorithmOutput * GetInternalOutputPort()
Retrieves an output port for the input data object at the specified port and connection index.
vtkAlgorithmOutput * GetInputConnection(int port=0, int index=0)
Convenience override method for obtaining the input connection without specifying the port or index.
vtkAnnotationLink * AnnotationLinkInternal
The annotation link for this representation.
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
virtual vtkAlgorithmOutput * GetInternalAnnotationOutputPort(int port, int conn)
int SelectionType
The selection type created by the view.
virtual bool RemoveFromView(vtkView *vtkNotUsed(view))
Removes the representation to the view.
void Annotate(vtkView *view, vtkAnnotationLayers *annotations)
Analogous to Select().
void SetAnnotationLink(vtkAnnotationLink *link)
virtual vtkAlgorithmOutput * GetInternalSelectionOutputPort()
The output port that contains the selection associated with the current annotation (normally the inte...
virtual vtkAlgorithmOutput * GetInternalOutputPort(int port, int conn)
virtual void SetSelectionArrayNames(vtkStringArray *names)
If a VALUES selection, the arrays used to produce a selection.
static vtkDataRepresentation * New()
virtual void ApplyViewTheme(vtkViewTheme *vtkNotUsed(theme))
Apply a theme to this representation.
void UpdateAnnotations(vtkAnnotationLayers *annotations, bool extend)
virtual vtkAlgorithmOutput * GetInternalSelectionOutputPort(int port)
void UpdateAnnotations(vtkAnnotationLayers *annotations)
Updates the selection in the selection link and fires a selection change event.
vtkStringArray * SelectionArrayNames
If a VALUES selection, the array names used in the selection.
virtual void ProcessEvents(vtkObject *caller, unsigned long eventId, void *callData)
Clear the input shallow copy caches if the algorithm is in "release data" mode.
virtual vtkAlgorithmOutput * GetInternalAnnotationOutputPort(int port)
~vtkDataRepresentation() override
virtual vtkAnnotationLayers * ConvertAnnotations(vtkView *view, vtkAnnotationLayers *annotations)
Analogous to ConvertSelection(), allows subclasses to manipulate annotations before passing them off ...
virtual void SetAnnotationLinkInternal(vtkAnnotationLink *link)
The annotation link for this representation.
virtual vtkSelection * ConvertSelection(vtkView *view, vtkSelection *selection)
Convert the selection to a type appropriate for sharing with other representations through vtkAnnotat...
void Select(vtkView *view, vtkSelection *selection, bool extend)
void UpdateSelection(vtkSelection *selection)
Updates the selection in the selection link and fires a selection change event.
virtual bool AddToView(vtkView *vtkNotUsed(view))
Adds the representation to the view.
virtual vtkAlgorithmOutput * GetInternalAnnotationOutputPort()
The output port that contains the annotations whose selections are localized for a particular input d...
void Select(vtkView *view, vtkSelection *selection)
The view calls this method when a selection occurs.
virtual vtkAlgorithmOutput * GetInternalSelectionOutputPort(int port, int conn)
void UpdateSelection(vtkSelection *selection, bool extend)
virtual void SetSelectionArrayName(const char *name)
If a VALUES selection, the array used to produce a selection.
virtual vtkAlgorithmOutput * GetInternalOutputPort(int port)
vtkAnnotationLink * GetAnnotationLink()
The annotation link for this representation.
void Annotate(vtkView *view, vtkAnnotationLayers *annotations, bool extend)
int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *) override
Subclasses should override this to connect inputs to the internal pipeline as necessary.
vtkTrivialProducer * GetInternalInput(int port, int conn)
void SetInternalInput(int port, int conn, vtkTrivialProducer *producer)
virtual const char * GetSelectionArrayName()
If a VALUES selection, the array used to produce a selection.
a simple class to control print indentation
Definition vtkIndent.h:34
Store zero or more vtkInformation instances.
Store vtkAlgorithm input/output information.
data object that represents a "selection" in VTK.
a vtkAbstractArray subclass for strings
Producer for stand-alone data objects.
Sets theme colors for a graphical view.
The superclass for all views.
Definition vtkView.h:58