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 =========================================================================*/
42 #ifndef vtkBiDimensionalRepresentation_h
43 #define vtkBiDimensionalRepresentation_h
44 
45 #include "vtkInteractionWidgetsModule.h" // For export macro
47 
49 
50 
52 {
53 public:
55 
57  void PrintSelf(ostream& os, vtkIndent indent);
59 
61 
64  virtual void SetPoint1WorldPosition(double pos[3]);
65  virtual void SetPoint2WorldPosition(double pos[3]);
66  virtual void SetPoint3WorldPosition(double pos[3]);
67  virtual void SetPoint4WorldPosition(double pos[3]);
68  virtual void GetPoint1WorldPosition(double pos[3]);
69  virtual void GetPoint2WorldPosition(double pos[3]);
70  virtual void GetPoint3WorldPosition(double pos[3]);
71  virtual void GetPoint4WorldPosition(double pos[3]);
72  virtual void SetPoint1DisplayPosition(double pos[3]);
73  virtual void SetPoint2DisplayPosition(double pos[3]);
74  virtual void SetPoint3DisplayPosition(double pos[3]);
75  virtual void SetPoint4DisplayPosition(double pos[3]);
76  virtual void GetPoint1DisplayPosition(double pos[3]);
77  virtual void GetPoint2DisplayPosition(double pos[3]);
78  virtual void GetPoint3DisplayPosition(double pos[3]);
79  virtual void GetPoint4DisplayPosition(double pos[3]);
81 
83 
92 
94 
98  vtkSetMacro(Line1Visibility,int);
99  vtkGetMacro(Line1Visibility,int);
100  vtkBooleanMacro(Line1Visibility,int);
101  vtkSetMacro(Line2Visibility,int);
102  vtkGetMacro(Line2Visibility,int);
103  vtkBooleanMacro(Line2Visibility,int);
105 
107 
119 
121 
124  vtkSetClampMacro(Tolerance,int,1,100);
125  vtkGetMacro(Tolerance,int);
127 
130  virtual double GetLength1();
131 
134  virtual double GetLength2();
135 
137 
140  vtkSetStringMacro(LabelFormat);
141  vtkGetStringMacro(LabelFormat);
143 
144 //BTX -- used to communicate about the state of the representation
145  enum {Outside=0,NearP1,NearP2,NearP3,NearP4,OnL1Inner,OnL1Outer,OnL2Inner,OnL2Outer,OnCenter};
146 //ETX
147 
149 
151  vtkSetMacro(ShowLabelAboveWidget, int);
152  vtkGetMacro(ShowLabelAboveWidget, int);
153  vtkBooleanMacro(ShowLabelAboveWidget, int);
155 
157 
158  void SetID(vtkIdType id);
161 
163  virtual char* GetLabelText() = 0;
164 
166 
167  virtual double* GetLabelPosition() = 0;
168  virtual void GetLabelPosition(double pos[3]) = 0;
169  virtual void GetWorldLabelPosition(double pos[3]) = 0;
171 
173 
174  virtual void StartWidgetDefinition(double e[2]) = 0;
175  virtual void Point2WidgetInteraction(double e[2]) = 0;
176  virtual void Point3WidgetInteraction(double e[2]) = 0;
177  virtual void StartWidgetManipulation(double e[2]) = 0;
179 
180 protected:
183 
184  // Keep track if modifier is set
185  int Modifier;
186 
187  // The handle and the rep used to close the handles
193 
194  // Selection tolerance for the handles
196 
197  // Visibility of the lines
200 
203 
204  // Internal variables
205  double P1World[3];
206  double P2World[3];
207  double P3World[3];
208  double P4World[3];
209  double P21World[3];
210  double P43World[3];
211  double T21;
212  double T43;
213  double CenterWorld[3];
214  double StartEventPositionWorld[4];
215 
216  // Format for printing the distance
217  char *LabelFormat;
218 
219  // toggle to determine whether to place text above or below widget
221 
222 private:
224  void operator=(const vtkBiDimensionalRepresentation&); //Not implemented
225 };
226 
227 #endif
vtkBiDimensionalRepresentation::GetPoint3DisplayPosition
virtual void GetPoint3DisplayPosition(double pos[3])
vtkWidgetRepresentation.h
vtkBiDimensionalRepresentation::SetPoint1DisplayPosition
virtual void SetPoint1DisplayPosition(double pos[3])
vtkGetObjectMacro
#define vtkGetObjectMacro(name, type)
Definition: vtkSetGet.h:232
vtkBiDimensionalRepresentation::SetPoint4WorldPosition
virtual void SetPoint4WorldPosition(double pos[3])
vtkIdType
int vtkIdType
Definition: vtkType.h:275
vtkBiDimensionalRepresentation::GetLength2
virtual double GetLength2()
vtkBiDimensionalRepresentation::GetWorldLabelPosition
virtual void GetWorldLabelPosition(double pos[3])=0
vtkBiDimensionalRepresentation::GetPoint4WorldPosition
virtual void GetPoint4WorldPosition(double pos[3])
vtkBiDimensionalRepresentation::InstantiateHandleRepresentation
virtual void InstantiateHandleRepresentation()
vtkBiDimensionalRepresentation::IDInitialized
int IDInitialized
Definition: vtkBiDimensionalRepresentation.h:202
vtkTypeMacro
#define vtkTypeMacro(thisClass, superclass)
Definition: vtkSetGet.h:642
vtkWidgetRepresentation
abstract class defines interface between the widget and widget representation classes
Definition: vtkWidgetRepresentation.h:54
vtkHandleRepresentation
abstract class for representing widget handles
Definition: vtkHandleRepresentation.h:58
vtkInteractionWidgetsModule.h
vtkBiDimensionalRepresentation::HandleRepresentation
vtkHandleRepresentation * HandleRepresentation
Definition: vtkBiDimensionalRepresentation.h:188
vtkBiDimensionalRepresentation::GetPoint1WorldPosition
virtual void GetPoint1WorldPosition(double pos[3])
vtkBiDimensionalRepresentation::GetPoint3WorldPosition
virtual void GetPoint3WorldPosition(double pos[3])
vtkBiDimensionalRepresentation::GetPoint2WorldPosition
virtual void GetPoint2WorldPosition(double pos[3])
vtkBiDimensionalRepresentation::GetLabelPosition
virtual double * GetLabelPosition()=0
vtkBiDimensionalRepresentation::Point2WidgetInteraction
virtual void Point2WidgetInteraction(double e[2])=0
vtkBiDimensionalRepresentation::SetID
void SetID(vtkIdType id)
vtkBiDimensionalRepresentation::SetHandleRepresentation
void SetHandleRepresentation(vtkHandleRepresentation *handle)
vtkBiDimensionalRepresentation::SetPoint2DisplayPosition
virtual void SetPoint2DisplayPosition(double pos[3])
vtkBiDimensionalRepresentation::StartWidgetDefinition
virtual void StartWidgetDefinition(double e[2])=0
vtkBiDimensionalRepresentation::Tolerance
int Tolerance
Definition: vtkBiDimensionalRepresentation.h:195
vtkBiDimensionalRepresentation::Point2Representation
vtkHandleRepresentation * Point2Representation
Definition: vtkBiDimensionalRepresentation.h:190
vtkSetClampMacro
#define vtkSetClampMacro(name, type, min, max)
Definition: vtkSetGet.h:143
vtkBiDimensionalRepresentation::T21
double T21
Definition: vtkBiDimensionalRepresentation.h:211
vtkBiDimensionalRepresentation::SetPoint4DisplayPosition
virtual void SetPoint4DisplayPosition(double pos[3])
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:39
vtkSetStringMacro
#define vtkSetStringMacro(name)
Definition: vtkSetGet.h:104
vtkBiDimensionalRepresentation::Point4Representation
vtkHandleRepresentation * Point4Representation
Definition: vtkBiDimensionalRepresentation.h:192
vtkBiDimensionalRepresentation
represent the vtkBiDimensionalWidget
Definition: vtkBiDimensionalRepresentation.h:52
vtkBiDimensionalRepresentation::Line1Visibility
int Line1Visibility
Definition: vtkBiDimensionalRepresentation.h:198
vtkBiDimensionalRepresentation::ID
vtkIdType ID
Definition: vtkBiDimensionalRepresentation.h:201
vtkGetMacro
#define vtkGetMacro(name, type)
Definition: vtkSetGet.h:93
vtkGetStringMacro
vtkGetStringMacro(ExtensionsString)
vtkBiDimensionalRepresentation::GetLabelText
virtual char * GetLabelText()=0
vtkBiDimensionalRepresentation::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent)
vtkBiDimensionalRepresentation::ShowLabelAboveWidget
int ShowLabelAboveWidget
Definition: vtkBiDimensionalRepresentation.h:220
vtkBiDimensionalRepresentation::SetPoint1WorldPosition
virtual void SetPoint1WorldPosition(double pos[3])
vtkBiDimensionalRepresentation::GetLength1
virtual double GetLength1()
vtkBiDimensionalRepresentation::StartWidgetManipulation
virtual void StartWidgetManipulation(double e[2])=0
vtkBooleanMacro
vtkBooleanMacro(IgnoreDriverBugs, bool)
vtkSetMacro
vtkSetMacro(IgnoreDriverBugs, bool)
vtkBiDimensionalRepresentation::SetPoint2WorldPosition
virtual void SetPoint2WorldPosition(double pos[3])
vtkBiDimensionalRepresentation::SetPoint3WorldPosition
virtual void SetPoint3WorldPosition(double pos[3])
vtkBiDimensionalRepresentation::GetPoint2DisplayPosition
virtual void GetPoint2DisplayPosition(double pos[3])
VTKINTERACTIONWIDGETS_EXPORT
#define VTKINTERACTIONWIDGETS_EXPORT
Definition: vtkInteractionWidgetsModule.h:15
vtkBiDimensionalRepresentation::Line2Visibility
int Line2Visibility
Definition: vtkBiDimensionalRepresentation.h:199
vtkBiDimensionalRepresentation::vtkBiDimensionalRepresentation
vtkBiDimensionalRepresentation()
vtkBiDimensionalRepresentation::GetPoint4DisplayPosition
virtual void GetPoint4DisplayPosition(double pos[3])
vtkBiDimensionalRepresentation::Modifier
int Modifier
Definition: vtkBiDimensionalRepresentation.h:185
vtkBiDimensionalRepresentation::LabelFormat
char * LabelFormat
Definition: vtkBiDimensionalRepresentation.h:217
vtkBiDimensionalRepresentation::Point3WidgetInteraction
virtual void Point3WidgetInteraction(double e[2])=0
vtkBiDimensionalRepresentation::Point1Representation
vtkHandleRepresentation * Point1Representation
Definition: vtkBiDimensionalRepresentation.h:189
vtkBiDimensionalRepresentation::SetPoint3DisplayPosition
virtual void SetPoint3DisplayPosition(double pos[3])
vtkBiDimensionalRepresentation::~vtkBiDimensionalRepresentation
~vtkBiDimensionalRepresentation()
vtkBiDimensionalRepresentation::T43
double T43
Definition: vtkBiDimensionalRepresentation.h:212
vtkBiDimensionalRepresentation::GetLabelPosition
virtual void GetLabelPosition(double pos[3])=0
vtkBiDimensionalRepresentation::Point3Representation
vtkHandleRepresentation * Point3Representation
Definition: vtkBiDimensionalRepresentation.h:191
vtkBiDimensionalRepresentation::GetPoint1DisplayPosition
virtual void GetPoint1DisplayPosition(double pos[3])