VTK  9.3.0
vtkFinitePlaneRepresentation.h
Go to the documentation of this file.
1// SPDX-FileCopyrightText: Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
2// SPDX-License-Identifier: BSD-3-Clause
22#ifndef vtkFinitePlaneRepresentation_h
23#define vtkFinitePlaneRepresentation_h
24
25#include "vtkDeprecation.h" // For VTK_DEPRECATED_IN_9_2_0
26#include "vtkInteractionWidgetsModule.h" // For export macro
27#include "vtkLegacy.h" // for VTK_LEGACY_REMOVE
29
30VTK_ABI_NAMESPACE_BEGIN
31class vtkActor;
32class vtkBox;
33class vtkCellPicker;
34class vtkConeSource;
35class vtkFeatureEdges;
36class vtkLineSource;
37class vtkPolyData;
39class vtkProperty;
40class vtkSphereSource;
41class vtkTransform;
42class vtkTubeFilter;
43
44class VTKINTERACTIONWIDGETS_EXPORT vtkFinitePlaneRepresentation : public vtkWidgetRepresentation
45{
46public:
51
53
57 void PrintSelf(ostream& os, vtkIndent indent) override;
59
65
67
72 vtkGetObjectMacro(V1HandleProperty, vtkProperty);
73 vtkGetObjectMacro(V2HandleProperty, vtkProperty);
74 vtkGetObjectMacro(SelectedHandleProperty, vtkProperty);
76
78
83 vtkGetObjectMacro(PlaneProperty, vtkProperty);
84 vtkGetObjectMacro(SelectedPlaneProperty, vtkProperty);
86
88
92 vtkSetMacro(Tubing, bool);
93 vtkGetMacro(Tubing, bool);
94 vtkBooleanMacro(Tubing, bool);
96
98
104 void SetDrawPlane(bool plane);
105 vtkGetMacro(DrawPlane, bool);
106 vtkBooleanMacro(DrawPlane, bool);
108
110
114 void SetHandles(bool handles);
115 virtual void HandlesOn();
116 virtual void HandlesOff();
118
120
123 void PlaceWidget(double bounds[6]) override;
124 void BuildRepresentation() override;
125 int ComputeInteractionState(int X, int Y, int modify = 0) override;
126 void StartWidgetInteraction(double e[2]) override;
127 void WidgetInteraction(double e[2]) override;
128 double* GetBounds() override;
130
132
140
141 vtkSetClampMacro(InteractionState, int, Outside, Pushing);
142
144
147 void SetOrigin(double x, double y, double z);
148 void SetOrigin(double x[3]);
149 vtkGetVector3Macro(Origin, double);
151
153
156 void SetNormal(double x, double y, double z);
157 void SetNormal(double n[3]);
158 vtkGetVector3Macro(Normal, double);
160
162
165 void SetV1(double x, double y);
166 void SetV1(double x[2]);
167 vtkGetVector2Macro(V1, double);
169
171
174 void SetV2(double x, double y);
175 void SetV2(double x[2]);
176 vtkGetVector2Macro(V2, double);
178
180
184 virtual void SetRepresentationState(int);
185 vtkGetMacro(RepresentationState, int);
187
189
192 vtkGetObjectMacro(NormalProperty, vtkProperty);
193 vtkGetObjectMacro(SelectedNormalProperty, vtkProperty);
195
196 // Methods to manipulate the plane
197 void TranslateOrigin(double* p1, double* p2);
198 void MovePoint1(double* p1, double* p2);
199 void MovePoint2(double* p1, double* p2);
200 void Push(double* p1, double* p2);
201 void Rotate(int X, int Y, double* p1, double* p2, double* vpn);
202
204 {
205 Outside = 0,
211 Pushing
212 };
213#if !defined(VTK_LEGACY_REMOVE)
214 VTK_DEPRECATED_IN_9_2_0("because leading underscore is reserved")
216#endif
217
218 /*
219 * Register internal Pickers within PickingManager
220 */
221 void RegisterPickers() override;
222
223protected:
226
228
229 // Size the glyphs representing hot spots (e.g., handles)
230 virtual void SizeHandles();
231
232 void SetHighlightNormal(int highlight);
233 void SetHighlightPlane(int highlight);
235
236 double LastEventPosition[3];
237
238 // the representation state
240
241 // the origin
245 double Origin[3];
246
247 // the normal
248 double Normal[3];
249
250 // the previous normal
251 double PreviousNormal[3];
252
253 // the rotation transform
255
256 // the X Vector
260 double V1[3];
261
262 // the Y Vector
266 double V2[3];
267
268 // The + normal cone
272
273 // The + normal line
277
278 // The - normal cone
282
283 // The - normal line
287
288 // The finite plane
292
293 // Optional tubes are represented by extracting boundary edges
298 bool Tubing; // control whether tubing is on
299 bool DrawPlane; // control whether plane is on
300
301 // Picking objects
304
305 // Transform the planes (used for rotations)
307
308 // Support GetBounds() method
310
311 // Properties used to control the appearance of selected objects and
312 // the manipulator in general.
321
322private:
324 void operator=(const vtkFinitePlaneRepresentation&) = delete;
325};
326
327VTK_ABI_NAMESPACE_END
328#endif
represents an object (geometry & properties) in a rendered scene
Definition vtkActor.h:41
implicit function for a bounding box
Definition vtkBox.h:31
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.
double * GetBounds() override
These are methods that satisfy vtkWidgetRepresentation's API.
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.
static vtkFinitePlaneRepresentation * New()
Instantiate the class.
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.
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.
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:29
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:80
abstract superclass for all actors, volumes and annotations
Definition vtkProp.h:43
represent surface properties of a geometric object
Definition vtkProperty.h:57
create a polygonal sphere centered at the origin
describes linear transformations via a 4x4 matrix
filter that generates tubes around lines
abstract specification for Viewports
Definition vtkViewport.h:45
abstract class defines interface between the widget and widget representation classes
window superclass for vtkRenderWindow
Definition vtkWindow.h:25
int vtkTypeBool
Definition vtkABI.h:64
#define VTK_DEPRECATED_IN_9_2_0(reason)