VTK
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 =========================================================================*/
34 #ifndef vtkFinitePlaneRepresentation_h
35 #define vtkFinitePlaneRepresentation_h
36 
37 #include "vtkInteractionWidgetsModule.h" // For export macro
39 
40 class vtkActor;
41 class vtkBox;
42 class vtkCellPicker;
43 class vtkConeSource;
44 class vtkFeatureEdges;
45 class vtkLineSource;
46 class vtkPolyData;
47 class vtkPolyDataMapper;
48 class vtkProperty;
49 class vtkSphereSource;
50 class vtkTransform;
51 class vtkTubeFilter;
52 
53 class VTKINTERACTIONWIDGETS_EXPORT vtkFinitePlaneRepresentation : public vtkWidgetRepresentation
54 {
55 public:
60 
62 
66  void PrintSelf(ostream& os, vtkIndent indent);
68 
74 
76 
81  vtkGetObjectMacro(V1HandleProperty, vtkProperty);
82  vtkGetObjectMacro(V2HandleProperty, vtkProperty);
83  vtkGetObjectMacro(SelectedHandleProperty, vtkProperty);
85 
87 
92  vtkGetObjectMacro(PlaneProperty, vtkProperty);
93  vtkGetObjectMacro(SelectedPlaneProperty, vtkProperty);
95 
97 
101  vtkSetMacro(Tubing, bool);
102  vtkGetMacro(Tubing, bool);
103  vtkBooleanMacro(Tubing, bool);
105 
107 
113  void SetDrawPlane(bool plane);
114  vtkGetMacro(DrawPlane, bool);
115  vtkBooleanMacro(DrawPlane, bool);
117 
119 
123  void SetHandles(bool handles);
124  virtual void HandlesOn();
125  virtual void HandlesOff();
127 
129 
132  virtual void PlaceWidget(double bounds[6]);
133  virtual void BuildRepresentation();
134  virtual int ComputeInteractionState(int X, int Y, int modify=0);
135  virtual void StartWidgetInteraction(double e[2]);
136  virtual void WidgetInteraction(double e[2]);
137  virtual double *GetBounds();
139 
141 
149 
150  vtkSetClampMacro(InteractionState, int, Outside, Pushing);
151 
153 
156  void SetOrigin(double x, double y, double z);
157  void SetOrigin(double x[3]);
158  vtkGetVector3Macro(Origin, double);
160 
162 
165  void SetNormal(double x, double y, double z);
166  void SetNormal(double x[3]);
167  vtkGetVector3Macro(Normal, double);
169 
171 
174  void SetV1(double x, double y);
175  void SetV1(double x[2]);
176  vtkGetVector2Macro(V1, double);
178 
180 
183  void SetV2(double x, double y);
184  void SetV2(double x[2]);
185  vtkGetVector2Macro(V2, double);
187 
189 
193  virtual void SetRepresentationState(int);
194  vtkGetMacro(RepresentationState, int);
196 
198 
201  vtkGetObjectMacro(NormalProperty, vtkProperty);
202  vtkGetObjectMacro(SelectedNormalProperty, vtkProperty);
204 
205  // Methods to manipulate the plane
206  void TranslateOrigin(double *p1, double *p2);
207  void MovePoint1(double *p1, double *p2);
208  void MovePoint2(double *p1, double *p2);
209  void Push(double *p1, double *p2);
210  void Rotate(int X, int Y, double *p1, double *p2, double *vpn);
211 
213  {
214  Outside = 0,
220  Pushing
221  };
222 
223 protected:
226 
227  virtual void CreateDefaultProperties();
228 
229  // Size the glyphs representing hot spots (e.g., handles)
230  virtual void SizeHandles();
231 
232  // Register internal Pickers within PickingManager
233  virtual void RegisterPickers();
234 
235  void SetHighlightNormal(int highlight);
236  void SetHighlightPlane(int highlight);
238 
239  double LastEventPosition[3];
240 
241  // the representation state
243 
244  // the origin
248  double Origin[3];
249 
250  // the normal
251  double Normal[3];
252 
253  // the previous normal
254  double PreviousNormal[3];
255 
256  // the rotation transform
258 
259  // the X Vector
263  double V1[3];
264 
265  // the Y Vector
269  double V2[3];
270 
271  // The + normal cone
275 
276  // The + normal line
280 
281  // The - normal cone
285 
286  // The - normal line
290 
291  // The finite plane
295 
296  // Optional tubes are represented by extracting boundary edges
301  bool Tubing; //control whether tubing is on
302  bool DrawPlane; //control whether plane is on
303 
304  // Picking objects
307 
308  // Transform the planes (used for rotations)
310 
311  // Support GetBounds() method
313 
314  // Properties used to control the appearance of selected objects and
315  // the manipulator in general.
324 
325 private:
327  void operator=(const vtkFinitePlaneRepresentation&) VTK_DELETE_FUNCTION;
328 };
329 
330 #endif
vtkPolyDataMapper
map vtkPolyData to graphics primitives
Definition: vtkPolyDataMapper.h:43
vtkFinitePlaneRepresentation::SetV1
void SetV1(double x, double y)
Set/Get the v1 vector of the plane.
vtkFinitePlaneRepresentation::WidgetInteraction
virtual void WidgetInteraction(double e[2])
vtkWidgetRepresentation.h
vtkFinitePlaneRepresentation::RenderTranslucentPolygonalGeometry
virtual int RenderTranslucentPolygonalGeometry(vtkViewport *)
vtkFinitePlaneRepresentation::GetBounds
virtual double * GetBounds()
Methods to make this class behave as a vtkProp.
vtkFinitePlaneRepresentation::CreateDefaultProperties
virtual void CreateDefaultProperties()
vtkFinitePlaneRepresentation::vtkFinitePlaneRepresentation
vtkFinitePlaneRepresentation()
vtkFinitePlaneRepresentation
represent the vtkFinitePlaneWidget.
Definition: vtkFinitePlaneRepresentation.h:54
vtkFinitePlaneRepresentation::CurrentHandle
vtkActor * CurrentHandle
Definition: vtkFinitePlaneRepresentation.h:306
vtkFinitePlaneRepresentation::PlanePolyData
vtkPolyData * PlanePolyData
Definition: vtkFinitePlaneRepresentation.h:292
vtkFinitePlaneRepresentation::HandlePicker
vtkCellPicker * HandlePicker
Definition: vtkFinitePlaneRepresentation.h:305
vtkFinitePlaneRepresentation::SetV1
void SetV1(double x[2])
vtkFinitePlaneRepresentation::BuildRepresentation
virtual void BuildRepresentation()
vtkFinitePlaneRepresentation::Edges
vtkFeatureEdges * Edges
Definition: vtkFinitePlaneRepresentation.h:297
vtkFinitePlaneRepresentation::SetDrawPlane
void SetDrawPlane(bool plane)
Enable/disable the drawing of the plane.
vtkFinitePlaneRepresentation::MovePoint2
void MovePoint2(double *p1, double *p2)
vtkFinitePlaneRepresentation::ComputeInteractionState
virtual int ComputeInteractionState(int X, int Y, int modify=0)
vtkFinitePlaneRepresentation::SetHighlightNormal
void SetHighlightNormal(int highlight)
vtkFinitePlaneRepresentation::PlaneMapper
vtkPolyDataMapper * PlaneMapper
Definition: vtkFinitePlaneRepresentation.h:293
vtkFinitePlaneRepresentation::ConeActor2
vtkActor * ConeActor2
Definition: vtkFinitePlaneRepresentation.h:284
vtkFinitePlaneRepresentation::TranslateOrigin
void TranslateOrigin(double *p1, double *p2)
vtkFinitePlaneRepresentation::OriginHandleProperty
vtkProperty * OriginHandleProperty
Definition: vtkFinitePlaneRepresentation.h:316
vtkX3D::Normal
@ Normal
Definition: vtkX3D.h:45
vtkFinitePlaneRepresentation::Tubing
bool Tubing
Definition: vtkFinitePlaneRepresentation.h:301
vtkConeSource
generate polygonal cone
Definition: vtkConeSource.h:45
vtkWidgetRepresentation
abstract class defines interface between the widget and widget representation classes
Definition: vtkWidgetRepresentation.h:55
vtkFinitePlaneRepresentation::SelectedPlaneProperty
vtkProperty * SelectedPlaneProperty
Definition: vtkFinitePlaneRepresentation.h:321
vtkFinitePlaneRepresentation::V1HandleProperty
vtkProperty * V1HandleProperty
Definition: vtkFinitePlaneRepresentation.h:317
vtkFinitePlaneRepresentation::HandlesOn
virtual void HandlesOn()
vtkFinitePlaneRepresentation::RepresentationState
int RepresentationState
Definition: vtkFinitePlaneRepresentation.h:242
vtkFinitePlaneRepresentation::DrawPlane
bool DrawPlane
Definition: vtkFinitePlaneRepresentation.h:302
vtkFinitePlaneRepresentation::Rotate
void Rotate(int X, int Y, double *p1, double *p2, double *vpn)
vtkFinitePlaneRepresentation::~vtkFinitePlaneRepresentation
~vtkFinitePlaneRepresentation()
vtkTransform
describes linear transformations via a 4x4 matrix
Definition: vtkTransform.h:61
vtkWindow
window superclass for vtkRenderWindow
Definition: vtkWindow.h:35
vtkFinitePlaneRepresentation::MoveOrigin
@ MoveOrigin
Definition: vtkFinitePlaneRepresentation.h:215
vtkFinitePlaneRepresentation::MovePoint1
void MovePoint1(double *p1, double *p2)
vtkFinitePlaneRepresentation::BoundingBox
vtkBox * BoundingBox
Definition: vtkFinitePlaneRepresentation.h:312
vtkFinitePlaneRepresentation::EdgesTuber
vtkTubeFilter * EdgesTuber
Definition: vtkFinitePlaneRepresentation.h:298
vtkFinitePlaneRepresentation::SizeHandles
virtual void SizeHandles()
vtkFinitePlaneRepresentation::SetNormal
void SetNormal(double x, double y, double z)
Set/Get the normal to the plane.
vtkTubeFilter
filter that generates tubes around lines
Definition: vtkTubeFilter.h:84
vtkFinitePlaneRepresentation::EdgesMapper
vtkPolyDataMapper * EdgesMapper
Definition: vtkFinitePlaneRepresentation.h:299
vtkFinitePlaneRepresentation::SetRepresentationState
virtual void SetRepresentationState(int)
Sets the visual appearance of the representation based on the state it is in.
vtkFinitePlaneRepresentation::V2Actor
vtkActor * V2Actor
Definition: vtkFinitePlaneRepresentation.h:268
vtkFinitePlaneRepresentation::ConeMapper
vtkPolyDataMapper * ConeMapper
Definition: vtkFinitePlaneRepresentation.h:273
vtkFinitePlaneRepresentation::SelectedNormalProperty
vtkProperty * SelectedNormalProperty
Definition: vtkFinitePlaneRepresentation.h:323
vtkFinitePlaneRepresentation::PlaneProperty
vtkProperty * PlaneProperty
Definition: vtkFinitePlaneRepresentation.h:320
vtkSphereSource
create a polygonal sphere centered at the origin
Definition: vtkSphereSource.h:47
vtkFinitePlaneRepresentation::ModifyV1
@ ModifyV1
Definition: vtkFinitePlaneRepresentation.h:216
vtkFinitePlaneRepresentation::SetHighlightHandle
void SetHighlightHandle(vtkProp *prop)
vtkFinitePlaneRepresentation::_InteractionState
_InteractionState
Definition: vtkFinitePlaneRepresentation.h:213
vtkFinitePlaneRepresentation::PlaceWidget
virtual void PlaceWidget(double bounds[6])
These are methods that satisfy vtkWidgetRepresentation's API.
vtkFinitePlaneRepresentation::Moving
@ Moving
Definition: vtkFinitePlaneRepresentation.h:218
vtkFinitePlaneRepresentation::SetHandles
void SetHandles(bool handles)
Switches handles (the spheres) on or off by manipulating the underlying actor visibility.
vtkFinitePlaneRepresentation::TransformRotation
vtkTransform * TransformRotation
Definition: vtkFinitePlaneRepresentation.h:309
vtkFinitePlaneRepresentation::Rotating
@ Rotating
Definition: vtkFinitePlaneRepresentation.h:219
vtkFinitePlaneRepresentation::LineActor
vtkActor * LineActor
Definition: vtkFinitePlaneRepresentation.h:279
vtkActor
represents an object (geometry & properties) in a rendered scene
Definition: vtkActor.h:52
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:40
vtkFinitePlaneRepresentation::RegisterPickers
virtual void RegisterPickers()
Register internal Pickers in the Picking Manager.
vtkFinitePlaneRepresentation::Transform
vtkTransform * Transform
Definition: vtkFinitePlaneRepresentation.h:257
vtkFinitePlaneRepresentation::LineSource
vtkLineSource * LineSource
Definition: vtkFinitePlaneRepresentation.h:277
vtkFinitePlaneRepresentation::V1Geometry
vtkSphereSource * V1Geometry
Definition: vtkFinitePlaneRepresentation.h:260
vtkFeatureEdges
extract boundary, non-manifold, and/or sharp edges from polygonal data
Definition: vtkFeatureEdges.h:53
vtkFinitePlaneRepresentation::SetHighlightPlane
void SetHighlightPlane(int highlight)
vtkFinitePlaneRepresentation::LineSource2
vtkLineSource * LineSource2
Definition: vtkFinitePlaneRepresentation.h:287
vtkFinitePlaneRepresentation::GetPolyData
void GetPolyData(vtkPolyData *pd)
Grab the polydata that defines the plane.
vtkFinitePlaneRepresentation::New
static vtkFinitePlaneRepresentation * New()
Instantiate the class.
vtkFinitePlaneRepresentation::HandlesOff
virtual void HandlesOff()
vtkLineSource
create a line defined by two end points
Definition: vtkLineSource.h:43
vtkFinitePlaneRepresentation::ConeActor
vtkActor * ConeActor
Definition: vtkFinitePlaneRepresentation.h:274
vtkViewport
abstract specification for Viewports
Definition: vtkViewport.h:48
vtkFinitePlaneRepresentation::LineActor2
vtkActor * LineActor2
Definition: vtkFinitePlaneRepresentation.h:289
vtkBooleanMacro
vtkBooleanMacro(IgnoreDriverBugs, bool)
Updates the extensions string.
vtkFinitePlaneRepresentation::ConeSource2
vtkConeSource * ConeSource2
Definition: vtkFinitePlaneRepresentation.h:282
vtkFinitePlaneRepresentation::SelectedHandleProperty
vtkProperty * SelectedHandleProperty
Definition: vtkFinitePlaneRepresentation.h:319
vtkSetMacro
vtkSetMacro(IgnoreDriverBugs, bool)
Updates the extensions string.
vtkProp
abstract superclass for all actors, volumes and annotations
Definition: vtkProp.h:48
vtkFinitePlaneRepresentation::V2HandleProperty
vtkProperty * V2HandleProperty
Definition: vtkFinitePlaneRepresentation.h:318
vtkFinitePlaneRepresentation::RenderOpaqueGeometry
virtual int RenderOpaqueGeometry(vtkViewport *)
WARNING: INTERNAL METHOD - NOT INTENDED FOR GENERAL USE DO NOT USE THESE METHODS OUTSIDE OF THE RENDE...
vtkFinitePlaneRepresentation::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent)
Methods invoked by print to print information about the object including superclasses.
vtkFinitePlaneRepresentation::SetNormal
void SetNormal(double x[3])
vtkBox
implicit function for a bounding box
Definition: vtkBox.h:42
vtkFinitePlaneRepresentation::NormalProperty
vtkProperty * NormalProperty
Definition: vtkFinitePlaneRepresentation.h:322
vtkFinitePlaneRepresentation::OriginGeometry
vtkSphereSource * OriginGeometry
Definition: vtkFinitePlaneRepresentation.h:245
vtkFinitePlaneRepresentation::HasTranslucentPolygonalGeometry
virtual int HasTranslucentPolygonalGeometry()
WARNING: INTERNAL METHOD - NOT INTENDED FOR GENERAL USE DO NOT USE THESE METHODS OUTSIDE OF THE RENDE...
vtkFinitePlaneRepresentation::Push
void Push(double *p1, double *p2)
vtkFinitePlaneRepresentation::V2Mapper
vtkPolyDataMapper * V2Mapper
Definition: vtkFinitePlaneRepresentation.h:267
vtkFinitePlaneRepresentation::LineMapper2
vtkPolyDataMapper * LineMapper2
Definition: vtkFinitePlaneRepresentation.h:288
vtkPolyData
concrete dataset represents vertices, lines, polygons, and triangle strips
Definition: vtkPolyData.h:86
vtkFinitePlaneRepresentation::OriginMapper
vtkPolyDataMapper * OriginMapper
Definition: vtkFinitePlaneRepresentation.h:246
vtkFinitePlaneRepresentation::ReleaseGraphicsResources
virtual void ReleaseGraphicsResources(vtkWindow *)
Methods supporting, and required by, the rendering process.
vtkFinitePlaneRepresentation::SetOrigin
void SetOrigin(double x[3])
vtkProperty
represent surface properties of a geometric object
Definition: vtkProperty.h:65
vtkFinitePlaneRepresentation::ModifyV2
@ ModifyV2
Definition: vtkFinitePlaneRepresentation.h:217
vtkFinitePlaneRepresentation::SetV2
void SetV2(double x[2])
vtkFinitePlaneRepresentation::ConeSource
vtkConeSource * ConeSource
Definition: vtkFinitePlaneRepresentation.h:272
vtkFinitePlaneRepresentation::V2Geometry
vtkSphereSource * V2Geometry
Definition: vtkFinitePlaneRepresentation.h:266
vtkFinitePlaneRepresentation::V1Mapper
vtkPolyDataMapper * V1Mapper
Definition: vtkFinitePlaneRepresentation.h:261
vtkCellPicker
ray-cast cell picker for all kinds of Prop3Ds
Definition: vtkCellPicker.h:70
vtkFinitePlaneRepresentation::OriginActor
vtkActor * OriginActor
Definition: vtkFinitePlaneRepresentation.h:247
vtkFinitePlaneRepresentation::LineMapper
vtkPolyDataMapper * LineMapper
Definition: vtkFinitePlaneRepresentation.h:278
vtkFinitePlaneRepresentation::EdgesActor
vtkActor * EdgesActor
Definition: vtkFinitePlaneRepresentation.h:300
vtkFinitePlaneRepresentation::PlaneActor
vtkActor * PlaneActor
Definition: vtkFinitePlaneRepresentation.h:294
vtkFinitePlaneRepresentation::SetOrigin
void SetOrigin(double x, double y, double z)
Set/Get the origin of the plane.
vtkFinitePlaneRepresentation::V1Actor
vtkActor * V1Actor
Definition: vtkFinitePlaneRepresentation.h:262
vtkFinitePlaneRepresentation::StartWidgetInteraction
virtual void StartWidgetInteraction(double e[2])
vtkFinitePlaneRepresentation::ConeMapper2
vtkPolyDataMapper * ConeMapper2
Definition: vtkFinitePlaneRepresentation.h:283
vtkFinitePlaneRepresentation::SetV2
void SetV2(double x, double y)
Set/Get the v2 vector of the plane.