Go to the documentation of this file.
39 #ifndef vtkDendrogramItem_h
40 #define vtkDendrogramItem_h
42 #include "vtkViewsInfovisModule.h"
104 vtkGetMacro(ExtendLeafNodes,
bool);
139 vtkGetMacro(DrawLabels,
bool);
147 vtkSetVector2Macro(Position,
float);
155 vtkGetVector2Macro(Position,
float);
164 vtkGetMacro(LeafSpacing,
double);
208 vtkGetMacro(LineWidth,
float);
218 vtkGetMacro(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.
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 correponding tree orientation.
Class for drawing 2D primitives to a graphical context.
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.
virtual bool Hit(const vtkContextMouseEvent &mouse)
Returns true if the transform is interactive, false otherwise.
vtkTypeUInt64 vtkMTimeType
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 bool Paint(vtkContext2D *painter)
Paints the input tree as a dendrogram.
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
virtual void PrintSelf(ostream &os, vtkIndent indent)
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)
vtkBooleanMacro(IgnoreDriverBugs, bool)
Updates the extensions string.
base class for items that are part of a vtkContextScene.
vtkSetMacro(IgnoreDriverBugs, bool)
Updates the extensions string.
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.
A 2D graphics item for rendering a tree as a dendrogram.
bool operator()(WeightedVertex &v1, WeightedVertex &v2)
virtual bool MouseDoubleClickEvent(const vtkContextMouseEvent &event)
Collapse or expand a subtree when the user double clicks on an internal node.
dynamic, self-adjusting array of double
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.
bool GetPositionOfVertex(std::string vertexName, double position[2])
Find the position of the vertex with the specified name.
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