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 
46 
48 
49 
51 {
52 public:
54 
56  void PrintSelf(ostream& os, vtkIndent indent);
58 
60 
63  virtual void SetPoint1WorldPosition(double pos[3]);
64  virtual void SetPoint2WorldPosition(double pos[3]);
65  virtual void SetPoint3WorldPosition(double pos[3]);
66  virtual void SetPoint4WorldPosition(double pos[3]);
67  virtual void GetPoint1WorldPosition(double pos[3]);
68  virtual void GetPoint2WorldPosition(double pos[3]);
69  virtual void GetPoint3WorldPosition(double pos[3]);
70  virtual void GetPoint4WorldPosition(double pos[3]);
71  virtual void SetPoint1DisplayPosition(double pos[3]);
72  virtual void SetPoint2DisplayPosition(double pos[3]);
73  virtual void SetPoint3DisplayPosition(double pos[3]);
74  virtual void SetPoint4DisplayPosition(double pos[3]);
75  virtual void GetPoint1DisplayPosition(double pos[3]);
76  virtual void GetPoint2DisplayPosition(double pos[3]);
77  virtual void GetPoint3DisplayPosition(double pos[3]);
78  virtual void GetPoint4DisplayPosition(double pos[3]);
80 
82 
86  vtkGetObjectMacro(Point1Representation,vtkHandleRepresentation);
87  vtkGetObjectMacro(Point2Representation,vtkHandleRepresentation);
88  vtkGetObjectMacro(Point3Representation,vtkHandleRepresentation);
89  vtkGetObjectMacro(Point4Representation,vtkHandleRepresentation);
91 
93 
97  vtkSetMacro(Line1Visibility,int);
98  vtkGetMacro(Line1Visibility,int);
99  vtkBooleanMacro(Line1Visibility,int);
100  vtkSetMacro(Line2Visibility,int);
101  vtkGetMacro(Line2Visibility,int);
102  vtkBooleanMacro(Line2Visibility,int);
104 
106 
115  void SetHandleRepresentation(vtkHandleRepresentation *handle);
116  virtual void InstantiateHandleRepresentation();
118 
120 
123  vtkSetClampMacro(Tolerance,int,1,100);
124  vtkGetMacro(Tolerance,int);
126 
129  virtual double GetLength1();
130 
133  virtual double GetLength2();
134 
136 
139  vtkSetStringMacro(LabelFormat);
140  vtkGetStringMacro(LabelFormat);
142 
143 //BTX -- used to communicate about the state of the representation
144  enum {Outside=0,NearP1,NearP2,NearP3,NearP4,OnL1Inner,OnL1Outer,OnL2Inner,OnL2Outer,OnCenter};
145 //ETX
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