VTK  9.2.5
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
40 
41 class vtkActor;
42 class vtkBox;
43 class vtkCellPicker;
44 class vtkConeSource;
45 class vtkFeatureEdges;
46 class vtkLineSource;
47 class vtkPolyData;
48 class vtkPolyDataMapper;
49 class vtkProperty;
50 class vtkSphereSource;
51 class vtkTransform;
52 class vtkTubeFilter;
53 
54 class VTKINTERACTIONWIDGETS_EXPORT vtkFinitePlaneRepresentation : public vtkWidgetRepresentation
55 {
56 public:
61 
63 
67  void PrintSelf(ostream& os, vtkIndent indent) override;
69 
75 
77 
82  vtkGetObjectMacro(V1HandleProperty, vtkProperty);
83  vtkGetObjectMacro(V2HandleProperty, vtkProperty);
84  vtkGetObjectMacro(SelectedHandleProperty, vtkProperty);
86 
88 
93  vtkGetObjectMacro(PlaneProperty, vtkProperty);
94  vtkGetObjectMacro(SelectedPlaneProperty, vtkProperty);
96 
98 
102  vtkSetMacro(Tubing, bool);
103  vtkGetMacro(Tubing, bool);
104  vtkBooleanMacro(Tubing, bool);
106 
108 
114  void SetDrawPlane(bool plane);
115  vtkGetMacro(DrawPlane, bool);
116  vtkBooleanMacro(DrawPlane, bool);
118 
120 
124  void SetHandles(bool handles);
125  virtual void HandlesOn();
126  virtual void HandlesOff();
128 
130 
133  void PlaceWidget(double bounds[6]) override;
134  void BuildRepresentation() override;
135  int ComputeInteractionState(int X, int Y, int modify = 0) override;
136  void StartWidgetInteraction(double e[2]) override;
137  void WidgetInteraction(double e[2]) override;
138  double* GetBounds() override;
140 
142 
150 
151  vtkSetClampMacro(InteractionState, int, Outside, Pushing);
152 
154 
157  void SetOrigin(double x, double y, double z);
158  void SetOrigin(double x[3]);
159  vtkGetVector3Macro(Origin, double);
161 
163 
166  void SetNormal(double x, double y, double z);
167  void SetNormal(double n[3]);
168  vtkGetVector3Macro(Normal, double);
170 
172 
175  void SetV1(double x, double y);
176  void SetV1(double x[2]);
177  vtkGetVector2Macro(V1, double);
179 
181 
184  void SetV2(double x, double y);
185  void SetV2(double x[2]);
186  vtkGetVector2Macro(V2, double);
188 
190 
194  virtual void SetRepresentationState(int);
195  vtkGetMacro(RepresentationState, int);
197 
199 
202  vtkGetObjectMacro(NormalProperty, vtkProperty);
203  vtkGetObjectMacro(SelectedNormalProperty, vtkProperty);
205 
206  // Methods to manipulate the plane
207  void TranslateOrigin(double* p1, double* p2);
208  void MovePoint1(double* p1, double* p2);
209  void MovePoint2(double* p1, double* p2);
210  void Push(double* p1, double* p2);
211  void Rotate(int X, int Y, double* p1, double* p2, double* vpn);
212 
214  {
215  Outside = 0,
221  Pushing
222  };
223 #if !defined(VTK_LEGACY_REMOVE)
224  VTK_DEPRECATED_IN_9_2_0("because leading underscore is reserved")
226 #endif
227 
228  /*
229  * Register internal Pickers within PickingManager
230  */
231  void RegisterPickers() override;
232 
233 protected:
236 
237  virtual void CreateDefaultProperties();
238 
239  // Size the glyphs representing hot spots (e.g., handles)
240  virtual void SizeHandles();
241 
242  void SetHighlightNormal(int highlight);
243  void SetHighlightPlane(int highlight);
245 
246  double LastEventPosition[3];
247 
248  // the representation state
250 
251  // the origin
255  double Origin[3];
256 
257  // the normal
258  double Normal[3];
259 
260  // the previous normal
261  double PreviousNormal[3];
262 
263  // the rotation transform
265 
266  // the X Vector
270  double V1[3];
271 
272  // the Y Vector
276  double V2[3];
277 
278  // The + normal cone
282 
283  // The + normal line
287 
288  // The - normal cone
292 
293  // The - normal line
297 
298  // The finite plane
302 
303  // Optional tubes are represented by extracting boundary edges
308  bool Tubing; // control whether tubing is on
309  bool DrawPlane; // control whether plane is on
310 
311  // Picking objects
314 
315  // Transform the planes (used for rotations)
317 
318  // Support GetBounds() method
320 
321  // Properties used to control the appearance of selected objects and
322  // the manipulator in general.
331 
332 private:
334  void operator=(const vtkFinitePlaneRepresentation&) = delete;
335 };
336 
337 #endif
represents an object (geometry & properties) in a rendered scene
Definition: vtkActor.h:161
implicit function for a bounding box
Definition: vtkBox.h:141
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:119
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:200
abstract superclass for all actors, volumes and annotations
Definition: vtkProp.h:76
represent surface properties of a geometric object
Definition: vtkProperty.h:177
create a polygonal sphere centered at the origin
describes linear transformations via a 4x4 matrix
Definition: vtkTransform.h:170
filter that generates tubes around lines
abstract specification for Viewports
Definition: vtkViewport.h:56
abstract class defines interface between the widget and widget representation classes
window superclass for vtkRenderWindow
Definition: vtkWindow.h:39
@ Normal
Definition: vtkX3D.h:51
int vtkTypeBool
Definition: vtkABI.h:69
#define VTK_DEPRECATED_IN_9_2_0(reason)