VTK
Main Page
Related Pages
Namespaces
Classes
Files
File List
File Members
dox
Widgets
vtkXYPlotWidget.h
Go to the documentation of this file.
1
/*=========================================================================
2
3
Program: Visualization Toolkit
4
Module: vtkXYPlotWidget.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
=========================================================================*/
35
#ifndef __vtkXYPlotWidget_h
36
#define __vtkXYPlotWidget_h
37
38
#include "
vtkInteractorObserver.h
"
39
class
vtkXYPlotActor
;
40
41
class
VTK_WIDGETS_EXPORT
vtkXYPlotWidget
:
public
vtkInteractorObserver
42
{
43
public
:
44
static
vtkXYPlotWidget
*
New
();
45
vtkTypeMacro(
vtkXYPlotWidget
,
vtkInteractorObserver
);
46
void
PrintSelf
(ostream& os,
vtkIndent
indent);
47
49
50
virtual
void
SetXYPlotActor(
vtkXYPlotActor
*);
51
vtkGetObjectMacro(XYPlotActor,
vtkXYPlotActor
);
53
55
virtual
void
SetEnabled
(
int
);
56
57
protected
:
58
vtkXYPlotWidget
();
59
~
vtkXYPlotWidget
();
60
61
// the actor that is used
62
vtkXYPlotActor
*
XYPlotActor
;
63
64
//handles the events
65
static
void
ProcessEvents
(
vtkObject
*
object
,
66
unsigned
long
event,
67
void
* clientdata,
68
void
* calldata);
69
70
// ProcessEvents() dispatches to these methods.
71
void
OnLeftButtonDown();
72
void
OnLeftButtonUp();
73
void
OnMouseMove();
74
75
// used to compute relative movements
76
float
StartPosition[2];
77
78
//BTX - manage the state of the widget
79
int
State
;
80
enum
WidgetState
81
{
82
Moving=0,
83
AdjustingP1
,
84
AdjustingP2
,
85
AdjustingP3
,
86
AdjustingP4
,
87
AdjustingE1
,
88
AdjustingE2
,
89
AdjustingE3
,
90
AdjustingE4
,
91
Inside
,
92
Outside
93
};
94
//ETX
95
96
// use to determine what state the mouse is over, edge1 p1, etc.
97
// returns a state from the WidgetState enum above
98
int
ComputeStateBasedOnPosition(
int
X,
int
Y,
int
*pos1,
int
*pos2);
99
100
// set the cursor to the correct shape based on State argument
101
void
SetCursor(
int
State);
102
103
private
:
104
vtkXYPlotWidget
(
const
vtkXYPlotWidget
&);
//Not implemented
105
void
operator=(
const
vtkXYPlotWidget
&);
//Not implemented
106
};
107
108
#endif
Generated on Sun Sep 9 2012 13:03:50 for VTK by
1.8.1.2