00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018 #ifndef __itkQuadEdgeMeshPolygonCell_h
00019 #define __itkQuadEdgeMeshPolygonCell_h
00020
00021 namespace itk
00022 {
00023
00035 template< class TCellInterface >
00036 class QuadEdgeMeshPolygonCell : public TCellInterface
00037 {
00038 public:
00040
00041 typedef QuadEdgeMeshPolygonCell Self;
00042 typedef AutoPointer< const Self > ConstSelfAutoPointer;
00043 typedef AutoPointer< Self > SelfAutoPointer;
00044 typedef Self* RawPointer;
00045 typedef const Self* ConstRawPointer;
00046
00047
00048 typedef TCellInterface Superclass;
00049 typedef typename Superclass::PixelType PixelType;
00050 typedef typename Superclass::CellType CellType;
00051 typedef typename Superclass::CellAutoPointer CellAutoPointer;
00052 typedef typename Superclass::CellConstAutoPointer CellConstAutoPointer;
00053 typedef typename Superclass::CellRawPointer CellRawPointer;
00054 typedef typename Superclass::CellConstRawPointer CellConstRawPointer;
00055 typedef typename Superclass::CellTraits CellTraits;
00056 typedef typename Superclass::CoordRepType CoordRepType;
00057 typedef typename Superclass::InterpolationWeightType InterpolationWeightType;
00058 typedef typename Superclass::PointIdentifier PointIdentifier;
00059 typedef typename Superclass::CellIdentifier CellIdentifier;
00060 typedef typename Superclass::CellFeatureIdentifier CellFeatureIdentifier;
00061 typedef typename Superclass::CellFeatureIdentifier CellFeatureCount;
00062 typedef typename Superclass::PointType PointType;
00063 typedef typename Superclass::PointsContainer PointsContainer;
00064 typedef typename Superclass::UsingCellsContainer UsingCellsContainer;
00065 typedef typename Superclass::CellGeometry CellGeometry;
00066 typedef typename Superclass::ParametricCoordArrayType ParametricCoordArrayType;
00067 typedef typename Superclass::ShapeFunctionsArrayType ShapeFunctionsArrayType;
00068 itkStaticConstMacro( PointDimension, unsigned int, Superclass::PointDimension );
00069 itkStaticConstMacro( CellDimension, unsigned int, 2 );
00070
00072 typedef typename CellType::MultiVisitor MultiVisitor;
00073
00075 typedef typename Superclass::CellTraits::QuadEdgeType QuadEdgeType;
00076 typedef typename QuadEdgeType::OriginRefType VertexRefType;
00077 typedef typename QuadEdgeType::DualOriginRefType FaceRefType;
00078 typedef typename QuadEdgeType::PrimalDataType PrimalDataType;
00079 typedef typename QuadEdgeType::DualDataType DualDataType;
00080 typedef typename QuadEdgeType::DualType QEDual;
00081
00083 typedef typename QuadEdgeType::IteratorGeom PointIdIterator;
00084 typedef typename QuadEdgeType::ConstIteratorGeom PointIdConstIterator;
00085
00086 public:
00088 itkTypeMacro( QuadEdgeMeshPolygonCell, TCellInterface );
00089
00091 QuadEdgeMeshPolygonCell( unsigned int nPoints );
00092 QuadEdgeMeshPolygonCell( QuadEdgeType* e );
00093 virtual ~QuadEdgeMeshPolygonCell() { }
00095
00097 void SetIdent( CellIdentifier cid ) { m_Ident = cid; }
00098 CellIdentifier GetIdent() { return( m_Ident ); }
00100
00102 QuadEdgeType* GetEdgeRingEntry() const { return( m_EdgeRingEntry ); }
00103 void SetEdgeRingEntry( QuadEdgeType* entry ) { m_EdgeRingEntry = entry; }
00105
00107 SelfAutoPointer New();
00108
00110 virtual void Accept( unsigned long cellId, MultiVisitor* mv );
00111 virtual CellGeometry GetType() const { return( Superclass::POLYGON_CELL );}
00113
00115 static int GetTopologyId()
00116 {
00117 return( Superclass::POLYGON_CELL );
00118 }
00119 virtual unsigned int GetDimension() const
00120 {
00121 return( Self::CellDimension );
00122 }
00123 virtual unsigned int GetNumberOfPoints() const;
00124 virtual CellFeatureCount GetNumberOfBoundaryFeatures( int dimension ) const;
00125 virtual bool GetBoundaryFeature( int dimension,
00126 CellFeatureIdentifier cellId,
00127 CellAutoPointer& cell );
00129
00131 virtual void MakeCopy( CellAutoPointer& cell ) const
00132 { (void)cell; }
00133
00135 virtual void SetPointIds( PointIdConstIterator first );
00136 virtual void SetPointIds( PointIdConstIterator first,
00137 PointIdConstIterator last );
00138 virtual void SetPointId( int localId, PointIdentifier pId );
00140
00141 virtual PointIdIterator PointIdsBegin();
00142 virtual PointIdIterator PointIdsEnd();
00143
00144 virtual PointIdConstIterator GetPointIds() const;
00145 virtual PointIdConstIterator PointIdsBegin() const;
00146 virtual PointIdConstIterator PointIdsEnd() const;
00147
00148 private:
00149 QuadEdgeMeshPolygonCell( const Self& );
00150 void operator=( const Self& );
00151
00152 QuadEdgeType * MakeQuadEdges();
00153
00154 private:
00158 CellIdentifier m_Ident;
00159
00163 QuadEdgeType * m_EdgeRingEntry;
00164 };
00165
00166 }
00167
00168 #ifndef ITK_MANUAL_INSTANTIATION
00169 #include "itkQuadEdgeMeshPolygonCell.txx"
00170 #endif
00171
00172 #endif
00173