VTK  9.2.6
vtkRenderedTreeAreaRepresentation.h
Go to the documentation of this file.
1/*=========================================================================
2
3 Program: Visualization Toolkit
4 Module: vtkRenderedTreeAreaRepresentation.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-------------------------------------------------------------------------*/
26#ifndef vtkRenderedTreeAreaRepresentation_h
27#define vtkRenderedTreeAreaRepresentation_h
28
30#include "vtkViewsInfovisModule.h" // For export macro
31
32class vtkActor;
33class vtkActor2D;
34class vtkAreaLayout;
37class vtkEdgeCenters;
40class vtkPolyData;
44class vtkTextProperty;
47class vtkVertexDegree;
49
51{
52public:
55 void PrintSelf(ostream& os, vtkIndent indent) override;
56
63 void SetLabelRenderMode(int mode) override;
64
66
69 virtual void SetAreaLabelArrayName(const char* name);
70 virtual const char* GetAreaLabelArrayName();
72
74
77 virtual void SetAreaSizeArrayName(const char* name);
78 virtual const char* GetAreaSizeArrayName();
80
82
86 virtual void SetAreaLabelPriorityArrayName(const char* name);
87 virtual const char* GetAreaLabelPriorityArrayName();
89
91
94 virtual void SetGraphEdgeLabelArrayName(const char* name)
95 {
96 this->SetGraphEdgeLabelArrayName(name, 0);
97 }
98 virtual void SetGraphEdgeLabelArrayName(const char* name, int idx);
99 virtual const char* GetGraphEdgeLabelArrayName() { return this->GetGraphEdgeLabelArrayName(0); }
100 virtual const char* GetGraphEdgeLabelArrayName(int idx);
102
104
108 {
109 this->SetGraphEdgeLabelTextProperty(tp, 0);
110 }
113 {
114 return this->GetGraphEdgeLabelTextProperty(0);
115 }
118
120
124 vtkSetStringMacro(AreaHoverArrayName);
125 vtkGetStringMacro(AreaHoverArrayName);
127
129
132 virtual void SetAreaLabelVisibility(bool vis);
134 vtkBooleanMacro(AreaLabelVisibility, bool);
136
138
144
146
149 virtual void SetGraphEdgeLabelVisibility(bool vis) { this->SetGraphEdgeLabelVisibility(vis, 0); }
150 virtual void SetGraphEdgeLabelVisibility(bool vis, int idx);
152 virtual bool GetGraphEdgeLabelVisibility(int idx);
153 vtkBooleanMacro(GraphEdgeLabelVisibility, bool);
155
157
160 void SetAreaColorArrayName(const char* name);
163
165
168 virtual void SetColorAreasByArray(bool vis);
169 virtual bool GetColorAreasByArray();
170 vtkBooleanMacro(ColorAreasByArray, bool);
172
174
177 virtual void SetGraphEdgeColorArrayName(const char* name)
178 {
179 this->SetGraphEdgeColorArrayName(name, 0);
180 }
181 virtual void SetGraphEdgeColorArrayName(const char* name, int idx);
182 virtual const char* GetGraphEdgeColorArrayName() { return this->GetGraphEdgeColorArrayName(0); }
183 virtual const char* GetGraphEdgeColorArrayName(int idx);
185
191
193
196 virtual void SetColorGraphEdgesByArray(bool vis) { this->SetColorGraphEdgesByArray(vis, 0); }
197 virtual void SetColorGraphEdgesByArray(bool vis, int idx);
198 virtual bool GetColorGraphEdgesByArray() { return this->GetColorGraphEdgesByArray(0); }
199 virtual bool GetColorGraphEdgesByArray(int idx);
200 vtkBooleanMacro(ColorGraphEdgesByArray, bool);
202
204
208 virtual void SetGraphHoverArrayName(const char* name) { this->SetGraphHoverArrayName(name, 0); }
209 virtual void SetGraphHoverArrayName(const char* name, int idx);
210 virtual const char* GetGraphHoverArrayName() { return this->GetGraphHoverArrayName(0); }
211 virtual const char* GetGraphHoverArrayName(int idx);
213
215
218 virtual void SetShrinkPercentage(double value);
219 virtual double GetShrinkPercentage();
221
223
226 virtual void SetGraphBundlingStrength(double strength)
227 {
228 this->SetGraphBundlingStrength(strength, 0);
229 }
230 virtual void SetGraphBundlingStrength(double strength, int idx);
231 virtual double GetGraphBundlingStrength() { return this->GetGraphBundlingStrength(0); }
232 virtual double GetGraphBundlingStrength(int idx);
234
236
242 virtual void SetGraphSplineType(int type, int idx);
243 virtual int GetGraphSplineType(int idx);
245
247
253
255
260 virtual void SetAreaToPolyData(vtkPolyDataAlgorithm* areaToPoly);
261 vtkGetObjectMacro(AreaToPolyData, vtkPolyDataAlgorithm);
263
265
268 vtkSetMacro(UseRectangularCoordinates, bool);
269 vtkGetMacro(UseRectangularCoordinates, bool);
270 vtkBooleanMacro(UseRectangularCoordinates, bool);
272
274
279 vtkGetObjectMacro(AreaLabelMapper, vtkLabeledDataMapper);
281
285 void ApplyViewTheme(vtkViewTheme* theme) override;
286
288
291 virtual void SetEdgeScalarBarVisibility(bool b);
294
295protected:
298
300
303 bool AddToView(vtkView* view) override;
304 bool RemoveFromView(vtkView* view) override;
306
308
309 int FillInputPortInformation(int port, vtkInformation* info) override;
310
312
313 void PrepareForRendering(vtkRenderView* view) override;
314
315 bool ValidIndex(int idx);
316
317 void UpdateHoverHighlight(vtkView* view, int x, int y);
318
319 std::string GetHoverStringInternal(vtkSelection* sel) override;
320
338
339 vtkSetStringMacro(AreaSizeArrayNameInternal);
340 vtkGetStringMacro(AreaSizeArrayNameInternal);
342 vtkSetStringMacro(AreaColorArrayNameInternal);
343 vtkGetStringMacro(AreaColorArrayNameInternal);
345 vtkSetStringMacro(AreaLabelArrayNameInternal);
346 vtkGetStringMacro(AreaLabelArrayNameInternal);
348 vtkSetStringMacro(AreaLabelPriorityArrayNameInternal);
349 vtkGetStringMacro(AreaLabelPriorityArrayNameInternal);
351 vtkSetStringMacro(GraphEdgeColorArrayNameInternal);
352 vtkGetStringMacro(GraphEdgeColorArrayNameInternal);
354 vtkGetStringMacro(AreaHoverTextInternal);
355 vtkSetStringMacro(AreaHoverTextInternal);
358
360
361private:
363 void operator=(const vtkRenderedTreeAreaRepresentation&) = delete;
364
365 class Internals;
366 Internals* Implementation;
367};
368
369#endif
a actor that draws 2D data
Definition vtkActor2D.h:40
represents an object (geometry & properties) in a rendered scene
Definition vtkActor.h:46
abstract superclass for all area layout strategies
layout a vtkTree into a tree map
Convert a selection from one type to another.
generate points at center of edges
a simple class to control print indentation
Definition vtkIndent.h:34
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:85
A view containing a renderer.
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 * GetGraphHoverArrayName()
The name of the array whose value appears when the mouse hovers over a graph edge.
vtkSmartPointer< vtkScalarBarWidget > EdgeScalarBar
virtual vtkTextProperty * GetGraphEdgeLabelTextProperty(int idx)
The text property for the graph edge labels.
virtual void SetAreaLabelVisibility(bool vis)
Whether to show area labels.
virtual const char * GetAreaLabelArrayName()
The array to use for area labeling.
vtkSelection * ConvertSelection(vtkView *view, vtkSelection *sel) override
Convert the selection to a type appropriate for sharing with other representations through vtkAnnotat...
virtual void SetColorGraphEdgesByArray(bool vis)
Whether to color edges.
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.
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 void SetColorAreasByArray(bool vis)
Whether to color vertices.
virtual void SetAreaToPolyData(vtkPolyDataAlgorithm *areaToPoly)
The filter for converting areas to polydata.
virtual vtkAreaLayoutStrategy * GetAreaLayoutStrategy()
The layout strategy for producing spatial regions for the tree.
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 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 const char * GetGraphEdgeColorArrayName()
The array to use for coloring edges.
virtual vtkTextProperty * GetGraphEdgeLabelTextProperty()
The text property for the graph edge labels.
virtual double GetGraphBundlingStrength()
Set the bundling strength.
virtual bool GetColorAreasByArray()
Whether to color vertices.
virtual void SetAreaLabelPriorityArrayName(const char *name)
The array to use for area labeling priority.
const char * GetAreaColorArrayName()
The array to use for coloring vertices.
vtkSmartPointer< vtkTreeFieldAggregator > TreeAggregation
int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *) override
Subclasses should override this to connect inputs to the internal pipeline as necessary.
virtual const char * GetGraphEdgeLabelArrayName(int idx)
The array to use for edge labeling.
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.
virtual const char * GetAreaSizeArrayName()
The array to use for area sizes.
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 const char * GetGraphEdgeColorArrayName(int idx)
The array to use for coloring edges.
virtual bool GetAreaLabelVisibility()
Whether to show area labels.
virtual void SetAreaLabelArrayName(const char *name)
The array to use for area 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.
virtual const char * GetGraphHoverArrayName(int idx)
The name of the array whose value appears when the mouse hovers over a graph edge.
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.
virtual bool GetGraphEdgeLabelVisibility()
Whether to show edge labels.
virtual bool GetColorGraphEdgesByArray(int idx)
Whether to color edges.
virtual const char * GetGraphEdgeLabelArrayName()
The array to use for edge labeling.
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.
static vtkRenderedTreeAreaRepresentation * New()
virtual void SetGraphEdgeColorArrayName(const char *name, int idx)
The array to use for coloring edges.
virtual vtkTextProperty * GetAreaLabelTextProperty()
The text property for the area labels.
vtkSmartPointer< vtkPolyDataMapper > AreaMapper
2D widget for manipulating a scalar bar
data object that represents a "selection" in VTK.
Hold a reference to a vtkObjectBase instance.
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.
The superclass for all views.
Definition vtkView.h:58
find world x,y,z corresponding to display x,y,z