VTK  9.0.1
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 
32 class vtkActor;
33 class vtkActor2D;
34 class vtkAreaLayout;
37 class vtkEdgeCenters;
41 class vtkPolyData;
43 class vtkPolyDataMapper;
44 class vtkScalarBarWidget;
45 class vtkTextProperty;
48 class vtkVertexDegree;
50 
51 class VTKVIEWSINFOVIS_EXPORT vtkRenderedTreeAreaRepresentation : public vtkRenderedRepresentation
52 {
53 public:
56  void PrintSelf(ostream& os, vtkIndent indent) override;
57 
64  void SetLabelRenderMode(int mode) override;
65 
67 
70  virtual void SetAreaLabelArrayName(const char* name);
71  virtual const char* GetAreaLabelArrayName();
73 
75 
78  virtual void SetAreaSizeArrayName(const char* name);
79  virtual const char* GetAreaSizeArrayName();
81 
83 
87  virtual void SetAreaLabelPriorityArrayName(const char* name);
88  virtual const char* GetAreaLabelPriorityArrayName();
90 
92 
95  virtual void SetGraphEdgeLabelArrayName(const char* name)
96  {
97  this->SetGraphEdgeLabelArrayName(name, 0);
98  }
99  virtual void SetGraphEdgeLabelArrayName(const char* name, int idx);
100  virtual const char* GetGraphEdgeLabelArrayName() { return this->GetGraphEdgeLabelArrayName(0); }
101  virtual const char* GetGraphEdgeLabelArrayName(int idx);
103 
105 
109  {
110  this->SetGraphEdgeLabelTextProperty(tp, 0);
111  }
112  virtual void SetGraphEdgeLabelTextProperty(vtkTextProperty* tp, int idx);
114  {
115  return this->GetGraphEdgeLabelTextProperty(0);
116  }
119 
121 
125  vtkSetStringMacro(AreaHoverArrayName);
126  vtkGetStringMacro(AreaHoverArrayName);
128 
130 
133  virtual void SetAreaLabelVisibility(bool vis);
134  virtual bool GetAreaLabelVisibility();
135  vtkBooleanMacro(AreaLabelVisibility, bool);
137 
139 
145 
147 
150  virtual void SetGraphEdgeLabelVisibility(bool vis) { this->SetGraphEdgeLabelVisibility(vis, 0); }
151  virtual void SetGraphEdgeLabelVisibility(bool vis, int idx);
152  virtual bool GetGraphEdgeLabelVisibility() { return this->GetGraphEdgeLabelVisibility(0); }
153  virtual bool GetGraphEdgeLabelVisibility(int idx);
154  vtkBooleanMacro(GraphEdgeLabelVisibility, bool);
156 
158 
161  void SetAreaColorArrayName(const char* name);
162  const char* GetAreaColorArrayName();
164 
166 
169  virtual void SetColorAreasByArray(bool vis);
170  virtual bool GetColorAreasByArray();
171  vtkBooleanMacro(ColorAreasByArray, bool);
173 
175 
178  virtual void SetGraphEdgeColorArrayName(const char* name)
179  {
180  this->SetGraphEdgeColorArrayName(name, 0);
181  }
182  virtual void SetGraphEdgeColorArrayName(const char* name, int idx);
183  virtual const char* GetGraphEdgeColorArrayName() { return this->GetGraphEdgeColorArrayName(0); }
184  virtual const char* GetGraphEdgeColorArrayName(int idx);
186 
191  virtual void SetGraphEdgeColorToSplineFraction(int idx);
192 
194 
197  virtual void SetColorGraphEdgesByArray(bool vis) { this->SetColorGraphEdgesByArray(vis, 0); }
198  virtual void SetColorGraphEdgesByArray(bool vis, int idx);
199  virtual bool GetColorGraphEdgesByArray() { return this->GetColorGraphEdgesByArray(0); }
200  virtual bool GetColorGraphEdgesByArray(int idx);
201  vtkBooleanMacro(ColorGraphEdgesByArray, bool);
203 
205 
209  virtual void SetGraphHoverArrayName(const char* name) { this->SetGraphHoverArrayName(name, 0); }
210  virtual void SetGraphHoverArrayName(const char* name, int idx);
211  virtual const char* GetGraphHoverArrayName() { return this->GetGraphHoverArrayName(0); }
212  virtual const char* GetGraphHoverArrayName(int idx);
214 
216 
219  virtual void SetShrinkPercentage(double value);
220  virtual double GetShrinkPercentage();
222 
224 
227  virtual void SetGraphBundlingStrength(double strength)
228  {
229  this->SetGraphBundlingStrength(strength, 0);
230  }
231  virtual void SetGraphBundlingStrength(double strength, int idx);
232  virtual double GetGraphBundlingStrength() { return this->GetGraphBundlingStrength(0); }
233  virtual double GetGraphBundlingStrength(int idx);
235 
237 
243  virtual void SetGraphSplineType(int type, int idx);
244  virtual int GetGraphSplineType(int idx);
246 
248 
254 
256 
261  virtual void SetAreaToPolyData(vtkPolyDataAlgorithm* areaToPoly);
262  vtkGetObjectMacro(AreaToPolyData, vtkPolyDataAlgorithm);
264 
266 
269  vtkSetMacro(UseRectangularCoordinates, bool);
270  vtkGetMacro(UseRectangularCoordinates, bool);
271  vtkBooleanMacro(UseRectangularCoordinates, bool);
273 
275 
280  vtkGetObjectMacro(AreaLabelMapper, vtkLabeledDataMapper);
282 
286  void ApplyViewTheme(vtkViewTheme* theme) override;
287 
289 
292  virtual void SetEdgeScalarBarVisibility(bool b);
295 
296 protected:
299 
301 
304  bool AddToView(vtkView* view) override;
305  bool RemoveFromView(vtkView* view) override;
307 
309 
311 
313 
314  void PrepareForRendering(vtkRenderView* view) override;
315 
316  bool ValidIndex(int idx);
317 
318  void UpdateHoverHighlight(vtkView* view, int x, int y);
319 
321 
339 
340  vtkSetStringMacro(AreaSizeArrayNameInternal);
341  vtkGetStringMacro(AreaSizeArrayNameInternal);
343  vtkSetStringMacro(AreaColorArrayNameInternal);
344  vtkGetStringMacro(AreaColorArrayNameInternal);
346  vtkSetStringMacro(AreaLabelArrayNameInternal);
347  vtkGetStringMacro(AreaLabelArrayNameInternal);
349  vtkSetStringMacro(AreaLabelPriorityArrayNameInternal);
350  vtkGetStringMacro(AreaLabelPriorityArrayNameInternal);
352  vtkSetStringMacro(GraphEdgeColorArrayNameInternal);
353  vtkGetStringMacro(GraphEdgeColorArrayNameInternal);
355  vtkGetStringMacro(AreaHoverTextInternal);
356  vtkSetStringMacro(AreaHoverTextInternal);
359 
361 
362 private:
364  void operator=(const vtkRenderedTreeAreaRepresentation&) = delete;
365 
366  class Internals;
367  Internals* Implementation;
368 };
369 
370 #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
Definition: vtkAreaLayout.h:47
Convert a selection from one type to another.
generate points at center of edges
extract a list of cells from a polydata
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.
Definition: vtkRenderView.h:65
vtkSmartPointer< vtkVertexDegree > VertexDegree
bool RemoveFromView(vtkView *view) override
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.
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()
void UpdateHoverHighlight(vtkView *view, int x, int y)
virtual void SetGraphHoverArrayName(const char *name, int idx)
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()
void PrepareForRendering(vtkRenderView *view) override
The view will call this method before every render.
virtual vtkTextProperty * GetGraphEdgeLabelTextProperty()
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)
bool AddToView(vtkView *view) override
Called by the view to add/remove this representation.
virtual void SetColorGraphEdgesByArray(bool vis, int idx)
virtual vtkTextProperty * GetAreaLabelTextProperty()
virtual void SetGraphEdgeLabelVisibility(bool vis)
Whether to show edge labels.
virtual void SetGraphBundlingStrength(double strength, int idx)
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)
vtkSelection * ConvertSelection(vtkView *view, vtkSelection *sel) override
Convert the selection to a type appropriate for sharing with other representations through vtkAnnotat...
static vtkRenderedTreeAreaRepresentation * New()
virtual const char * GetAreaLabelArrayName()
virtual void SetAreaLabelPriorityArrayName(const char *name)
The array to use for area labeling priority.
virtual vtkAreaLayoutStrategy * GetAreaLayoutStrategy()
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()
vtkSmartPointer< vtkPointSetToLabelHierarchy > AreaLabelHierarchy
vtkSmartPointer< vtkPolyDataMapper > HighlightMapper
virtual void SetGraphEdgeColorArrayName(const char *name)
The array to use for coloring edges.
vtkUnicodeString GetHoverTextInternal(vtkSelection *sel) override
Subclasses may override this method to generate the hover text.
virtual void SetGraphEdgeLabelTextProperty(vtkTextProperty *tp, int idx)
virtual int GetGraphSplineType(int idx)
void ApplyViewTheme(vtkViewTheme *theme) override
Apply the theme to this view.
virtual double GetGraphBundlingStrength(int idx)
virtual void SetGraphSplineType(int type, int idx)
Sets the spline type for the graph edges.
virtual void SetGraphEdgeLabelVisibility(bool vis, int idx)
virtual void SetGraphEdgeColorToSplineFraction()
Set the color to be the spline fraction.
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
virtual const char * GetGraphHoverArrayName(int idx)
virtual void SetAreaLabelArrayName(const char *name)
The array to use for area labeling.
virtual const char * GetGraphEdgeLabelArrayName(int idx)
virtual void SetGraphEdgeLabelArrayName(const char *name, int idx)
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)
void SetLabelRenderMode(int mode) override
Set the label render mode.
virtual void SetGraphEdgeColorToSplineFraction(int idx)
virtual bool GetEdgeScalarBarVisibility()
vtkSmartPointer< vtkApplyColors > ApplyColors
virtual bool GetColorGraphEdgesByArray(int idx)
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)
vtkSmartPointer< vtkPolyDataMapper > AreaMapper
2D widget for manipulating a scalar bar
data object that represents a "selection" in VTK.
Definition: vtkSelection.h:58
represent text properties.
aggregate field values from the leaves up the tree
adds level and leaf fields to a vtkTree
String class that stores Unicode text.
Adds an attribute array with the degree of each vertex.
Sets theme colors for a graphical view.
Definition: vtkViewTheme.h:43
The superclass for all views.
Definition: vtkView.h:64
find world x,y,z corresponding to display x,y,z
@ info
Definition: vtkX3D.h:382
@ mode
Definition: vtkX3D.h:253
@ value
Definition: vtkX3D.h:226
@ port
Definition: vtkX3D.h:453
@ type
Definition: vtkX3D.h:522
@ name
Definition: vtkX3D.h:225