X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=lib%2FcpExtensions%2FDataStructures%2FQuadEdgeCell.h;h=d177e3d47ab381f462d2d83d7229bf252c56c7ba;hb=7c7bc497af96e7b5845be9a2fc277036ec752be9;hp=ff7e5a40a78ba5d40808c7488f7413566236ff16;hpb=2361f4f97631e09d88d8a5510a369817dcaa19db;p=cpPlugins.git diff --git a/lib/cpExtensions/DataStructures/QuadEdgeCell.h b/lib/cpExtensions/DataStructures/QuadEdgeCell.h index ff7e5a4..d177e3d 100644 --- a/lib/cpExtensions/DataStructures/QuadEdgeCell.h +++ b/lib/cpExtensions/DataStructures/QuadEdgeCell.h @@ -4,116 +4,116 @@ #include namespace cpExtensions +{ + namespace DataStructures { - namespace DataStructures + /** + */ + template< class I, class E > + class QuadEdgeCell + : public I { - /** - */ - template< class I, class E > - class QuadEdgeCell - : public I - { - public: - // Base types - typedef QuadEdgeCell Self; - typedef I Superclass; - typedef itk::AutoPointer< Self > SelfAutoPointer; - typedef itk::AutoPointer< const Self > ConstSelfAutoPointer; - typedef Self* RawPointer; - typedef const Self* ConstRawPointer; - - // QuadEdge objects - typedef E TPrimalEdge; - typedef typename E::TDual TDualEdge; - - // Inherited types - typedef typename I::PixelType PixelType; - typedef typename I::CellType CellType; - typedef typename I::CellAutoPointer CellAutoPointer; - typedef typename I::CellConstAutoPointer CellConstAutoPointer; - typedef typename I::CellRawPointer CellRawPointer; - typedef typename I::CellConstRawPointer CellConstRawPointer; - typedef typename I::CellTraits CellTraits; - typedef typename I::CoordRepType CoordRepType; - typedef typename I::InterpolationWeightType InterpolationWeightType; - typedef typename I::PointIdentifier PointIdentifier; - typedef typename I::PointIdIterator PointIdIterator; - typedef typename I::PointIdConstIterator PointIdConstIterator; - typedef typename I::CellIdentifier CellIdentifier; - typedef typename I::CellFeatureIdentifier CellFeatureIdentifier; - typedef typename I::CellFeatureIdentifier CellFeatureCount; - typedef typename I::PointType PointType; - typedef typename I::VectorType VectorType; - typedef typename I::PointsContainer PointsContainer; - typedef typename I::UsingCellsContainer UsingCellsContainer; - typedef typename I::CellGeometry CellGeometry; - typedef typename I::ParametricCoordArrayType ParametricCoordArrayType; - typedef typename I::ShapeFunctionsArrayType ShapeFunctionsArrayType; - - itkStaticConstMacro( PointDimension, unsigned int, I::PointDimension ); - itkStaticConstMacro( CellDimension, unsigned int, 2 ); - - public: - itkTypeMacro( QuadEdgeCell, I ); - - public: - QuadEdgeCell( ); - QuadEdgeCell( E* entry ); - virtual ~QuadEdgeCell( ); - - /// Implement the standard CellInterface. - virtual CellGeometry GetType( ) const; - virtual void MakeCopy( CellAutoPointer& other ) const; - virtual unsigned int GetDimension( ) const; - virtual unsigned int GetNumberOfPoints( ) const; - virtual CellFeatureCount GetNumberOfBoundaryFeatures( - int dimension - ) const; - virtual bool GetBoundaryFeature( - int dimension, CellFeatureIdentifier fId, CellAutoPointer& ptr - ); - virtual void SetPointIds( PointIdConstIterator first ); - virtual void SetPointIds( - PointIdConstIterator first, PointIdConstIterator last - ); - virtual void AddPointId( PointIdentifier pId ); - virtual void RemovePointId( PointIdentifier pId ); - virtual void SetPointIds( - int dummy, int num, PointIdConstIterator first - ); - virtual void BuildEdges( ); - virtual void ClearPoints( ); - virtual void SetPointId( int localId, PointIdentifier pId ); - - // Visitor methods - static int GetTopologyId( ); - virtual void Accept( - CellIdentifier cellid, - typename itk::CellInterface< PixelType, CellTraits >:: - MultiVisitor* mv - ); - - // Iterators - virtual PointIdIterator PointIdsBegin( ); - virtual PointIdConstIterator PointIdsBegin( ) const; - virtual PointIdIterator PointIdsEnd( ); - virtual PointIdConstIterator PointIdsEnd( ) const; - - /// QuadEdgeCell-specific interface. - virtual E* GetEntryPrimalEdge( ); - virtual const E* GetEntryPrimalEdge( ) const; - virtual void SetEntryPrimalEdge( E* entry ); - - private: - /// Purposely not implemented. - QuadEdgeCell( const Self& ); - Self& operator=( const Self& ); - - protected: - E* m_EntryEdge; - }; - - } // ecapseman + public: + // Base types + typedef QuadEdgeCell Self; + typedef I Superclass; + typedef itk::AutoPointer< Self > SelfAutoPointer; + typedef itk::AutoPointer< const Self > ConstSelfAutoPointer; + typedef Self* RawPointer; + typedef const Self* ConstRawPointer; + + // QuadEdge objects + typedef E TPrimalEdge; + typedef typename E::TDual TDualEdge; + + // Inherited types + typedef typename I::PixelType PixelType; + typedef typename I::CellType CellType; + typedef typename I::CellAutoPointer CellAutoPointer; + typedef typename I::CellConstAutoPointer CellConstAutoPointer; + typedef typename I::CellRawPointer CellRawPointer; + typedef typename I::CellConstRawPointer CellConstRawPointer; + typedef typename I::CellTraits CellTraits; + typedef typename I::CoordRepType CoordRepType; + typedef typename I::InterpolationWeightType InterpolationWeightType; + typedef typename I::PointIdentifier PointIdentifier; + typedef typename I::PointIdIterator PointIdIterator; + typedef typename I::PointIdConstIterator PointIdConstIterator; + typedef typename I::CellIdentifier CellIdentifier; + typedef typename I::CellFeatureIdentifier CellFeatureIdentifier; + typedef typename I::CellFeatureIdentifier CellFeatureCount; + typedef typename I::PointType PointType; + typedef typename I::VectorType VectorType; + typedef typename I::PointsContainer PointsContainer; + typedef typename I::UsingCellsContainer UsingCellsContainer; + typedef typename I::CellGeometry CellGeometry; + typedef typename I::ParametricCoordArrayType ParametricCoordArrayType; + typedef typename I::ShapeFunctionsArrayType ShapeFunctionsArrayType; + + itkStaticConstMacro( PointDimension, unsigned int, I::PointDimension ); + itkStaticConstMacro( CellDimension, unsigned int, 2 ); + + public: + itkTypeMacro( QuadEdgeCell, I ); + + public: + QuadEdgeCell( ); + QuadEdgeCell( E* entry ); + virtual ~QuadEdgeCell( ); + + /// Implement the standard CellInterface. + virtual CellGeometry GetType( ) const; + virtual void MakeCopy( CellAutoPointer& other ) const; + virtual unsigned int GetDimension( ) const; + virtual unsigned int GetNumberOfPoints( ) const; + virtual CellFeatureCount GetNumberOfBoundaryFeatures( + int dimension + ) const; + virtual bool GetBoundaryFeature( + int dimension, CellFeatureIdentifier fId, CellAutoPointer& ptr + ); + virtual void SetPointIds( PointIdConstIterator first ); + virtual void SetPointIds( + PointIdConstIterator first, PointIdConstIterator last + ); + virtual void AddPointId( PointIdentifier pId ); + virtual void RemovePointId( PointIdentifier pId ); + virtual void SetPointIds( + int dummy, int num, PointIdConstIterator first + ); + virtual void BuildEdges( ); + virtual void ClearPoints( ); + virtual void SetPointId( int localId, PointIdentifier pId ); + + // Visitor methods + static int GetTopologyId( ); + virtual void Accept( + CellIdentifier cellid, + typename itk::CellInterface< PixelType, CellTraits >:: + MultiVisitor* mv + ); + + // Iterators + virtual PointIdIterator PointIdsBegin( ); + virtual PointIdConstIterator PointIdsBegin( ) const; + virtual PointIdIterator PointIdsEnd( ); + virtual PointIdConstIterator PointIdsEnd( ) const; + + /// QuadEdgeCell-specific interface. + virtual E* GetEntryPrimalEdge( ); + virtual const E* GetEntryPrimalEdge( ) const; + virtual void SetEntryPrimalEdge( E* entry ); + + private: + /// Purposely not implemented. + QuadEdgeCell( const Self& ); + Self& operator=( const Self& ); + + protected: + E* m_EntryEdge; + }; + + } // ecapseman } // ecapseman