VTK
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 
29 #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) VTK_OVERRIDE;
57 
64  void SetLabelRenderMode(int mode) VTK_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  { this->SetGraphEdgeLabelArrayName(name, 0); }
97  virtual void SetGraphEdgeLabelArrayName(const char* name, int idx);
98  virtual const char* GetGraphEdgeLabelArrayName()
99  { return this->GetGraphEdgeLabelArrayName(0); }
100  virtual const char* GetGraphEdgeLabelArrayName(int idx);
102 
104 
108  { this->SetGraphEdgeLabelTextProperty(tp, 0); }
109  virtual void SetGraphEdgeLabelTextProperty(vtkTextProperty* tp, int idx);
111  { return this->GetGraphEdgeLabelTextProperty(0); }
112  virtual vtkTextProperty* GetGraphEdgeLabelTextProperty(int idx);
114 
116 
120  vtkSetStringMacro(AreaHoverArrayName);
121  vtkGetStringMacro(AreaHoverArrayName);
123 
125 
128  virtual void SetAreaLabelVisibility(bool vis);
129  virtual bool GetAreaLabelVisibility();
130  vtkBooleanMacro(AreaLabelVisibility, bool);
132 
134 
137  virtual void SetAreaLabelTextProperty(vtkTextProperty* tp);
138  virtual vtkTextProperty* GetAreaLabelTextProperty();
140 
142 
145  virtual void SetGraphEdgeLabelVisibility(bool vis)
146  { this->SetGraphEdgeLabelVisibility(vis, 0); }
147  virtual void SetGraphEdgeLabelVisibility(bool vis, int idx);
149  { return this->GetGraphEdgeLabelVisibility(0); }
150  virtual bool GetGraphEdgeLabelVisibility(int idx);
151  vtkBooleanMacro(GraphEdgeLabelVisibility, bool);
153 
155 
158  void SetAreaColorArrayName(const char* name);
159  const char* GetAreaColorArrayName();
161 
163 
166  virtual void SetColorAreasByArray(bool vis);
167  virtual bool GetColorAreasByArray();
168  vtkBooleanMacro(ColorAreasByArray, bool);
170 
172 
175  virtual void SetGraphEdgeColorArrayName(const char* name)
176  { this->SetGraphEdgeColorArrayName(name, 0); }
177  virtual void SetGraphEdgeColorArrayName(const char* name, int idx);
178  virtual const char* GetGraphEdgeColorArrayName()
179  { return this->GetGraphEdgeColorArrayName(0); }
180  virtual const char* GetGraphEdgeColorArrayName(int idx);
182 
187  { this->SetGraphEdgeColorToSplineFraction(0); }
188  virtual void SetGraphEdgeColorToSplineFraction(int idx);
189 
191 
194  virtual void SetColorGraphEdgesByArray(bool vis)
195  { this->SetColorGraphEdgesByArray(vis, 0); }
196  virtual void SetColorGraphEdgesByArray(bool vis, int idx);
198  { return this->GetColorGraphEdgesByArray(0); }
199  virtual bool GetColorGraphEdgesByArray(int idx);
200  vtkBooleanMacro(ColorGraphEdgesByArray, bool);
202 
204 
208  virtual void SetGraphHoverArrayName(const char* name)
209  { this->SetGraphHoverArrayName(name, 0); }
210  virtual void SetGraphHoverArrayName(const char* name, int idx);
211  virtual const char* GetGraphHoverArrayName()
212  { return this->GetGraphHoverArrayName(0); }
213  virtual const char* GetGraphHoverArrayName(int idx);
215 
217 
220  virtual void SetShrinkPercentage(double value);
221  virtual double GetShrinkPercentage();
223 
225 
228  virtual void SetGraphBundlingStrength(double strength)
229  { this->SetGraphBundlingStrength(strength, 0); }
230  virtual void SetGraphBundlingStrength(double strength, int idx);
231  virtual double GetGraphBundlingStrength()
232  { 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 
251  virtual void SetAreaLayoutStrategy(vtkAreaLayoutStrategy* strategy);
252  virtual vtkAreaLayoutStrategy* GetAreaLayoutStrategy();
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 
279  virtual void SetAreaLabelMapper(vtkLabeledDataMapper* mapper);
280  vtkGetObjectMacro(AreaLabelMapper, vtkLabeledDataMapper);
282 
286  void ApplyViewTheme(vtkViewTheme* theme) VTK_OVERRIDE;
287 
289 
292  virtual void SetEdgeScalarBarVisibility(bool b);
293  virtual bool GetEdgeScalarBarVisibility();
295 
296 protected:
298  ~vtkRenderedTreeAreaRepresentation() VTK_OVERRIDE;
299 
301 
304  bool AddToView(vtkView* view) VTK_OVERRIDE;
305  bool RemoveFromView(vtkView* view) VTK_OVERRIDE;
307 
308  vtkSelection* ConvertSelection(vtkView* view, vtkSelection* sel) VTK_OVERRIDE;
309 
310  int FillInputPortInformation(int port, vtkInformation* info) VTK_OVERRIDE;
311 
312  int RequestData(
315  vtkInformationVector*) VTK_OVERRIDE;
316 
317  void PrepareForRendering(vtkRenderView* view) VTK_OVERRIDE;
318 
319  bool ValidIndex(int idx);
320 
321  void UpdateHoverHighlight(vtkView* view, int x, int y);
322 
324 
325  class Internals;
326  Internals* Implementation;
327 
345 
346  vtkSetStringMacro(AreaSizeArrayNameInternal);
347  vtkGetStringMacro(AreaSizeArrayNameInternal);
349  vtkSetStringMacro(AreaColorArrayNameInternal);
350  vtkGetStringMacro(AreaColorArrayNameInternal);
352  vtkSetStringMacro(AreaLabelArrayNameInternal);
353  vtkGetStringMacro(AreaLabelArrayNameInternal);
355  vtkSetStringMacro(AreaLabelPriorityArrayNameInternal);
356  vtkGetStringMacro(AreaLabelPriorityArrayNameInternal);
358  vtkSetStringMacro(GraphEdgeColorArrayNameInternal);
359  vtkGetStringMacro(GraphEdgeColorArrayNameInternal);
361  vtkGetStringMacro(AreaHoverTextInternal);
362  vtkSetStringMacro(AreaHoverTextInternal);
363  char* AreaHoverTextInternal;
365 
367 
368 private:
370  void operator=(const vtkRenderedTreeAreaRepresentation&) VTK_DELETE_FUNCTION;
371 };
372 
373 #endif
374 
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:45
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:39
vtkSmartPointer< vtkScalarBarWidget > EdgeScalarBar
int RequestData(vtkInformation *, vtkInformationVector **, vtkInformationVector *) override
Subclasses should override this to connect inputs to the internal pipeline as necessary.
A node in a selection tree.
Definition: vtkSelection.h:37
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:79
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:42
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:54
virtual vtkTextProperty * GetGraphEdgeLabelTextProperty()
The text property for the graph edge labels.
a simple class to control print indentation
Definition: vtkIndent.h:33
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.
vtkGetStringMacro(ExtensionsString)
Returns a string listing all available extensions.
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.
vtkSetMacro(IgnoreDriverBugs, bool)
When set known driver bugs are ignored during driver feature detection.
virtual void SetGraphEdgeColorArrayName(const char *name)
The array to use for coloring edges.
map vtkPolyData to graphics primitives
vtkSmartPointer< vtkVertexDegree > VertexDegree
A view containing a renderer.
Definition: vtkRenderView.h:58
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.
vtkBooleanMacro(IgnoreDriverBugs, bool)
When set known driver bugs are ignored during driver feature detection.
vtkSmartPointer< vtkPointSetToLabelHierarchy > AreaLabelHierarchy
find world x,y,z corresponding to display x,y,z
virtual vtkUnicodeString GetHoverTextInternal(vtkSelection *)
Subclasses may override this method to generate the hover text.
String class that stores Unicode text.
extract a list of cells from a polydata
virtual void SetGraphEdgeLabelVisibility(bool vis)
Whether to show edge labels.
2D widget for manipulating a scalar bar