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:
63  static vtkPolygonalSurfacePointPlacer *New();
64 
66 
70  void PrintSelf(ostream& os, vtkIndent indent) VTK_OVERRIDE;
72 
73  // Descuription:
74  // Add /remove a prop, to place points on
75  void AddProp( vtkProp * ) VTK_OVERRIDE;
76  void RemoveViewProp(vtkProp *prop) VTK_OVERRIDE;
77  void RemoveAllProps() VTK_OVERRIDE;
78 
87  int ComputeWorldPosition( vtkRenderer *ren,
88  double displayPos[2],
89  double worldPos[3],
90  double worldOrient[9] ) VTK_OVERRIDE;
91 
98  int ComputeWorldPosition( vtkRenderer *ren,
99  double displayPos[2],
100  double refWorldPos[3],
101  double worldPos[3],
102  double worldOrient[9] ) VTK_OVERRIDE;
103 
108  int ValidateWorldPosition( double worldPos[3] ) VTK_OVERRIDE;
109 
113  int UpdateNodeWorldPosition( double worldPos[3],
114  vtkIdType nodePointId ) VTK_OVERRIDE;
115 
119  int ValidateDisplayPosition( vtkRenderer *, double displayPos[2] ) VTK_OVERRIDE;
120 
125  int ValidateWorldPosition( double worldPos[3],
126  double worldOrient[9] ) VTK_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, int );
161  vtkGetMacro( SnapToClosestPoint, int );
162  vtkBooleanMacro( SnapToClosestPoint, int );
164 
166 
170  Node *GetNodeAtWorldPosition( double worldPos[3] );
172 
173 protected:
175  ~vtkPolygonalSurfacePointPlacer() VTK_OVERRIDE;
176 
177  // The props that represents the terrain data (one or more) in a rendered
178  // scene
179  vtkCellPicker *CellPicker;
180  vtkPolyDataCollection *Polys;
181  vtkPolygonalSurfacePointPlacerInternals *Internals;
182  double DistanceOffset;
183  int SnapToClosestPoint;
184 
185 private:
186  vtkPolygonalSurfacePointPlacer(const vtkPolygonalSurfacePointPlacer&) VTK_DELETE_FUNCTION;
187  void operator=(const vtkPolygonalSurfacePointPlacer&) VTK_DELETE_FUNCTION;
188 };
189 
190 #endif
abstract superclass for all actors, volumes and annotations
Definition: vtkProp.h:44
abstract specification for renderers
Definition: vtkRenderer.h:57
int vtkIdType
Definition: vtkType.h:345
concrete dataset represents vertices, lines, polygons, and triangle strips
Definition: vtkPolyData.h:79
Place points on the surface of polygonal data.
a simple class to control print indentation
Definition: vtkIndent.h:33
Base class to place points given constraints on polygonal data.
vtkSetMacro(IgnoreDriverBugs, bool)
When set known driver bugs are ignored during driver feature detection.
ray-cast cell picker for all kinds of Prop3Ds
Definition: vtkCellPicker.h:63
vtkBooleanMacro(IgnoreDriverBugs, bool)
When set known driver bugs are ignored during driver feature detection.
maintain a list of polygonal data objects