-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path_InteractionCallBack.h
More file actions
58 lines (44 loc) · 1.44 KB
/
Copy path_InteractionCallBack.h
File metadata and controls
58 lines (44 loc) · 1.44 KB
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
#ifndef _INTERCALLBACK_H
#define _INTERCALLBACK_H
#include "includes.h"
template<typename T> void vtkValueMessageTemplate(vtkImageData* image, int* position, std::string& message) {
T* tuple = ((T*)image -> GetScalarPointer(position));
int components = image -> GetNumberOfScalarComponents();
for (int c = 0; c < components; ++c) {
message += vtkVariant(tuple[c]).ToString();
if (c != (components - 1)) {
message += ", ";
}
}
message += " )";
}
class _InteractionCallBack : public vtkCommand {
private:
int _wsize;
vtkPolyData *Lines;
vtkCellArray *LinesArray;
_Im2Graph *Im2Graph;
vtkPropPicker *Picker;
vtkImageViewer2 *Viewer;
vtkCornerAnnotation *Annotation;
vtkMutableUndirectedGraph *vtkG;
std::vector<int> _ssdx, _ssdy;
std::vector<vtkIdType> ControlPoints, Buffer;
public:
_InteractionCallBack() {
this -> Viewer = NULL;
this -> Picker = NULL;
this -> Annotation = NULL;
}
~_InteractionCallBack() {
this -> Viewer = NULL;
this -> Picker = NULL;
this -> Annotation = NULL;
}
static _InteractionCallBack *New() {
return new _InteractionCallBack;
}
void Initialize(vtkPropPicker *picker, vtkCornerAnnotation *annotation, vtkImageViewer2 *viewer, vtkMutableUndirectedGraph *G, _Im2Graph *im2g, int wsize);
virtual void Execute(vtkObject *, unsigned long vtkNotUsed(event), void*);
};
#endif