VTK
|
00001 /*========================================================================= 00002 00003 Program: Visualization Toolkit 00004 Module: vtkPointSet.h 00005 00006 Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen 00007 All rights reserved. 00008 See Copyright.txt or http://www.kitware.com/Copyright.htm for details. 00009 00010 This software is distributed WITHOUT ANY WARRANTY; without even 00011 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR 00012 PURPOSE. See the above copyright notice for more information. 00013 00014 =========================================================================*/ 00034 #ifndef vtkPointSet_h 00035 #define vtkPointSet_h 00036 00037 #include "vtkCommonDataModelModule.h" // For export macro 00038 #include "vtkDataSet.h" 00039 00040 #include "vtkPoints.h" // Needed for inline methods 00041 00042 class vtkPointLocator; 00043 00044 class VTKCOMMONDATAMODEL_EXPORT vtkPointSet : public vtkDataSet 00045 { 00046 public: 00047 vtkTypeMacro(vtkPointSet,vtkDataSet); 00048 void PrintSelf(ostream& os, vtkIndent indent); 00049 00051 void Initialize(); 00052 00054 void CopyStructure(vtkDataSet *pd); 00055 00057 00058 vtkIdType GetNumberOfPoints(); 00059 double *GetPoint(vtkIdType ptId) {return this->Points->GetPoint(ptId);}; 00060 void GetPoint(vtkIdType ptId, double x[3]) {this->Points->GetPoint(ptId,x);}; 00061 virtual vtkIdType FindPoint(double x[3]); 00062 vtkIdType FindPoint(double x, double y, double z) { 00063 return this->vtkDataSet::FindPoint(x, y, z);}; 00064 virtual vtkIdType FindCell(double x[3], vtkCell *cell, vtkIdType cellId, 00065 double tol2, int& subId, double pcoords[3], 00066 double *weights); 00067 virtual vtkIdType FindCell(double x[3], vtkCell *cell, 00068 vtkGenericCell *gencell, vtkIdType cellId, 00069 double tol2, int& subId, double pcoords[3], 00070 double *weights); 00072 00074 vtkCellIterator* NewCellIterator(); 00075 00077 unsigned long GetMTime(); 00078 00080 void ComputeBounds(); 00081 00083 void Squeeze(); 00084 00086 00087 virtual void SetPoints(vtkPoints*); 00088 vtkGetObjectMacro(Points,vtkPoints); 00090 00096 unsigned long GetActualMemorySize(); 00097 00099 00100 void ShallowCopy(vtkDataObject *src); 00101 void DeepCopy(vtkDataObject *src); 00103 00105 00106 virtual void Register(vtkObjectBase* o); 00107 virtual void UnRegister(vtkObjectBase* o); 00109 00110 //BTX 00112 00113 static vtkPointSet* GetData(vtkInformation* info); 00114 static vtkPointSet* GetData(vtkInformationVector* v, int i=0); 00115 //ETX 00117 00118 protected: 00119 vtkPointSet(); 00120 ~vtkPointSet(); 00121 00122 vtkPoints *Points; 00123 vtkPointLocator *Locator; 00124 00125 virtual void ReportReferences(vtkGarbageCollector*); 00126 private: 00127 00128 void Cleanup(); 00129 00130 vtkPointSet(const vtkPointSet&); // Not implemented. 00131 void operator=(const vtkPointSet&); // Not implemented. 00132 }; 00133 00134 inline vtkIdType vtkPointSet::GetNumberOfPoints() 00135 { 00136 if (this->Points) 00137 { 00138 return this->Points->GetNumberOfPoints(); 00139 } 00140 else 00141 { 00142 return 0; 00143 } 00144 } 00145 00146 00147 #endif 00148 00149