VTK
|
00001 /*========================================================================= 00002 00003 Program: Visualization Toolkit 00004 Module: $RCSfile: vtkPointSet.h,v $ 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 =========================================================================*/ 00031 #ifndef __vtkPointSet_h 00032 #define __vtkPointSet_h 00033 00034 #include "vtkDataSet.h" 00035 00036 #include "vtkPoints.h" // Needed for inline methods 00037 00038 class vtkPointLocator; 00039 00040 class VTK_FILTERING_EXPORT vtkPointSet : public vtkDataSet 00041 { 00042 public: 00043 vtkTypeRevisionMacro(vtkPointSet,vtkDataSet); 00044 void PrintSelf(ostream& os, vtkIndent indent); 00045 00047 void Initialize(); 00048 00050 void CopyStructure(vtkDataSet *pd); 00051 00053 00054 vtkIdType GetNumberOfPoints(); 00055 double *GetPoint(vtkIdType ptId) {return this->Points->GetPoint(ptId);}; 00056 void GetPoint(vtkIdType ptId, double x[3]) {this->Points->GetPoint(ptId,x);}; 00057 vtkIdType FindPoint(double x[3]); 00058 vtkIdType FindPoint(double x, double y, double z) { 00059 return this->vtkDataSet::FindPoint(x, y, z);}; 00060 vtkIdType FindCell(double x[3], vtkCell *cell, vtkIdType cellId, double tol2, 00061 int& subId, double pcoords[3], double *weights); 00062 vtkIdType FindCell(double x[3], vtkCell *cell, vtkGenericCell *gencell, 00063 vtkIdType cellId, double tol2, int& subId, 00064 double pcoords[3], double *weights); 00066 00068 unsigned long GetMTime(); 00069 00071 void ComputeBounds(); 00072 00074 void Squeeze(); 00075 00077 00078 virtual void SetPoints(vtkPoints*); 00079 vtkGetObjectMacro(Points,vtkPoints); 00081 00087 unsigned long GetActualMemorySize(); 00088 00090 00091 void ShallowCopy(vtkDataObject *src); 00092 void DeepCopy(vtkDataObject *src); 00094 00095 //BTX 00097 00098 static vtkPointSet* GetData(vtkInformation* info); 00099 static vtkPointSet* GetData(vtkInformationVector* v, int i=0); 00100 //ETX 00102 00103 protected: 00104 vtkPointSet(); 00105 ~vtkPointSet(); 00106 00107 vtkPoints *Points; 00108 vtkPointLocator *Locator; 00109 00110 virtual void ReportReferences(vtkGarbageCollector*); 00111 private: 00112 vtkPointSet(const vtkPointSet&); // Not implemented. 00113 void operator=(const vtkPointSet&); // Not implemented. 00114 }; 00115 00116 inline vtkIdType vtkPointSet::GetNumberOfPoints() 00117 { 00118 if (this->Points) 00119 { 00120 return this->Points->GetNumberOfPoints(); 00121 } 00122 else 00123 { 00124 return 0; 00125 } 00126 } 00127 00128 00129 #endif 00130 00131