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) VTK_OVERRIDE;
47 
51  void Initialize() VTK_OVERRIDE;
52 
56  void CopyStructure(vtkDataSet *pd) VTK_OVERRIDE;
57 
59 
62  vtkIdType GetNumberOfPoints() VTK_OVERRIDE;
63  void GetPoint(vtkIdType ptId, double x[3]) VTK_OVERRIDE
64  {this->Points->GetPoint(ptId,x);};
65  vtkIdType FindPoint(double x[3]) VTK_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) VTK_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) VTK_OVERRIDE;
76 
83  double *GetPoint(vtkIdType ptId) VTK_OVERRIDE
84  {return this->Points->GetPoint(ptId);};
85 
89  vtkCellIterator* NewCellIterator() VTK_OVERRIDE;
90 
94  vtkMTimeType GetMTime() VTK_OVERRIDE;
95 
99  void ComputeBounds() VTK_OVERRIDE;
100 
104  void Squeeze() VTK_OVERRIDE;
105 
107 
110  virtual void SetPoints(vtkPoints*);
111  vtkGetObjectMacro(Points,vtkPoints);
113 
122  unsigned long GetActualMemorySize() VTK_OVERRIDE;
123 
125 
128  void ShallowCopy(vtkDataObject *src) VTK_OVERRIDE;
129  void DeepCopy(vtkDataObject *src) VTK_OVERRIDE;
131 
133 
136  void Register(vtkObjectBase* o) VTK_OVERRIDE;
137  void UnRegister(vtkObjectBase* o) VTK_OVERRIDE;
139 
141 
144  static vtkPointSet* GetData(vtkInformation* info);
145  static vtkPointSet* GetData(vtkInformationVector* v, int i=0);
147 
148 protected:
149  vtkPointSet();
150  ~vtkPointSet() VTK_OVERRIDE;
151 
152  vtkPoints *Points;
153  vtkPointLocator *Locator;
154 
155  void ReportReferences(vtkGarbageCollector*) VTK_OVERRIDE;
156 private:
157 
158  void Cleanup();
159 
160  vtkPointSet(const vtkPointSet&) VTK_DELETE_FUNCTION;
161  void operator=(const vtkPointSet&) VTK_DELETE_FUNCTION;
162 };
163 
164 inline vtkIdType vtkPointSet::GetNumberOfPoints()
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 
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:132
quickly locate points in 3-space
Store vtkAlgorithm input/output information.
abstract class to specify dataset behavior
Definition: vtkDataSet.h:62
void DeepCopy(vtkPistonReference *self, vtkPistonReference *other)
abstract class for specifying dataset behavior
Definition: vtkPointSet.h:42
int vtkIdType
Definition: vtkType.h:287
vtkIdType FindPoint(double x, double y, double z)
See vtkDataSet for additional information.
Definition: vtkPointSet.h:66
vtkTypeUInt64 vtkMTimeType
Definition: vtkType.h:248
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
void GetPoint(const int i, const int j, const int k, double pnt[3])
abstract class to specify cell behavior
Definition: vtkCell.h:59
a simple class to control print indentation
Definition: vtkIndent.h:39
virtual vtkCellIterator * NewCellIterator()
Return an iterator that traverses the cells in this data set.
abstract base class for most VTK objects
Definition: vtkObjectBase.h:65
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:64
vtkIdType FindPoint(double x, double y, double z)
Locate the closest point to the global coordinate x.
Definition: vtkDataSet.h:192
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.