VTK
dox/Common/DataModel/vtkPointSet.h
Go to the documentation of this file.
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 =========================================================================*/
00031 #ifndef __vtkPointSet_h
00032 #define __vtkPointSet_h
00033 
00034 #include "vtkCommonDataModelModule.h" // For export macro
00035 #include "vtkDataSet.h"
00036 
00037 #include "vtkPoints.h" // Needed for inline methods
00038 
00039 class vtkPointLocator;
00040 
00041 class VTKCOMMONDATAMODEL_EXPORT vtkPointSet : public vtkDataSet
00042 {
00043 public:
00044   vtkTypeMacro(vtkPointSet,vtkDataSet);
00045   void PrintSelf(ostream& os, vtkIndent indent);
00046 
00048   void Initialize();
00049 
00051   void CopyStructure(vtkDataSet *pd);
00052 
00054 
00055   vtkIdType GetNumberOfPoints();
00056   double *GetPoint(vtkIdType ptId) {return this->Points->GetPoint(ptId);};
00057   void GetPoint(vtkIdType ptId, double x[3]) {this->Points->GetPoint(ptId,x);};
00058   virtual vtkIdType FindPoint(double x[3]);
00059   vtkIdType FindPoint(double x, double y, double z) {
00060     return this->vtkDataSet::FindPoint(x, y, z);};
00061   virtual vtkIdType FindCell(double x[3], vtkCell *cell, vtkIdType cellId,
00062                              double tol2, int& subId, double pcoords[3],
00063                              double *weights);
00064   virtual vtkIdType FindCell(double x[3], vtkCell *cell,
00065                              vtkGenericCell *gencell, vtkIdType cellId,
00066                              double tol2, int& subId, double pcoords[3],
00067                              double *weights);
00069 
00071   unsigned long GetMTime();
00072 
00074   void ComputeBounds();
00075 
00077   void Squeeze();
00078 
00080 
00081   virtual void SetPoints(vtkPoints*);
00082   vtkGetObjectMacro(Points,vtkPoints);
00084 
00090   unsigned long GetActualMemorySize();
00091 
00093 
00094   void ShallowCopy(vtkDataObject *src);
00095   void DeepCopy(vtkDataObject *src);
00097 
00099 
00100   virtual void Register(vtkObjectBase* o);
00101   virtual void UnRegister(vtkObjectBase* o);
00103 
00104   //BTX
00106 
00107   static vtkPointSet* GetData(vtkInformation* info);
00108   static vtkPointSet* GetData(vtkInformationVector* v, int i=0);
00109   //ETX
00111 
00112 protected:
00113   vtkPointSet();
00114   ~vtkPointSet();
00115 
00116   vtkPoints *Points;
00117   vtkPointLocator *Locator;
00118 
00119   virtual void ReportReferences(vtkGarbageCollector*);
00120 private:
00121 
00122   void Cleanup();
00123 
00124   vtkPointSet(const vtkPointSet&);  // Not implemented.
00125   void operator=(const vtkPointSet&);  // Not implemented.
00126 };
00127 
00128 inline vtkIdType vtkPointSet::GetNumberOfPoints()
00129 {
00130   if (this->Points)
00131     {
00132     return this->Points->GetNumberOfPoints();
00133     }
00134   else
00135     {
00136     return 0;
00137     }
00138 }
00139 
00140 
00141 #endif
00142 
00143