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 
87  vtkGetObjectMacro(Point1Representation,vtkHandleRepresentation);
88  vtkGetObjectMacro(Point2Representation,vtkHandleRepresentation);
89  vtkGetObjectMacro(Point3Representation,vtkHandleRepresentation);
90  vtkGetObjectMacro(Point4Representation,vtkHandleRepresentation);
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 
116  void SetHandleRepresentation(vtkHandleRepresentation *handle);
117  virtual void InstantiateHandleRepresentation();
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  // Used to communicate about the state of the representation
145  enum {Outside=0,NearP1,NearP2,NearP3,NearP4,OnL1Inner,OnL1Outer,OnL2Inner,OnL2Outer,OnCenter};
146 
148 
150  vtkSetMacro(ShowLabelAboveWidget, int);
151  vtkGetMacro(ShowLabelAboveWidget, int);
152  vtkBooleanMacro(ShowLabelAboveWidget, int);
154 
156 
157  void SetID(vtkIdType id);
158  vtkGetMacro(ID, vtkIdType);
160 
162  virtual char* GetLabelText() = 0;
163 
165 
166  virtual double* GetLabelPosition() = 0;
167  virtual void GetLabelPosition(double pos[3]) = 0;
168  virtual void GetWorldLabelPosition(double pos[3]) = 0;
170 
172 
173  virtual void StartWidgetDefinition(double e[2]) = 0;
174  virtual void Point2WidgetInteraction(double e[2]) = 0;
175  virtual void Point3WidgetInteraction(double e[2]) = 0;
176  virtual void StartWidgetManipulation(double e[2]) = 0;
178 
179 protected:
182 
183  // Keep track if modifier is set
184  int Modifier;
185 
186  // The handle and the rep used to close the handles
192 
193  // Selection tolerance for the handles
195 
196  // Visibility of the lines
199 
202 
203  // Internal variables
204  double P1World[3];
205  double P2World[3];
206  double P3World[3];
207  double P4World[3];
208  double P21World[3];
209  double P43World[3];
210  double T21;
211  double T43;
212  double CenterWorld[3];
213  double StartEventPositionWorld[4];
214 
215  // Format for printing the distance
216  char *LabelFormat;
217 
218  // toggle to determine whether to place text above or below widget
220 
221 private:
223  void operator=(const vtkBiDimensionalRepresentation&); //Not implemented
224 };
225 
226 #endif
abstract class for representing widget handles
represent the vtkBiDimensionalWidget
int vtkIdType
Definition: vtkType.h:247
abstract class defines interface between the widget and widget representation classes ...
#define VTKINTERACTIONWIDGETS_EXPORT
a simple class to control print indentation
Definition: vtkIndent.h:38
void PrintSelf(ostream &os, vtkIndent indent)