VTK
vtkBiDimensionalRepresentation.h
Go to the documentation of this file.
1/*=========================================================================
2
3 Program: Visualization Toolkit
4 Module: vtkBiDimensionalRepresentation.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 vtkBiDimensionalRepresentation_h
44#define vtkBiDimensionalRepresentation_h
45
46#include "vtkInteractionWidgetsModule.h" // For export macro
48
50
51
52class VTKINTERACTIONWIDGETS_EXPORT vtkBiDimensionalRepresentation : public vtkWidgetRepresentation
53{
54public:
56
60 void PrintSelf(ostream& os, vtkIndent indent);
62
64
69 virtual void SetPoint1WorldPosition(double pos[3]);
70 virtual void SetPoint2WorldPosition(double pos[3]);
71 virtual void SetPoint3WorldPosition(double pos[3]);
72 virtual void SetPoint4WorldPosition(double pos[3]);
73 virtual void GetPoint1WorldPosition(double pos[3]);
74 virtual void GetPoint2WorldPosition(double pos[3]);
75 virtual void GetPoint3WorldPosition(double pos[3]);
76 virtual void GetPoint4WorldPosition(double pos[3]);
77 virtual void SetPoint1DisplayPosition(double pos[3]);
78 virtual void SetPoint2DisplayPosition(double pos[3]);
79 virtual void SetPoint3DisplayPosition(double pos[3]);
80 virtual void SetPoint4DisplayPosition(double pos[3]);
81 virtual void GetPoint1DisplayPosition(double pos[3]);
82 virtual void GetPoint2DisplayPosition(double pos[3]);
83 virtual void GetPoint3DisplayPosition(double pos[3]);
84 virtual void GetPoint4DisplayPosition(double pos[3]);
86
88
94 vtkGetObjectMacro(Point1Representation,vtkHandleRepresentation);
95 vtkGetObjectMacro(Point2Representation,vtkHandleRepresentation);
96 vtkGetObjectMacro(Point3Representation,vtkHandleRepresentation);
97 vtkGetObjectMacro(Point4Representation,vtkHandleRepresentation);
99
101
107 vtkSetMacro(Line1Visibility,int);
108 vtkGetMacro(Line1Visibility,int);
109 vtkBooleanMacro(Line1Visibility,int);
110 vtkSetMacro(Line2Visibility,int);
111 vtkGetMacro(Line2Visibility,int);
112 vtkBooleanMacro(Line2Visibility,int);
114
116
130
132
137 vtkSetClampMacro(Tolerance,int,1,100);
138 vtkGetMacro(Tolerance,int);
140
145 virtual double GetLength1();
146
151 virtual double GetLength2();
152
154
159 vtkSetStringMacro(LabelFormat);
160 vtkGetStringMacro(LabelFormat);
162
163 // Used to communicate about the state of the representation
164 enum {Outside=0,NearP1,NearP2,NearP3,NearP4,OnL1Inner,OnL1Outer,OnL2Inner,OnL2Outer,OnCenter};
165
167
171 vtkSetMacro(ShowLabelAboveWidget, int);
172 vtkGetMacro(ShowLabelAboveWidget, int);
173 vtkBooleanMacro(ShowLabelAboveWidget, int);
175
177
180 void SetID(vtkIdType id);
181 vtkGetMacro(ID, vtkIdType);
183
187 virtual char* GetLabelText() = 0;
188
190
193 virtual double* GetLabelPosition() = 0;
194 virtual void GetLabelPosition(double pos[3]) = 0;
195 virtual void GetWorldLabelPosition(double pos[3]) = 0;
197
199
202 virtual void StartWidgetDefinition(double e[2]) = 0;
203 virtual void Point2WidgetInteraction(double e[2]) = 0;
204 virtual void Point3WidgetInteraction(double e[2]) = 0;
205 virtual void StartWidgetManipulation(double e[2]) = 0;
207
208protected:
211
212 // Keep track if modifier is set
214
215 // The handle and the rep used to close the handles
221
222 // Selection tolerance for the handles
224
225 // Visibility of the lines
228
231
232 // Internal variables
233 double P1World[3];
234 double P2World[3];
235 double P3World[3];
236 double P4World[3];
237 double P21World[3];
238 double P43World[3];
239 double T21;
240 double T43;
241 double CenterWorld[3];
242 double StartEventPositionWorld[4];
243
244 // Format for printing the distance
246
247 // toggle to determine whether to place text above or below widget
249
250private:
252 void operator=(const vtkBiDimensionalRepresentation&) VTK_DELETE_FUNCTION;
253};
254
255#endif
represent the vtkBiDimensionalWidget
virtual void GetPoint2DisplayPosition(double pos[3])
virtual void SetPoint1DisplayPosition(double pos[3])
virtual double GetLength2()
Return the length of the line defined by (Point3,Point4).
virtual char * GetLabelText()=0
Get the text shown in the widget's label.
virtual void GetPoint1WorldPosition(double pos[3])
virtual void StartWidgetManipulation(double e[2])=0
virtual void Point2WidgetInteraction(double e[2])=0
void SetHandleRepresentation(vtkHandleRepresentation *handle)
This method is used to specify the type of handle representation to use for the four internal vtkHand...
virtual void SetPoint3DisplayPosition(double pos[3])
virtual void SetPoint2WorldPosition(double pos[3])
void PrintSelf(ostream &os, vtkIndent indent)
Methods invoked by print to print information about the object including superclasses.
virtual void GetPoint4DisplayPosition(double pos[3])
virtual double * GetLabelPosition()=0
Get the position of the widget's label in display coordinates.
virtual void Point3WidgetInteraction(double e[2])=0
virtual void GetPoint2WorldPosition(double pos[3])
virtual void SetPoint1WorldPosition(double pos[3])
Methods to Set/Get the coordinates of the four points defining this representation.
virtual void GetPoint4WorldPosition(double pos[3])
virtual void StartWidgetDefinition(double e[2])=0
These are methods that satisfy vtkWidgetRepresentation's API.
virtual void SetPoint4DisplayPosition(double pos[3])
virtual void SetPoint2DisplayPosition(double pos[3])
void SetID(vtkIdType id)
Set/get the id to display in the label.
virtual void SetPoint3WorldPosition(double pos[3])
virtual void GetPoint1DisplayPosition(double pos[3])
virtual void GetWorldLabelPosition(double pos[3])=0
virtual void GetPoint3WorldPosition(double pos[3])
virtual void SetPoint4WorldPosition(double pos[3])
virtual void GetPoint3DisplayPosition(double pos[3])
virtual void GetLabelPosition(double pos[3])=0
virtual double GetLength1()
Return the length of the line defined by (Point1,Point2).
virtual void InstantiateHandleRepresentation()
abstract class for representing widget handles
a simple class to control print indentation
Definition: vtkIndent.h:40
abstract class defines interface between the widget and widget representation classes
vtkSetMacro(IgnoreDriverBugs, bool)
Updates the extensions string.
vtkBooleanMacro(IgnoreDriverBugs, bool)
Updates the extensions string.
vtkGetStringMacro(ExtensionsString)
Returns a string listing all available extensions.
int vtkIdType
Definition: vtkType.h:287