VTK  9.3.0
vtkPolygonalSurfacePointPlacer.h
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
2 // SPDX-License-Identifier: BSD-3-Clause
32 #ifndef vtkPolygonalSurfacePointPlacer_h
33 #define vtkPolygonalSurfacePointPlacer_h
34 
35 #include "vtkInteractionWidgetsModule.h" // For export macro
36 #include "vtkPolyDataPointPlacer.h"
37 
38 VTK_ABI_NAMESPACE_BEGIN
40 class vtkCellPicker;
41 class vtkPolygonalSurfacePointPlacerInternals;
42 class vtkPolyData;
43 
44 // The Node stores information about the point. This information is used by
45 // the interpolator. Reusing this information avoids the need for a second
46 // pick operation to regenerate it. (Cellpickers are slow).
48 {
49  double WorldPosition[3];
53  double ParametricCoords[3]; // parametric coords within cell
55 };
56 
57 class VTKINTERACTIONWIDGETS_EXPORT vtkPolygonalSurfacePointPlacer : public vtkPolyDataPointPlacer
58 {
59 public:
64 
66 
70  void PrintSelf(ostream& os, vtkIndent indent) override;
72 
73  // Description:
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  vtkRenderer* ren, double displayPos[2], double worldPos[3], double worldOrient[9]) override;
89 
96  int ComputeWorldPosition(vtkRenderer* ren, double displayPos[2], double refWorldPos[3],
97  double worldPos[3], double worldOrient[9]) override;
98 
103  int ValidateWorldPosition(double worldPos[3]) override;
104 
108  int UpdateNodeWorldPosition(double worldPos[3], vtkIdType nodePointId) override;
109 
113  int ValidateDisplayPosition(vtkRenderer*, double displayPos[2]) override;
114 
119  int ValidateWorldPosition(double worldPos[3], double worldOrient[9]) override;
120 
122 
125  vtkGetObjectMacro(CellPicker, vtkCellPicker);
127 
129 
133  vtkGetObjectMacro(Polys, vtkPolyDataCollection);
135 
137 
142  vtkSetMacro(DistanceOffset, double);
143  vtkGetMacro(DistanceOffset, double);
145 
147 
153  vtkSetMacro(SnapToClosestPoint, vtkTypeBool);
154  vtkGetMacro(SnapToClosestPoint, vtkTypeBool);
155  vtkBooleanMacro(SnapToClosestPoint, vtkTypeBool);
157 
159 
163  Node* GetNodeAtWorldPosition(double worldPos[3]);
165 
166 protected:
169 
170  // The props that represents the terrain data (one or more) in a rendered
171  // scene
174  vtkPolygonalSurfacePointPlacerInternals* Internals;
177 
178 private:
180  void operator=(const vtkPolygonalSurfacePointPlacer&) = delete;
181 };
182 
183 VTK_ABI_NAMESPACE_END
184 #endif
ray-cast cell picker for all kinds of Prop3Ds
Definition: vtkCellPicker.h:71
a simple class to control print indentation
Definition: vtkIndent.h:38
maintain a list of polygonal data objects
Base class to place points given constraints on polygonal data.
concrete dataset represents vertices, lines, polygons, and triangle strips
Definition: vtkPolyData.h:89
Place points on the surface of polygonal data.
~vtkPolygonalSurfacePointPlacer() override
vtkPolygonalSurfacePointPlacerNode Node
Internally used by the interpolator.
Node * GetNodeAtWorldPosition(double worldPos[3])
Internally used by the interpolator.
int UpdateNodeWorldPosition(double worldPos[3], vtkIdType nodePointId) override
Give the node a chance to update its auxiliary point id.
void AddProp(vtkProp *) override
int ValidateDisplayPosition(vtkRenderer *, double displayPos[2]) override
Given a display position, check the validity of this position.
int ComputeWorldPosition(vtkRenderer *ren, double displayPos[2], double refWorldPos[3], double worldPos[3], double worldOrient[9]) override
Given a renderer, a display position, and a reference world position, compute the new world position ...
int ValidateWorldPosition(double worldPos[3]) override
Given a world position check the validity of this position according to the constraints of the placer...
void PrintSelf(ostream &os, vtkIndent indent) override
Standard methods for instances of this class.
vtkPolygonalSurfacePointPlacerInternals * Internals
int ValidateWorldPosition(double worldPos[3], double worldOrient[9]) override
Given a world position and a world orientation, validate it according to the constraints of the place...
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...
static vtkPolygonalSurfacePointPlacer * New()
Instantiate this class.
void RemoveViewProp(vtkProp *prop) override
abstract superclass for all actors, volumes and annotations
Definition: vtkProp.h:55
abstract specification for renderers
Definition: vtkRenderer.h:71
int vtkTypeBool
Definition: vtkABI.h:64
int vtkIdType
Definition: vtkType.h:315