VTK  9.3.20240328
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
52 #ifndef vtkPolygonalSurfacePointPlacer_h
53 #define vtkPolygonalSurfacePointPlacer_h
54 
55 #include "vtkInteractionWidgetsModule.h" // For export macro
56 #include "vtkPolyDataPointPlacer.h"
57 
58 VTK_ABI_NAMESPACE_BEGIN
60 class vtkCellPicker;
61 class vtkPolygonalSurfacePointPlacerInternals;
62 class vtkPolyData;
63 
64 // The Node stores information about the point. This information is used by
65 // the interpolator. Reusing this information avoids the need for a second
66 // pick operation to regenerate it. (Cellpickers are slow).
68 {
69  double WorldPosition[3];
73  double ParametricCoords[3]; // parametric coords within cell
75 };
76 
77 class VTKINTERACTIONWIDGETS_EXPORT vtkPolygonalSurfacePointPlacer : public vtkPolyDataPointPlacer
78 {
79 public:
84 
86 
90  void PrintSelf(ostream& os, vtkIndent indent) override;
92 
93  // Description:
94  // Add /remove a prop, to place points on
95  void AddProp(vtkProp*) override;
96  void RemoveViewProp(vtkProp* prop) override;
97  void RemoveAllProps() override;
98 
108  vtkRenderer* ren, double displayPos[2], double worldPos[3], double worldOrient[9]) override;
109 
116  int ComputeWorldPosition(vtkRenderer* ren, double displayPos[2], double refWorldPos[3],
117  double worldPos[3], double worldOrient[9]) override;
118 
123  int ValidateWorldPosition(double worldPos[3]) override;
124 
128  int UpdateNodeWorldPosition(double worldPos[3], vtkIdType nodePointId) override;
129 
133  int ValidateDisplayPosition(vtkRenderer*, double displayPos[2]) override;
134 
139  int ValidateWorldPosition(double worldPos[3], double worldOrient[9]) override;
140 
142 
145  vtkGetObjectMacro(CellPicker, vtkCellPicker);
147 
149 
153  vtkGetObjectMacro(Polys, vtkPolyDataCollection);
155 
157 
162  vtkSetMacro(DistanceOffset, double);
163  vtkGetMacro(DistanceOffset, double);
165 
167 
173  vtkSetMacro(SnapToClosestPoint, vtkTypeBool);
174  vtkGetMacro(SnapToClosestPoint, vtkTypeBool);
175  vtkBooleanMacro(SnapToClosestPoint, vtkTypeBool);
177 
179 
183  Node* GetNodeAtWorldPosition(double worldPos[3]);
185 
186 protected:
189 
190  // The props that represents the terrain data (one or more) in a rendered
191  // scene
194  vtkPolygonalSurfacePointPlacerInternals* Internals;
197 
198 private:
200  void operator=(const vtkPolygonalSurfacePointPlacer&) = delete;
201 };
202 
203 VTK_ABI_NAMESPACE_END
204 #endif
ray-cast cell picker for all kinds of Prop3Ds
Definition: vtkCellPicker.h:91
a simple class to control print indentation
Definition: vtkIndent.h:108
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:180
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:65
abstract specification for renderers
Definition: vtkRenderer.h:171
int vtkTypeBool
Definition: vtkABI.h:64
int vtkIdType
Definition: vtkType.h:315