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 -------------------------------------------------------------------------*/
29 #ifndef vtkRenderedTreeAreaRepresentation_h
30 #define vtkRenderedTreeAreaRepresentation_h
31 
33 #include "vtkViewsInfovisModule.h" // For export macro
34 
35 class vtkActor;
36 class vtkActor2D;
37 class vtkAreaLayout;
40 class vtkEdgeCenters;
43 class vtkPolyData;
45 class vtkPolyDataMapper;
46 class vtkScalarBarWidget;
47 class vtkTextProperty;
50 class vtkVertexDegree;
52 
53 class VTKVIEWSINFOVIS_EXPORT vtkRenderedTreeAreaRepresentation : public vtkRenderedRepresentation
54 {
55 public:
58  void PrintSelf(ostream& os, vtkIndent indent) override;
59 
66  void SetLabelRenderMode(int mode) override;
67 
69 
72  virtual void SetAreaLabelArrayName(const char* name);
73  virtual const char* GetAreaLabelArrayName();
75 
77 
80  virtual void SetAreaSizeArrayName(const char* name);
81  virtual const char* GetAreaSizeArrayName();
83 
85 
89  virtual void SetAreaLabelPriorityArrayName(const char* name);
90  virtual const char* GetAreaLabelPriorityArrayName();
92 
94 
97  virtual void SetGraphEdgeLabelArrayName(const char* name)
98  {
99  this->SetGraphEdgeLabelArrayName(name, 0);
100  }
101  virtual void SetGraphEdgeLabelArrayName(const char* name, int idx);
102  virtual const char* GetGraphEdgeLabelArrayName() { return this->GetGraphEdgeLabelArrayName(0); }
103  virtual const char* GetGraphEdgeLabelArrayName(int idx);
105 
107 
111  {
112  this->SetGraphEdgeLabelTextProperty(tp, 0);
113  }
114  virtual void SetGraphEdgeLabelTextProperty(vtkTextProperty* tp, int idx);
116  {
117  return this->GetGraphEdgeLabelTextProperty(0);
118  }
119  virtual vtkTextProperty* GetGraphEdgeLabelTextProperty(int idx);
121 
123 
127  vtkSetStringMacro(AreaHoverArrayName);
128  vtkGetStringMacro(AreaHoverArrayName);
130 
132 
135  virtual void SetAreaLabelVisibility(bool vis);
136  virtual bool GetAreaLabelVisibility();
137  vtkBooleanMacro(AreaLabelVisibility, bool);
139 
141 
144  virtual void SetAreaLabelTextProperty(vtkTextProperty* tp);
145  virtual vtkTextProperty* GetAreaLabelTextProperty();
147 
149 
152  virtual void SetGraphEdgeLabelVisibility(bool vis) { this->SetGraphEdgeLabelVisibility(vis, 0); }
153  virtual void SetGraphEdgeLabelVisibility(bool vis, int idx);
154  virtual bool GetGraphEdgeLabelVisibility() { return this->GetGraphEdgeLabelVisibility(0); }
155  virtual bool GetGraphEdgeLabelVisibility(int idx);
156  vtkBooleanMacro(GraphEdgeLabelVisibility, bool);
158 
160 
163  void SetAreaColorArrayName(const char* name);
164  const char* GetAreaColorArrayName();
166 
168 
171  virtual void SetColorAreasByArray(bool vis);
172  virtual bool GetColorAreasByArray();
173  vtkBooleanMacro(ColorAreasByArray, bool);
175 
177 
180  virtual void SetGraphEdgeColorArrayName(const char* name)
181  {
182  this->SetGraphEdgeColorArrayName(name, 0);
183  }
184  virtual void SetGraphEdgeColorArrayName(const char* name, int idx);
185  virtual const char* GetGraphEdgeColorArrayName() { return this->GetGraphEdgeColorArrayName(0); }
186  virtual const char* GetGraphEdgeColorArrayName(int idx);
188 
193  virtual void SetGraphEdgeColorToSplineFraction(int idx);
194 
196 
199  virtual void SetColorGraphEdgesByArray(bool vis) { this->SetColorGraphEdgesByArray(vis, 0); }
200  virtual void SetColorGraphEdgesByArray(bool vis, int idx);
201  virtual bool GetColorGraphEdgesByArray() { return this->GetColorGraphEdgesByArray(0); }
202  virtual bool GetColorGraphEdgesByArray(int idx);
203  vtkBooleanMacro(ColorGraphEdgesByArray, bool);
205 
207 
211  virtual void SetGraphHoverArrayName(const char* name) { this->SetGraphHoverArrayName(name, 0); }
212  virtual void SetGraphHoverArrayName(const char* name, int idx);
213  virtual const char* GetGraphHoverArrayName() { return this->GetGraphHoverArrayName(0); }
214  virtual const char* GetGraphHoverArrayName(int idx);
216 
218 
221  virtual void SetShrinkPercentage(double value);
222  virtual double GetShrinkPercentage();
224 
226 
229  virtual void SetGraphBundlingStrength(double strength)
230  {
231  this->SetGraphBundlingStrength(strength, 0);
232  }
233  virtual void SetGraphBundlingStrength(double strength, int idx);
234  virtual double GetGraphBundlingStrength() { return this->GetGraphBundlingStrength(0); }
235  virtual double GetGraphBundlingStrength(int idx);
237 
239 
245  virtual void SetGraphSplineType(int type, int idx);
246  virtual int GetGraphSplineType(int idx);
248 
250 
253  virtual void SetAreaLayoutStrategy(vtkAreaLayoutStrategy* strategy);
254  virtual vtkAreaLayoutStrategy* GetAreaLayoutStrategy();
256 
258 
263  virtual void SetAreaToPolyData(vtkPolyDataAlgorithm* areaToPoly);
264  vtkGetObjectMacro(AreaToPolyData, vtkPolyDataAlgorithm);
266 
268 
271  vtkSetMacro(UseRectangularCoordinates, bool);
272  vtkGetMacro(UseRectangularCoordinates, bool);
273  vtkBooleanMacro(UseRectangularCoordinates, bool);
275 
277 
281  virtual void SetAreaLabelMapper(vtkLabeledDataMapper* mapper);
282  vtkGetObjectMacro(AreaLabelMapper, vtkLabeledDataMapper);
284 
288  void ApplyViewTheme(vtkViewTheme* theme) override;
289 
291 
294  virtual void SetEdgeScalarBarVisibility(bool b);
295  virtual bool GetEdgeScalarBarVisibility();
297 
298 protected:
301 
303 
306  bool AddToView(vtkView* view) override;
307  bool RemoveFromView(vtkView* view) override;
309 
310  vtkSelection* ConvertSelection(vtkView* view, vtkSelection* sel) override;
311 
312  int FillInputPortInformation(int port, vtkInformation* info) override;
313 
315 
316  void PrepareForRendering(vtkRenderView* view) override;
317 
318  bool ValidIndex(int idx);
319 
320  void UpdateHoverHighlight(vtkView* view, int x, int y);
321 
323 
341 
342  vtkSetStringMacro(AreaSizeArrayNameInternal);
343  vtkGetStringMacro(AreaSizeArrayNameInternal);
345  vtkSetStringMacro(AreaColorArrayNameInternal);
346  vtkGetStringMacro(AreaColorArrayNameInternal);
348  vtkSetStringMacro(AreaLabelArrayNameInternal);
349  vtkGetStringMacro(AreaLabelArrayNameInternal);
351  vtkSetStringMacro(AreaLabelPriorityArrayNameInternal);
352  vtkGetStringMacro(AreaLabelPriorityArrayNameInternal);
354  vtkSetStringMacro(GraphEdgeColorArrayNameInternal);
355  vtkGetStringMacro(GraphEdgeColorArrayNameInternal);
357  vtkGetStringMacro(AreaHoverTextInternal);
358  vtkSetStringMacro(AreaHoverTextInternal);
359  char* AreaHoverTextInternal;
361 
363 
364 private:
366  void operator=(const vtkRenderedTreeAreaRepresentation&) = delete;
367 
368  class Internals;
369  Internals* Implementation;
370 };
371 
372 #endif
virtual bool GetGraphEdgeLabelVisibility()
Whether to show edge labels.
virtual void ApplyViewTheme(vtkViewTheme *vtkNotUsed(theme))
Apply a theme to this representation.
virtual void SetGraphEdgeLabelTextProperty(vtkTextProperty *tp)
The text property for the graph edge labels.
virtual vtkSelection * ConvertSelection(vtkView *view, vtkSelection *selection)
Convert the selection to a type appropriate for sharing with other representations through vtkAnnotat...
vtkSmartPointer< vtkWorldPointPicker > Picker
virtual void SetGraphHoverArrayName(const char *name)
The name of the array whose value appears when the mouse hovers over a graph edge.
represents an object (geometry & properties) in a rendered scene
Definition: vtkActor.h:51
vtkSmartPointer< vtkApplyColors > ApplyColors
vtkSmartPointer< vtkPolyDataMapper > HighlightMapper
Store vtkAlgorithm input/output information.
virtual void SetGraphEdgeColorToSplineFraction()
Set the color to be the spline fraction.
virtual const char * GetGraphEdgeColorArrayName()
The array to use for coloring edges.
vtkSmartPointer< vtkTreeLevelsFilter > TreeLevels
abstract superclass for all area layout strategies
virtual void SetGraphEdgeLabelArrayName(const char *name)
The array to use for edge labeling.
a actor that draws 2D data
Definition: vtkActor2D.h:45
vtkSmartPointer< vtkScalarBarWidget > EdgeScalarBar
int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *) override
Subclasses should override this to connect inputs to the internal pipeline as necessary.
data object that represents a "selection" in VTK.
Definition: vtkSelection.h:59
Adds an attribute array with the degree of each vertex.
vtkSmartPointer< vtkTreeFieldAggregator > TreeAggregation
virtual void SetLabelRenderMode(int)
Set the label render mode.
virtual bool AddToView(vtkView *vtkNotUsed(view))
Adds the representation to the view.
concrete dataset represents vertices, lines, polygons, and triangle strips
Definition: vtkPolyData.h:90
static vtkRenderedRepresentation * New()
draw text labels at dataset points
vtkSmartPointer< vtkPolyDataMapper > AreaMapper
virtual double GetGraphBundlingStrength()
Set the bundling strength.
generate points at center of edges
Sets theme colors for a graphical view.
Definition: vtkViewTheme.h:48
layout a vtkTree into a tree map
Definition: vtkAreaLayout.h:46
Superclass for algorithms that produce only polydata as output.
The superclass for all views.
Definition: vtkView.h:63
virtual vtkTextProperty * GetGraphEdgeLabelTextProperty()
The text property for the graph edge labels.
a simple class to control print indentation
Definition: vtkIndent.h:39
virtual bool RemoveFromView(vtkView *vtkNotUsed(view))
Removes the representation to the view.
virtual void PrepareForRendering(vtkRenderView *view)
The view will call this method before every render.
virtual void SetGraphBundlingStrength(double strength)
Set the bundling strength.
virtual const char * GetGraphEdgeLabelArrayName()
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 SetColorGraphEdgesByArray(bool vis)
Whether to color edges.
represent text properties.
aggregate field values from the leaves up the tree
build a label hierarchy for a graph or point set.
virtual bool GetColorGraphEdgesByArray()
Whether to color edges.
virtual void SetGraphEdgeColorArrayName(const char *name)
The array to use for coloring edges.
virtual std::string GetHoverStringInternal(vtkSelection *)
Subclasses may override this method to generate the hover text.
map vtkPolyData to graphics primitives
vtkSmartPointer< vtkVertexDegree > VertexDegree
A view containing a renderer.
Definition: vtkRenderView.h:64
adds level and leaf fields to a vtkTree
Store zero or more vtkInformation instances.
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
virtual const char * GetGraphHoverArrayName()
The name of the array whose value appears when the mouse hovers over a graph edge.
Convert a selection from one type to another.
vtkSmartPointer< vtkPointSetToLabelHierarchy > AreaLabelHierarchy
find world x,y,z corresponding to display x,y,z
virtual void SetGraphEdgeLabelVisibility(bool vis)
Whether to show edge labels.
2D widget for manipulating a scalar bar