VTK  9.1.0
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=========================================================================*/
61#ifndef vtkPolygonalSurfacePointPlacer_h
62#define vtkPolygonalSurfacePointPlacer_h
63
64#include "vtkInteractionWidgetsModule.h" // For export macro
66
68class vtkCellPicker;
69class vtkPolygonalSurfacePointPlacerInternals;
70class vtkPolyData;
71
72// The Node stores information about the point. This information is used by
73// the interpolator. Reusing this information avoids the need for a second
74// pick operation to regenerate it. (Cellpickers are slow).
76{
77 double WorldPosition[3];
81 double ParametricCoords[3]; // parametric coords within cell
83};
84
85class VTKINTERACTIONWIDGETS_EXPORT vtkPolygonalSurfacePointPlacer : public vtkPolyDataPointPlacer
86{
87public:
92
94
98 void PrintSelf(ostream& os, vtkIndent indent) override;
100
101 // Descuription:
102 // Add /remove a prop, to place points on
103 void AddProp(vtkProp*) override;
104 void RemoveViewProp(vtkProp* prop) override;
105 void RemoveAllProps() override;
106
116 vtkRenderer* ren, double displayPos[2], double worldPos[3], double worldOrient[9]) override;
117
124 int ComputeWorldPosition(vtkRenderer* ren, double displayPos[2], double refWorldPos[3],
125 double worldPos[3], double worldOrient[9]) override;
126
131 int ValidateWorldPosition(double worldPos[3]) override;
132
136 int UpdateNodeWorldPosition(double worldPos[3], vtkIdType nodePointId) override;
137
141 int ValidateDisplayPosition(vtkRenderer*, double displayPos[2]) override;
142
147 int ValidateWorldPosition(double worldPos[3], double worldOrient[9]) override;
148
150
153 vtkGetObjectMacro(CellPicker, vtkCellPicker);
155
157
161 vtkGetObjectMacro(Polys, vtkPolyDataCollection);
163
165
170 vtkSetMacro(DistanceOffset, double);
171 vtkGetMacro(DistanceOffset, double);
173
175
181 vtkSetMacro(SnapToClosestPoint, vtkTypeBool);
182 vtkGetMacro(SnapToClosestPoint, vtkTypeBool);
183 vtkBooleanMacro(SnapToClosestPoint, vtkTypeBool);
185
187
191 Node* GetNodeAtWorldPosition(double worldPos[3]);
193
194protected:
197
198 // The props that represents the terrain data (one or more) in a rendered
199 // scene
202 vtkPolygonalSurfacePointPlacerInternals* Internals;
205
206private:
208 void operator=(const vtkPolygonalSurfacePointPlacer&) = delete;
209};
210
211#endif
ray-cast cell picker for all kinds of Prop3Ds
Definition: vtkCellPicker.h:96
a simple class to control print indentation
Definition: vtkIndent.h:113
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:195
Place points on the surface of polygonal data.
~vtkPolygonalSurfacePointPlacer() override
vtkPolygonalSurfacePointPlacerNode Node
Internally used by the interpolator.
static vtkPolygonalSurfacePointPlacer * New()
Instantiate this class.
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.
Node * GetNodeAtWorldPosition(double worldPos[3])
Internally used by the interpolator.
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...
void RemoveViewProp(vtkProp *prop) override
abstract superclass for all actors, volumes and annotations
Definition: vtkProp.h:67
abstract specification for renderers
Definition: vtkRenderer.h:173
int vtkTypeBool
Definition: vtkABI.h:69
int vtkIdType
Definition: vtkType.h:332