VTK  9.2.6
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=========================================================================*/
31#ifndef vtkFinitePlaneRepresentation_h
32#define vtkFinitePlaneRepresentation_h
33
34#include "vtkDeprecation.h" // For VTK_DEPRECATED_IN_9_2_0
35#include "vtkInteractionWidgetsModule.h" // For export macro
37
38class vtkActor;
39class vtkBox;
40class vtkCellPicker;
41class vtkConeSource;
42class vtkFeatureEdges;
43class vtkLineSource;
44class vtkPolyData;
46class vtkProperty;
47class vtkSphereSource;
48class vtkTransform;
49class vtkTubeFilter;
50
51class VTKINTERACTIONWIDGETS_EXPORT vtkFinitePlaneRepresentation : public vtkWidgetRepresentation
52{
53public:
58
60
64 void PrintSelf(ostream& os, vtkIndent indent) override;
66
72
74
79 vtkGetObjectMacro(V1HandleProperty, vtkProperty);
80 vtkGetObjectMacro(V2HandleProperty, vtkProperty);
81 vtkGetObjectMacro(SelectedHandleProperty, vtkProperty);
83
85
90 vtkGetObjectMacro(PlaneProperty, vtkProperty);
91 vtkGetObjectMacro(SelectedPlaneProperty, vtkProperty);
93
95
99 vtkSetMacro(Tubing, bool);
100 vtkGetMacro(Tubing, bool);
101 vtkBooleanMacro(Tubing, bool);
103
105
111 void SetDrawPlane(bool plane);
112 vtkGetMacro(DrawPlane, bool);
113 vtkBooleanMacro(DrawPlane, bool);
115
117
121 void SetHandles(bool handles);
122 virtual void HandlesOn();
123 virtual void HandlesOff();
125
127
130 void PlaceWidget(double bounds[6]) override;
131 void BuildRepresentation() override;
132 int ComputeInteractionState(int X, int Y, int modify = 0) override;
133 void StartWidgetInteraction(double e[2]) override;
134 void WidgetInteraction(double e[2]) override;
135 double* GetBounds() override;
137
139
147
148 vtkSetClampMacro(InteractionState, int, Outside, Pushing);
149
151
154 void SetOrigin(double x, double y, double z);
155 void SetOrigin(double x[3]);
156 vtkGetVector3Macro(Origin, double);
158
160
163 void SetNormal(double x, double y, double z);
164 void SetNormal(double n[3]);
165 vtkGetVector3Macro(Normal, double);
167
169
172 void SetV1(double x, double y);
173 void SetV1(double x[2]);
174 vtkGetVector2Macro(V1, double);
176
178
181 void SetV2(double x, double y);
182 void SetV2(double x[2]);
183 vtkGetVector2Macro(V2, double);
185
187
191 virtual void SetRepresentationState(int);
192 vtkGetMacro(RepresentationState, int);
194
196
199 vtkGetObjectMacro(NormalProperty, vtkProperty);
200 vtkGetObjectMacro(SelectedNormalProperty, vtkProperty);
202
203 // Methods to manipulate the plane
204 void TranslateOrigin(double* p1, double* p2);
205 void MovePoint1(double* p1, double* p2);
206 void MovePoint2(double* p1, double* p2);
207 void Push(double* p1, double* p2);
208 void Rotate(int X, int Y, double* p1, double* p2, double* vpn);
209
211 {
212 Outside = 0,
218 Pushing
219 };
220#if !defined(VTK_LEGACY_REMOVE)
221 VTK_DEPRECATED_IN_9_2_0("because leading underscore is reserved")
223#endif
224
225 /*
226 * Register internal Pickers within PickingManager
227 */
228 void RegisterPickers() override;
229
230protected:
233
235
236 // Size the glyphs representing hot spots (e.g., handles)
237 virtual void SizeHandles();
238
239 void SetHighlightNormal(int highlight);
240 void SetHighlightPlane(int highlight);
242
243 double LastEventPosition[3];
244
245 // the representation state
247
248 // the origin
252 double Origin[3];
253
254 // the normal
255 double Normal[3];
256
257 // the previous normal
258 double PreviousNormal[3];
259
260 // the rotation transform
262
263 // the X Vector
267 double V1[3];
268
269 // the Y Vector
273 double V2[3];
274
275 // The + normal cone
279
280 // The + normal line
284
285 // The - normal cone
289
290 // The - normal line
294
295 // The finite plane
299
300 // Optional tubes are represented by extracting boundary edges
305 bool Tubing; // control whether tubing is on
306 bool DrawPlane; // control whether plane is on
307
308 // Picking objects
311
312 // Transform the planes (used for rotations)
314
315 // Support GetBounds() method
317
318 // Properties used to control the appearance of selected objects and
319 // the manipulator in general.
328
329private:
331 void operator=(const vtkFinitePlaneRepresentation&) = delete;
332};
333
334#endif
represents an object (geometry & properties) in a rendered scene
Definition vtkActor.h:46
implicit function for a bounding box
Definition vtkBox.h:39
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:34
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:85
abstract superclass for all actors, volumes and annotations
Definition vtkProp.h:51
represent surface properties of a geometric object
Definition vtkProperty.h:62
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:50
abstract class defines interface between the widget and widget representation classes
window superclass for vtkRenderWindow
Definition vtkWindow.h:39
int vtkTypeBool
Definition vtkABI.h:69
#define VTK_DEPRECATED_IN_9_2_0(reason)