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: 2004/12/11 20:27:47 $
00007   Version:   $Revision: 1.32 $
00008 
00009   Copyright (c) Insight Software 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 "itkLineCell.h"
00025 #include "itkPoint.h"
00026 #include <vector>
00027 #include <deque>
00028 
00029 namespace itk
00030 {
00031 
00046 template < typename TCellInterface >
00047 class ITK_EXPORT PolygonCell: public TCellInterface
00048 {
00049 public:
00051   itkCellCommonTypedefs(PolygonCell);
00052   itkCellInheritedTypedefs(TCellInterface);
00053    
00055   itkTypeMacro(PolygonCell, CellInterface);
00056 
00058   itkStaticConstMacro(CellDimension, unsigned int, 2);
00059 
00061   typedef VertexCell< TCellInterface >            VertexType;
00062   typedef typename VertexType::SelfAutoPointer    VertexAutoPointer;
00063   
00065   typedef LineCell< TCellInterface >              EdgeType;
00066   typedef typename EdgeType::SelfAutoPointer      EdgeAutoPointer;
00067     
00068   typedef FixedArray<int,2> EdgeInfo;
00069   typedef std::deque<EdgeInfo> EdgeInfoDQ;
00070   
00072   itkCellVisitMacro(Superclass::POLYGON_CELL);
00073 
00075   virtual CellGeometry GetType(void) const 
00076     {return Superclass::POLYGON_CELL;}
00077   virtual void MakeCopy( CellAutoPointer & ) const;
00078   virtual unsigned int GetDimension(void) const;
00079   virtual unsigned int GetNumberOfPoints(void) const;
00080   virtual CellFeatureCount GetNumberOfBoundaryFeatures(int dimension) const;
00081   virtual bool GetBoundaryFeature(int dimension, CellFeatureIdentifier,CellAutoPointer &);
00082   
00083   virtual void SetPointIds(PointIdConstIterator first); 
00084   virtual void SetPointIds(PointIdConstIterator first,
00085                            PointIdConstIterator last);
00086 
00087   void AddPointId(PointIdentifier);
00088   void RemovePointId(PointIdentifier);
00089   void SetPointIds(int dummy, int num, PointIdConstIterator first);
00090   void BuildEdges(void);
00091   void ClearPoints(void);
00092   
00093   virtual void SetPointId(int localId, PointIdentifier);
00094   virtual PointIdIterator      PointIdsBegin(void);
00095   virtual PointIdConstIterator PointIdsBegin(void) const;
00096   virtual PointIdIterator      PointIdsEnd(void);
00097   virtual PointIdConstIterator PointIdsEnd(void) const; 
00098   
00100   virtual CellFeatureCount GetNumberOfVertices(void) const;
00101   virtual CellFeatureCount GetNumberOfEdges(void) const;
00102   virtual bool GetVertex(CellFeatureIdentifier, VertexAutoPointer &);
00103   virtual bool GetEdge(CellFeatureIdentifier, EdgeAutoPointer &);
00104   
00105 
00107   PolygonCell() {}
00108   ~PolygonCell() {}
00109 
00110 protected:
00111   std::vector<EdgeInfo> m_Edges;
00112   std::vector<PointIdentifier> m_PointIds;
00113 
00114 private:
00115   PolygonCell(const Self&); //purposely not implemented
00116   void operator=(const Self&); //purposely not implemented
00117 
00118 };
00119 
00120 } //end namespace
00121 
00122 #ifndef ITK_MANUAL_INSTANTIATION
00123 #include "itkPolygonCell.txx"
00124 #endif
00125 
00126 #endif
00127 
00128 

Generated at Wed May 24 23:52:32 2006 for ITK by doxygen 1.3.5 written by Dimitri van Heesch, © 1997-2000