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   vtkCellIterator* NewCellIterator();
00072 
00074   unsigned long GetMTime();
00075 
00077   void ComputeBounds();
00078 
00080   void Squeeze();
00081 
00083 
00084   virtual void SetPoints(vtkPoints*);
00085   vtkGetObjectMacro(Points,vtkPoints);
00087 
00093   unsigned long GetActualMemorySize();
00094 
00096 
00097   void ShallowCopy(vtkDataObject *src);
00098   void DeepCopy(vtkDataObject *src);
00100 
00102 
00103   virtual void Register(vtkObjectBase* o);
00104   virtual void UnRegister(vtkObjectBase* o);
00106 
00107   //BTX
00109 
00110   static vtkPointSet* GetData(vtkInformation* info);
00111   static vtkPointSet* GetData(vtkInformationVector* v, int i=0);
00112   //ETX
00114 
00115 protected:
00116   vtkPointSet();
00117   ~vtkPointSet();
00118 
00119   vtkPoints *Points;
00120   vtkPointLocator *Locator;
00121 
00122   virtual void ReportReferences(vtkGarbageCollector*);
00123 private:
00124 
00125   void Cleanup();
00126 
00127   vtkPointSet(const vtkPointSet&);  // Not implemented.
00128   void operator=(const vtkPointSet&);  // Not implemented.
00129 };
00130 
00131 inline vtkIdType vtkPointSet::GetNumberOfPoints()
00132 {
00133   if (this->Points)
00134     {
00135     return this->Points->GetNumberOfPoints();
00136     }
00137   else
00138     {
00139     return 0;
00140     }
00141 }
00142 
00143 
00144 #endif
00145 
00146