VTK
vtkTanglegramItem.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: TestDiagram.cxx
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 =========================================================================*/
31 #ifndef vtkTanglegramItem_h
32 #define vtkTanglegramItem_h
33 
34 #include "vtkViewsInfovisModule.h" // For export macro
35 
36 #include "vtkContextItem.h"
37 #include "vtkSmartPointer.h" // For SmartPointer ivars
38 #include "vtkTable.h" // For get/set
39 
40 class vtkDendrogramItem;
41 class vtkLookupTable;
42 class vtkStringArray;
43 class vtkTree;
44 
46 {
47 public:
48  static vtkTanglegramItem *New();
50  virtual void PrintSelf(ostream &os, vtkIndent indent);
51 
53  virtual void SetTree1(vtkTree *tree);
54 
56  virtual void SetTree2(vtkTree *tree);
57 
59 
65  vtkTable * GetTable();
66  void SetTable(vtkTable *table);
68 
70 
71  vtkGetStringMacro(Tree1Label);
72  vtkSetStringMacro(Tree1Label);
74 
76 
77  vtkGetStringMacro(Tree2Label);
78  vtkSetStringMacro(Tree2Label);
80 
83  void SetOrientation(int orientation);
84 
86  int GetOrientation();
87 
89 
93  vtkGetMacro(MinimumVisibleFontSize, int);
94  vtkSetMacro(MinimumVisibleFontSize, int);
96 
98 
102  vtkGetMacro(LabelSizeDifference, int);
103  vtkSetMacro(LabelSizeDifference, int);
105 
107 
109  vtkGetMacro(CorrespondenceLineWidth, float);
110  vtkSetMacro(CorrespondenceLineWidth, float);
112 
114 
116  float GetTreeLineWidth();
117  void SetTreeLineWidth(float width);
119 
120  // BTX
121 
123  virtual bool Hit(const vtkContextMouseEvent &mouse);
124 
127  virtual bool MouseDoubleClickEvent(const vtkContextMouseEvent &event);
128 
129  //ETX
130 
131 protected:
134 
136  void RefreshBuffers(vtkContext2D *painter);
137 
139  void PositionTree2();
140 
143  void PaintCorrespondenceLines(vtkContext2D *painter);
144 
146  void PaintTreeLabels(vtkContext2D *painter);
147 
150  void ReorderTree();
151 
154  void ReorderTreeAtVertex(vtkIdType parent, vtkTree *tree);
155 
160  double GetPositionScoreForVertex(vtkIdType vertex, vtkTree *tree);
161 
164  void GenerateLookupTable();
165 
167  virtual bool Paint(vtkContext2D *painter);
168 
169 private:
174  vtkStringArray *Tree1Names;
175  vtkStringArray *Tree2Names;
176  vtkStringArray *SourceNames;
177  double Tree1Bounds[4];
178  double Tree2Bounds[4];
179  double Spacing;
180  double LabelWidth1;
181  double LabelWidth2;
182  bool PositionSet;
183  bool TreeReordered;
184  char* Tree1Label;
185  char* Tree2Label;
186  int Orientation;
187  int MinimumVisibleFontSize;
188  int LabelSizeDifference;
189  float CorrespondenceLineWidth;
190 
191  vtkTanglegramItem(const vtkTanglegramItem&); // Not implemented
192  void operator=(const vtkTanglegramItem&); // Not implemented
193 
194 };
195 
196 #endif
Display two related trees.
A 2D graphics item for rendering a tree as a dendrogram.
base class for items that are part of a vtkContextScene.
virtual bool Paint(vtkContext2D *painter)
map scalar values into colors via a lookup table
a vtkAbstractArray subclass for strings
int vtkIdType
Definition: vtkType.h:275
Class for drawing 2D primitives to a graphical context.
Definition: vtkContext2D.h:56
data structure to represent mouse events.
a simple class to control print indentation
Definition: vtkIndent.h:38
A table, which contains similar-typed columns of data.
Definition: vtkTable.h:67
virtual bool Hit(const vtkContextMouseEvent &mouse)
virtual void PrintSelf(ostream &os, vtkIndent indent)
static vtkObject * New()
A rooted tree data structure.
Definition: vtkTree.h:59
virtual bool MouseDoubleClickEvent(const vtkContextMouseEvent &mouse)
#define VTKVIEWSINFOVIS_EXPORT