VTK  9.0.20201029
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 class VTKINTERACTIONWIDGETS_EXPORT vtkBiDimensionalRepresentation : public vtkWidgetRepresentation
52 {
53 public:
55 
59  void PrintSelf(ostream& os, vtkIndent indent) override;
61 
63 
68  virtual void SetPoint1WorldPosition(double pos[3]);
69  virtual void SetPoint2WorldPosition(double pos[3]);
70  virtual void SetPoint3WorldPosition(double pos[3]);
71  virtual void SetPoint4WorldPosition(double pos[3]);
72  virtual void GetPoint1WorldPosition(double pos[3]);
73  virtual void GetPoint2WorldPosition(double pos[3]);
74  virtual void GetPoint3WorldPosition(double pos[3]);
75  virtual void GetPoint4WorldPosition(double pos[3]);
76  virtual void SetPoint1DisplayPosition(double pos[3]);
77  virtual void SetPoint2DisplayPosition(double pos[3]);
78  virtual void SetPoint3DisplayPosition(double pos[3]);
79  virtual void SetPoint4DisplayPosition(double pos[3]);
80  virtual void GetPoint1DisplayPosition(double pos[3]);
81  virtual void GetPoint2DisplayPosition(double pos[3]);
82  virtual void GetPoint3DisplayPosition(double pos[3]);
83  virtual void GetPoint4DisplayPosition(double pos[3]);
85 
87 
93  vtkGetObjectMacro(Point1Representation, vtkHandleRepresentation);
94  vtkGetObjectMacro(Point2Representation, vtkHandleRepresentation);
95  vtkGetObjectMacro(Point3Representation, vtkHandleRepresentation);
96  vtkGetObjectMacro(Point4Representation, vtkHandleRepresentation);
98 
100 
106  vtkSetMacro(Line1Visibility, vtkTypeBool);
107  vtkGetMacro(Line1Visibility, vtkTypeBool);
108  vtkBooleanMacro(Line1Visibility, vtkTypeBool);
109  vtkSetMacro(Line2Visibility, vtkTypeBool);
110  vtkGetMacro(Line2Visibility, vtkTypeBool);
111  vtkBooleanMacro(Line2Visibility, vtkTypeBool);
113 
115 
126  void SetHandleRepresentation(vtkHandleRepresentation* handle);
127  virtual void InstantiateHandleRepresentation();
129 
131 
136  vtkSetClampMacro(Tolerance, int, 1, 100);
137  vtkGetMacro(Tolerance, int);
139 
144  virtual double GetLength1();
145 
150  virtual double GetLength2();
151 
153 
158  vtkSetStringMacro(LabelFormat);
159  vtkGetStringMacro(LabelFormat);
161 
162  // Used to communicate about the state of the representation
163  enum
164  {
165  Outside = 0,
174  OnCenter
175  };
176 
178 
182  vtkSetMacro(ShowLabelAboveWidget, vtkTypeBool);
183  vtkGetMacro(ShowLabelAboveWidget, vtkTypeBool);
184  vtkBooleanMacro(ShowLabelAboveWidget, vtkTypeBool);
186 
188 
191  void SetID(vtkIdType id);
192  vtkGetMacro(ID, vtkIdType);
194 
198  virtual char* GetLabelText() = 0;
199 
201 
204  virtual double* GetLabelPosition() = 0;
205  virtual void GetLabelPosition(double pos[3]) = 0;
206  virtual void GetWorldLabelPosition(double pos[3]) = 0;
208 
210 
213  virtual void StartWidgetDefinition(double e[2]) = 0;
214  virtual void Point2WidgetInteraction(double e[2]) = 0;
215  virtual void Point3WidgetInteraction(double e[2]) = 0;
216  virtual void StartWidgetManipulation(double e[2]) = 0;
218 
219 protected:
221  ~vtkBiDimensionalRepresentation() override;
222 
223  // Keep track if modifier is set
224  int Modifier;
225 
226  // The handle and the rep used to close the handles
232 
233  // Selection tolerance for the handles
235 
236  // Visibility of the lines
239 
242 
243  // Internal variables
244  double P1World[3];
245  double P2World[3];
246  double P3World[3];
247  double P4World[3];
248  double P21World[3];
249  double P43World[3];
250  double T21;
251  double T43;
252  double CenterWorld[3];
253  double StartEventPositionWorld[4];
254 
255  // Format for printing the distance
256  char* LabelFormat;
257 
258  // toggle to determine whether to place text above or below widget
260 
261 private:
263  void operator=(const vtkBiDimensionalRepresentation&) = delete;
264 };
265 
266 #endif
vtkWidgetRepresentation.h
vtkBiDimensionalRepresentation::OnL1Inner
Definition: vtkBiDimensionalRepresentation.h:170
vtkBiDimensionalRepresentation::NearP4
Definition: vtkBiDimensionalRepresentation.h:169
vtkBiDimensionalRepresentation::OnL1Outer
Definition: vtkBiDimensionalRepresentation.h:171
vtkIdType
int vtkIdType
Definition: vtkType.h:330
vtkBiDimensionalRepresentation::OnL2Outer
Definition: vtkBiDimensionalRepresentation.h:173
vtkBiDimensionalRepresentation::ShowLabelAboveWidget
vtkTypeBool ShowLabelAboveWidget
Definition: vtkBiDimensionalRepresentation.h:259
vtkBiDimensionalRepresentation::OnL2Inner
Definition: vtkBiDimensionalRepresentation.h:172
vtkBiDimensionalRepresentation::NearP2
Definition: vtkBiDimensionalRepresentation.h:167
vtkBiDimensionalRepresentation::IDInitialized
int IDInitialized
Definition: vtkBiDimensionalRepresentation.h:241
vtkWidgetRepresentation
abstract class defines interface between the widget and widget representation classes
Definition: vtkWidgetRepresentation.h:59
vtkHandleRepresentation
abstract class for representing widget handles
Definition: vtkHandleRepresentation.h:55
vtkBiDimensionalRepresentation::HandleRepresentation
vtkHandleRepresentation * HandleRepresentation
Definition: vtkBiDimensionalRepresentation.h:227
vtkBiDimensionalRepresentation::Line2Visibility
vtkTypeBool Line2Visibility
Definition: vtkBiDimensionalRepresentation.h:238
vtkBiDimensionalRepresentation::Tolerance
int Tolerance
Definition: vtkBiDimensionalRepresentation.h:234
vtkBiDimensionalRepresentation::Point2Representation
vtkHandleRepresentation * Point2Representation
Definition: vtkBiDimensionalRepresentation.h:229
vtkBiDimensionalRepresentation::NearP3
Definition: vtkBiDimensionalRepresentation.h:168
vtkBiDimensionalRepresentation::T21
double T21
Definition: vtkBiDimensionalRepresentation.h:250
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:33
vtkBiDimensionalRepresentation::Point4Representation
vtkHandleRepresentation * Point4Representation
Definition: vtkBiDimensionalRepresentation.h:231
vtkBiDimensionalRepresentation
represent the vtkBiDimensionalWidget
Definition: vtkBiDimensionalRepresentation.h:51
vtkBiDimensionalRepresentation::Line1Visibility
vtkTypeBool Line1Visibility
Definition: vtkBiDimensionalRepresentation.h:237
vtkBiDimensionalRepresentation::ID
vtkIdType ID
Definition: vtkBiDimensionalRepresentation.h:240
vtkBiDimensionalRepresentation::Modifier
int Modifier
Definition: vtkBiDimensionalRepresentation.h:224
vtkBiDimensionalRepresentation::NearP1
Definition: vtkBiDimensionalRepresentation.h:166
vtkBiDimensionalRepresentation::LabelFormat
char * LabelFormat
Definition: vtkBiDimensionalRepresentation.h:256
vtkBiDimensionalRepresentation::Point1Representation
vtkHandleRepresentation * Point1Representation
Definition: vtkBiDimensionalRepresentation.h:228
vtkBiDimensionalRepresentation::T43
double T43
Definition: vtkBiDimensionalRepresentation.h:251
vtkTypeBool
int vtkTypeBool
Definition: vtkABI.h:69
vtkBiDimensionalRepresentation::Point3Representation
vtkHandleRepresentation * Point3Representation
Definition: vtkBiDimensionalRepresentation.h:230
vtkWidgetRepresentation::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.