VTK  9.1.0
vtkPointSet.h
Go to the documentation of this file.
1/*=========================================================================
2
3 Program: Visualization Toolkit
4 Module: vtkPointSet.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 vtkPointSet_h
62#define vtkPointSet_h
63
64#include "vtkCommonDataModelModule.h" // For export macro
65#include "vtkDataSet.h"
66
67#include "vtkCellTypes.h" // For GetCellType
68#include "vtkEmptyCell.h" // For GetCell
69#include "vtkGenericCell.h" // For GetCell
70#include "vtkPoints.h" // Needed for inline methods
71
74
75class VTKCOMMONDATAMODEL_EXPORT vtkPointSet : public vtkDataSet
76{
77public:
81 static vtkPointSet* New();
83
85
88 vtkTypeMacro(vtkPointSet, vtkDataSet);
89 void PrintSelf(ostream& os, vtkIndent indent) override;
91
93
102 vtkSetMacro(Editable, bool);
103 vtkGetMacro(Editable, bool);
104 vtkBooleanMacro(Editable, bool);
106
110 void Initialize() override;
111
115 void CopyStructure(vtkDataSet* pd) override;
116
118
121 vtkIdType GetNumberOfPoints() override;
122 void GetPoint(vtkIdType ptId, double x[3]) override { this->Points->GetPoint(ptId, x); }
123 vtkIdType FindPoint(double x[3]) override;
124 vtkIdType FindPoint(double x, double y, double z) { return this->vtkDataSet::FindPoint(x, y, z); }
125 vtkIdType FindCell(double x[3], vtkCell* cell, vtkIdType cellId, double tol2, int& subId,
126 double pcoords[3], double* weights) override;
127 vtkIdType FindCell(double x[3], vtkCell* cell, vtkGenericCell* gencell, vtkIdType cellId,
128 double tol2, int& subId, double pcoords[3], double* weights) override;
130
132
135 vtkIdType GetNumberOfCells() override { return 0; }
136 int GetMaxCellSize() override { return 0; }
138
139 using Superclass::GetCell;
144 vtkCell* GetCell(vtkIdType) override { return this->EmptyCell; }
145
147
150 void GetCellPoints(vtkIdType, vtkIdList* idList) override { idList->Reset(); }
151 void GetPointCells(vtkIdType, vtkIdList* idList) override { idList->Reset(); }
153
157 void GetCell(vtkIdType, vtkGenericCell* cell) override { cell->SetCellTypeToEmptyCell(); }
158
163 int GetCellType(vtkIdType) override { return VTK_EMPTY_CELL; }
164
171 double* GetPoint(vtkIdType ptId) VTK_SIZEHINT(3) override { return this->Points->GetPoint(ptId); }
172
177
179
184 void BuildLocator() { this->BuildPointLocator(); }
186
192
194
201 vtkGetObjectMacro(PointLocator, vtkAbstractPointLocator);
203
205
210 vtkGetObjectMacro(CellLocator, vtkAbstractCellLocator);
212
217
221 void ComputeBounds() override;
222
226 void Squeeze() override;
227
229
232 virtual void SetPoints(vtkPoints*);
233 vtkGetObjectMacro(Points, vtkPoints);
235
244 unsigned long GetActualMemorySize() override;
245
247
250 void ShallowCopy(vtkDataObject* src) override;
251 void DeepCopy(vtkDataObject* src) override;
253
255
258 void Register(vtkObjectBase* o) override;
259 void UnRegister(vtkObjectBase* o) override;
261
263
269
270protected:
272 ~vtkPointSet() override;
273
278
280
281private:
282 void Cleanup();
283 vtkEmptyCell* EmptyCell;
284
285 vtkPointSet(const vtkPointSet&) = delete;
286 void operator=(const vtkPointSet&) = delete;
287};
288
290{
291 if (this->Points)
292 {
293 return this->Points->GetNumberOfPoints();
294 }
295 else
296 {
297 return 0;
298 }
299}
300
301#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:67
general representation of visualization data
Definition: vtkDataObject.h:69
abstract class to specify dataset behavior
Definition: vtkDataSet.h:66
virtual vtkIdType GetNumberOfPoints()=0
Determine the number of points composing the dataset.
vtkIdType FindPoint(double x, double y, double z)
Locate the closest point to the global coordinate x.
Definition: vtkDataSet.h:210
an empty cell used as a place-holder during processing
Definition: vtkEmptyCell.h:30
Detect and break reference loops.
provides thread-safe access to cells
void SetCellTypeToEmptyCell()
list of point or cell ids
Definition: vtkIdList.h:40
void Reset()
Reset to an empty state but retain previously allocated memory.
Definition: vtkIdList.h:154
a simple class to control print indentation
Definition: vtkIndent.h:43
Store zero or more vtkInformation instances.
Store vtkAlgorithm input/output information.
abstract base class for most VTK objects
Definition: vtkObjectBase.h:79
concrete class for storing a set of points
Definition: vtkPointSet.h:76
void GetCellPoints(vtkIdType, vtkIdList *idList) override
This method resets parameter idList, as there is no cell in a vtkPointSet.
Definition: vtkPointSet.h:150
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.
vtkIdType FindPoint(double x, double y, double z)
See vtkDataSet for additional information.
Definition: vtkPointSet.h:124
void GetPointCells(vtkIdType, vtkIdList *idList) override
This method resets parameter idList, as there is no cell in a vtkPointSet.
Definition: vtkPointSet.h:151
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 internal point locator .
void PrintSelf(ostream &os, vtkIndent indent) override
Standard methdos 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.
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.
vtkAbstractPointLocator * PointLocator
Definition: vtkPointSet.h:276
void UnRegister(vtkObjectBase *o) override
Overwritten to handle the data/locator loop.
void Register(vtkObjectBase *o) override
Overwritten to handle the data/locator loop.
void BuildLocator()
Build the internal point locator .
Definition: vtkPointSet.h:184
vtkIdType FindCell(double x[3], vtkCell *cell, vtkIdType cellId, double tol2, int &subId, double pcoords[3], double *weights) override
See vtkDataSet for additional information.
vtkAbstractCellLocator * CellLocator
Definition: vtkPointSet.h:277
void BuildCellLocator()
Build the cell locator.
void ComputeBounds() override
Compute the (X, Y, Z) bounds of the data.
vtkPoints * Points
Definition: vtkPointSet.h:275
vtkIdType GetNumberOfCells() override
This method always returns 0, as there are no cells in a vtkPointSet.
Definition: vtkPointSet.h:135
static vtkPointSet * GetData(vtkInformation *info)
Retrieve an instance of this class from an information object.
vtkIdType GetNumberOfPoints() override
See vtkDataSet for additional information.
Definition: vtkPointSet.h:289
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.
Definition: vtkPointSet.h:122
void ReportReferences(vtkGarbageCollector *) override
void GetCell(vtkIdType, vtkGenericCell *cell) override
This method sets cell to be an empty cell.
Definition: vtkPointSet.h:157
vtkCell * GetCell(vtkIdType) override
This method always return a vtkEmptyCell, as there is no cell in a vtkPointSet.
Definition: vtkPointSet.h:144
int GetCellType(vtkIdType) override
This method always returns VTK_EMPTY_CELL, as there is no cell in a vtkPointSet.
Definition: vtkPointSet.h:163
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.
Definition: vtkPointSet.h:136
double * GetPoint(vtkIdType ptId) override
See vtkDataSet for additional information.
Definition: vtkPointSet.h:171
represent and manipulate 3D points
Definition: vtkPoints.h:43
vtkIdType GetNumberOfPoints() const
Return number of points in array.
Definition: vtkPoints.h:135
@ info
Definition: vtkX3D.h:382
@ VTK_EMPTY_CELL
Definition: vtkCellType.h:46
int vtkIdType
Definition: vtkType.h:332
vtkTypeUInt32 vtkMTimeType
Definition: vtkType.h:287
#define VTK_SIZEHINT(...)