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 =========================================================================*/
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 
122  vtkCellIterator* NewCellIterator() override;
123 
125 
129  void BuildPointLocator();
130  void BuildLocator() { this->BuildPointLocator(); }
132 
137  void BuildCellLocator();
138 
140 
146  virtual void SetPointLocator(vtkAbstractPointLocator*);
147  vtkGetObjectMacro(PointLocator, vtkAbstractPointLocator);
149 
151 
155  virtual void SetCellLocator(vtkAbstractCellLocator*);
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:
217  vtkPointSet();
218  ~vtkPointSet() override;
219 
220  bool Editable;
224 
225  void ReportReferences(vtkGarbageCollector*) override;
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:33
vtkDataSet::GetNumberOfPoints
virtual vtkIdType GetNumberOfPoints()=0
Determine the number of points composing the dataset.
vtkDataSet::GetActualMemorySize
unsigned long GetActualMemorySize() override
Return the actual size of the data in kibibytes (1024 bytes).
vtkDataSet::ShallowCopy
void ShallowCopy(vtkDataObject *src) override
Shallow and Deep copy.
vtkIdType
int vtkIdType
Definition: vtkType.h:343
vtkObjectBase::Register
virtual void Register(vtkObjectBase *o)
Increase the reference count (mark as used by another object).
vtkInformationVector
Store zero or more vtkInformation instances.
Definition: vtkInformationVector.h:35
vtkObjectBase::ReportReferences
virtual void ReportReferences(vtkGarbageCollector *)
vtkPoints.h
vtkDataSet::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkPointSet::PointLocator
vtkAbstractPointLocator * PointLocator
Definition: vtkPointSet.h:222
vtkDataSet::GetData
static vtkDataSet * GetData(vtkInformation *info)
Retrieve an instance of this class from an information object.
vtkPointSet::FindPoint
vtkIdType FindPoint(double x, double y, double z)
Definition: vtkPointSet.h:104
vtkPointSet::GetPoint
double * GetPoint(vtkIdType ptId) override
See vtkDataSet for additional information.
Definition: vtkPointSet.h:117
vtkDataSet::FindCell
virtual vtkIdType FindCell(double x[3], vtkCell *cell, vtkIdType cellId, double tol2, int &subId, double pcoords[3], double *weights)=0
Locate cell based on global coordinate x and tolerance squared.
vtkDataSet::ComputeBounds
virtual void ComputeBounds()
Compute the data bounding box from data points.
vtkPoints::GetNumberOfPoints
vtkIdType GetNumberOfPoints()
Return number of points in array.
Definition: vtkPoints.h:125
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
vtkObjectBase
abstract base class for most VTK objects
Definition: vtkObjectBase.h:63
vtkDataSet::GetMTime
vtkMTimeType GetMTime() override
Datasets are composite objects and need to check each part for MTime THIS METHOD IS THREAD SAFE.
vtkCell
abstract class to specify cell behavior
Definition: vtkCell.h:56
vtkDataSet::Squeeze
virtual void Squeeze()
Reclaim any extra memory used to store data.
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:33
vtkDataSet::Initialize
void Initialize() override
Restore data object to initial state.
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:48
vtkGarbageCollector
Detect and break reference loops.
Definition: vtkGarbageCollector.h:94
vtkPointSet::BuildLocator
void BuildLocator()
Definition: vtkPointSet.h:130
vtkDataSet.h
vtkDataSet
abstract class to specify dataset behavior
Definition: vtkDataSet.h:56
vtkInformation
Store vtkAlgorithm input/output information.
Definition: vtkInformation.h:64
vtkX3D::info
Definition: vtkX3D.h:382
vtkDataSet::NewCellIterator
virtual vtkCellIterator * NewCellIterator()
Return an iterator that traverses the cells in this data set.
vtkPointSet
abstract class for specifying dataset behavior
Definition: vtkPointSet.h:62
vtkDataSet::CopyStructure
virtual void CopyStructure(vtkDataSet *ds)=0
Copy the geometric and topological structure of an object.
vtkAbstractPointLocator
abstract class to quickly locate points in 3-space
Definition: vtkAbstractPointLocator.h:38
vtkGenericCell
provides thread-safe access to cells
Definition: vtkGenericCell.h:36
vtkCellIterator
Efficient cell iterator for vtkDataSet topologies.
Definition: vtkCellIterator.h:77
vtkDataObject
general representation of visualization data
Definition: vtkDataObject.h:58
vtkPointSet::CellLocator
vtkAbstractCellLocator * CellLocator
Definition: vtkPointSet.h:223
vtkObjectBase::UnRegister
virtual void UnRegister(vtkObjectBase *o)
Decrease the reference count (release by another object).
vtkDataSet::DeepCopy
void DeepCopy(vtkDataObject *src) override
vtkMTimeType
vtkTypeUInt32 vtkMTimeType
Definition: vtkType.h:298
vtkPointSet::GetNumberOfPoints
vtkIdType GetNumberOfPoints() override
See vtkDataSet for additional information.
Definition: vtkPointSet.h:234
vtkPointSet::Editable
bool Editable
Definition: vtkPointSet.h:220