Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members   Related Pages  

Common/vtkPointSet.h

Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Visualization Toolkit
00004   Module:    $RCSfile: vtkPointSet.h,v $
00005   Language:  C++
00006 
00007   Copyright (c) 1993-2002 Ken Martin, Will Schroeder, Bill Lorensen 
00008   All rights reserved.
00009   See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
00010 
00011      This software is distributed WITHOUT ANY WARRANTY; without even 
00012      the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR 
00013      PURPOSE.  See the above copyright notice for more information.
00014 
00015 =========================================================================*/
00045 #ifndef __vtkPointSet_h
00046 #define __vtkPointSet_h
00047 
00048 #include "vtkDataSet.h"
00049 
00050 #include "vtkPoints.h" // Needed for inline methods
00051 
00052 class vtkPointLocator;
00053 
00054 class VTK_COMMON_EXPORT vtkPointSet : public vtkDataSet
00055 {
00056 public:
00057   vtkTypeRevisionMacro(vtkPointSet,vtkDataSet);
00058   void PrintSelf(ostream& os, vtkIndent indent);
00059 
00061   void Initialize();
00062 
00064   void CopyStructure(vtkDataSet *pd);
00065 
00067 
00068   vtkIdType GetNumberOfPoints();
00069   float *GetPoint(vtkIdType ptId) {return this->Points->GetPoint(ptId);};
00070   void GetPoint(vtkIdType ptId, float x[3]) {this->Points->GetPoint(ptId,x);};
00071   vtkIdType FindPoint(float x[3]);
00072   vtkIdType FindPoint(float x, float y, float z) { return this->vtkDataSet::FindPoint(x, y, z);};
00073   vtkIdType FindCell(float x[3], vtkCell *cell, vtkIdType cellId, float tol2,
00074                int& subId, float pcoords[3], float *weights);
00075   vtkIdType FindCell(float x[3], vtkCell *cell, vtkGenericCell *gencell,
00076                vtkIdType cellId, float tol2, int& subId, 
00077                float pcoords[3], float *weights);
00079 
00081   unsigned long GetMTime();
00082 
00084   void ComputeBounds();
00085   
00087   void Squeeze();
00088 
00090 
00091   virtual void SetPoints(vtkPoints*);
00092   vtkGetObjectMacro(Points,vtkPoints);
00094 
00096   virtual void UnRegister(vtkObjectBase *o);
00097   
00101   virtual int GetNetReferenceCount();
00102 
00108   unsigned long GetActualMemorySize();
00109 
00111 
00112   void ShallowCopy(vtkDataObject *src);  
00113   void DeepCopy(vtkDataObject *src);
00115 
00116 protected:
00117   vtkPointSet();
00118   ~vtkPointSet();
00119 
00120   vtkPoints *Points;
00121   vtkPointLocator *Locator;
00122 
00123 private:
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