VTK  9.3.20240328
vtkRenderedTreeAreaRepresentation.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
13 #ifndef vtkRenderedTreeAreaRepresentation_h
14 #define vtkRenderedTreeAreaRepresentation_h
15 
17 #include "vtkViewsInfovisModule.h" // For export macro
18 
19 VTK_ABI_NAMESPACE_BEGIN
20 class vtkActor;
21 class vtkActor2D;
22 class vtkAreaLayout;
25 class vtkEdgeCenters;
28 class vtkPolyData;
30 class vtkPolyDataMapper;
31 class vtkScalarBarWidget;
32 class vtkTextProperty;
35 class vtkVertexDegree;
37 
38 class VTKVIEWSINFOVIS_EXPORT vtkRenderedTreeAreaRepresentation : public vtkRenderedRepresentation
39 {
40 public:
43  void PrintSelf(ostream& os, vtkIndent indent) override;
44 
51  void SetLabelRenderMode(int mode) override;
52 
54 
57  virtual void SetAreaLabelArrayName(const char* name);
58  virtual const char* GetAreaLabelArrayName();
60 
62 
65  virtual void SetAreaSizeArrayName(const char* name);
66  virtual const char* GetAreaSizeArrayName();
68 
70 
74  virtual void SetAreaLabelPriorityArrayName(const char* name);
75  virtual const char* GetAreaLabelPriorityArrayName();
77 
79 
82  virtual void SetGraphEdgeLabelArrayName(const char* name)
83  {
84  this->SetGraphEdgeLabelArrayName(name, 0);
85  }
86  virtual void SetGraphEdgeLabelArrayName(const char* name, int idx);
87  virtual const char* GetGraphEdgeLabelArrayName() { return this->GetGraphEdgeLabelArrayName(0); }
88  virtual const char* GetGraphEdgeLabelArrayName(int idx);
90 
92 
96  {
97  this->SetGraphEdgeLabelTextProperty(tp, 0);
98  }
99  virtual void SetGraphEdgeLabelTextProperty(vtkTextProperty* tp, int idx);
101  {
102  return this->GetGraphEdgeLabelTextProperty(0);
103  }
106 
108 
112  vtkSetStringMacro(AreaHoverArrayName);
113  vtkGetStringMacro(AreaHoverArrayName);
115 
117 
120  virtual void SetAreaLabelVisibility(bool vis);
121  virtual bool GetAreaLabelVisibility();
122  vtkBooleanMacro(AreaLabelVisibility, bool);
124 
126 
132 
134 
137  virtual void SetGraphEdgeLabelVisibility(bool vis) { this->SetGraphEdgeLabelVisibility(vis, 0); }
138  virtual void SetGraphEdgeLabelVisibility(bool vis, int idx);
139  virtual bool GetGraphEdgeLabelVisibility() { return this->GetGraphEdgeLabelVisibility(0); }
140  virtual bool GetGraphEdgeLabelVisibility(int idx);
141  vtkBooleanMacro(GraphEdgeLabelVisibility, bool);
143 
145 
148  void SetAreaColorArrayName(const char* name);
149  const char* GetAreaColorArrayName();
151 
153 
156  virtual void SetColorAreasByArray(bool vis);
157  virtual bool GetColorAreasByArray();
158  vtkBooleanMacro(ColorAreasByArray, bool);
160 
162 
165  virtual void SetGraphEdgeColorArrayName(const char* name)
166  {
167  this->SetGraphEdgeColorArrayName(name, 0);
168  }
169  virtual void SetGraphEdgeColorArrayName(const char* name, int idx);
170  virtual const char* GetGraphEdgeColorArrayName() { return this->GetGraphEdgeColorArrayName(0); }
171  virtual const char* GetGraphEdgeColorArrayName(int idx);
173 
178  virtual void SetGraphEdgeColorToSplineFraction(int idx);
179 
181 
184  virtual void SetColorGraphEdgesByArray(bool vis) { this->SetColorGraphEdgesByArray(vis, 0); }
185  virtual void SetColorGraphEdgesByArray(bool vis, int idx);
186  virtual bool GetColorGraphEdgesByArray() { return this->GetColorGraphEdgesByArray(0); }
187  virtual bool GetColorGraphEdgesByArray(int idx);
188  vtkBooleanMacro(ColorGraphEdgesByArray, bool);
190 
192 
196  virtual void SetGraphHoverArrayName(const char* name) { this->SetGraphHoverArrayName(name, 0); }
197  virtual void SetGraphHoverArrayName(const char* name, int idx);
198  virtual const char* GetGraphHoverArrayName() { return this->GetGraphHoverArrayName(0); }
199  virtual const char* GetGraphHoverArrayName(int idx);
201 
203 
206  virtual void SetShrinkPercentage(double value);
207  virtual double GetShrinkPercentage();
209 
211 
214  virtual void SetGraphBundlingStrength(double strength)
215  {
216  this->SetGraphBundlingStrength(strength, 0);
217  }
218  virtual void SetGraphBundlingStrength(double strength, int idx);
219  virtual double GetGraphBundlingStrength() { return this->GetGraphBundlingStrength(0); }
220  virtual double GetGraphBundlingStrength(int idx);
222 
224 
230  virtual void SetGraphSplineType(int type, int idx);
231  virtual int GetGraphSplineType(int idx);
233 
235 
241 
243 
248  virtual void SetAreaToPolyData(vtkPolyDataAlgorithm* areaToPoly);
249  vtkGetObjectMacro(AreaToPolyData, vtkPolyDataAlgorithm);
251 
253 
256  vtkSetMacro(UseRectangularCoordinates, bool);
257  vtkGetMacro(UseRectangularCoordinates, bool);
258  vtkBooleanMacro(UseRectangularCoordinates, bool);
260 
262 
267  vtkGetObjectMacro(AreaLabelMapper, vtkLabeledDataMapper);
269 
273  void ApplyViewTheme(vtkViewTheme* theme) override;
274 
276 
279  virtual void SetEdgeScalarBarVisibility(bool b);
282 
283 protected:
286 
288 
291  bool AddToView(vtkView* view) override;
292  bool RemoveFromView(vtkView* view) override;
294 
296 
298 
300 
301  void PrepareForRendering(vtkRenderView* view) override;
302 
303  bool ValidIndex(int idx);
304 
305  void UpdateHoverHighlight(vtkView* view, int x, int y);
306 
308 
326 
327  vtkSetStringMacro(AreaSizeArrayNameInternal);
328  vtkGetStringMacro(AreaSizeArrayNameInternal);
330  vtkSetStringMacro(AreaColorArrayNameInternal);
331  vtkGetStringMacro(AreaColorArrayNameInternal);
333  vtkSetStringMacro(AreaLabelArrayNameInternal);
334  vtkGetStringMacro(AreaLabelArrayNameInternal);
336  vtkSetStringMacro(AreaLabelPriorityArrayNameInternal);
337  vtkGetStringMacro(AreaLabelPriorityArrayNameInternal);
339  vtkSetStringMacro(GraphEdgeColorArrayNameInternal);
340  vtkGetStringMacro(GraphEdgeColorArrayNameInternal);
342  vtkGetStringMacro(AreaHoverTextInternal);
343  vtkSetStringMacro(AreaHoverTextInternal);
346 
348 
349 private:
351  void operator=(const vtkRenderedTreeAreaRepresentation&) = delete;
352 
353  class Internals;
354  Internals* Implementation;
355 };
356 
357 VTK_ABI_NAMESPACE_END
358 #endif
a actor that draws 2D data
Definition: vtkActor2D.h:144
represents an object (geometry & properties) in a rendered scene
Definition: vtkActor.h:150
abstract superclass for all area layout strategies
layout a vtkTree into a tree map
Definition: vtkAreaLayout.h:32
Convert a selection from one type to another.
generate points at center of edges
a simple class to control print indentation
Definition: vtkIndent.h:108
Store zero or more vtkInformation instances.
Store vtkAlgorithm input/output information.
draw text labels at dataset points
build a label hierarchy for a graph or point set.
Superclass for algorithms that produce only polydata as output.
map vtkPolyData to graphics primitives
concrete dataset represents vertices, lines, polygons, and triangle strips
Definition: vtkPolyData.h:180
A view containing a renderer.
Definition: vtkRenderView.h:69
vtkSmartPointer< vtkVertexDegree > VertexDegree
bool RemoveFromView(vtkView *view) override
Called by the view to add/remove this representation.
virtual void SetShrinkPercentage(double value)
Set the region shrink percentage between 0.0 and 1.0.
virtual void SetEdgeScalarBarVisibility(bool b)
Visibility of scalar bar actor for edges.
virtual void SetAreaSizeArrayName(const char *name)
The array to use for area sizes.
virtual const char * GetGraphEdgeColorArrayName()
The array to use for coloring edges.
vtkSmartPointer< vtkScalarBarWidget > EdgeScalarBar
virtual void SetAreaLabelVisibility(bool vis)
Whether to show area labels.
virtual void SetColorGraphEdgesByArray(bool vis)
Whether to color edges.
virtual const char * GetAreaSizeArrayName()
The array to use for area sizes.
void UpdateHoverHighlight(vtkView *view, int x, int y)
virtual void SetGraphHoverArrayName(const char *name, int idx)
The name of the array whose value appears when the mouse hovers over a graph edge.
const char * GetAreaColorArrayName()
The array to use for coloring vertices.
vtkSmartPointer< vtkTreeLevelsFilter > TreeLevels
virtual void SetAreaLayoutStrategy(vtkAreaLayoutStrategy *strategy)
The layout strategy for producing spatial regions for the tree.
vtkSmartPointer< vtkWorldPointPicker > Picker
virtual const char * GetAreaLabelPriorityArrayName()
The array to use for area labeling priority.
void PrepareForRendering(vtkRenderView *view) override
The view will call this method before every render.
virtual vtkTextProperty * GetGraphEdgeLabelTextProperty()
The text property for the graph edge labels.
virtual void SetColorAreasByArray(bool vis)
Whether to color vertices.
virtual void SetAreaToPolyData(vtkPolyDataAlgorithm *areaToPoly)
The filter for converting areas to polydata.
virtual const char * GetGraphEdgeColorArrayName(int idx)
The array to use for coloring edges.
bool AddToView(vtkView *view) override
Called by the view to add/remove this representation.
virtual void SetColorGraphEdgesByArray(bool vis, int idx)
Whether to color edges.
virtual vtkTextProperty * GetAreaLabelTextProperty()
The text property for the area labels.
virtual void SetGraphEdgeLabelVisibility(bool vis)
Whether to show edge labels.
virtual void SetGraphBundlingStrength(double strength, int idx)
Set the bundling strength.
virtual void SetGraphHoverArrayName(const char *name)
The name of the array whose value appears when the mouse hovers over a graph edge.
virtual void SetGraphBundlingStrength(double strength)
Set the bundling strength.
virtual vtkTextProperty * GetGraphEdgeLabelTextProperty(int idx)
The text property for the graph edge labels.
vtkSelection * ConvertSelection(vtkView *view, vtkSelection *sel) override
Convert the selection to a type appropriate for sharing with other representations through vtkAnnotat...
virtual double GetGraphBundlingStrength()
Set the bundling strength.
virtual bool GetColorAreasByArray()
Whether to color vertices.
static vtkRenderedTreeAreaRepresentation * New()
virtual const char * GetAreaLabelArrayName()
The array to use for area labeling.
virtual void SetAreaLabelPriorityArrayName(const char *name)
The array to use for area labeling priority.
virtual vtkAreaLayoutStrategy * GetAreaLayoutStrategy()
The layout strategy for producing spatial regions for the tree.
virtual const char * GetGraphHoverArrayName()
The name of the array whose value appears when the mouse hovers over a graph edge.
vtkSmartPointer< vtkTreeFieldAggregator > TreeAggregation
int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *) override
Subclasses should override this to connect inputs to the internal pipeline as necessary.
virtual double GetShrinkPercentage()
Set the region shrink percentage between 0.0 and 1.0.
vtkSmartPointer< vtkPointSetToLabelHierarchy > AreaLabelHierarchy
vtkSmartPointer< vtkPolyDataMapper > HighlightMapper
virtual void SetGraphEdgeColorArrayName(const char *name)
The array to use for coloring edges.
virtual void SetGraphEdgeLabelTextProperty(vtkTextProperty *tp, int idx)
The text property for the graph edge labels.
virtual int GetGraphSplineType(int idx)
Sets the spline type for the graph edges.
void ApplyViewTheme(vtkViewTheme *theme) override
Apply the theme to this view.
virtual double GetGraphBundlingStrength(int idx)
Set the bundling strength.
virtual void SetGraphSplineType(int type, int idx)
Sets the spline type for the graph edges.
virtual void SetGraphEdgeLabelVisibility(bool vis, int idx)
Whether to show edge labels.
virtual void SetGraphEdgeColorToSplineFraction()
Set the color to be the spline fraction.
virtual bool GetColorGraphEdgesByArray()
Whether to color edges.
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
virtual bool GetAreaLabelVisibility()
Whether to show area labels.
virtual const char * GetGraphHoverArrayName(int idx)
The name of the array whose value appears when the mouse hovers over a graph edge.
virtual void SetAreaLabelArrayName(const char *name)
The array to use for area labeling.
virtual const char * GetGraphEdgeLabelArrayName()
The array to use for edge labeling.
virtual const char * GetGraphEdgeLabelArrayName(int idx)
The array to use for edge labeling.
virtual void SetGraphEdgeLabelArrayName(const char *name, int idx)
The array to use for edge labeling.
virtual void SetAreaLabelTextProperty(vtkTextProperty *tp)
The text property for the area labels.
void SetAreaColorArrayName(const char *name)
The array to use for coloring vertices.
virtual bool GetGraphEdgeLabelVisibility(int idx)
Whether to show edge labels.
std::string GetHoverStringInternal(vtkSelection *sel) override
Subclasses may override this method to generate the hover text.
void SetLabelRenderMode(int mode) override
Set the label render mode.
virtual void SetGraphEdgeColorToSplineFraction(int idx)
virtual bool GetEdgeScalarBarVisibility()
Visibility of scalar bar actor for edges.
vtkSmartPointer< vtkApplyColors > ApplyColors
virtual bool GetGraphEdgeLabelVisibility()
Whether to show edge labels.
virtual bool GetColorGraphEdgesByArray(int idx)
Whether to color edges.
virtual void SetGraphEdgeLabelArrayName(const char *name)
The array to use for edge labeling.
int FillInputPortInformation(int port, vtkInformation *info) override
Fill the input port information objects for this algorithm.
virtual void SetAreaLabelMapper(vtkLabeledDataMapper *mapper)
The mapper for rendering labels on areas.
virtual void SetGraphEdgeLabelTextProperty(vtkTextProperty *tp)
The text property for the graph edge labels.
virtual void SetGraphEdgeColorArrayName(const char *name, int idx)
The array to use for coloring edges.
vtkSmartPointer< vtkPolyDataMapper > AreaMapper
2D widget for manipulating a scalar bar
data object that represents a "selection" in VTK.
Definition: vtkSelection.h:159
represent text properties.
aggregate field values from the leaves up the tree
adds level and leaf fields to a vtkTree
Adds an attribute array with the degree of each vertex.
Sets theme colors for a graphical view.
Definition: vtkViewTheme.h:123
The superclass for all views.
Definition: vtkView.h:49
find world x,y,z corresponding to display x,y,z
@ info
Definition: vtkX3D.h:376
@ mode
Definition: vtkX3D.h:247
@ value
Definition: vtkX3D.h:220
@ port
Definition: vtkX3D.h:447
@ type
Definition: vtkX3D.h:516
@ name
Definition: vtkX3D.h:219
@ string
Definition: vtkX3D.h:490