VTK
Main Page
Related Pages
Namespaces
Classes
Files
File List
File Members
dox
Widgets
vtkBiDimensionalRepresentation2D.h
Go to the documentation of this file.
1
/*=========================================================================
2
3
Program: Visualization Toolkit
4
Module: vtkBiDimensionalRepresentation2D.h
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
=========================================================================*/
43
#ifndef __vtkBiDimensionalRepresentation2D_h
44
#define __vtkBiDimensionalRepresentation2D_h
45
46
#include "
vtkBiDimensionalRepresentation.h
"
47
48
class
vtkHandleRepresentation
;
49
class
vtkCellArray
;
50
class
vtkPoints
;
51
class
vtkPolyData
;
52
class
vtkPolyDataMapper2D
;
53
class
vtkTextMapper
;
54
class
vtkActor2D
;
55
class
vtkProperty2D
;
56
class
vtkTextProperty
;
57
58
59
class
VTK_WIDGETS_EXPORT
vtkBiDimensionalRepresentation2D
:
public
vtkBiDimensionalRepresentation
60
{
61
public
:
63
static
vtkBiDimensionalRepresentation2D
*
New
();
64
66
67
vtkTypeMacro(
vtkBiDimensionalRepresentation2D
,
vtkBiDimensionalRepresentation
);
68
void
PrintSelf
(ostream& os,
vtkIndent
indent);
70
72
74
vtkGetObjectMacro(LineProperty,
vtkProperty2D
);
75
vtkGetObjectMacro(SelectedLineProperty,
vtkProperty2D
);
77
79
81
vtkGetObjectMacro(TextProperty,
vtkTextProperty
);
83
84
//BTX -- used to communicate about the state of the representation
85
enum
{Outside=0,
NearP1
,
NearP2
,
NearP3
,
NearP4
,
OnL1Inner
,
OnL1Outer
,
OnL2Inner
,
OnL2Outer
,OnCenter};
86
//ETX
87
89
90
virtual
void
BuildRepresentation
();
91
virtual
int
ComputeInteractionState
(
int
X,
int
Y,
int
modify=0);
92
virtual
void
StartWidgetDefinition
(
double
e[2]);
93
virtual
void
Point2WidgetInteraction
(
double
e[2]);
94
virtual
void
Point3WidgetInteraction
(
double
e[2]);
95
virtual
void
StartWidgetManipulation
(
double
e[2]);
96
virtual
void
WidgetInteraction
(
double
e[2]);
97
virtual
void
Highlight
(
int
highlightOn);
99
101
102
virtual
void
ReleaseGraphicsResources
(
vtkWindow
*w);
103
virtual
int
RenderOverlay
(
vtkViewport
*viewport);
105
107
char
*
GetLabelText
();
108
110
111
double
*
GetLabelPosition
();
112
void
GetLabelPosition
(
double
pos[3]);
113
void
GetWorldLabelPosition
(
double
pos[3]);
115
116
protected
:
117
vtkBiDimensionalRepresentation2D
();
118
~
vtkBiDimensionalRepresentation2D
();
119
120
// Keep track if modifier is set
121
int
Modifier
;
122
123
// Geometry of the lines
124
vtkCellArray
*
LineCells
;
125
vtkPoints
*
LinePoints
;
126
vtkPolyData
*
LinePolyData
;
127
vtkPolyDataMapper2D
*
LineMapper
;
128
vtkActor2D
*
LineActor
;
129
vtkProperty2D
*
LineProperty
;
130
vtkProperty2D
*
SelectedLineProperty
;
131
132
// The labels for the line lengths
133
vtkTextProperty
*
TextProperty
;
134
vtkTextMapper
*
TextMapper
;
135
vtkActor2D
*
TextActor
;
136
137
// Internal variables
138
double
P1World[3];
139
double
P2World[3];
140
double
P3World[3];
141
double
P4World[3];
142
double
P21World[3];
143
double
P43World[3];
144
double
T21
;
145
double
T43
;
146
double
CenterWorld[3];
147
double
StartEventPositionWorld[4];
148
149
// Helper method
150
void
ProjectOrthogonalPoint(
double
x[4],
double
y[3],
double
x1[3],
double
x2[3],
double
x21[3],
151
double
dir
,
double
xP[3]);
152
153
private
:
154
vtkBiDimensionalRepresentation2D
(
const
vtkBiDimensionalRepresentation2D
&);
//Not implemented
155
void
operator=(
const
vtkBiDimensionalRepresentation2D
&);
//Not implemented
156
};
157
158
#endif
Generated on Wed May 30 2012 13:22:25 for VTK by
1.8.1