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) VTK_OVERRIDE;
44 
48  void Initialize() VTK_OVERRIDE;
49 
53  void CopyStructure(vtkDataSet *pd) VTK_OVERRIDE;
54 
56 
59  vtkIdType GetNumberOfPoints() VTK_OVERRIDE;
60  void GetPoint(vtkIdType ptId, double x[3]) VTK_OVERRIDE
61  {this->Points->GetPoint(ptId,x);};
62  vtkIdType FindPoint(double x[3]) VTK_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) VTK_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) VTK_OVERRIDE;
73 
80  double *GetPoint(vtkIdType ptId) VTK_OVERRIDE
81  {return this->Points->GetPoint(ptId);};
82 
86  vtkCellIterator* NewCellIterator() VTK_OVERRIDE;
87 
91  vtkMTimeType GetMTime() VTK_OVERRIDE;
92 
96  void ComputeBounds() VTK_OVERRIDE;
97 
101  void Squeeze() VTK_OVERRIDE;
102 
104 
107  virtual void SetPoints(vtkPoints*);
108  vtkGetObjectMacro(Points,vtkPoints);
110 
119  unsigned long GetActualMemorySize() VTK_OVERRIDE;
120 
122 
125  void ShallowCopy(vtkDataObject *src) VTK_OVERRIDE;
126  void DeepCopy(vtkDataObject *src) VTK_OVERRIDE;
128 
130 
133  void Register(vtkObjectBase* o) VTK_OVERRIDE;
134  void UnRegister(vtkObjectBase* o) VTK_OVERRIDE;
136 
138 
141  static vtkPointSet* GetData(vtkInformation* info);
142  static vtkPointSet* GetData(vtkInformationVector* v, int i=0);
144 
145 protected:
146  vtkPointSet();
147  ~vtkPointSet() VTK_OVERRIDE;
148 
149  vtkPoints *Points;
150  vtkPointLocator *Locator;
151 
152  void ReportReferences(vtkGarbageCollector*) VTK_OVERRIDE;
153 private:
154 
155  void Cleanup();
156 
157  vtkPointSet(const vtkPointSet&) VTK_DELETE_FUNCTION;
158  void operator=(const vtkPointSet&) VTK_DELETE_FUNCTION;
159 };
160 
161 inline vtkIdType vtkPointSet::GetNumberOfPoints()
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 
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.
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:300
abstract class to specify dataset behavior
Definition: vtkDataSet.h:56
abstract class for specifying dataset behavior
Definition: vtkPointSet.h:39
int vtkIdType
Definition: vtkType.h:345
vtkIdType FindPoint(double x, double y, double z)
See vtkDataSet for additional information.
Definition: vtkPointSet.h:63
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
void GetPoint(const int i, const int j, const int k, double pnt[3])
abstract class to specify cell behavior
Definition: vtkCell.h:56
a simple class to control print indentation
Definition: vtkIndent.h:33
virtual vtkCellIterator * NewCellIterator()
Return an iterator that traverses the cells in this data set.
abstract base class for most VTK objects
Definition: vtkObjectBase.h:62
void Initialize() override
Restore data object to initial state.
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.