Main Page   Groups   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members   Concepts

itkPolygonCell.h

Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Insight Segmentation & Registration Toolkit
00004   Module:    $RCSfile: itkPolygonCell.h,v $
00005   Language:  C++
00006   Date:      $Date: 2002/09/11 19:57:13 $
00007   Version:   $Revision: 1.26 $
00008 
00009   Copyright (c) 2002 Insight Consortium. All rights reserved.
00010   See ITKCopyright.txt or http://www.itk.org/HTML/Copyright.htm for details.
00011 
00012   Portions of this code are covered under the VTK copyright.
00013   See VTKCopyright.txt or http://www.kitware.com/VTKCopyright.htm for details.
00014 
00015      This software is distributed WITHOUT ANY WARRANTY; without even 
00016      the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR 
00017      PURPOSE.  See the above copyright notices for more information.
00018 
00019 =========================================================================*/
00020 #ifndef __itkPolygonCell_h
00021 #define __itkPolygonCell_h
00022 
00023 #include "itkCellInterface.h"
00024 #include "itkCellBoundary.h"
00025 #include "itkLineCell.h"
00026 #include "itkPoint.h"
00027 #include <vector>
00028 #include <queue>
00029 
00030 
00031 namespace itk
00032 {
00033 
00048 template < typename TCellInterface >
00049 class PolygonCell: public TCellInterface
00050 {
00051 public:
00053   itkCellCommonTypedefs(PolygonCell);
00054   itkCellInheritedTypedefs(TCellInterface);
00055    
00057   itkTypeMacro(PolygonCell, CellInterface);
00058 
00060   itkStaticConstMacro(CellDimension, unsigned int, 2);
00061 
00063   typedef VertexBoundary< TCellInterface >            VertexType;
00064   typedef typename VertexType::SelfAutoPointer        VertexAutoPointer;
00065   
00067   typedef LineBoundary< TCellInterface >              EdgeType;
00068   typedef typename EdgeType::SelfAutoPointer          EdgeAutoPointer;
00069     
00070   typedef FixedArray<int,2> EdgeInfo;
00071   typedef std::deque<EdgeInfo> EdgeInfoDQ;
00072   
00074   itkCellVisitMacro(POLYGON_CELL);
00075 
00077   virtual CellGeometry GetType(void) const 
00078     {return Superclass::POLYGON_CELL;}
00079   virtual void MakeCopy( CellAutoPointer & ) const;
00080   virtual unsigned int GetDimension(void) const;
00081   virtual unsigned int GetNumberOfPoints(void) const;
00082   virtual CellFeatureCount GetNumberOfBoundaryFeatures(int dimension) const;
00083   virtual bool GetBoundaryFeature(int dimension, CellFeatureIdentifier,CellAutoPointer &);
00084   
00085   virtual void SetPointIds(PointIdConstIterator first); 
00086   virtual void SetPointIds(PointIdConstIterator first,
00087                            PointIdConstIterator last);
00088 
00089   void AddPointId(PointIdentifier);
00090   void SetPointIds(int dummy, int num, PointIdConstIterator first);
00091   void BuildEdges(void);
00092   void ClearPoints(void);
00093   
00094   virtual void SetPointId(int localId, PointIdentifier);
00095   virtual PointIdIterator      PointIdsBegin(void);
00096   virtual PointIdConstIterator PointIdsBegin(void) const;
00097   virtual PointIdIterator      PointIdsEnd(void);
00098   virtual PointIdConstIterator PointIdsEnd(void) const; 
00099   
00101   virtual CellFeatureCount GetNumberOfVertices(void) const;
00102   virtual CellFeatureCount GetNumberOfEdges(void) const;
00103   virtual bool GetVertex(CellFeatureIdentifier, VertexAutoPointer &);
00104   virtual bool GetEdge(CellFeatureIdentifier, EdgeAutoPointer &);
00105   
00106 
00108   PolygonCell() {}
00109   ~PolygonCell() {}
00110 
00111 protected:
00112   std::vector<EdgeInfo> m_Edges;
00113   std::vector<PointIdentifier> m_PointIds;
00114 
00115 private:
00116   PolygonCell(const Self&); //purposely not implemented
00117   void operator=(const Self&); //purposely not implemented
00118 
00119 };
00120 
00126 template <typename TCellInterface >
00127 class PolygonBoundary:
00128   public CellBoundary< PolygonCell< TCellInterface > >
00129 {
00130 public:
00132   itkCellCommonTypedefs(PolygonBoundary);
00133 
00135   itkTypeMacro(PolygonBoundary, CellBoundary);
00136 
00138   PolygonBoundary() {}
00139   ~PolygonBoundary() {}
00140 
00141 };
00142 
00143 } //end namespace
00144 
00145 #ifndef ITK_MANUAL_INSTANTIATION
00146 #include "itkPolygonCell.txx"
00147 #endif
00148 
00149 #endif
00150 
00151 

Generated at Wed Mar 12 01:13:09 2003 for ITK by doxygen 1.2.15 written by Dimitri van Heesch, © 1997-2000