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 =========================================================================*/
35 #ifndef vtkPolygonalSurfacePointPlacer_h
36 #define vtkPolygonalSurfacePointPlacer_h
37 
38 #include "vtkInteractionWidgetsModule.h" // For export macro
39 #include "vtkPolyDataPointPlacer.h"
40 
42 class vtkCellPicker;
43 class vtkPolygonalSurfacePointPlacerInternals;
44 class vtkPolyData;
45 
46 // The Node stores information about the point. This information is used by
47 // the interpolator. Reusing this information avoids the need for a second
48 // pick operation to regenerate it. (Cellpickers are slow).
50 {
51  double WorldPosition[3];
55  double ParametricCoords[3]; // parametric coords within cell
57 };
58 
59 class VTKINTERACTIONWIDGETS_EXPORT vtkPolygonalSurfacePointPlacer : public vtkPolyDataPointPlacer
60 {
61 public:
66 
68 
72  void PrintSelf(ostream& os, vtkIndent indent) override;
74 
75  // Descuription:
76  // Add /remove a prop, to place points on
77  void AddProp(vtkProp*) override;
78  void RemoveViewProp(vtkProp* prop) override;
79  void RemoveAllProps() override;
80 
90  vtkRenderer* ren, double displayPos[2], double worldPos[3], double worldOrient[9]) override;
91 
98  int ComputeWorldPosition(vtkRenderer* ren, double displayPos[2], double refWorldPos[3],
99  double worldPos[3], double worldOrient[9]) override;
100 
105  int ValidateWorldPosition(double worldPos[3]) override;
106 
110  int UpdateNodeWorldPosition(double worldPos[3], vtkIdType nodePointId) override;
111 
115  int ValidateDisplayPosition(vtkRenderer*, double displayPos[2]) override;
116 
121  int ValidateWorldPosition(double worldPos[3], double worldOrient[9]) override;
122 
124 
127  vtkGetObjectMacro(CellPicker, vtkCellPicker);
129 
131 
135  vtkGetObjectMacro(Polys, vtkPolyDataCollection);
137 
139 
144  vtkSetMacro(DistanceOffset, double);
145  vtkGetMacro(DistanceOffset, double);
147 
149 
155  vtkSetMacro(SnapToClosestPoint, vtkTypeBool);
156  vtkGetMacro(SnapToClosestPoint, vtkTypeBool);
157  vtkBooleanMacro(SnapToClosestPoint, vtkTypeBool);
159 
161 
165  Node* GetNodeAtWorldPosition(double worldPos[3]);
167 
168 protected:
170  ~vtkPolygonalSurfacePointPlacer() override;
171 
172  // The props that represents the terrain data (one or more) in a rendered
173  // scene
176  vtkPolygonalSurfacePointPlacerInternals* Internals;
179 
180 private:
182  void operator=(const vtkPolygonalSurfacePointPlacer&) = delete;
183 };
184 
185 #endif
abstract superclass for all actors, volumes and annotations
Definition: vtkProp.h:56
virtual void RemoveAllProps()
vtkPolygonalSurfacePointPlacerNode Node
Internally used by the interpolator.
vtkPolygonalSurfacePointPlacerInternals * Internals
abstract specification for renderers
Definition: vtkRenderer.h:72
int vtkIdType
Definition: vtkType.h:332
concrete dataset represents vertices, lines, polygons, and triangle strips
Definition: vtkPolyData.h:90
Place points on the surface of polygonal data.
int vtkTypeBool
Definition: vtkABI.h:69
a simple class to control print indentation
Definition: vtkIndent.h:39
Base class to place points given constraints on polygonal data.
virtual void AddProp(vtkProp *)
void PrintSelf(ostream &os, vtkIndent indent) override
Standard methods for instances of this class.
int ValidateDisplayPosition(vtkRenderer *, double displayPos[2]) override
Given a display position, check the validity of this position.
static vtkPolyDataPointPlacer * New()
Instantiate this class.
virtual int UpdateNodeWorldPosition(double worldPos[3], vtkIdType nodePointId)
Give the placer a chance to update the node information, if any.
int ValidateWorldPosition(double worldPos[3]) override
Given a world position check the validity of this position according to the constraints of the placer...
ray-cast cell picker for all kinds of Prop3Ds
Definition: vtkCellPicker.h:72
virtual void RemoveViewProp(vtkProp *prop)
maintain a list of polygonal data objects
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...