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
65 #include "vtkPolyDataPointPlacer.h"
66 
68 class vtkCellPicker;
69 class vtkPolygonalSurfacePointPlacerInternals;
70 class 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 
85 class VTKINTERACTIONWIDGETS_EXPORT vtkPolygonalSurfacePointPlacer : public vtkPolyDataPointPlacer
86 {
87 public:
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 
194 protected:
197 
198  // The props that represents the terrain data (one or more) in a rendered
199  // scene
202  vtkPolygonalSurfacePointPlacerInternals* Internals;
205 
206 private:
208  void operator=(const vtkPolygonalSurfacePointPlacer&) = delete;
209 };
210 
211 #endif
vtkPolygonalSurfacePointPlacer::UpdateNodeWorldPosition
int UpdateNodeWorldPosition(double worldPos[3], vtkIdType nodePointId) override
Give the node a chance to update its auxiliary point id.
vtkPolyDataCollection
maintain a list of polygonal data objects
Definition: vtkPolyDataCollection.h:64
vtkPolygonalSurfacePointPlacer::AddProp
void AddProp(vtkProp *) override
vtkPolygonalSurfacePointPlacer::CellPicker
vtkCellPicker * CellPicker
Definition: vtkPolygonalSurfacePointPlacer.h:200
vtkPolygonalSurfacePointPlacerNode::ParametricCoords
double ParametricCoords[3]
Definition: vtkPolygonalSurfacePointPlacer.h:81
vtkIdType
int vtkIdType
Definition: vtkType.h:332
vtkPolygonalSurfacePointPlacer::Polys
vtkPolyDataCollection * Polys
Definition: vtkPolygonalSurfacePointPlacer.h:201
vtkPolygonalSurfacePointPlacerNode
Definition: vtkPolygonalSurfacePointPlacer.h:76
vtkPolygonalSurfacePointPlacer::New
static vtkPolygonalSurfacePointPlacer * New()
Instantiate this class.
vtkPolygonalSurfacePointPlacer::ValidateWorldPosition
int ValidateWorldPosition(double worldPos[3]) override
Given a world position check the validity of this position according to the constraints of the placer...
vtkPolygonalSurfacePointPlacerNode::PolyData
vtkPolyData * PolyData
Definition: vtkPolygonalSurfacePointPlacer.h:82
vtkPolygonalSurfacePointPlacer::RemoveViewProp
void RemoveViewProp(vtkProp *prop) override
vtkPolygonalSurfacePointPlacer::SnapToClosestPoint
vtkTypeBool SnapToClosestPoint
Definition: vtkPolygonalSurfacePointPlacer.h:204
vtkPolyDataPointPlacer.h
vtkPolygonalSurfacePointPlacer::Node
vtkPolygonalSurfacePointPlacerNode Node
Internally used by the interpolator.
Definition: vtkPolygonalSurfacePointPlacer.h:183
vtkPolygonalSurfacePointPlacer::RemoveAllProps
void RemoveAllProps() override
vtkPolygonalSurfacePointPlacerNode::SurfaceWorldPosition
double SurfaceWorldPosition[3]
Definition: vtkPolygonalSurfacePointPlacer.h:78
vtkPolygonalSurfacePointPlacer::~vtkPolygonalSurfacePointPlacer
~vtkPolygonalSurfacePointPlacer() override
vtkPolyDataPointPlacer
Base class to place points given constraints on polygonal data.
Definition: vtkPolyDataPointPlacer.h:46
vtkPolygonalSurfacePointPlacerNode::CellId
vtkIdType CellId
Definition: vtkPolygonalSurfacePointPlacer.h:79
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:113
vtkPolygonalSurfacePointPlacer::ComputeWorldPosition
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...
vtkPolygonalSurfacePointPlacer::ValidateDisplayPosition
int ValidateDisplayPosition(vtkRenderer *, double displayPos[2]) override
Given a display position, check the validity of this position.
vtkPolygonalSurfacePointPlacerNode::PointId
vtkIdType PointId
Definition: vtkPolygonalSurfacePointPlacer.h:80
vtkPolygonalSurfacePointPlacerNode::WorldPosition
double WorldPosition[3]
Definition: vtkPolygonalSurfacePointPlacer.h:77
vtkProp
abstract superclass for all actors, volumes and annotations
Definition: vtkProp.h:76
vtkPolygonalSurfacePointPlacer::DistanceOffset
double DistanceOffset
Definition: vtkPolygonalSurfacePointPlacer.h:203
vtkPolygonalSurfacePointPlacer::ValidateWorldPosition
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...
vtkPolygonalSurfacePointPlacer::GetNodeAtWorldPosition
Node * GetNodeAtWorldPosition(double worldPos[3])
Internally used by the interpolator.
vtkRenderer
abstract specification for renderers
Definition: vtkRenderer.h:182
vtkPolyData
concrete dataset represents vertices, lines, polygons, and triangle strips
Definition: vtkPolyData.h:195
vtkCellPicker
ray-cast cell picker for all kinds of Prop3Ds
Definition: vtkCellPicker.h:96
vtkPolygonalSurfacePointPlacer::vtkPolygonalSurfacePointPlacer
vtkPolygonalSurfacePointPlacer()
vtkPolygonalSurfacePointPlacer
Place points on the surface of polygonal data.
Definition: vtkPolygonalSurfacePointPlacer.h:86
vtkTypeBool
int vtkTypeBool
Definition: vtkABI.h:69
vtkPolygonalSurfacePointPlacer::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent) override
Standard methods for instances of this class.
vtkPolygonalSurfacePointPlacer::Internals
vtkPolygonalSurfacePointPlacerInternals * Internals
Definition: vtkPolygonalSurfacePointPlacer.h:202
vtkPolygonalSurfacePointPlacer::ComputeWorldPosition
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 ...