VTK  9.0.1
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 =========================================================================*/
51 #ifndef vtkPointSet_h
52 #define vtkPointSet_h
53 
54 #include "vtkCommonDataModelModule.h" // For export macro
55 #include "vtkDataSet.h"
56 
57 #include "vtkPoints.h" // Needed for inline methods
58 
61 
62 class VTKCOMMONDATAMODEL_EXPORT vtkPointSet : public vtkDataSet
63 {
64 public:
66 
69  vtkTypeMacro(vtkPointSet, vtkDataSet);
70  void PrintSelf(ostream& os, vtkIndent indent) override;
71 
73 
82  vtkSetMacro(Editable, bool);
83  vtkGetMacro(Editable, bool);
84  vtkBooleanMacro(Editable, bool);
86 
90  void Initialize() override;
91 
95  void CopyStructure(vtkDataSet* pd) override;
96 
98 
101  vtkIdType GetNumberOfPoints() override;
102  void GetPoint(vtkIdType ptId, double x[3]) override { this->Points->GetPoint(ptId, x); }
103  vtkIdType FindPoint(double x[3]) override;
104  vtkIdType FindPoint(double x, double y, double z) { return this->vtkDataSet::FindPoint(x, y, z); }
105  vtkIdType FindCell(double x[3], vtkCell* cell, vtkIdType cellId, double tol2, int& subId,
106  double pcoords[3], double* weights) override;
107  vtkIdType FindCell(double x[3], vtkCell* cell, vtkGenericCell* gencell, vtkIdType cellId,
108  double tol2, int& subId, double pcoords[3], double* weights) override;
110 
117  double* GetPoint(vtkIdType ptId) VTK_SIZEHINT(3) override { return this->Points->GetPoint(ptId); }
118 
123 
125 
130  void BuildLocator() { this->BuildPointLocator(); }
132 
138 
140 
147  vtkGetObjectMacro(PointLocator, vtkAbstractPointLocator);
149 
151 
156  vtkGetObjectMacro(CellLocator, vtkAbstractCellLocator);
158 
162  vtkMTimeType GetMTime() override;
163 
167  void ComputeBounds() override;
168 
172  void Squeeze() override;
173 
175 
178  virtual void SetPoints(vtkPoints*);
179  vtkGetObjectMacro(Points, vtkPoints);
181 
190  unsigned long GetActualMemorySize() override;
191 
193 
196  void ShallowCopy(vtkDataObject* src) override;
197  void DeepCopy(vtkDataObject* src) override;
199 
201 
204  void Register(vtkObjectBase* o) override;
205  void UnRegister(vtkObjectBase* o) override;
207 
209 
213  static vtkPointSet* GetData(vtkInformationVector* v, int i = 0);
215 
216 protected:
218  ~vtkPointSet() override;
219 
220  bool Editable;
224 
226 
227 private:
228  void Cleanup();
229 
230  vtkPointSet(const vtkPointSet&) = delete;
231  void operator=(const vtkPointSet&) = delete;
232 };
233 
235 {
236  if (this->Points)
237  {
238  return this->Points->GetNumberOfPoints();
239  }
240  else
241  {
242  return 0;
243  }
244 }
245 
246 #endif
vtkPoints
represent and manipulate 3D points
Definition: vtkPoints.h:34
vtkDataSet::GetNumberOfPoints
virtual vtkIdType GetNumberOfPoints()=0
Determine the number of points composing the dataset.
vtkPointSet::FindCell
vtkIdType FindCell(double x[3], vtkCell *cell, vtkIdType cellId, double tol2, int &subId, double pcoords[3], double *weights) override
Locate cell based on global coordinate x and tolerance squared.
vtkPointSet::BuildCellLocator
void BuildCellLocator()
Build the cell locator.
vtkIdType
int vtkIdType
Definition: vtkType.h:338
vtkInformationVector
Store zero or more vtkInformation instances.
Definition: vtkInformationVector.h:36
vtkPoints.h
vtkPointSet::SetPoints
virtual void SetPoints(vtkPoints *)
Specify point array to define point coordinates.
vtkPointSet::Squeeze
void Squeeze() override
Reclaim any unused memory.
vtkPointSet::PointLocator
vtkAbstractPointLocator * PointLocator
Definition: vtkPointSet.h:222
vtkPointSet::FindPoint
vtkIdType FindPoint(double x, double y, double z)
Definition: vtkPointSet.h:104
vtkPointSet::Register
void Register(vtkObjectBase *o) override
Overwritten to handle the data/locator loop.
vtkPointSet::GetPoint
double * GetPoint(vtkIdType ptId) override
See vtkDataSet for additional information.
Definition: vtkPointSet.h:117
vtkPointSet::GetData
static vtkPointSet * GetData(vtkInformation *info)
Retrieve an instance of this class from an information object.
vtkPointSet::~vtkPointSet
~vtkPointSet() override
vtkPoints::GetNumberOfPoints
vtkIdType GetNumberOfPoints()
Return number of points in array.
Definition: vtkPoints.h:125
vtkPointSet::FindCell
vtkIdType FindCell(double x[3], vtkCell *cell, vtkGenericCell *gencell, vtkIdType cellId, double tol2, int &subId, double pcoords[3], double *weights) override
This is a version of the above method that can be used with multithreaded applications.
vtkPointSet::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
VTK_SIZEHINT
#define VTK_SIZEHINT(...)
Definition: vtkWrappingHints.h:45
vtkDataSet::FindPoint
vtkIdType FindPoint(double x, double y, double z)
Locate the closest point to the global coordinate x.
Definition: vtkDataSet.h:193
vtkPointSet::SetPointLocator
virtual void SetPointLocator(vtkAbstractPointLocator *)
Set / get an instance of vtkAbstractPointLocator which is used to support the FindPoint() and FindCel...
vtkPointSet::DeepCopy
void DeepCopy(vtkDataObject *src) override
vtkObjectBase
abstract base class for most VTK objects
Definition: vtkObjectBase.h:64
vtkCell
abstract class to specify cell behavior
Definition: vtkCell.h:57
vtkPointSet::vtkPointSet
vtkPointSet()
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:34
vtkPointSet::Initialize
void Initialize() override
Reset to an empty state and free any memory.
vtkPointSet::GetMTime
vtkMTimeType GetMTime() override
Get MTime which also considers its vtkPoints MTime.
vtkPointSet::GetPoint
void GetPoint(vtkIdType ptId, double x[3]) override
Copy point coordinates into user provided array x[3] for specified point id.
Definition: vtkPointSet.h:102
vtkPointSet::Points
vtkPoints * Points
Definition: vtkPointSet.h:221
vtkAbstractCellLocator
an abstract base class for locators which find cells
Definition: vtkAbstractCellLocator.h:49
vtkGarbageCollector
Detect and break reference loops.
Definition: vtkGarbageCollector.h:95
vtkPointSet::UnRegister
void UnRegister(vtkObjectBase *o) override
Decrease the reference count (release by another object).
vtkPointSet::BuildLocator
void BuildLocator()
Definition: vtkPointSet.h:130
vtkDataSet.h
vtkDataSet
abstract class to specify dataset behavior
Definition: vtkDataSet.h:57
vtkPointSet::NewCellIterator
vtkCellIterator * NewCellIterator() override
Return an iterator that traverses the cells in this data set.
vtkInformation
Store vtkAlgorithm input/output information.
Definition: vtkInformation.h:65
vtkX3D::info
@ info
Definition: vtkX3D.h:382
vtkPointSet
abstract class for specifying dataset behavior
Definition: vtkPointSet.h:63
vtkPointSet::BuildPointLocator
void BuildPointLocator()
Build the internal point locator .
vtkPointSet::ShallowCopy
void ShallowCopy(vtkDataObject *src) override
Shallow and Deep copy.
vtkAbstractPointLocator
abstract class to quickly locate points in 3-space
Definition: vtkAbstractPointLocator.h:39
vtkGenericCell
provides thread-safe access to cells
Definition: vtkGenericCell.h:37
vtkCellIterator
Efficient cell iterator for vtkDataSet topologies.
Definition: vtkCellIterator.h:78
vtkPointSet::SetCellLocator
virtual void SetCellLocator(vtkAbstractCellLocator *)
Set / get an instance of vtkAbstractCellLocator which may be used when a vtkCellLocatorStrategy is us...
vtkDataObject
general representation of visualization data
Definition: vtkDataObject.h:60
vtkPointSet::GetActualMemorySize
unsigned long GetActualMemorySize() override
Return the actual size of the data in kibibytes (1024 bytes).
vtkPointSet::CopyStructure
void CopyStructure(vtkDataSet *pd) override
Copy the geometric structure of an input point set object.
vtkPointSet::CellLocator
vtkAbstractCellLocator * CellLocator
Definition: vtkPointSet.h:223
vtkPointSet::ReportReferences
void ReportReferences(vtkGarbageCollector *) override
vtkPointSet::GetData
static vtkPointSet * GetData(vtkInformationVector *v, int i=0)
vtkPointSet::ComputeBounds
void ComputeBounds() override
Compute the (X, Y, Z) bounds of the data.
vtkMTimeType
vtkTypeUInt32 vtkMTimeType
Definition: vtkType.h:293
vtkPointSet::FindPoint
vtkIdType FindPoint(double x[3]) override
vtkPointSet::GetNumberOfPoints
vtkIdType GetNumberOfPoints() override
See vtkDataSet for additional information.
Definition: vtkPointSet.h:234
vtkPointSet::Editable
bool Editable
Definition: vtkPointSet.h:220