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 
89  vtkCellIterator* NewCellIterator() override;
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 
145  static vtkPointSet* GetData(vtkInformationVector* v, int i=0);
147 
148 protected:
149  vtkPointSet();
150  ~vtkPointSet() override;
151 
154 
155  void ReportReferences(vtkGarbageCollector*) override;
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 
vtkIdType GetNumberOfPoints() override
See vtkDataSet for additional information.
Definition: vtkPointSet.h:164
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:153
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:62
virtual void ComputeBounds()
Compute the data bounding box from data points.
abstract class for specifying dataset behavior
Definition: vtkPointSet.h:42
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:66
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:83
Detect and break reference loops.
provides thread-safe access to cells
abstract class to specify cell behavior
Definition: vtkCell.h:59
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:39
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:152
void DeepCopy(vtkDataObject *src) override
Shallow and Deep copy.
abstract base class for most VTK objects
Definition: vtkObjectBase.h:65
#define VTK_SIZEHINT(...)
void GetPoint(vtkIdType ptId, double x[3]) override
See vtkDataSet for additional information.
Definition: vtkPointSet.h:63
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:64
vtkIdType FindPoint(double x, double y, double z)
Locate the closest point to the global coordinate x.
Definition: vtkDataSet.h:197
represent and manipulate 3D points
Definition: vtkPoints.h:39
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.