VTK
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 =========================================================================*/
72 #ifndef vtkImplicitPlaneWidget_h
73 #define vtkImplicitPlaneWidget_h
74 
75 #include "vtkInteractionWidgetsModule.h" // For export macro
77 
78 class vtkActor;
79 class vtkPolyDataMapper;
80 class vtkCellPicker;
81 class vtkConeSource;
82 class vtkLineSource;
83 class vtkSphereSource;
84 class vtkTubeFilter;
85 class vtkPlane;
86 class vtkCutter;
87 class vtkProperty;
88 class vtkImageData;
89 class vtkOutlineFilter;
90 class vtkFeatureEdges;
91 class vtkPolyData;
92 class vtkTransform;
93 
95 {
96 public:
99 
101  void PrintSelf(ostream& os, vtkIndent indent);
102 
104 
105  virtual void SetEnabled(int);
106  virtual void PlaceWidget(double bounds[6]);
107  void PlaceWidget()
108  {this->Superclass::PlaceWidget();}
109  void PlaceWidget(double xmin, double xmax, double ymin, double ymax,
110  double zmin, double zmax)
111  {this->Superclass::PlaceWidget(xmin,xmax,ymin,ymax,zmin,zmax);}
113 
115 
116  virtual void SetOrigin(double x, double y, double z);
117  virtual void SetOrigin(double x[3]);
118  double* GetOrigin();
119  void GetOrigin(double xyz[3]);
121 
123 
124  void SetNormal(double x, double y, double z);
125  void SetNormal(double x[3]);
126  double* GetNormal();
127  void GetNormal(double xyz[3]);
129 
131 
135  void SetNormalToXAxis(int);
136  vtkGetMacro(NormalToXAxis,int);
137  vtkBooleanMacro(NormalToXAxis,int);
138  void SetNormalToYAxis(int);
139  vtkGetMacro(NormalToYAxis,int);
140  vtkBooleanMacro(NormalToYAxis,int);
141  void SetNormalToZAxis(int);
142  vtkGetMacro(NormalToZAxis,int);
143  vtkBooleanMacro(NormalToZAxis,int);
145 
147 
149  vtkSetMacro(Tubing,int);
150  vtkGetMacro(Tubing,int);
151  vtkBooleanMacro(Tubing,int);
153 
155 
159  void SetDrawPlane(int plane);
160  vtkGetMacro(DrawPlane,int);
161  vtkBooleanMacro(DrawPlane,int);
163 
165 
167  vtkSetMacro(OutlineTranslation,int);
168  vtkGetMacro(OutlineTranslation,int);
169  vtkBooleanMacro(OutlineTranslation,int);
171 
173 
175  vtkSetMacro(OutsideBounds,int);
176  vtkGetMacro(OutsideBounds,int);
177  vtkBooleanMacro(OutsideBounds,int);
179 
181 
182  vtkSetMacro(ScaleEnabled,int);
183  vtkGetMacro(ScaleEnabled,int);
184  vtkBooleanMacro(ScaleEnabled,int);
186 
188 
190  vtkSetMacro(OriginTranslation,int);
191  vtkGetMacro(OriginTranslation,int);
192  vtkBooleanMacro(OriginTranslation,int);
194 
196 
198  vtkSetClampMacro(DiagonalRatio,double,0,2);
199  vtkGetMacro(DiagonalRatio,double);
201 
205 
209 
214  void GetPlane(vtkPlane *plane);
215 
220 
222  virtual void SizeHandles();
223 
225 
227  vtkGetObjectMacro(SelectedNormalProperty,vtkProperty);
229 
231 
234  vtkGetObjectMacro(SelectedPlaneProperty,vtkProperty);
236 
238 
239  vtkGetObjectMacro(OutlineProperty,vtkProperty);
240  vtkGetObjectMacro(SelectedOutlineProperty,vtkProperty);
242 
244 
248 
249 protected:
252 
253 //BTX - manage the state of the widget
254  int State;
256  {
257  Start=0,
264  Outside
265  };
266 //ETX
267 
268  //handles the events
269  static void ProcessEvents(vtkObject* object, unsigned long event,
270  void* clientdata, void* calldata);
271 
272  // ProcessEvents() dispatches to these methods.
279  void OnMouseMove();
280 
281  // Controlling ivars
286 
287  // The actual plane which is being manipulated
289 
290  // The bounding box is represented by a single voxel image data
295  void HighlightOutline(int highlight);
296  int OutlineTranslation; //whether the outline can be moved
297  int ScaleEnabled; //whether the widget can be scaled
298  int OutsideBounds; //whether the widget can be moved outside input's bounds
299 
300  // The cut plane is produced with a vtkCutter
305  virtual void HighlightPlane(int highlight);
306 
307  // Optional tubes are represented by extracting boundary edges and tubing
312  int Tubing; //control whether tubing is on
313 
314  // Control final length of the arrow:
316 
317  // The + normal cone
321  void HighlightNormal(int highlight);
322 
323  // The + normal line
327 
328  // The - normal cone
332 
333  // The - normal line
337 
338  // The origin positioning handle
342  int OriginTranslation; //whether the origin (sphere) can be moved
343 
344  // Do the picking
346 
347  // Register internal Pickers within PickingManager
348  virtual void RegisterPickers();
349 
350  // Transform the normal (used for rotation)
352 
353  // Methods to manipulate the plane
354  void ConstrainOrigin(double x[3]);
355  void Rotate(int X, int Y, double *p1, double *p2, double *vpn);
356  void TranslatePlane(double *p1, double *p2);
357  void TranslateOutline(double *p1, double *p2);
358  void TranslateOrigin(double *p1, double *p2);
359  void Push(double *p1, double *p2);
360  void Scale(double *p1, double *p2, int X, int Y);
361 
362  // Properties used to control the appearance of selected objects and
363  // the manipulator in general.
372 
374 
375 private:
376  vtkImplicitPlaneWidget(const vtkImplicitPlaneWidget&); //Not implemented
377  void operator=(const vtkImplicitPlaneWidget&); //Not implemented
378 };
379 
380 #endif
vtkPolyDataMapper
map vtkPolyData to graphics primitives
Definition: vtkPolyDataMapper.h:42
vtkImplicitPlaneWidget::Scale
void Scale(double *p1, double *p2, int X, int Y)
vtkImplicitPlaneWidget::ConeActor2
vtkActor * ConeActor2
Definition: vtkImplicitPlaneWidget.h:331
vtkImplicitPlaneWidget::Pushing
@ Pushing
Definition: vtkImplicitPlaneWidget.h:262
vtkgl::z
GLdouble GLdouble z
Definition: vtkgl.h:11754
vtkImplicitPlaneWidget::vtkImplicitPlaneWidget
vtkImplicitPlaneWidget()
vtkPlane
perform various plane computations
Definition: vtkPlane.h:37
vtkImplicitPlaneWidget::SetNormalToYAxis
void SetNormalToYAxis(int)
vtkGetObjectMacro
#define vtkGetObjectMacro(name, type)
Definition: vtkSetGet.h:232
vtkImplicitPlaneWidget::ConeSource2
vtkConeSource * ConeSource2
Definition: vtkImplicitPlaneWidget.h:329
vtkImplicitPlaneWidget::Rotating
@ Rotating
Definition: vtkImplicitPlaneWidget.h:263
vtkImplicitPlaneWidget::GetPlane
void GetPlane(vtkPlane *plane)
vtkImplicitPlaneWidget::TranslateOutline
void TranslateOutline(double *p1, double *p2)
vtkImplicitPlaneWidget::SizeHandles
virtual void SizeHandles()
vtkCutter
Cut vtkDataSet with user-specified implicit function.
Definition: vtkCutter.h:69
vtkImplicitPlaneWidget::SetOrigin
virtual void SetOrigin(double x, double y, double z)
vtkImplicitPlaneWidget::ConeMapper2
vtkPolyDataMapper * ConeMapper2
Definition: vtkImplicitPlaneWidget.h:330
vtkImplicitPlaneWidget::Plane
vtkPlane * Plane
Definition: vtkImplicitPlaneWidget.h:288
vtkImplicitPlaneWidget::OutlineTranslation
int OutlineTranslation
Definition: vtkImplicitPlaneWidget.h:296
vtkImplicitPlaneWidget::LineSource
vtkLineSource * LineSource
Definition: vtkImplicitPlaneWidget.h:324
vtkImplicitPlaneWidget::SetOrigin
virtual void SetOrigin(double x[3])
vtkImplicitPlaneWidget::GetPolyData
void GetPolyData(vtkPolyData *pd)
vtkImplicitPlaneWidget::LineSource2
vtkLineSource * LineSource2
Definition: vtkImplicitPlaneWidget.h:334
vtkImplicitPlaneWidget::OnRightButtonUp
void OnRightButtonUp()
vtkImplicitPlaneWidget::HighlightPlane
virtual void HighlightPlane(int highlight)
vtkImplicitPlaneWidget::UpdateRepresentation
void UpdateRepresentation()
vtkImplicitPlaneWidget::Edges
vtkFeatureEdges * Edges
Definition: vtkImplicitPlaneWidget.h:308
vtkImplicitPlaneWidget::OnLeftButtonUp
void OnLeftButtonUp()
vtkImplicitPlaneWidget::NormalToYAxis
int NormalToYAxis
Definition: vtkImplicitPlaneWidget.h:283
vtkImplicitPlaneWidget::Picker
vtkCellPicker * Picker
Definition: vtkImplicitPlaneWidget.h:345
vtkConeSource
generate polygonal cone
Definition: vtkConeSource.h:44
vtkTypeMacro
#define vtkTypeMacro(thisClass, superclass)
Definition: vtkSetGet.h:642
vtkImplicitPlaneWidget::GetOrigin
void GetOrigin(double xyz[3])
vtkImplicitPlaneWidget::SphereActor
vtkActor * SphereActor
Definition: vtkImplicitPlaneWidget.h:341
vtkObject
abstract base class for most VTK objects
Definition: vtkObject.h:62
vtkImplicitPlaneWidget::NormalToXAxis
int NormalToXAxis
Definition: vtkImplicitPlaneWidget.h:282
vtkInteractionWidgetsModule.h
vtkImplicitPlaneWidget::OnRightButtonDown
void OnRightButtonDown()
vtkgl::x
GLint GLint GLint GLint GLint x
Definition: vtkgl.h:11318
vtkImplicitPlaneWidget::MovingOutline
@ MovingOutline
Definition: vtkImplicitPlaneWidget.h:259
vtkImplicitPlaneWidget::NormalProperty
vtkProperty * NormalProperty
Definition: vtkImplicitPlaneWidget.h:364
vtkImplicitPlaneWidget::SetDrawPlane
void SetDrawPlane(int plane)
vtkImplicitPlaneWidget::Transform
vtkTransform * Transform
Definition: vtkImplicitPlaneWidget.h:351
vtkImplicitPlaneWidget::SelectedOutlineProperty
vtkProperty * SelectedOutlineProperty
Definition: vtkImplicitPlaneWidget.h:369
vtkImplicitPlaneWidget::LineMapper
vtkPolyDataMapper * LineMapper
Definition: vtkImplicitPlaneWidget.h:325
vtkImplicitPlaneWidget::Rotate
void Rotate(int X, int Y, double *p1, double *p2, double *vpn)
vtkImplicitPlaneWidget::OnMiddleButtonDown
void OnMiddleButtonDown()
vtkTransform
describes linear transformations via a 4x4 matrix
Definition: vtkTransform.h:60
vtkImplicitPlaneWidget::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent)
vtkImplicitPlaneWidget::LineMapper2
vtkPolyDataMapper * LineMapper2
Definition: vtkImplicitPlaneWidget.h:335
vtkImplicitPlaneWidget::EdgesActor
vtkActor * EdgesActor
Definition: vtkImplicitPlaneWidget.h:311
vtkgl::event
struct _cl_event * event
Definition: vtkgl.h:14387
vtkImplicitPlaneWidget::DiagonalRatio
double DiagonalRatio
Definition: vtkImplicitPlaneWidget.h:315
vtkImplicitPlaneWidget::ConstrainOrigin
void ConstrainOrigin(double x[3])
vtkImplicitPlaneWidget::HighlightOutline
void HighlightOutline(int highlight)
vtkImplicitPlaneWidget::TranslateOrigin
void TranslateOrigin(double *p1, double *p2)
vtkImplicitPlaneWidget::NormalToZAxis
int NormalToZAxis
Definition: vtkImplicitPlaneWidget.h:284
vtkImplicitPlaneWidget::GetPolyDataAlgorithm
vtkPolyDataAlgorithm * GetPolyDataAlgorithm()
vtkImplicitPlaneWidget::SetNormal
void SetNormal(double x, double y, double z)
vtkImplicitPlaneWidget::ConeActor
vtkActor * ConeActor
Definition: vtkImplicitPlaneWidget.h:320
vtkImplicitPlaneWidget::GetOrigin
double * GetOrigin()
vtkTubeFilter
filter that generates tubes around lines
Definition: vtkTubeFilter.h:83
vtkImplicitPlaneWidget::SetEnabled
virtual void SetEnabled(int)
vtkImplicitPlaneWidget::SetNormalToXAxis
void SetNormalToXAxis(int)
vtkImplicitPlaneWidget::SetNormal
void SetNormal(double x[3])
vtkSetClampMacro
#define vtkSetClampMacro(name, type, min, max)
Definition: vtkSetGet.h:143
vtkImplicitPlaneWidget::ProcessEvents
static void ProcessEvents(vtkObject *object, unsigned long event, void *clientdata, void *calldata)
vtkImplicitPlaneWidget::CutMapper
vtkPolyDataMapper * CutMapper
Definition: vtkImplicitPlaneWidget.h:302
vtkImplicitPlaneWidget::PlaceWidget
virtual void PlaceWidget(double bounds[6])
vtkSphereSource
create a polygonal sphere centered at the origin
Definition: vtkSphereSource.h:46
vtkImplicitPlaneWidget::LineActor
vtkActor * LineActor
Definition: vtkImplicitPlaneWidget.h:326
vtkImplicitPlaneWidget::OutlineActor
vtkActor * OutlineActor
Definition: vtkImplicitPlaneWidget.h:294
vtkImplicitPlaneWidget::PlaceWidget
void PlaceWidget(double xmin, double xmax, double ymin, double ymax, double zmin, double zmax)
Definition: vtkImplicitPlaneWidget.h:109
vtkActor
represents an object (geometry & properties) in a rendered scene
Definition: vtkActor.h:51
vtkImplicitPlaneWidget::SphereMapper
vtkPolyDataMapper * SphereMapper
Definition: vtkImplicitPlaneWidget.h:340
vtkImplicitPlaneWidget::HighlightNormal
void HighlightNormal(int highlight)
vtkImageData
topologically and geometrically regular array of data
Definition: vtkImageData.h:45
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:39
vtkImplicitPlaneWidget::SetNormalToZAxis
void SetNormalToZAxis(int)
vtkImplicitPlaneWidget::TranslatePlane
void TranslatePlane(double *p1, double *p2)
vtkFeatureEdges
extract boundary, non-manifold, and/or sharp edges from polygonal data
Definition: vtkFeatureEdges.h:52
vtkImplicitPlaneWidget::SelectedPlaneProperty
vtkProperty * SelectedPlaneProperty
Definition: vtkImplicitPlaneWidget.h:367
vtkImplicitPlaneWidget::OnMouseMove
void OnMouseMove()
vtkImplicitPlaneWidget::New
static vtkImplicitPlaneWidget * New()
vtkImplicitPlaneWidget::Box
vtkImageData * Box
Definition: vtkImplicitPlaneWidget.h:291
vtkGetMacro
#define vtkGetMacro(name, type)
Definition: vtkSetGet.h:93
vtkImplicitPlaneWidget::EdgesTuber
vtkTubeFilter * EdgesTuber
Definition: vtkImplicitPlaneWidget.h:309
vtkLineSource
create a line defined by two end points
Definition: vtkLineSource.h:42
vtkgl::zmax
GLclampd zmax
Definition: vtkgl.h:17479
vtkImplicitPlaneWidget::SelectedNormalProperty
vtkProperty * SelectedNormalProperty
Definition: vtkImplicitPlaneWidget.h:365
vtkImplicitPlaneWidget::ConeMapper
vtkPolyDataMapper * ConeMapper
Definition: vtkImplicitPlaneWidget.h:319
vtkBooleanMacro
vtkBooleanMacro(IgnoreDriverBugs, bool)
vtkSetMacro
vtkSetMacro(IgnoreDriverBugs, bool)
vtkImplicitPlaneWidget::ScaleEnabled
int ScaleEnabled
Definition: vtkImplicitPlaneWidget.h:297
vtkImplicitPlaneWidget::MovingPlane
@ MovingPlane
Definition: vtkImplicitPlaneWidget.h:258
vtkImplicitPlaneWidget::GetNormal
void GetNormal(double xyz[3])
vtkImplicitPlaneWidget::LineActor2
vtkActor * LineActor2
Definition: vtkImplicitPlaneWidget.h:336
VTKINTERACTIONWIDGETS_EXPORT
#define VTKINTERACTIONWIDGETS_EXPORT
Definition: vtkInteractionWidgetsModule.h:15
vtkgl::y
GLint GLint GLint GLint GLint GLint y
Definition: vtkgl.h:11318
vtkImplicitPlaneWidget::WidgetState
WidgetState
Definition: vtkImplicitPlaneWidget.h:256
vtkImplicitPlaneWidget::MovingOrigin
@ MovingOrigin
Definition: vtkImplicitPlaneWidget.h:260
vtkImplicitPlaneWidget::RegisterPickers
virtual void RegisterPickers()
vtk3DWidget::PlaceWidget
virtual void PlaceWidget()
vtkImplicitPlaneWidget::PlaceWidget
void PlaceWidget()
Definition: vtkImplicitPlaneWidget.h:107
vtkImplicitPlaneWidget::Tubing
int Tubing
Definition: vtkImplicitPlaneWidget.h:312
vtkImplicitPlaneWidget
3D widget for manipulating an infinite plane
Definition: vtkImplicitPlaneWidget.h:95
vtkImplicitPlaneWidget::ConeSource
vtkConeSource * ConeSource
Definition: vtkImplicitPlaneWidget.h:318
vtkPolyDataSourceWidget
abstract PolyDataSource-based 3D widget
Definition: vtkPolyDataSourceWidget.h:45
vtkPolyData
concrete dataset represents vertices, lines, polygons, and triangle strips
Definition: vtkPolyData.h:84
vtkOutlineFilter
create wireframe outline for arbitrary data set
Definition: vtkOutlineFilter.h:38
vtkImplicitPlaneWidget::UpdatePlacement
void UpdatePlacement()
vtkImplicitPlaneWidget::EdgesProperty
vtkProperty * EdgesProperty
Definition: vtkImplicitPlaneWidget.h:370
vtkImplicitPlaneWidget::Push
void Push(double *p1, double *p2)
vtkImplicitPlaneWidget::State
int State
Definition: vtkImplicitPlaneWidget.h:254
vtkImplicitPlaneWidget::OnMiddleButtonUp
void OnMiddleButtonUp()
vtkProperty
represent surface properties of a geometric object
Definition: vtkProperty.h:64
vtkImplicitPlaneWidget::GeneratePlane
void GeneratePlane()
vtkImplicitPlaneWidget::PlaneProperty
vtkProperty * PlaneProperty
Definition: vtkImplicitPlaneWidget.h:366
vtkImplicitPlaneWidget::OutlineMapper
vtkPolyDataMapper * OutlineMapper
Definition: vtkImplicitPlaneWidget.h:293
vtkImplicitPlaneWidget::Scaling
@ Scaling
Definition: vtkImplicitPlaneWidget.h:261
vtkImplicitPlaneWidget::Cutter
vtkCutter * Cutter
Definition: vtkImplicitPlaneWidget.h:301
vtkImplicitPlaneWidget::OriginTranslation
int OriginTranslation
Definition: vtkImplicitPlaneWidget.h:342
vtkCellPicker
ray-cast cell picker for all kinds of Prop3Ds
Definition: vtkCellPicker.h:69
vtkImplicitPlaneWidget::OutlineProperty
vtkProperty * OutlineProperty
Definition: vtkImplicitPlaneWidget.h:368
vtkImplicitPlaneWidget::CreateDefaultProperties
void CreateDefaultProperties()
vtkImplicitPlaneWidget::OnLeftButtonDown
void OnLeftButtonDown()
vtkImplicitPlaneWidget::~vtkImplicitPlaneWidget
~vtkImplicitPlaneWidget()
vtkImplicitPlaneWidget::CutActor
vtkActor * CutActor
Definition: vtkImplicitPlaneWidget.h:303
vtkImplicitPlaneWidget::Outline
vtkOutlineFilter * Outline
Definition: vtkImplicitPlaneWidget.h:292
vtkImplicitPlaneWidget::DrawPlane
int DrawPlane
Definition: vtkImplicitPlaneWidget.h:304
vtkImplicitPlaneWidget::OutsideBounds
int OutsideBounds
Definition: vtkImplicitPlaneWidget.h:298
vtkPolyDataSourceWidget.h
vtkImplicitPlaneWidget::Sphere
vtkSphereSource * Sphere
Definition: vtkImplicitPlaneWidget.h:339
vtkImplicitPlaneWidget::GetNormal
double * GetNormal()
vtkImplicitPlaneWidget::EdgesMapper
vtkPolyDataMapper * EdgesMapper
Definition: vtkImplicitPlaneWidget.h:310
vtkPolyDataAlgorithm
Superclass for algorithms that produce only polydata as output.
Definition: vtkPolyDataAlgorithm.h:44