Go to the documentation of this file.
39 #ifndef vtkDendrogramItem_h
40 #define vtkDendrogramItem_h
42 #include "vtkViewsInfovisModule.h"
103 vtkSetMacro(ExtendLeafNodes,
bool);
104 vtkGetMacro(ExtendLeafNodes,
bool);
105 vtkBooleanMacro(ExtendLeafNodes,
bool);
138 vtkSetMacro(DrawLabels,
bool);
139 vtkGetMacro(DrawLabels,
bool);
140 vtkBooleanMacro(DrawLabels,
bool);
147 vtkSetVector2Macro(Position,
float);
155 vtkGetVector2Macro(Position,
float);
164 vtkGetMacro(LeafSpacing,
double);
165 vtkSetMacro(LeafSpacing,
double);
208 vtkGetMacro(LineWidth,
float);
209 vtkSetMacro(LineWidth,
float);
217 vtkSetMacro(DisplayNumberOfCollapsedLeafNodes,
bool);
218 vtkGetMacro(DisplayNumberOfCollapsedLeafNodes,
bool);
219 vtkBooleanMacro(DisplayNumberOfCollapsedLeafNodes,
bool);
405 int NumberOfLeafNodes;
412 double SceneBottomLeft[3];
413 double SceneTopRight[3];
417 bool ExtendLeafNodes;
419 bool DisplayNumberOfCollapsedLeafNodes;
420 bool LegendPositionSet;
data structure to represent mouse events.
void PositionColorLegend()
void ComputeLabelWidth(vtkContext2D *painter)
Compute the width of the longest leaf node label.
~vtkDendrogramItem() override
void ComputeBounds()
Compute the bounds of our tree in pixel coordinates.
bool LineIsVisible(double x0, double y0, double x1, double y1)
Returns true if any part of the line segment defined by endpoints (x0, y0), (x1, y1) falls within the...
void CollapseToNumberOfLeafNodes(unsigned int n)
Collapse subtrees until there are only n leaf nodes left in the tree.
double GetTextAngleForOrientation(int orientation)
Get the angle that vertex labels should be rotated for the corresponding tree orientation.
bool GetPositionOfVertex(const std::string &vertexName, double position[2])
Find the position of the vertex with the specified name.
Class for drawing 2D primitives to a graphical context.
bool Hit(const vtkContextMouseEvent &mouse) override
Returns true if the transform is interactive, false otherwise.
virtual void PaintBuffers(vtkContext2D *painter)
This function does the bulk of the actual work in rendering our dendrogram.
vtkIdType GetClickedCollapsedSubTree(double x, double y)
Check if the click at (x, y) should be considered as a click on a collapsed subtree.
float GetLabelWidth()
Get the width of the longest leaf node label.
void SetOrientation(int orientation)
Set which way the tree should face within the visualization.
void CollapseSubTree(vtkIdType vertex)
Collapse the subtree rooted at vertex.
void UpdateVisibleSceneExtent(vtkContext2D *painter)
Calculate the extent of the data that is visible within the window.
void PrepareToPaint(vtkContext2D *painter)
This function calls RebuildBuffers() if necessary.
A rooted tree data structure.
virtual bool IsDirty()
This function returns a bool indicating whether or not we need to rebuild our cached data before pain...
vtkIdType GetClosestVertex(double x, double y)
Get the tree vertex closest to the specified coordinates.
vtkIdType GetOriginalId(vtkIdType vertex)
Look up the original ID of a vertex in the pruned tree.
vtkTree * GetTree()
Get the tree that this item draws.
virtual void GetBounds(double bounds[4])
Get the bounds for this item as (Xmin,Xmax,Ymin,Ymax).
virtual void SetTree(vtkTree *tree)
Set the tree that this item draws.
vtkVector2f PositionVector
static vtkDendrogramItem * New()
a simple class to control print indentation
vtkSmartPointer< vtkTree > LayoutTree
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
int GetOrientation()
Get the current tree orientation.
vtkSmartPointer< vtkTree > Tree
int CountLeafNodes(vtkIdType vertex)
Count the number of leaf nodes that descend from a given vertex.
vtkIdType GetPrunedIdForOriginalId(vtkIdType originalId)
Look up the ID of a vertex in the pruned tree from a vertex ID of the input tree.
double GetAngleForOrientation(int orientation)
Get the rotation angle (in degrees) that corresponds to the given tree orientation.
vtkVector2f GetPositionVector()
prune a subtree out of a vtkTree
void SetPosition(const vtkVector2f &pos)
base class for items that are part of a vtkContextScene.
map scalar values into colors via a lookup table
void SetOrientation(vtkTree *tree, int orientation)
Internal function.
vtkTree * GetPrunedTree()
Get the collapsed tree.
virtual void RebuildBuffers()
Generate some data needed for painting.
Legend item to display vtkScalarsToColors.
void CountLeafNodes()
Count the number of leaf nodes in the tree.
bool MouseDoubleClickEvent(const vtkContextMouseEvent &event) override
Collapse or expand a subtree when the user double clicks on an internal node.
A 2D graphics item for rendering a tree as a dendrogram.
bool operator()(WeightedVertex &v1, WeightedVertex &v2)
dynamic, self-adjusting array of double
bool Paint(vtkContext2D *painter) override
Paints the input tree as a dendrogram.
void ComputeMultipliers()
Compute how to scale our data so that text labels will fit within the bounds determined by the spacin...
void ExpandSubTree(vtkIdType vertex)
Expand the previously collapsed subtree rooted at vertex.
Wrapper around std::string to keep symbols short.
void SetColorArray(const char *arrayName)
Indicate which array within the Tree's VertexData should be used to color the tree.
layout a graph in 2 or 3 dimensions
vtkTypeUInt32 vtkMTimeType