VTK
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 =========================================================================*/
32 #ifndef vtkPointSet_h
33 #define vtkPointSet_h
34 
35 #include "vtkCommonDataModelModule.h" // For export macro
36 #include "vtkDataSet.h"
37 
38 #include "vtkPoints.h" // Needed for inline methods
39 
40 class vtkPointLocator;
41 
42 class VTKCOMMONDATAMODEL_EXPORT vtkPointSet : public vtkDataSet
43 {
44 public:
45  vtkTypeMacro(vtkPointSet,vtkDataSet);
46  void PrintSelf(ostream& os, vtkIndent indent) override;
47 
51  void Initialize() override;
52 
56  void CopyStructure(vtkDataSet *pd) override;
57 
59 
62  vtkIdType GetNumberOfPoints() override;
63  void GetPoint(vtkIdType ptId, double x[3]) override
64  {this->Points->GetPoint(ptId,x);};
65  vtkIdType FindPoint(double x[3]) override;
66  vtkIdType FindPoint(double x, double y, double z) {
67  return this->vtkDataSet::FindPoint(x, y, z);};
68  vtkIdType FindCell(double x[3], vtkCell *cell, vtkIdType cellId,
69  double tol2, int& subId, double pcoords[3],
70  double *weights) override;
71  vtkIdType FindCell(double x[3], vtkCell *cell,
72  vtkGenericCell *gencell, vtkIdType cellId,
73  double tol2, int& subId, double pcoords[3],
74  double *weights) override;
76 
83  double *GetPoint(vtkIdType ptId) VTK_SIZEHINT(3) override
84  {return this->Points->GetPoint(ptId);};
85 
90 
94  vtkMTimeType GetMTime() override;
95 
99  void ComputeBounds() override;
100 
104  void Squeeze() override;
105 
107 
110  virtual void SetPoints(vtkPoints*);
111  vtkGetObjectMacro(Points,vtkPoints);
113 
122  unsigned long GetActualMemorySize() override;
123 
125 
128  void ShallowCopy(vtkDataObject *src) override;
129  void DeepCopy(vtkDataObject *src) override;
131 
133 
136  void Register(vtkObjectBase* o) override;
137  void UnRegister(vtkObjectBase* o) override;
139 
141 
147 
148 protected:
150  ~vtkPointSet() override;
151 
154 
156 private:
157 
158  void Cleanup();
159 
160  vtkPointSet(const vtkPointSet&) = delete;
161  void operator=(const vtkPointSet&) = delete;
162 };
163 
165 {
166  if (this->Points)
167  {
168  return this->Points->GetNumberOfPoints();
169  }
170  else
171  {
172  return 0;
173  }
174 }
175 
176 
177 #endif
178 
179 
vtkPoints
represent and manipulate 3D points
Definition: vtkPoints.h:40
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.
vtkIdType
int vtkIdType
Definition: vtkType.h:347
vtkPointSet::Locator
vtkPointLocator * Locator
Definition: vtkPointSet.h:153
vtkInformationVector
Store zero or more vtkInformation instances.
Definition: vtkInformationVector.h:42
vtkPointLocator
quickly locate points in 3-space
Definition: vtkPointLocator.h:54
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::FindPoint
vtkIdType FindPoint(double x, double y, double z)
Definition: vtkPointSet.h:66
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:83
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:132
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:42
vtkDataSet::FindPoint
vtkIdType FindPoint(double x, double y, double z)
Locate the closest point to the global coordinate x.
Definition: vtkDataSet.h:197
vtkPointSet::DeepCopy
void DeepCopy(vtkDataObject *src) override
vtkObjectBase
abstract base class for most VTK objects
Definition: vtkObjectBase.h:66
vtkCell
abstract class to specify cell behavior
Definition: vtkCell.h:60
vtkPointSet::vtkPointSet
vtkPointSet()
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:40
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:63
vtkPointSet::Points
vtkPoints * Points
Definition: vtkPointSet.h:152
vtkGarbageCollector
Detect and break reference loops.
Definition: vtkGarbageCollector.h:100
vtkPointSet::UnRegister
void UnRegister(vtkObjectBase *o) override
Decrease the reference count (release by another object).
vtkDataSet.h
vtkDataSet
abstract class to specify dataset behavior
Definition: vtkDataSet.h:63
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:87
vtkX3D::info
@ info
Definition: vtkX3D.h:376
vtkPointSet
abstract class for specifying dataset behavior
Definition: vtkPointSet.h:43
vtkPointSet::ShallowCopy
void ShallowCopy(vtkDataObject *src) override
Shallow and Deep copy.
vtkGenericCell
provides thread-safe access to cells
Definition: vtkGenericCell.h:40
vtkCellIterator
Efficient cell iterator for vtkDataSet topologies.
Definition: vtkCellIterator.h:81
vtkDataObject
general representation of visualization data
Definition: vtkDataObject.h:65
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::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:302
vtkPointSet::FindPoint
vtkIdType FindPoint(double x[3]) override
vtkPointSet::GetNumberOfPoints
vtkIdType GetNumberOfPoints() override
See vtkDataSet for additional information.
Definition: vtkPointSet.h:164