VTK
vtkPolygonalSurfacePointPlacer.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkPolygonalSurfacePointPlacer.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 =========================================================================*/
32 #ifndef vtkPolygonalSurfacePointPlacer_h
33 #define vtkPolygonalSurfacePointPlacer_h
34 
35 #include "vtkInteractionWidgetsModule.h" // For export macro
36 #include "vtkPolyDataPointPlacer.h"
37 
39 class vtkCellPicker;
40 class vtkPolygonalSurfacePointPlacerInternals;
41 class vtkPolyData;
42 
43 // The Node stores information about the point. This information is used by
44 // the interpolator. Reusing this information avoids the need for a second
45 // pick operation to regenerate it. (Cellpickers are slow).
47 {
48  double WorldPosition[3];
52  double ParametricCoords[3]; // parametric coords within cell
54 };
55 
56 class VTKINTERACTIONWIDGETS_EXPORT vtkPolygonalSurfacePointPlacer
57  : public vtkPolyDataPointPlacer
58 {
59 public:
64 
66 
70  void PrintSelf(ostream& os, vtkIndent indent) override;
72 
73  // Descuription:
74  // Add /remove a prop, to place points on
75  void AddProp( vtkProp * ) override;
76  void RemoveViewProp(vtkProp *prop) override;
77  void RemoveAllProps() override;
78 
88  double displayPos[2],
89  double worldPos[3],
90  double worldOrient[9] ) override;
91 
99  double displayPos[2],
100  double refWorldPos[3],
101  double worldPos[3],
102  double worldOrient[9] ) override;
103 
108  int ValidateWorldPosition( double worldPos[3] ) override;
109 
113  int UpdateNodeWorldPosition( double worldPos[3],
114  vtkIdType nodePointId ) override;
115 
119  int ValidateDisplayPosition( vtkRenderer *, double displayPos[2] ) override;
120 
125  int ValidateWorldPosition( double worldPos[3],
126  double worldOrient[9] ) override;
127 
129 
132  vtkGetObjectMacro( CellPicker, vtkCellPicker );
134 
136 
140  vtkGetObjectMacro( Polys, vtkPolyDataCollection );
142 
144 
149  vtkSetMacro( DistanceOffset, double );
150  vtkGetMacro( DistanceOffset, double );
152 
154 
160  vtkSetMacro( SnapToClosestPoint, vtkTypeBool );
161  vtkGetMacro( SnapToClosestPoint, vtkTypeBool );
162  vtkBooleanMacro( SnapToClosestPoint, vtkTypeBool );
164 
166 
170  Node *GetNodeAtWorldPosition( double worldPos[3] );
172 
173 protected:
175  ~vtkPolygonalSurfacePointPlacer() override;
176 
177  // The props that represents the terrain data (one or more) in a rendered
178  // scene
181  vtkPolygonalSurfacePointPlacerInternals *Internals;
184 
185 private:
187  void operator=(const vtkPolygonalSurfacePointPlacer&) = delete;
188 };
189 
190 #endif
vtkPolyDataCollection
maintain a list of polygonal data objects
Definition: vtkPolyDataCollection.h:34
vtkPolygonalSurfacePointPlacer::CellPicker
vtkCellPicker * CellPicker
Definition: vtkPolygonalSurfacePointPlacer.h:179
vtkPolyDataPointPlacer::New
static vtkPolyDataPointPlacer * New()
Instantiate this class.
vtkPolygonalSurfacePointPlacerNode::ParametricCoords
double ParametricCoords[3]
Definition: vtkPolygonalSurfacePointPlacer.h:52
vtkPolyDataPointPlacer::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkPolyDataPointPlacer::AddProp
virtual void AddProp(vtkProp *)
vtkIdType
int vtkIdType
Definition: vtkType.h:347
vtkPolyDataPointPlacer::ValidateDisplayPosition
int ValidateDisplayPosition(vtkRenderer *, double displayPos[2]) override
Given a display position, check the validity of this position.
vtkPolygonalSurfacePointPlacer::Polys
vtkPolyDataCollection * Polys
Definition: vtkPolygonalSurfacePointPlacer.h:180
vtkPolygonalSurfacePointPlacerNode
Definition: vtkPolygonalSurfacePointPlacer.h:46
vtkPolyDataPointPlacer::ValidateWorldPosition
int ValidateWorldPosition(double worldPos[3]) override
Given a world position check the validity of this position according to the constraints of the placer...
vtkPolygonalSurfacePointPlacerNode::PolyData
vtkPolyData * PolyData
Definition: vtkPolygonalSurfacePointPlacer.h:53
vtkPolyDataPointPlacer::RemoveViewProp
virtual void RemoveViewProp(vtkProp *prop)
vtkPolygonalSurfacePointPlacer::SnapToClosestPoint
vtkTypeBool SnapToClosestPoint
Definition: vtkPolygonalSurfacePointPlacer.h:183
vtkPolyDataPointPlacer.h
vtkPolygonalSurfacePointPlacer::Node
vtkPolygonalSurfacePointPlacerNode Node
Internally used by the interpolator.
Definition: vtkPolygonalSurfacePointPlacer.h:162
vtkPolyDataPointPlacer::ComputeWorldPosition
int ComputeWorldPosition(vtkRenderer *ren, double displayPos[2], double worldPos[3], double worldOrient[9]) override
Given a renderer and a display position in pixel coordinates, compute the world position and orientat...
vtkPolygonalSurfacePointPlacerNode::SurfaceWorldPosition
double SurfaceWorldPosition[3]
Definition: vtkPolygonalSurfacePointPlacer.h:49
vtkPolyDataPointPlacer
Base class to place points given constraints on polygonal data.
Definition: vtkPolyDataPointPlacer.h:45
vtkPolygonalSurfacePointPlacerNode::CellId
vtkIdType CellId
Definition: vtkPolygonalSurfacePointPlacer.h:50
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:33
vtkPolyDataPointPlacer::RemoveAllProps
virtual void RemoveAllProps()
vtkPolygonalSurfacePointPlacerNode::PointId
vtkIdType PointId
Definition: vtkPolygonalSurfacePointPlacer.h:51
vtkPolygonalSurfacePointPlacerNode::WorldPosition
double WorldPosition[3]
Definition: vtkPolygonalSurfacePointPlacer.h:48
vtkProp
abstract superclass for all actors, volumes and annotations
Definition: vtkProp.h:46
vtkPolygonalSurfacePointPlacer::DistanceOffset
double DistanceOffset
Definition: vtkPolygonalSurfacePointPlacer.h:182
vtkRenderer
abstract specification for renderers
Definition: vtkRenderer.h:57
vtkPolyData
concrete dataset represents vertices, lines, polygons, and triangle strips
Definition: vtkPolyData.h:79
vtkCellPicker
ray-cast cell picker for all kinds of Prop3Ds
Definition: vtkCellPicker.h:63
vtkPointPlacer::UpdateNodeWorldPosition
virtual int UpdateNodeWorldPosition(double worldPos[3], vtkIdType nodePointId)
Give the placer a chance to update the node information, if any.
vtkPolygonalSurfacePointPlacer
Place points on the surface of polygonal data.
Definition: vtkPolygonalSurfacePointPlacer.h:56
vtkTypeBool
int vtkTypeBool
Definition: vtkABI.h:69
vtkPolygonalSurfacePointPlacer::Internals
vtkPolygonalSurfacePointPlacerInternals * Internals
Definition: vtkPolygonalSurfacePointPlacer.h:181