VTK
vtkImplicitPlaneRepresentation.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkImplicitPlaneRepresentation.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 =========================================================================*/
40 #ifndef vtkImplicitPlaneRepresentation_h
41 #define vtkImplicitPlaneRepresentation_h
42 
43 #include "vtkInteractionWidgetsModule.h" // For export macro
45 
46 class vtkActor;
47 class vtkPolyDataMapper;
48 class vtkCellPicker;
49 class vtkConeSource;
50 class vtkLineSource;
51 class vtkSphereSource;
52 class vtkTubeFilter;
53 class vtkPlane;
54 class vtkCutter;
55 class vtkProperty;
56 class vtkImageData;
57 class vtkOutlineFilter;
58 class vtkFeatureEdges;
59 class vtkPolyData;
61 class vtkTransform;
62 class vtkBox;
63 class vtkLookupTable;
64 
66 {
67 public:
70 
72 
74  void PrintSelf(ostream& os, vtkIndent indent);
76 
78 
79  void SetOrigin(double x, double y, double z);
80  void SetOrigin(double x[3]);
81  double* GetOrigin();
82  void GetOrigin(double xyz[3]);
84 
86 
87  void SetNormal(double x, double y, double z);
88  void SetNormal(double x[3]);
90  double* GetNormal();
91  void GetNormal(double xyz[3]);
93 
95 
99  void SetNormalToXAxis(int);
100  vtkGetMacro(NormalToXAxis,int);
101  vtkBooleanMacro(NormalToXAxis,int);
102  void SetNormalToYAxis(int);
103  vtkGetMacro(NormalToYAxis,int);
104  vtkBooleanMacro(NormalToYAxis,int);
105  void SetNormalToZAxis(int);
106  vtkGetMacro(NormalToZAxis,int);
107  vtkBooleanMacro(NormalToZAxis,int);
109 
111 
114  virtual void SetLockNormalToCamera(int);
115  vtkGetMacro(LockNormalToCamera,int);
116  vtkBooleanMacro(LockNormalToCamera,int);
118 
120 
122  vtkSetMacro(Tubing,int);
123  vtkGetMacro(Tubing,int);
124  vtkBooleanMacro(Tubing,int);
126 
128 
132  void SetDrawPlane(int plane);
133  vtkGetMacro(DrawPlane,int);
134  vtkBooleanMacro(DrawPlane,int);
136 
138 
140  vtkSetMacro(OutlineTranslation,int);
141  vtkGetMacro(OutlineTranslation,int);
142  vtkBooleanMacro(OutlineTranslation,int);
144 
146 
148  vtkSetMacro(OutsideBounds,int);
149  vtkGetMacro(OutsideBounds,int);
150  vtkBooleanMacro(OutsideBounds,int);
152 
154 
155  vtkSetMacro(ScaleEnabled,int);
156  vtkGetMacro(ScaleEnabled,int);
157  vtkBooleanMacro(ScaleEnabled,int);
159 
163 
167 
172  void GetPlane(vtkPlane *plane);
173 
177  void UpdatePlacement(void);
178 
180 
182  vtkGetObjectMacro(SelectedNormalProperty,vtkProperty);
184 
186 
189  vtkGetObjectMacro(SelectedPlaneProperty,vtkProperty);
191 
193 
194  vtkGetObjectMacro(OutlineProperty,vtkProperty);
195  vtkGetObjectMacro(SelectedOutlineProperty,vtkProperty);
197 
199 
203 
204 
206  void SetEdgeColor(double, double, double);
207  void SetEdgeColor(double x[3]);
209 
211 
214  vtkSetClampMacro(BumpDistance,double,0.000001,1);
215  vtkGetMacro(BumpDistance,double);
217 
223  void BumpPlane(int dir, double factor);
224 
229  void PushPlane(double distance);
230 
232 
233  virtual int ComputeInteractionState(int X, int Y, int modify=0);
234  virtual void PlaceWidget(double bounds[6]);
235  virtual void BuildRepresentation();
236  virtual void StartWidgetInteraction(double eventPos[2]);
237  virtual void WidgetInteraction(double newEventPos[2]);
238  virtual void EndWidgetInteraction(double newEventPos[2]);
240 
241 
242  virtual double *GetBounds();
243  virtual void GetActors(vtkPropCollection *pc);
249 
250 //BTX - manage the state of the widget
252  {
253  Outside=0,
259  Scaling
260  };
261 //ETX
262 
264 
271  vtkSetClampMacro(InteractionState,int,Outside,Scaling);
273 
275 
277  virtual void SetRepresentationState(int);
278  vtkGetMacro(RepresentationState, int);
280 
281 protected:
284 
286 
287  // Keep track of event positions
288  double LastEventPosition[3];
289 
290  // Controlling ivars
294 
295  // Locking normal to camera
297 
298  // Controlling the push operation
299  double BumpDistance;
300 
301  // The actual plane which is being manipulated
303 
304  // The bounding box is represented by a single voxel image data
309  void HighlightOutline(int highlight);
310  int OutlineTranslation; //whether the outline can be moved
311  int ScaleEnabled; //whether the widget can be scaled
312  int OutsideBounds; //whether the widget can be moved outside input's bounds
313 
314  // The cut plane is produced with a vtkCutter
319  void HighlightPlane(int highlight);
320 
321  // Optional tubes are represented by extracting boundary edges and tubing
326  int Tubing; //control whether tubing is on
327 
328  // The + normal cone
332  void HighlightNormal(int highlight);
333 
334  // The + normal line
338 
339  // The - normal cone
343 
344  // The - normal line
348 
349  // The origin positioning handle
353 
354  // Do the picking
356 
357  // Register internal Pickers within PickingManager
358  virtual void RegisterPickers();
359 
360  // Transform the normal (used for rotation)
362 
363  // Methods to manipulate the plane
364  void ConstrainOrigin(double x[3]);
365  void Rotate(double X, double Y, double *p1, double *p2, double *vpn);
366  void TranslatePlane(double *p1, double *p2);
367  void TranslateOutline(double *p1, double *p2);
368  void TranslateOrigin(double *p1, double *p2);
369  void Push(double *p1, double *p2);
370  void Scale(double *p1, double *p2, double X, double Y);
371  void SizeHandles();
372 
373  // Properties used to control the appearance of selected objects and
374  // the manipulator in general.
383 
385 
386  // Support GetBounds() method
388 
389 private:
391  void operator=(const vtkImplicitPlaneRepresentation&); //Not implemented
392 };
393 
394 #endif
vtkPolyDataMapper
map vtkPolyData to graphics primitives
Definition: vtkPolyDataMapper.h:42
vtkWidgetRepresentation.h
vtkgl::z
GLdouble GLdouble z
Definition: vtkgl.h:11754
vtkImplicitPlaneRepresentation::SetNormalToYAxis
void SetNormalToYAxis(int)
vtkPlane
perform various plane computations
Definition: vtkPlane.h:37
vtkImplicitPlaneRepresentation::MovingOutline
@ MovingOutline
Definition: vtkImplicitPlaneRepresentation.h:255
vtkImplicitPlaneRepresentation::LineActor2
vtkActor * LineActor2
Definition: vtkImplicitPlaneRepresentation.h:347
vtkImplicitPlaneRepresentation::PushPlane
void PushPlane(double distance)
vtkImplicitPlaneRepresentation::GetPolyData
void GetPolyData(vtkPolyData *pd)
vtkGetObjectMacro
#define vtkGetObjectMacro(name, type)
Definition: vtkSetGet.h:232
vtkImplicitPlaneRepresentation::ConeMapper2
vtkPolyDataMapper * ConeMapper2
Definition: vtkImplicitPlaneRepresentation.h:341
vtkImplicitPlaneRepresentation::MovingOrigin
@ MovingOrigin
Definition: vtkImplicitPlaneRepresentation.h:256
vtkImplicitPlaneRepresentation::Outline
vtkOutlineFilter * Outline
Definition: vtkImplicitPlaneRepresentation.h:306
vtkImplicitPlaneRepresentation::SelectedNormalProperty
vtkProperty * SelectedNormalProperty
Definition: vtkImplicitPlaneRepresentation.h:376
vtkImplicitPlaneRepresentation::NormalProperty
vtkProperty * NormalProperty
Definition: vtkImplicitPlaneRepresentation.h:375
vtkCutter
Cut vtkDataSet with user-specified implicit function.
Definition: vtkCutter.h:69
vtkImplicitPlaneRepresentation::HighlightOutline
void HighlightOutline(int highlight)
vtkImplicitPlaneRepresentation::BuildRepresentation
virtual void BuildRepresentation()
vtkImplicitPlaneRepresentation::RenderOpaqueGeometry
virtual int RenderOpaqueGeometry(vtkViewport *)
vtkImplicitPlaneRepresentation::HighlightNormal
void HighlightNormal(int highlight)
vtkImplicitPlaneRepresentation::Tubing
int Tubing
Definition: vtkImplicitPlaneRepresentation.h:326
vtkImplicitPlaneRepresentation::RepresentationState
int RepresentationState
Definition: vtkImplicitPlaneRepresentation.h:285
vtkImplicitPlaneRepresentation::SetNormalToXAxis
void SetNormalToXAxis(int)
vtkImplicitPlaneRepresentation::SetEdgeColor
void SetEdgeColor(double x[3])
vtkImplicitPlaneRepresentation::Rotate
void Rotate(double X, double Y, double *p1, double *p2, double *vpn)
vtkImplicitPlaneRepresentation::CreateDefaultProperties
void CreateDefaultProperties()
vtkImplicitPlaneRepresentation::CutMapper
vtkPolyDataMapper * CutMapper
Definition: vtkImplicitPlaneRepresentation.h:316
vtkConeSource
generate polygonal cone
Definition: vtkConeSource.h:44
vtkImplicitPlaneRepresentation::EdgesProperty
vtkProperty * EdgesProperty
Definition: vtkImplicitPlaneRepresentation.h:381
vtkTypeMacro
#define vtkTypeMacro(thisClass, superclass)
Definition: vtkSetGet.h:642
vtkWidgetRepresentation
abstract class defines interface between the widget and widget representation classes
Definition: vtkWidgetRepresentation.h:54
vtkImplicitPlaneRepresentation::SetRepresentationState
virtual void SetRepresentationState(int)
vtkImplicitPlaneRepresentation::SphereActor
vtkActor * SphereActor
Definition: vtkImplicitPlaneRepresentation.h:352
vtkX3D::dir
@ dir
Definition: vtkX3D.h:324
vtkImplicitPlaneRepresentation::GetBounds
virtual double * GetBounds()
vtkImplicitPlaneRepresentation::EndWidgetInteraction
virtual void EndWidgetInteraction(double newEventPos[2])
vtkInteractionWidgetsModule.h
vtkgl::x
GLint GLint GLint GLint GLint x
Definition: vtkgl.h:11318
vtkImplicitPlaneRepresentation::SetEdgeColor
void SetEdgeColor(vtkLookupTable *)
vtkImplicitPlaneRepresentation::PlaneProperty
vtkProperty * PlaneProperty
Definition: vtkImplicitPlaneRepresentation.h:377
vtkImplicitPlaneRepresentation::ConeSource
vtkConeSource * ConeSource
Definition: vtkImplicitPlaneRepresentation.h:329
vtkImplicitPlaneRepresentation::LineMapper
vtkPolyDataMapper * LineMapper
Definition: vtkImplicitPlaneRepresentation.h:336
vtkImplicitPlaneRepresentation::HasTranslucentPolygonalGeometry
virtual int HasTranslucentPolygonalGeometry()
vtkImplicitPlaneRepresentation::GetNormal
void GetNormal(double xyz[3])
vtkTransform
describes linear transformations via a 4x4 matrix
Definition: vtkTransform.h:60
vtkImplicitPlaneRepresentation::Cutter
vtkCutter * Cutter
Definition: vtkImplicitPlaneRepresentation.h:315
vtkImplicitPlaneRepresentation::SetEdgeColor
void SetEdgeColor(double, double, double)
vtkImplicitPlaneRepresentation::RegisterPickers
virtual void RegisterPickers()
vtkImplicitPlaneRepresentation::SphereMapper
vtkPolyDataMapper * SphereMapper
Definition: vtkImplicitPlaneRepresentation.h:351
vtkImplicitPlaneRepresentation::Moving
@ Moving
Definition: vtkImplicitPlaneRepresentation.h:254
vtkWindow
window superclass for vtkRenderWindow
Definition: vtkWindow.h:34
vtkImplicitPlaneRepresentation::GetActors
virtual void GetActors(vtkPropCollection *pc)
vtkImplicitPlaneRepresentation::GetPlane
void GetPlane(vtkPlane *plane)
vtkImplicitPlaneRepresentation::Rotating
@ Rotating
Definition: vtkImplicitPlaneRepresentation.h:257
vtkImplicitPlaneRepresentation
a class defining the representation for a vtkImplicitPlaneWidget2
Definition: vtkImplicitPlaneRepresentation.h:66
vtkTubeFilter
filter that generates tubes around lines
Definition: vtkTubeFilter.h:83
vtkSetClampMacro
#define vtkSetClampMacro(name, type, min, max)
Definition: vtkSetGet.h:143
vtkImplicitPlaneRepresentation::OutsideBounds
int OutsideBounds
Definition: vtkImplicitPlaneRepresentation.h:312
vtkImplicitPlaneRepresentation::OutlineMapper
vtkPolyDataMapper * OutlineMapper
Definition: vtkImplicitPlaneRepresentation.h:307
vtkImplicitPlaneRepresentation::ConeMapper
vtkPolyDataMapper * ConeMapper
Definition: vtkImplicitPlaneRepresentation.h:330
vtkImplicitPlaneRepresentation::LineSource2
vtkLineSource * LineSource2
Definition: vtkImplicitPlaneRepresentation.h:345
vtkImplicitPlaneRepresentation::TranslatePlane
void TranslatePlane(double *p1, double *p2)
vtkImplicitPlaneRepresentation::WidgetInteraction
virtual void WidgetInteraction(double newEventPos[2])
vtkImplicitPlaneRepresentation::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent)
vtkImplicitPlaneRepresentation::GetNormal
double * GetNormal()
vtkImplicitPlaneRepresentation::SetOrigin
void SetOrigin(double x[3])
vtkImplicitPlaneRepresentation::EdgesActor
vtkActor * EdgesActor
Definition: vtkImplicitPlaneRepresentation.h:325
vtkImplicitPlaneRepresentation::SelectedOutlineProperty
vtkProperty * SelectedOutlineProperty
Definition: vtkImplicitPlaneRepresentation.h:380
vtkImplicitPlaneRepresentation::Push
void Push(double *p1, double *p2)
vtkImplicitPlaneRepresentation::ConeSource2
vtkConeSource * ConeSource2
Definition: vtkImplicitPlaneRepresentation.h:340
vtkSphereSource
create a polygonal sphere centered at the origin
Definition: vtkSphereSource.h:46
vtkImplicitPlaneRepresentation::StartWidgetInteraction
virtual void StartWidgetInteraction(double eventPos[2])
vtkImplicitPlaneRepresentation::BumpDistance
double BumpDistance
Definition: vtkImplicitPlaneRepresentation.h:299
vtkImplicitPlaneRepresentation::LineActor
vtkActor * LineActor
Definition: vtkImplicitPlaneRepresentation.h:337
vtkImplicitPlaneRepresentation::LineSource
vtkLineSource * LineSource
Definition: vtkImplicitPlaneRepresentation.h:335
vtkImplicitPlaneRepresentation::SetNormalToCamera
void SetNormalToCamera()
vtkImplicitPlaneRepresentation::OutlineTranslation
int OutlineTranslation
Definition: vtkImplicitPlaneRepresentation.h:310
vtkImplicitPlaneRepresentation::GeneratePlane
void GeneratePlane()
vtkImplicitPlaneRepresentation::PlaceWidget
virtual void PlaceWidget(double bounds[6])
vtkActor
represents an object (geometry & properties) in a rendered scene
Definition: vtkActor.h:51
vtkImplicitPlaneRepresentation::SetOrigin
void SetOrigin(double x, double y, double z)
vtkImageData
topologically and geometrically regular array of data
Definition: vtkImageData.h:45
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:39
vtkImplicitPlaneRepresentation::CutActor
vtkActor * CutActor
Definition: vtkImplicitPlaneRepresentation.h:317
vtkImplicitPlaneRepresentation::DrawPlane
int DrawPlane
Definition: vtkImplicitPlaneRepresentation.h:318
vtkImplicitPlaneRepresentation::ConeActor2
vtkActor * ConeActor2
Definition: vtkImplicitPlaneRepresentation.h:342
vtkImplicitPlaneRepresentation::ScaleEnabled
int ScaleEnabled
Definition: vtkImplicitPlaneRepresentation.h:311
vtkImplicitPlaneRepresentation::NormalToZAxis
int NormalToZAxis
Definition: vtkImplicitPlaneRepresentation.h:293
vtkFeatureEdges
extract boundary, non-manifold, and/or sharp edges from polygonal data
Definition: vtkFeatureEdges.h:52
vtkImplicitPlaneRepresentation::GetOrigin
void GetOrigin(double xyz[3])
vtkImplicitPlaneRepresentation::SizeHandles
void SizeHandles()
vtkImplicitPlaneRepresentation::UpdatePlacement
void UpdatePlacement(void)
vtkImplicitPlaneRepresentation::BoundingBox
vtkBox * BoundingBox
Definition: vtkImplicitPlaneRepresentation.h:387
vtkImplicitPlaneRepresentation::SetNormal
void SetNormal(double x[3])
vtkGetMacro
#define vtkGetMacro(name, type)
Definition: vtkSetGet.h:93
vtkImplicitPlaneRepresentation::ConeActor
vtkActor * ConeActor
Definition: vtkImplicitPlaneRepresentation.h:331
vtkImplicitPlaneRepresentation::OutlineActor
vtkActor * OutlineActor
Definition: vtkImplicitPlaneRepresentation.h:308
vtkLineSource
create a line defined by two end points
Definition: vtkLineSource.h:42
vtkImplicitPlaneRepresentation::HighlightPlane
void HighlightPlane(int highlight)
vtkImplicitPlaneRepresentation::_InteractionState
_InteractionState
Definition: vtkImplicitPlaneRepresentation.h:252
vtkViewport
abstract specification for Viewports
Definition: vtkViewport.h:47
vtkImplicitPlaneRepresentation::Plane
vtkPlane * Plane
Definition: vtkImplicitPlaneRepresentation.h:302
vtkImplicitPlaneRepresentation::Picker
vtkCellPicker * Picker
Definition: vtkImplicitPlaneRepresentation.h:355
vtkImplicitPlaneRepresentation::GetOrigin
double * GetOrigin()
vtkImplicitPlaneRepresentation::Pushing
@ Pushing
Definition: vtkImplicitPlaneRepresentation.h:258
vtkImplicitPlaneRepresentation::Sphere
vtkSphereSource * Sphere
Definition: vtkImplicitPlaneRepresentation.h:350
vtkImplicitPlaneRepresentation::Transform
vtkTransform * Transform
Definition: vtkImplicitPlaneRepresentation.h:361
vtkBooleanMacro
vtkBooleanMacro(IgnoreDriverBugs, bool)
vtkImplicitPlaneRepresentation::GetPolyDataAlgorithm
vtkPolyDataAlgorithm * GetPolyDataAlgorithm()
vtkImplicitPlaneRepresentation::~vtkImplicitPlaneRepresentation
~vtkImplicitPlaneRepresentation()
vtkImplicitPlaneRepresentation::ComputeInteractionState
virtual int ComputeInteractionState(int X, int Y, int modify=0)
vtkSetMacro
vtkSetMacro(IgnoreDriverBugs, bool)
vtkLookupTable
map scalar values into colors via a lookup table
Definition: vtkLookupTable.h:74
vtkImplicitPlaneRepresentation::RenderTranslucentPolygonalGeometry
virtual int RenderTranslucentPolygonalGeometry(vtkViewport *)
vtkImplicitPlaneRepresentation::Box
vtkImageData * Box
Definition: vtkImplicitPlaneRepresentation.h:305
vtkImplicitPlaneRepresentation::SetNormalToZAxis
void SetNormalToZAxis(int)
vtkBox
implicit function for a bounding box
Definition: vtkBox.h:41
vtkImplicitPlaneRepresentation::OutlineProperty
vtkProperty * OutlineProperty
Definition: vtkImplicitPlaneRepresentation.h:379
VTKINTERACTIONWIDGETS_EXPORT
#define VTKINTERACTIONWIDGETS_EXPORT
Definition: vtkInteractionWidgetsModule.h:15
vtkgl::y
GLint GLint GLint GLint GLint GLint y
Definition: vtkgl.h:11318
vtkImplicitPlaneRepresentation::LockNormalToCamera
int LockNormalToCamera
Definition: vtkImplicitPlaneRepresentation.h:296
vtkImplicitPlaneRepresentation::ReleaseGraphicsResources
virtual void ReleaseGraphicsResources(vtkWindow *)
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
vtkImplicitPlaneRepresentation::NormalToYAxis
int NormalToYAxis
Definition: vtkImplicitPlaneRepresentation.h:292
vtkImplicitPlaneRepresentation::New
static vtkImplicitPlaneRepresentation * New()
vtkProperty
represent surface properties of a geometric object
Definition: vtkProperty.h:64
vtkImplicitPlaneRepresentation::SetNormal
void SetNormal(double x, double y, double z)
vtkImplicitPlaneRepresentation::ConstrainOrigin
void ConstrainOrigin(double x[3])
vtkImplicitPlaneRepresentation::BumpPlane
void BumpPlane(int dir, double factor)
vtkImplicitPlaneRepresentation::SetDrawPlane
void SetDrawPlane(int plane)
vtkImplicitPlaneRepresentation::NormalToXAxis
int NormalToXAxis
Definition: vtkImplicitPlaneRepresentation.h:291
vtkPropCollection
a list of Props
Definition: vtkPropCollection.h:38
vtkCellPicker
ray-cast cell picker for all kinds of Prop3Ds
Definition: vtkCellPicker.h:69
vtkImplicitPlaneRepresentation::Scale
void Scale(double *p1, double *p2, double X, double Y)
vtkImplicitPlaneRepresentation::TranslateOrigin
void TranslateOrigin(double *p1, double *p2)
vtkImplicitPlaneRepresentation::Edges
vtkFeatureEdges * Edges
Definition: vtkImplicitPlaneRepresentation.h:322
vtkImplicitPlaneRepresentation::SetLockNormalToCamera
virtual void SetLockNormalToCamera(int)
vtkImplicitPlaneRepresentation::EdgesTuber
vtkTubeFilter * EdgesTuber
Definition: vtkImplicitPlaneRepresentation.h:323
vtkImplicitPlaneRepresentation::vtkImplicitPlaneRepresentation
vtkImplicitPlaneRepresentation()
vtkImplicitPlaneRepresentation::LineMapper2
vtkPolyDataMapper * LineMapper2
Definition: vtkImplicitPlaneRepresentation.h:346
vtkImplicitPlaneRepresentation::EdgesMapper
vtkPolyDataMapper * EdgesMapper
Definition: vtkImplicitPlaneRepresentation.h:324
vtkImplicitPlaneRepresentation::SelectedPlaneProperty
vtkProperty * SelectedPlaneProperty
Definition: vtkImplicitPlaneRepresentation.h:378
vtkImplicitPlaneRepresentation::TranslateOutline
void TranslateOutline(double *p1, double *p2)
vtkPolyDataAlgorithm
Superclass for algorithms that produce only polydata as output.
Definition: vtkPolyDataAlgorithm.h:44