VTK  9.7.20260805
vtkPointSet.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
42
43#ifndef vtkPointSet_h
44#define vtkPointSet_h
45
46#include "vtkCommonDataModelModule.h" // For export macro
47#include "vtkDataSet.h"
48#include "vtkWrappingHints.h" // For VTK_MARSHALAUTO
49
50#include "vtkCellTypes.h" // For GetCellType
51#include "vtkGenericCell.h" // For GetCell
52#include "vtkPoints.h" // Needed for inline methods
53
54VTK_ABI_NAMESPACE_BEGIN
57
58class VTKCOMMONDATAMODEL_EXPORT VTK_MARSHALAUTO vtkPointSet : public vtkDataSet
59{
60public:
64 static vtkPointSet* New();
66
68
71 vtkTypeMacro(vtkPointSet, vtkDataSet);
72 void PrintSelf(ostream& os, vtkIndent indent) override;
74
78 int GetDataObjectType() VTK_FUTURE_CONST override { return VTK_POINT_SET; }
79
81
90 vtkSetMacro(Editable, bool);
91 vtkGetMacro(Editable, bool);
92 vtkBooleanMacro(Editable, bool);
94
98 void Initialize() override;
99
103 void CopyStructure(vtkDataSet* pd) override;
104
106
109 vtkIdType GetNumberOfPoints() override;
110 void GetPoint(vtkIdType ptId, double x[3]) override { this->Points->GetPoint(ptId, x); }
111 vtkIdType FindPoint(double x[3]) override;
113 vtkIdType FindCell(double x[3], vtkCell* cell, vtkGenericCell* gencell, vtkIdType cellId,
114 double tol2, int& subId, double pcoords[3], double* weights) override;
116
118
121 vtkIdType GetNumberOfCells() override { return 0; }
122 int GetMaxCellSize() override { return 0; }
124
125 using Superclass::GetCell;
131
133
137 void GetCellPoints(vtkIdType, vtkIdList* idList) override { idList->Reset(); }
138 void GetPointCells(vtkIdType, vtkIdList* idList) override { idList->Reset(); }
140
144 void GetCell(vtkIdType, vtkGenericCell* cell) override { cell->SetCellTypeToEmptyCell(); }
145
150 int GetCellType(vtkIdType) override { return VTK_EMPTY_CELL; }
151
156 vtkIdType GetCellSize(vtkIdType) override { return 1; }
157
164 double* GetPoint(vtkIdType ptId) VTK_SIZEHINT(3) override { return this->Points->GetPoint(ptId); }
165
170
172
177 VTK_DEPRECATED_IN_9_7_0("Use BuildPointLocator() instead.")
178 void BuildLocator() { this->BuildPointLocator(); }
180
186
188
199
201
210
215
219 void ComputeBounds() override;
220
224 void Squeeze() override;
225
227
230 virtual void SetPoints(vtkPoints*);
231 vtkPoints* GetPoints() override { return this->Points; }
233
242 unsigned long GetActualMemorySize() override;
243
245
248 void ShallowCopy(vtkDataObject* src) override;
249 void DeepCopy(vtkDataObject* src) override;
251
253
256 bool UsesGarbageCollector() const override { return true; }
258
260
266
267protected:
269 ~vtkPointSet() override;
270
275
277
278private:
279 void Cleanup();
280
281 vtkPointSet(const vtkPointSet&) = delete;
282 void operator=(const vtkPointSet&) = delete;
283};
284
286{
287 if (this->Points)
288 {
289 return this->Points->GetNumberOfPoints();
290 }
291 else
292 {
293 return 0;
294 }
295}
296
297VTK_ABI_NAMESPACE_END
298#endif
an abstract base class for locators which find cells
abstract class to quickly locate points in 3-space
Efficient cell iterator for vtkDataSet topologies.
abstract class to specify cell behavior
Definition vtkCell.h:51
virtual vtkIdType FindCell(double x[3], vtkCell *cell, vtkIdType cellId, double tol2, int &subId, double pcoords[3], double *weights)
Locate cell based on global coordinate x and tolerance squared.
virtual vtkIdType GetNumberOfPoints()=0
Determine the number of points composing the dataset.
virtual void GetCellPoints(vtkIdType cellId, vtkIdList *ptIds)=0
Topological inquiry to get points defining cell.
Detect and break reference loops.
provides thread-safe access to cells
void SetCellTypeToEmptyCell()
list of point or cell ids
Definition vtkIdList.h:26
void Reset()
Reset to an empty state but retain previously allocated memory.
Definition vtkIdList.h:186
a simple class to control print indentation
Definition vtkIndent.h:29
Store zero or more vtkInformation instances.
Store vtkAlgorithm input/output information.
void GetCellPoints(vtkIdType, vtkIdList *idList) override
This method resets parameter idList, as there is no cell in a vtkPointSet.
void CopyStructure(vtkDataSet *pd) override
Copy the geometric structure of an input point set object.
void Initialize() override
Reset to an empty state and free any memory.
void GetPointCells(vtkIdType, vtkIdList *idList) override
This method resets parameter idList, as there is no cell in a vtkPointSet.
virtual void SetCellLocator(vtkAbstractCellLocator *)
Set / get an instance of vtkAbstractCellLocator which may be used when a vtkCellLocatorStrategy is us...
static vtkPointSet * ExtendedNew()
void BuildPointLocator()
Build the point locator.
void PrintSelf(ostream &os, vtkIndent indent) override
Standard methods for type information and printing.
virtual void SetPoints(vtkPoints *)
Specify point array to define point coordinates.
~vtkPointSet() override
virtual void SetPointLocator(vtkAbstractPointLocator *)
Set / get an instance of vtkAbstractPointLocator which is used to support the FindPoint() and FindCel...
void ShallowCopy(vtkDataObject *src) override
Shallow and Deep copy.
bool UsesGarbageCollector() const override
Overwritten to handle the data/locator loop.
vtkIdType GetCellSize(vtkIdType) override
This method always returns 1, as all cells are point in a pure vtkPointSet.
vtkCellIterator * NewCellIterator() override
Return an iterator that traverses the cells in this data set.
void Squeeze() override
Reclaim any unused memory.
vtkIdType FindPoint(double x[3]) override
See vtkDataSet for additional information.
static vtkPointSet * GetData(vtkInformationVector *v, int i=0)
Retrieve an instance of this class from an information object.
static vtkPointSet * New()
Standard instantiation method.
vtkIdType FindCell(double x[3], vtkCell *cell, vtkGenericCell *gencell, vtkIdType cellId, double tol2, int &subId, double pcoords[3], double *weights) override
See vtkDataSet for additional information.
vtkPoints * GetPoints() override
Specify point array to define point coordinates.
vtkAbstractPointLocator * PointLocator
void BuildLocator()
Build the point locator.
vtkAbstractCellLocator * CellLocator
void BuildCellLocator()
Build the cell locator.
void ComputeBounds() override
Compute the (X, Y, Z) bounds of the data.
vtkPoints * Points
vtkIdType GetNumberOfCells() override
This method always returns 0, as there are no cells in a vtkPointSet.
static vtkPointSet * GetData(vtkInformation *info)
Retrieve an instance of this class from an information object.
vtkIdType GetNumberOfPoints() override
See vtkDataSet for additional information.
vtkMTimeType GetMTime() override
Get MTime which also considers its vtkPoints MTime.
void DeepCopy(vtkDataObject *src) override
Shallow and Deep copy.
void GetPoint(vtkIdType ptId, double x[3]) override
See vtkDataSet for additional information.
void ReportReferences(vtkGarbageCollector *) override
void GetCell(vtkIdType, vtkGenericCell *cell) override
This method sets cell to be an empty cell.
vtkCell * GetCell(vtkIdType) override
This method always return a vtkEmptyCell, as there is no cell in a vtkPointSet.
int GetCellType(vtkIdType) override
This method always returns VTK_EMPTY_CELL, as there is no cell in a vtkPointSet.
int GetDataObjectType() VTK_FUTURE_CONST override
Standard vtkDataSet API methods.
Definition vtkPointSet.h:78
unsigned long GetActualMemorySize() override
Return the actual size of the data in kibibytes (1024 bytes).
int GetMaxCellSize() override
This method always returns 0, as there are no cells in a vtkPointSet.
double * GetPoint(vtkIdType ptId) override
See vtkDataSet for additional information.
represent and manipulate 3D points
Definition vtkPoints.h:31
@ VTK_EMPTY_CELL
Definition vtkCellType.h:37
#define VTK_DEPRECATED_IN_9_7_0(reason)
int vtkIdType
Definition vtkType.h:363
vtkTypeUInt32 vtkMTimeType
Definition vtkType.h:318
@ VTK_POINT_SET
Definition vtkType.h:118
#define VTK_SIZEHINT(...)
#define VTK_MARSHAL_EXCLUDE_REASON_NOT_SUPPORTED
#define VTK_MARSHALAUTO
#define VTK_MARSHALEXCLUDE(reason)