-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvtkLineageView.h
274 lines (230 loc) · 8.31 KB
/
vtkLineageView.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
// Copyright 2009 Sandia Corporation, Kitware Inc.
// See LICENSE.txt for details.
// .NAME vtkLineageView - Display a cell lineage hierarchy
//
// .SECTION Description
// vtkLineageView is a prototype class that displays cool stuff about
// cell lineage trees.
//
// .SECTION See Also
// vtkTreeMapView
//
// .SECTION Thanks
// Thanks to the Universe for making the space in which this class
// was constructed within.
#ifndef __vtkLineageView_h
#define __vtkLineageView_h
#include "vtkRenderView.h"
#include "vtkSmartPointer.h" // Required for smart pointer internal ivars.
class vtkAbstractGraph;
class vtkAnnotationLink;
class vtkElbowGraphToPolyData;
class vtkTreeLayoutStrategy;
class vtkGraphLayout;
class vtkDelaunay2D;
class vtkContourFilter;
class vtkSplineFilter;
class vtkCornerAnnotation;
class vtkPolyDataMapper;
class vtkAlgorithmOutput;
class vtkActor;
class vtkActor2D;
class vtkGlyph3D;
class vtkRenderWindowInteractor;
class vtkInteractorStyleImage;
class vtkRenderWindow;
class vtkRenderer;
class vtkRenderWindowInteractor;
class vtkLookupTable;
class vtkLabeledDataMapper;
class vtkDynamic2DLabelMapper;
class vtkEventForwarderCommand;
class vtkAlgorithmOutput;
class vtkSphereSource;
class vtkConeSource;
class vtkTree;
class vtkTreeAlgorithm;
class vtkSelection;
class vtkVisibleCellSelector;
class vtkExtractSelectedIds;
class vtkRenderWindowInteractor;
class vtkInteractorStyleSelect2D;
class vtkRenderedAreaPicker;
class vtkDataSetMapper;
class vtkGeometryFilter;
class vtkDynamic2DLabelMapper;
class vtkCellCenters;
class vtkTreeCollapseFilter;
class vtkTreeVertexToEdgeSelection;
class vtkThresholdPoints;
class vtkVertexGlyphFilter;
class vtkLineageView : public vtkRenderView
{
public:
static vtkLineageView *New();
vtkTypeRevisionMacro(vtkLineageView, vtkRenderView);
void PrintSelf(ostream& os, vtkIndent indent);
// Description:
// The name of the vertex field used for coloring the vertices
virtual void SetVertexColorFieldName(const char *field);
virtual char* GetVertexColorFieldName();
// Description:
// The name of the edge field used for coloring the edges
virtual void SetEdgeColorFieldName(const char *field);
virtual char* GetEdgeColorFieldName();
// Description:
// The name of the field used for labeling
virtual void SetLabelFieldName(const char *field);
virtual char* GetLabelFieldName();
// Description:
// These methods turn labeling on/off. Defaulted to off
virtual void SetLabelsOn();
virtual void SetLabelsOff();
// Description:
// The size of the font used for labeling
virtual void SetFontSize(const int size);
virtual int GetFontSize();
// Description:
// Set/Get the field to use for the edge weights.
vtkSetStringMacro(EdgeWeightField);
vtkGetStringMacro(EdgeWeightField);
// Description:
// Set whether to use radial layout.
void SetRadialLayout(bool radial);
bool GetRadialLayout() { return this->Radial; }
// Description:
// Set the radial layout angle.
void SetRadialAngle(int angle);
int GetRadialAngle();
// Description:
// Set the log spacing for the layout.
void SetLogSpacingFactor(float spacing);
// Description:
// Turn back plane on/off. Defaulted to off
virtual void SetBackPlane(bool state);
// Description:
// Turn isocontour on/off. Defaulted to on
virtual void SetIsoContour(bool state);
// Description:
// Set the min,max,current time
vtkSetMacro(MinTime, double);
vtkSetMacro(MaxTime, double);
void SetCurrentTime(double time_value);
// Description:
// Set the elbow parameters.
void SetElbow(int onOff);
void SetElbowAngle(double value);
// Description:
// Change the mode of coloring edges by a scalar.
void SetEdgeScalarVisibility(bool value);
// Description:
// Set the array name to use for the vertex distance.
void SetDistanceArrayName(const char* name);
// Description:
// Block the updating to make things faster
vtkSetClampMacro(BlockUpdate, int, 0, 1);
vtkBooleanMacro(BlockUpdate, int);
vtkGetMacro(BlockUpdate, int);
//BTX
enum
{
COLLAPSE_MODE,
SELECT_MODE
};
//ETX
// Description:
// The interaction mode for the viewer.
vtkSetMacro(SelectMode, int);
vtkGetMacro(SelectMode, int);
// Description:
// Apply the theme to this view.
virtual void ApplyViewTheme(vtkViewTheme* theme);
protected:
vtkLineageView();
~vtkLineageView();
// Description:
// Connects the representation to the internal pipeline.
virtual void AddRepresentationInternal(vtkDataRepresentation* rep);
// Description:
// Disconnects the representation from the internal pipeline.
virtual void RemoveRepresentationInternal(vtkDataRepresentation* rep);
// Description:
// Called to process the user event from the interactor style.
virtual void ProcessEvents(vtkObject* caller, unsigned long eventId,
void* callData);
// Description:
// Connects the selection link to the internal pipeline.
virtual void SetAnnotationLink(vtkAnnotationLink* link);
// Decsription:
// Prepares the view for rendering.
virtual void PrepareForRendering();
//BTX
vtkSmartPointer<vtkTreeLayoutStrategy> TreeLayoutStrategy;
vtkSmartPointer<vtkGraphLayout> TreeLayout;
vtkSmartPointer<vtkDelaunay2D> MakePlane;
vtkSmartPointer<vtkContourFilter> IsoContour;
vtkSmartPointer<vtkSplineFilter> SmoothContour;
vtkSmartPointer<vtkCornerAnnotation> CornerAnnotation;
vtkSmartPointer<vtkElbowGraphToPolyData> TreeToPolyData;
vtkSmartPointer<vtkElbowGraphToPolyData> CollapseToPolyData;
vtkSmartPointer<vtkSphereSource> SphereSource;
vtkSmartPointer<vtkConeSource> ConeSource;
vtkSmartPointer<vtkVertexGlyphFilter> VertexGlyphs;
vtkSmartPointer<vtkPolyDataMapper> IsoLineMapper;
vtkSmartPointer<vtkPolyDataMapper> PlaneMapper;
vtkSmartPointer<vtkPolyDataMapper> GlyphMapper;
vtkSmartPointer<vtkPolyDataMapper> CollapseMapper;
vtkSmartPointer<vtkActor> IsoActor;
vtkSmartPointer<vtkActor> PlaneActor;
vtkSmartPointer<vtkActor> GlyphActor;
vtkSmartPointer<vtkActor> CollapseActor;
vtkSmartPointer<vtkActor2D> LabelActor;
vtkSmartPointer<vtkLookupTable> ColorLUT;
vtkSmartPointer<vtkDynamic2DLabelMapper> LabeledDataMapper;
vtkSmartPointer<vtkVisibleCellSelector> VisibleCellSelector;
vtkSmartPointer<vtkExtractSelectedIds> ExtractSelection;
vtkSmartPointer<vtkGeometryFilter> SelectionGeometry;
vtkSmartPointer<vtkDataSetMapper> SelectionMapper;
vtkSmartPointer<vtkActor> SelectionActor;
vtkSmartPointer<vtkRenderedAreaPicker> Picker;
vtkSmartPointer<vtkCellCenters> CellCenters;
vtkSmartPointer<vtkTreeCollapseFilter> TreeCollapse;
vtkSmartPointer<vtkTreeVertexToEdgeSelection> TreeVertexToEdge;
vtkSmartPointer<vtkGlyph3D> CollapsedNodes;
vtkSmartPointer<vtkPolyDataMapper> CollapsedGlyphMapper;
vtkSmartPointer<vtkActor> CollapsedGlyphActor;
vtkSmartPointer<vtkThresholdPoints> CollapsedThreshold;
//ETX
// Description:
// This intercepts events from the graph layout class
// and re-emits them as if they came from this class.
vtkEventForwarderCommand *EventForwarder;
unsigned long ObserverTag;
int SelectMode;
private:
// Internally used methods
// Description:
// Setup the internal pipeline for the graph layout view
virtual void SetupPipeline();
// Description:
// The field to use for the edge weights
char* EdgeWeightField;
// Description:
// Whether to use radial layout.
bool Radial;
// Description:
// The radial layout angle.
int Angle;
// Description:
// The log spacing for the layout.
float LogSpacing;
// Description:
// Keep track of the minimum, maximum, current time values
double MinTime;
double CurrentTime;
double MaxTime;
int BlockUpdate;
vtkLineageView(const vtkLineageView&); // Not implemented.
void operator=(const vtkLineageView&); // Not implemented.
};
#endif