-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathvtkPushPlaneTool.h
132 lines (105 loc) · 3.59 KB
/
vtkPushPlaneTool.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
/*=========================================================================
Program: ToolCursor
Module: vtkPushPlaneTool.h
Copyright (c) 2010 David Gobbi
All rights reserved.
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the above copyright notice for more information.
=========================================================================*/
// .NAME vtkPushPlaneTool - Controls plane-pushing action.
// .SECTION Description
// This class controls the "push" interaction for vtkImageSlice slices,
// vtkVolumeMapper cropping planes, or clipping planes on all types of
// mappers.
#ifndef __vtkPushPlaneTool_h
#define __vtkPushPlaneTool_h
#include "vtkTool.h"
class vtkImageActor;
class vtkVolumeMapper;
class vtkImageMapper3D;
class vtkAbstractMapper3D;
class vtkLODProp3D;
class vtkTransform;
class VTK_EXPORT vtkPushPlaneTool : public vtkTool
{
public:
// Description:
// Instantiate the object.
static vtkPushPlaneTool *New();
// Description:
// Standard vtkObject methods
vtkTypeMacro(vtkPushPlaneTool,vtkTool);
void PrintSelf(ostream& os, vtkIndent indent);
// Description:
// Allow the tool to perform rotation.
vtkSetMacro(AllowRotation, int);
vtkGetMacro(AllowRotation, int);
vtkBooleanMacro(AllowRotation, int);
// Description:
// Allow the tool to perform slicing.
vtkSetMacro(AllowSlicing, int);
vtkGetMacro(AllowSlicing, int);
vtkBooleanMacro(AllowSlicing, int);
// Description:
// These are the methods that are called when the action takes place.
virtual void StartAction();
virtual void StopAction();
virtual void DoAction();
// Description:
// This method allows the action to constrain the cursor position.
virtual void ConstrainCursor(double position[3], double normal[3]);
protected:
vtkPushPlaneTool();
~vtkPushPlaneTool();
vtkTransform *Transform;
vtkImageActor *ImageActor;
vtkVolumeMapper *VolumeMapper;
vtkImageMapper3D *ImageMapper;
vtkAbstractMapper3D *Mapper;
vtkLODProp3D *LODProp3D;
int PlaneId;
int EdgeId;
int PerpendicularPlane;
double StartNormal[3];
double StartOrigin[3];
double Origin[3];
double Normal[3];
double DistanceLimits[2];
bool IsOffOfPlane;
int AllowRotation;
int AllowSlicing;
int IsPlaneValid() { return (this->PlaneId >= 0); };
void GetPropInformation();
void GetPlaneOriginAndNormal(double origin[3], double normal[3]);
void SetStartOrigin(const double origin[3]) {
this->StartOrigin[0] = origin[0];
this->StartOrigin[1] = origin[1];
this->StartOrigin[2] = origin[2]; };
void GetStartOrigin(double origin[3]) {
origin[0] = this->StartOrigin[0];
origin[1] = this->StartOrigin[1];
origin[2] = this->StartOrigin[2]; };
void SetOrigin(const double origin[3]);
void GetOrigin(double origin[3]) {
origin[0] = this->Origin[0];
origin[1] = this->Origin[1];
origin[2] = this->Origin[2]; };
void SetStartNormal(const double normal[3]) {
this->StartNormal[0] = normal[0];
this->StartNormal[1] = normal[1];
this->StartNormal[2] = normal[2]; };
void GetStartNormal(double normal[3]) {
normal[0] = this->StartNormal[0];
normal[1] = this->StartNormal[1];
normal[2] = this->StartNormal[2]; };
void SetNormal(const double normal[3]);
void GetNormal(double normal[3]) {
normal[0] = this->Normal[0];
normal[1] = this->Normal[1];
normal[2] = this->Normal[2]; };
private:
vtkPushPlaneTool(const vtkPushPlaneTool&); //Not implemented
void operator=(const vtkPushPlaneTool&); //Not implemented
};
#endif