VTK  9.2.6
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 =========================================================================*/
64 #ifndef vtkPolygonalSurfacePointPlacer_h
65 #define vtkPolygonalSurfacePointPlacer_h
66 
67 #include "vtkInteractionWidgetsModule.h" // For export macro
68 #include "vtkPolyDataPointPlacer.h"
69 
71 class vtkCellPicker;
72 class vtkPolygonalSurfacePointPlacerInternals;
73 class vtkPolyData;
74 
75 // The Node stores information about the point. This information is used by
76 // the interpolator. Reusing this information avoids the need for a second
77 // pick operation to regenerate it. (Cellpickers are slow).
79 {
80  double WorldPosition[3];
84  double ParametricCoords[3]; // parametric coords within cell
86 };
87 
88 class VTKINTERACTIONWIDGETS_EXPORT vtkPolygonalSurfacePointPlacer : public vtkPolyDataPointPlacer
89 {
90 public:
95 
97 
101  void PrintSelf(ostream& os, vtkIndent indent) override;
103 
104  // Descuription:
105  // Add /remove a prop, to place points on
106  void AddProp(vtkProp*) override;
107  void RemoveViewProp(vtkProp* prop) override;
108  void RemoveAllProps() override;
109 
119  vtkRenderer* ren, double displayPos[2], double worldPos[3], double worldOrient[9]) override;
120 
127  int ComputeWorldPosition(vtkRenderer* ren, double displayPos[2], double refWorldPos[3],
128  double worldPos[3], double worldOrient[9]) override;
129 
134  int ValidateWorldPosition(double worldPos[3]) override;
135 
139  int UpdateNodeWorldPosition(double worldPos[3], vtkIdType nodePointId) override;
140 
144  int ValidateDisplayPosition(vtkRenderer*, double displayPos[2]) override;
145 
150  int ValidateWorldPosition(double worldPos[3], double worldOrient[9]) override;
151 
153 
156  vtkGetObjectMacro(CellPicker, vtkCellPicker);
158 
160 
164  vtkGetObjectMacro(Polys, vtkPolyDataCollection);
166 
168 
173  vtkSetMacro(DistanceOffset, double);
174  vtkGetMacro(DistanceOffset, double);
176 
178 
184  vtkSetMacro(SnapToClosestPoint, vtkTypeBool);
185  vtkGetMacro(SnapToClosestPoint, vtkTypeBool);
186  vtkBooleanMacro(SnapToClosestPoint, vtkTypeBool);
188 
190 
194  Node* GetNodeAtWorldPosition(double worldPos[3]);
196 
197 protected:
200 
201  // The props that represents the terrain data (one or more) in a rendered
202  // scene
205  vtkPolygonalSurfacePointPlacerInternals* Internals;
208 
209 private:
211  void operator=(const vtkPolygonalSurfacePointPlacer&) = delete;
212 };
213 
214 #endif
ray-cast cell picker for all kinds of Prop3Ds
a simple class to control print indentation
Definition: vtkIndent.h:119
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:200
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:76
abstract specification for renderers
Definition: vtkRenderer.h:182
int vtkTypeBool
Definition: vtkABI.h:69
int vtkIdType
Definition: vtkType.h:332