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 =========================================================================*/
29 #ifndef vtkPointSet_h
30 #define vtkPointSet_h
31 
32 #include "vtkCommonDataModelModule.h" // For export macro
33 #include "vtkDataSet.h"
34 
35 #include "vtkPoints.h" // Needed for inline methods
36 
37 class vtkPointLocator;
38 
39 class VTKCOMMONDATAMODEL_EXPORT vtkPointSet : public vtkDataSet
40 {
41 public:
42  vtkTypeMacro(vtkPointSet,vtkDataSet);
43  void PrintSelf(ostream& os, vtkIndent indent) override;
44 
48  void Initialize() override;
49 
53  void CopyStructure(vtkDataSet *pd) override;
54 
56 
59  vtkIdType GetNumberOfPoints() override;
60  void GetPoint(vtkIdType ptId, double x[3]) override
61  {this->Points->GetPoint(ptId,x);};
62  vtkIdType FindPoint(double x[3]) override;
63  vtkIdType FindPoint(double x, double y, double z) {
64  return this->vtkDataSet::FindPoint(x, y, z);};
65  vtkIdType FindCell(double x[3], vtkCell *cell, vtkIdType cellId,
66  double tol2, int& subId, double pcoords[3],
67  double *weights) override;
68  vtkIdType FindCell(double x[3], vtkCell *cell,
69  vtkGenericCell *gencell, vtkIdType cellId,
70  double tol2, int& subId, double pcoords[3],
71  double *weights) override;
73 
80  double *GetPoint(vtkIdType ptId) VTK_SIZEHINT(3) override
81  {return this->Points->GetPoint(ptId);};
82 
86  vtkCellIterator* NewCellIterator() override;
87 
91  vtkMTimeType GetMTime() override;
92 
96  void ComputeBounds() override;
97 
101  void Squeeze() override;
102 
104 
107  virtual void SetPoints(vtkPoints*);
108  vtkGetObjectMacro(Points,vtkPoints);
110 
119  unsigned long GetActualMemorySize() override;
120 
122 
125  void ShallowCopy(vtkDataObject *src) override;
126  void DeepCopy(vtkDataObject *src) override;
128 
130 
133  void Register(vtkObjectBase* o) override;
134  void UnRegister(vtkObjectBase* o) override;
136 
138 
142  static vtkPointSet* GetData(vtkInformationVector* v, int i=0);
144 
145 protected:
146  vtkPointSet();
147  ~vtkPointSet() override;
148 
151 
152  void ReportReferences(vtkGarbageCollector*) override;
153 private:
154 
155  void Cleanup();
156 
157  vtkPointSet(const vtkPointSet&) = delete;
158  void operator=(const vtkPointSet&) = delete;
159 };
160 
162 {
163  if (this->Points)
164  {
165  return this->Points->GetNumberOfPoints();
166  }
167  else
168  {
169  return 0;
170  }
171 }
172 
173 
174 #endif
175 
176 
vtkIdType GetNumberOfPoints() override
See vtkDataSet for additional information.
Definition: vtkPointSet.h:161
virtual void Register(vtkObjectBase *o)
Increase the reference count (mark as used by another object).
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.
vtkPointLocator * Locator
Definition: vtkPointSet.h:150
vtkIdType GetNumberOfPoints()
Return number of points in array.
Definition: vtkPoints.h:126
quickly locate points in 3-space
Store vtkAlgorithm input/output information.
vtkTypeUInt32 vtkMTimeType
Definition: vtkType.h:302
virtual vtkIdType GetNumberOfPoints()=0
Determine the number of points composing the dataset.
abstract class to specify dataset behavior
Definition: vtkDataSet.h:56
virtual void ComputeBounds()
Compute the data bounding box from data points.
abstract class for specifying dataset behavior
Definition: vtkPointSet.h:39
int vtkIdType
Definition: vtkType.h:347
virtual void Squeeze()
Reclaim any extra memory used to store data.
vtkIdType FindPoint(double x, double y, double z)
See vtkDataSet for additional information.
Definition: vtkPointSet.h:63
static vtkDataSet * GetData(vtkInformation *info)
Retrieve an instance of this class from an information object.
double * GetPoint(vtkIdType ptId) override
See vtkDataSet for additional information.
Definition: vtkPointSet.h:80
Detect and break reference loops.
provides thread-safe access to cells
abstract class to specify cell behavior
Definition: vtkCell.h:56
virtual void UnRegister(vtkObjectBase *o)
Decrease the reference count (release by another object).
unsigned long GetActualMemorySize() override
Return the actual size of the data in kibibytes (1024 bytes).
a simple class to control print indentation
Definition: vtkIndent.h:33
virtual void ReportReferences(vtkGarbageCollector *)
vtkMTimeType GetMTime() override
Datasets are composite objects and need to check each part for MTime THIS METHOD IS THREAD SAFE.
virtual vtkCellIterator * NewCellIterator()
Return an iterator that traverses the cells in this data set.
vtkPoints * Points
Definition: vtkPointSet.h:149
void DeepCopy(vtkDataObject *src) override
Shallow and Deep copy.
abstract base class for most VTK objects
Definition: vtkObjectBase.h:62
#define VTK_SIZEHINT(...)
void GetPoint(vtkIdType ptId, double x[3]) override
See vtkDataSet for additional information.
Definition: vtkPointSet.h:60
void Initialize() override
Restore data object to initial state.
virtual void CopyStructure(vtkDataSet *ds)=0
Copy the geometric and topological structure of an object.
void ShallowCopy(vtkDataObject *src) override
Shallow and Deep copy.
Store zero or more vtkInformation instances.
Efficient cell iterator for vtkDataSet topologies.
general representation of visualization data
Definition: vtkDataObject.h:58
vtkIdType FindPoint(double x, double y, double z)
Locate the closest point to the global coordinate x.
Definition: vtkDataSet.h:191
represent and manipulate 3D points
Definition: vtkPoints.h:33
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.