VTK  9.3.0
vtkDataRepresentation.h
Go to the documentation of this file.
1// SPDX-FileCopyrightText: Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
2// SPDX-FileCopyrightText: Copyright 2008 Sandia Corporation
3// SPDX-License-Identifier: LicenseRef-BSD-3-Clause-Sandia-USGov
37#ifndef vtkDataRepresentation_h
38#define vtkDataRepresentation_h
39
41#include "vtkViewsCoreModule.h" // For export macro
42
43VTK_ABI_NAMESPACE_BEGIN
47class vtkDataObject;
48class vtkSelection;
49class vtkStringArray;
51class vtkView;
52class vtkViewTheme;
53
54class VTKVIEWSCORE_EXPORT vtkDataRepresentation : public vtkPassInputTypeAlgorithm
55{
56public:
59 void PrintSelf(ostream& os, vtkIndent indent) override;
60
65 vtkAlgorithmOutput* GetInputConnection(int port = 0, int index = 0)
66 {
67 return this->Superclass::GetInputConnection(port, index);
68 }
69
75 vtkAnnotationLink* GetAnnotationLink() { return this->AnnotationLinkInternal; }
77
82 virtual void ApplyViewTheme(vtkViewTheme* vtkNotUsed(theme)) {}
83
94 void Select(vtkView* view, vtkSelection* selection) { this->Select(view, selection, false); }
95 void Select(vtkView* view, vtkSelection* selection, bool extend);
96
108 void Annotate(vtkView* view, vtkAnnotationLayers* annotations)
109 {
110 this->Annotate(view, annotations, false);
111 }
112 void Annotate(vtkView* view, vtkAnnotationLayers* annotations, bool extend);
113
115
119 vtkSetMacro(Selectable, bool);
120 vtkGetMacro(Selectable, bool);
121 vtkBooleanMacro(Selectable, bool);
123
131 void UpdateSelection(vtkSelection* selection) { this->UpdateSelection(selection, false); }
132 void UpdateSelection(vtkSelection* selection, bool extend);
133
142 {
143 this->UpdateAnnotations(annotations, false);
144 }
145 void UpdateAnnotations(vtkAnnotationLayers* annotations, bool extend);
146
153 {
154 return this->GetInternalAnnotationOutputPort(0);
155 }
157 {
158 return this->GetInternalAnnotationOutputPort(port, 0);
159 }
161
168 {
169 return this->GetInternalSelectionOutputPort(0);
170 }
172 {
173 return this->GetInternalSelectionOutputPort(port, 0);
174 }
176
184 {
185 return this->GetInternalOutputPort(port, 0);
186 }
187 virtual vtkAlgorithmOutput* GetInternalOutputPort(int port, int conn);
188
190
198 vtkSetMacro(SelectionType, int);
199 vtkGetMacro(SelectionType, int);
201
203
207 vtkGetObjectMacro(SelectionArrayNames, vtkStringArray);
209
211
214 virtual void SetSelectionArrayName(const char* name);
215 virtual const char* GetSelectionArrayName();
217
227
228protected:
231
243 {
244 return 1;
245 }
246
250 virtual void ProcessEvents(vtkObject* caller, unsigned long eventId, void* callData);
251
253
259
260 // Whether its representation can handle a selection.
262
267
272
273 friend class vtkView;
274 friend class vtkRenderView;
275 class Command;
276 friend class Command;
277 Command* Observer;
278
279 // ------------------------------------------------------------------------
280 // Methods to override in subclasses
281 // ------------------------------------------------------------------------
282
288 virtual bool AddToView(vtkView* vtkNotUsed(view)) { return true; }
289
295 virtual bool RemoveFromView(vtkView* vtkNotUsed(view)) { return true; }
296
303
305 void SetInternalInput(int port, int conn, vtkTrivialProducer* producer);
306
307private:
309 void operator=(const vtkDataRepresentation&) = delete;
310
311 class Internals;
312 Internals* Implementation;
313};
314
315VTK_ABI_NAMESPACE_END
316#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
The superclass for all representations.
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:29
Store zero or more vtkInformation instances.
Store vtkAlgorithm input/output information.
abstract base class for most VTK objects
Definition vtkObject.h:49
Superclass for algorithms that produce output of the same type as input.
A view containing a renderer.
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:46