VTK  9.2.6
vtkImplicitPlaneWidget.h
Go to the documentation of this file.
1/*=========================================================================
2
3 Program: Visualization Toolkit
4 Module: vtkImplicitPlaneWidget.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=========================================================================*/
70#ifndef vtkImplicitPlaneWidget_h
71#define vtkImplicitPlaneWidget_h
72
73#include "vtkInteractionWidgetsModule.h" // For export macro
75
76class vtkActor;
78class vtkCellPicker;
79class vtkConeSource;
80class vtkLineSource;
81class vtkSphereSource;
82class vtkTubeFilter;
83class vtkPlane;
84class vtkCutter;
85class vtkProperty;
86class vtkImageData;
88class vtkFeatureEdges;
89class vtkPolyData;
90class vtkTransform;
91
92class VTKINTERACTIONWIDGETS_EXPORT vtkImplicitPlaneWidget : public vtkPolyDataSourceWidget
93{
94public:
99
101 void PrintSelf(ostream& os, vtkIndent indent) override;
102
104
107 void SetEnabled(int) override;
108 void PlaceWidget(double bounds[6]) override;
109 void PlaceWidget() override { this->Superclass::PlaceWidget(); }
111 double xmin, double xmax, double ymin, double ymax, double zmin, double zmax) override
112 {
113 this->Superclass::PlaceWidget(xmin, xmax, ymin, ymax, zmin, zmax);
114 }
116
118
121 virtual void SetOrigin(double x, double y, double z);
122 virtual void SetOrigin(double x[3]);
124 void GetOrigin(double xyz[3]);
126
128
131 void SetNormal(double x, double y, double z);
132 void SetNormal(double n[3]);
133 double* GetNormal() VTK_SIZEHINT(3);
134 void GetNormal(double xyz[3]);
136
138
145 void SetNormalToXAxis(vtkTypeBool);
146 vtkGetMacro(NormalToXAxis, vtkTypeBool);
147 vtkBooleanMacro(NormalToXAxis, vtkTypeBool);
148 void SetNormalToYAxis(vtkTypeBool);
149 vtkGetMacro(NormalToYAxis, vtkTypeBool);
150 vtkBooleanMacro(NormalToYAxis, vtkTypeBool);
151 void SetNormalToZAxis(vtkTypeBool);
152 vtkGetMacro(NormalToZAxis, vtkTypeBool);
153 vtkBooleanMacro(NormalToZAxis, vtkTypeBool);
155
157
161 vtkSetMacro(Tubing, vtkTypeBool);
162 vtkGetMacro(Tubing, vtkTypeBool);
163 vtkBooleanMacro(Tubing, vtkTypeBool);
165
167
173 void SetDrawPlane(vtkTypeBool plane);
174 vtkGetMacro(DrawPlane, vtkTypeBool);
175 vtkBooleanMacro(DrawPlane, vtkTypeBool);
177
179
183 vtkSetMacro(OutlineTranslation, vtkTypeBool);
184 vtkGetMacro(OutlineTranslation, vtkTypeBool);
185 vtkBooleanMacro(OutlineTranslation, vtkTypeBool);
187
189
192 vtkSetMacro(OutsideBounds, vtkTypeBool);
193 vtkGetMacro(OutsideBounds, vtkTypeBool);
194 vtkBooleanMacro(OutsideBounds, vtkTypeBool);
196
198
201 vtkSetMacro(ScaleEnabled, vtkTypeBool);
202 vtkGetMacro(ScaleEnabled, vtkTypeBool);
203 vtkBooleanMacro(ScaleEnabled, vtkTypeBool);
205
207
211 vtkSetMacro(OriginTranslation, vtkTypeBool);
212 vtkGetMacro(OriginTranslation, vtkTypeBool);
213 vtkBooleanMacro(OriginTranslation, vtkTypeBool);
215
217
221 vtkSetClampMacro(DiagonalRatio, double, 0, 2);
222 vtkGetMacro(DiagonalRatio, double);
224
229 void GetPolyData(vtkPolyData* pd);
230
235 vtkPolyDataAlgorithm* GetPolyDataAlgorithm() override;
236
243 void GetPlane(vtkPlane* plane);
244
249 void UpdatePlacement() override;
250
254 void SizeHandles() override;
255
257
260 vtkGetObjectMacro(NormalProperty, vtkProperty);
261 vtkGetObjectMacro(SelectedNormalProperty, vtkProperty);
263
265
269 vtkGetObjectMacro(PlaneProperty, vtkProperty);
270 vtkGetObjectMacro(SelectedPlaneProperty, vtkProperty);
272
274
277 vtkGetObjectMacro(OutlineProperty, vtkProperty);
278 vtkGetObjectMacro(SelectedOutlineProperty, vtkProperty);
280
282
286 vtkGetObjectMacro(EdgesProperty, vtkProperty);
288
289protected:
292
293 // Manage the state of the widget
294 int State;
306
307 // handles the events
308 static void ProcessEvents(
309 vtkObject* object, unsigned long event, void* clientdata, void* calldata);
310
311 // ProcessEvents() dispatches to these methods.
319
320 // Controlling ivars
325
326 // The actual plane which is being manipulated
328
329 // The bounding box is represented by a single voxel image data
334 void HighlightOutline(int highlight);
335 vtkTypeBool OutlineTranslation; // whether the outline can be moved
336 vtkTypeBool ScaleEnabled; // whether the widget can be scaled
337 vtkTypeBool OutsideBounds; // whether the widget can be moved outside input's bounds
338
339 // The cut plane is produced with a vtkCutter
344 virtual void HighlightPlane(int highlight);
345
346 // Optional tubes are represented by extracting boundary edges and tubing
351 vtkTypeBool Tubing; // control whether tubing is on
352
353 // Control final length of the arrow:
355
356 // The + normal cone
360 void HighlightNormal(int highlight);
361
362 // The + normal line
366
367 // The - normal cone
371
372 // The - normal line
376
377 // The origin positioning handle
381 vtkTypeBool OriginTranslation; // whether the origin (sphere) can be moved
382
383 // Do the picking
385
386 // Register internal Pickers within PickingManager
387 void RegisterPickers() override;
388
389 // Transform the normal (used for rotation)
391
392 // Methods to manipulate the plane
393 void ConstrainOrigin(double x[3]);
394 void Rotate(int X, int Y, double* p1, double* p2, double* vpn);
395 void TranslatePlane(double* p1, double* p2);
396 void TranslateOutline(double* p1, double* p2);
397 void TranslateOrigin(double* p1, double* p2);
398 void Push(double* p1, double* p2);
399 void Scale(double* p1, double* p2, int X, int Y);
400
401 // Properties used to control the appearance of selected objects and
402 // the manipulator in general.
411
413
414private:
416 void operator=(const vtkImplicitPlaneWidget&) = delete;
417};
418
419#endif
virtual void PlaceWidget()
This method is used to initially place the widget.
represents an object (geometry & properties) in a rendered scene
Definition vtkActor.h:52
ray-cast cell picker for all kinds of Prop3Ds
generate polygonal cone
Cut vtkDataSet with user-specified implicit function.
Definition vtkCutter.h:74
extract interior, boundary, non-manifold, and/or sharp edges from polygonal data
topologically and geometrically regular array of data
3D widget for manipulating an infinite plane
void PlaceWidget(double xmin, double xmax, double ymin, double ymax, double zmin, double zmax) override
Methods that satisfy the superclass' API.
void TranslateOutline(double *p1, double *p2)
void TranslatePlane(double *p1, double *p2)
static vtkImplicitPlaneWidget * New()
Instantiate the object.
vtkPolyDataMapper * ConeMapper2
void Rotate(int X, int Y, double *p1, double *p2, double *vpn)
virtual void HighlightPlane(int highlight)
vtkPolyDataMapper * SphereMapper
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
void RegisterPickers() override
Register internal Pickers in the Picking Manager.
void ConstrainOrigin(double x[3])
virtual void SetOrigin(double x, double y, double z)
Get the origin of the plane.
void Scale(double *p1, double *p2, int X, int Y)
void HighlightNormal(int highlight)
void SetEnabled(int) override
Methods that satisfy the superclass' API.
void TranslateOrigin(double *p1, double *p2)
static void ProcessEvents(vtkObject *object, unsigned long event, void *clientdata, void *calldata)
void PlaceWidget() override
Methods that satisfy the superclass' API.
vtkPolyDataMapper * OutlineMapper
void PlaceWidget(double bounds[6]) override
Methods that satisfy the superclass' API.
double * GetOrigin()
Get the origin of the plane.
virtual void SetOrigin(double x[3])
Get the origin of the plane.
void HighlightOutline(int highlight)
vtkPolyDataMapper * EdgesMapper
vtkPolyDataMapper * LineMapper2
void Push(double *p1, double *p2)
a simple class to control print indentation
Definition vtkIndent.h:40
create a line defined by two end points
abstract base class for most VTK objects
Definition vtkObject.h:63
create wireframe outline for an arbitrary data set or composite dataset
perform various plane computations
Definition vtkPlane.h:37
Superclass for algorithms that produce only polydata as output.
map vtkPolyData to graphics primitives
abstract PolyDataSource-based 3D widget
concrete dataset represents vertices, lines, polygons, and triangle strips
Definition vtkPolyData.h:91
represent surface properties of a geometric object
Definition vtkProperty.h:68
create a polygonal sphere centered at the origin
describes linear transformations via a 4x4 matrix
filter that generates tubes around lines
int vtkTypeBool
Definition vtkABI.h:69
#define VTK_SIZEHINT(...)