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
23 #ifndef vtkPolygonalSurfacePointPlacer_h
24 #define vtkPolygonalSurfacePointPlacer_h
25 
26 #include "vtkInteractionWidgetsModule.h" // For export macro
27 #include "vtkPolyDataPointPlacer.h"
28 
29 VTK_ABI_NAMESPACE_BEGIN
31 class vtkCellPicker;
32 class vtkPolygonalSurfacePointPlacerInternals;
33 class vtkPolyData;
34 
35 // The Node stores information about the point. This information is used by
36 // the interpolator. Reusing this information avoids the need for a second
37 // pick operation to regenerate it. (Cellpickers are slow).
39 {
40  double WorldPosition[3];
44  double ParametricCoords[3]; // parametric coords within cell
46 };
47 
48 class VTKINTERACTIONWIDGETS_EXPORT vtkPolygonalSurfacePointPlacer : public vtkPolyDataPointPlacer
49 {
50 public:
55 
57 
61  void PrintSelf(ostream& os, vtkIndent indent) override;
63 
64  // Description:
65  // Add /remove a prop, to place points on
66  void AddProp(vtkProp*) override;
67  void RemoveViewProp(vtkProp* prop) override;
68  void RemoveAllProps() override;
69 
79  vtkRenderer* ren, double displayPos[2], double worldPos[3], double worldOrient[9]) override;
80 
87  int ComputeWorldPosition(vtkRenderer* ren, double displayPos[2], double refWorldPos[3],
88  double worldPos[3], double worldOrient[9]) override;
89 
94  int ValidateWorldPosition(double worldPos[3]) override;
95 
99  int UpdateNodeWorldPosition(double worldPos[3], vtkIdType nodePointId) override;
100 
104  int ValidateDisplayPosition(vtkRenderer*, double displayPos[2]) override;
105 
110  int ValidateWorldPosition(double worldPos[3], double worldOrient[9]) override;
111 
113 
116  vtkGetObjectMacro(CellPicker, vtkCellPicker);
118 
120 
124  vtkGetObjectMacro(Polys, vtkPolyDataCollection);
126 
128 
133  vtkSetMacro(DistanceOffset, double);
134  vtkGetMacro(DistanceOffset, double);
136 
138 
144  vtkSetMacro(SnapToClosestPoint, vtkTypeBool);
145  vtkGetMacro(SnapToClosestPoint, vtkTypeBool);
146  vtkBooleanMacro(SnapToClosestPoint, vtkTypeBool);
148 
150 
154  Node* GetNodeAtWorldPosition(double worldPos[3]);
156 
157 protected:
160 
161  // The props that represents the terrain data (one or more) in a rendered
162  // scene
165  vtkPolygonalSurfacePointPlacerInternals* Internals;
168 
169 private:
171  void operator=(const vtkPolygonalSurfacePointPlacer&) = delete;
172 };
173 
174 VTK_ABI_NAMESPACE_END
175 #endif
ray-cast cell picker for all kinds of Prop3Ds
Definition: vtkCellPicker.h:62
a simple class to control print indentation
Definition: vtkIndent.h:29
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:80
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:46
abstract specification for renderers
Definition: vtkRenderer.h:62
int vtkTypeBool
Definition: vtkABI.h:64
int vtkIdType
Definition: vtkType.h:315