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