VTK  9.2.20230606
vtkFinitePlaneRepresentation.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkFinitePlaneRepresentation.h
5 
6  Copyright (c)
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 =========================================================================*/
34 #ifndef vtkFinitePlaneRepresentation_h
35 #define vtkFinitePlaneRepresentation_h
36 
37 #include "vtkDeprecation.h" // For VTK_DEPRECATED_IN_9_2_0
38 #include "vtkInteractionWidgetsModule.h" // For export macro
39 #include "vtkLegacy.h" // for VTK_LEGACY_REMOVE
41 
42 VTK_ABI_NAMESPACE_BEGIN
43 class vtkActor;
44 class vtkBox;
45 class vtkCellPicker;
46 class vtkConeSource;
47 class vtkFeatureEdges;
48 class vtkLineSource;
49 class vtkPolyData;
50 class vtkPolyDataMapper;
51 class vtkProperty;
52 class vtkSphereSource;
53 class vtkTransform;
54 class vtkTubeFilter;
55 
56 class VTKINTERACTIONWIDGETS_EXPORT vtkFinitePlaneRepresentation : public vtkWidgetRepresentation
57 {
58 public:
63 
65 
69  void PrintSelf(ostream& os, vtkIndent indent) override;
71 
77 
79 
84  vtkGetObjectMacro(V1HandleProperty, vtkProperty);
85  vtkGetObjectMacro(V2HandleProperty, vtkProperty);
86  vtkGetObjectMacro(SelectedHandleProperty, vtkProperty);
88 
90 
95  vtkGetObjectMacro(PlaneProperty, vtkProperty);
96  vtkGetObjectMacro(SelectedPlaneProperty, vtkProperty);
98 
100 
104  vtkSetMacro(Tubing, bool);
105  vtkGetMacro(Tubing, bool);
106  vtkBooleanMacro(Tubing, bool);
108 
110 
116  void SetDrawPlane(bool plane);
117  vtkGetMacro(DrawPlane, bool);
118  vtkBooleanMacro(DrawPlane, bool);
120 
122 
126  void SetHandles(bool handles);
127  virtual void HandlesOn();
128  virtual void HandlesOff();
130 
132 
135  void PlaceWidget(double bounds[6]) override;
136  void BuildRepresentation() override;
137  int ComputeInteractionState(int X, int Y, int modify = 0) override;
138  void StartWidgetInteraction(double e[2]) override;
139  void WidgetInteraction(double e[2]) override;
140  double* GetBounds() override;
142 
144 
152 
153  vtkSetClampMacro(InteractionState, int, Outside, Pushing);
154 
156 
159  void SetOrigin(double x, double y, double z);
160  void SetOrigin(double x[3]);
161  vtkGetVector3Macro(Origin, double);
163 
165 
168  void SetNormal(double x, double y, double z);
169  void SetNormal(double n[3]);
170  vtkGetVector3Macro(Normal, double);
172 
174 
177  void SetV1(double x, double y);
178  void SetV1(double x[2]);
179  vtkGetVector2Macro(V1, double);
181 
183 
186  void SetV2(double x, double y);
187  void SetV2(double x[2]);
188  vtkGetVector2Macro(V2, double);
190 
192 
196  virtual void SetRepresentationState(int);
197  vtkGetMacro(RepresentationState, int);
199 
201 
204  vtkGetObjectMacro(NormalProperty, vtkProperty);
205  vtkGetObjectMacro(SelectedNormalProperty, vtkProperty);
207 
208  // Methods to manipulate the plane
209  void TranslateOrigin(double* p1, double* p2);
210  void MovePoint1(double* p1, double* p2);
211  void MovePoint2(double* p1, double* p2);
212  void Push(double* p1, double* p2);
213  void Rotate(int X, int Y, double* p1, double* p2, double* vpn);
214 
216  {
217  Outside = 0,
223  Pushing
224  };
225 #if !defined(VTK_LEGACY_REMOVE)
226  VTK_DEPRECATED_IN_9_2_0("because leading underscore is reserved")
228 #endif
229 
230  /*
231  * Register internal Pickers within PickingManager
232  */
233  void RegisterPickers() override;
234 
235 protected:
238 
239  virtual void CreateDefaultProperties();
240 
241  // Size the glyphs representing hot spots (e.g., handles)
242  virtual void SizeHandles();
243 
244  void SetHighlightNormal(int highlight);
245  void SetHighlightPlane(int highlight);
247 
248  double LastEventPosition[3];
249 
250  // the representation state
252 
253  // the origin
257  double Origin[3];
258 
259  // the normal
260  double Normal[3];
261 
262  // the previous normal
263  double PreviousNormal[3];
264 
265  // the rotation transform
267 
268  // the X Vector
272  double V1[3];
273 
274  // the Y Vector
278  double V2[3];
279 
280  // The + normal cone
284 
285  // The + normal line
289 
290  // The - normal cone
294 
295  // The - normal line
299 
300  // The finite plane
304 
305  // Optional tubes are represented by extracting boundary edges
310  bool Tubing; // control whether tubing is on
311  bool DrawPlane; // control whether plane is on
312 
313  // Picking objects
316 
317  // Transform the planes (used for rotations)
319 
320  // Support GetBounds() method
322 
323  // Properties used to control the appearance of selected objects and
324  // the manipulator in general.
333 
334 private:
336  void operator=(const vtkFinitePlaneRepresentation&) = delete;
337 };
338 
339 VTK_ABI_NAMESPACE_END
340 #endif
represents an object (geometry & properties) in a rendered scene
Definition: vtkActor.h:162
implicit function for a bounding box
Definition: vtkBox.h:142
ray-cast cell picker for all kinds of Prop3Ds
generate polygonal cone
extract interior, boundary, non-manifold, and/or sharp edges from polygonal data
represent the vtkFinitePlaneWidget.
void Rotate(int X, int Y, double *p1, double *p2, double *vpn)
void SetHighlightNormal(int highlight)
void SetDrawPlane(bool plane)
Enable/disable the drawing of the plane.
void SetV2(double x[2])
Set/Get the v2 vector of the plane.
void ReleaseGraphicsResources(vtkWindow *) override
Methods supporting, and required by, the rendering process.
virtual void CreateDefaultProperties()
void SetHighlightHandle(vtkProp *prop)
void SetOrigin(double x, double y, double z)
Set/Get the origin of the plane.
virtual void HandlesOn()
Switches handles (the spheres) on or off by manipulating the underlying actor visibility.
virtual void SetRepresentationState(int)
Sets the visual appearance of the representation based on the state it is in.
void BuildRepresentation() override
These are methods that satisfy vtkWidgetRepresentation's API.
double * GetBounds() override
These are methods that satisfy vtkWidgetRepresentation's API.
void SetNormal(double x, double y, double z)
Set/Get the normal to the plane.
void SetHighlightPlane(int highlight)
int RenderOpaqueGeometry(vtkViewport *) override
Methods supporting, and required by, the rendering process.
void RegisterPickers() override
Register internal Pickers in the Picking Manager.
void SetHandles(bool handles)
Switches handles (the spheres) on or off by manipulating the underlying actor visibility.
void StartWidgetInteraction(double e[2]) override
These are methods that satisfy vtkWidgetRepresentation's API.
void SetNormal(double n[3])
Set/Get the normal to the plane.
void SetOrigin(double x[3])
Set/Get the origin of the plane.
void SetV1(double x[2])
Set/Get the v1 vector of the plane.
int RenderTranslucentPolygonalGeometry(vtkViewport *) override
Methods supporting, and required by, the rendering process.
void GetPolyData(vtkPolyData *pd)
Grab the polydata that defines the plane.
vtkTypeBool HasTranslucentPolygonalGeometry() override
Methods supporting, and required by, the rendering process.
void SetV1(double x, double y)
Set/Get the v1 vector of the plane.
static vtkFinitePlaneRepresentation * New()
Instantiate the class.
int ComputeInteractionState(int X, int Y, int modify=0) override
These are methods that satisfy vtkWidgetRepresentation's API.
void PlaceWidget(double bounds[6]) override
These are methods that satisfy vtkWidgetRepresentation's API.
void TranslateOrigin(double *p1, double *p2)
void WidgetInteraction(double e[2]) override
These are methods that satisfy vtkWidgetRepresentation's API.
void MovePoint1(double *p1, double *p2)
virtual void HandlesOff()
Switches handles (the spheres) on or off by manipulating the underlying actor visibility.
void SetV2(double x, double y)
Set/Get the v2 vector of the plane.
void PrintSelf(ostream &os, vtkIndent indent) override
Standard vtkObject methods.
~vtkFinitePlaneRepresentation() override
void MovePoint2(double *p1, double *p2)
void Push(double *p1, double *p2)
a simple class to control print indentation
Definition: vtkIndent.h:120
create a line defined by two end points
map vtkPolyData to graphics primitives
concrete dataset represents vertices, lines, polygons, and triangle strips
Definition: vtkPolyData.h:201
abstract superclass for all actors, volumes and annotations
Definition: vtkProp.h:77
represent surface properties of a geometric object
Definition: vtkProperty.h:178
create a polygonal sphere centered at the origin
describes linear transformations via a 4x4 matrix
Definition: vtkTransform.h:171
filter that generates tubes around lines
abstract specification for Viewports
Definition: vtkViewport.h:57
abstract class defines interface between the widget and widget representation classes
window superclass for vtkRenderWindow
Definition: vtkWindow.h:40
@ Normal
Definition: vtkX3D.h:57
int vtkTypeBool
Definition: vtkABI.h:71
#define VTK_DEPRECATED_IN_9_2_0(reason)