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

itkQuadEdgeMeshLineCell.h

Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Insight Segmentation & Registration Toolkit
00004   Module:    $RCSfile: itkQuadEdgeMeshLineCell.h,v $
00005   Language:  C++
00006   Date:      $Date: 2009-07-30 21:17:33 $
00007   Version:   $Revision: 1.16 $
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      This software is distributed WITHOUT ANY WARRANTY; without even
00013      the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
00014      PURPOSE.  See the above copyright notices for more information.
00015 
00016 =========================================================================*/
00017 
00018 
00019 #ifndef __itkQuadEdgeMeshLineCell_h
00020 #define __itkQuadEdgeMeshLineCell_h
00021 
00022 #include "itkAutoPointer.h"
00023 #include "itkGeometricalQuadEdge.h"
00024 
00025 namespace itk
00026 {
00027 
00039 template< class TCellInterface >
00040 class QuadEdgeMeshLineCell 
00041   : public TCellInterface, public TCellInterface::CellTraits::QuadEdgeType
00042 {
00043 public:
00044 
00046   // itkCellCommonTypedefs
00047   typedef QuadEdgeMeshLineCell      Self;
00048   typedef AutoPointer< const Self > ConstSelfAutoPointer;
00049   typedef AutoPointer< Self >       SelfAutoPointer;
00050   typedef Self *                    RawPointer;
00051   typedef const Self *              ConstRawPointer;
00052 
00053   // itkCellInheritedTypedefs
00054   typedef TCellInterface                                Superclass;
00055   typedef typename Superclass::PixelType                PixelType;
00056   typedef typename Superclass::CellType                 CellType;
00057   typedef typename Superclass::CellAutoPointer          CellAutoPointer;
00058   typedef typename Superclass::CellConstAutoPointer     CellConstAutoPointer;
00059   typedef typename Superclass::CellRawPointer           CellRawPointer;
00060   typedef typename Superclass::CellConstRawPointer      CellConstRawPointer;
00061   typedef typename Superclass::CellTraits               CellTraits;
00062   typedef typename Superclass::CoordRepType             CoordRepType;
00063   typedef typename Superclass::InterpolationWeightType  InterpolationWeightType;
00064   typedef typename Superclass::PointIdentifier          PointIdentifier;
00065   typedef typename Superclass::CellIdentifier           CellIdentifier;
00066   typedef typename Superclass::CellFeatureIdentifier    CellFeatureIdentifier;
00067   typedef typename Superclass::CellFeatureIdentifier    CellFeatureCount;
00068   typedef typename Superclass::PointType                PointType;
00069   typedef typename Superclass::PointsContainer          PointsContainer;
00070   typedef typename Superclass::UsingCellsContainer      UsingCellsContainer;
00071   typedef typename Superclass::CellGeometry             CellGeometry;
00072   typedef typename Superclass::ParametricCoordArrayType ParametricCoordArrayType;
00073   typedef typename Superclass::ShapeFunctionsArrayType  ShapeFunctionsArrayType;
00074   itkStaticConstMacro( PointDimension, unsigned int, Superclass::PointDimension );
00075   itkStaticConstMacro( CellDimension, unsigned int, 2 );
00076 
00078   typedef typename CellType::MultiVisitor MultiVisitor;
00079 
00081   typedef typename CellTraits::PointIdIterator              PointIdIterator;
00082   typedef typename CellTraits::PointIdConstIterator         PointIdConstIterator;
00083   typedef typename CellTraits::PointIdInternalIterator      PointIdInternalIterator;
00084   typedef typename CellTraits::PointIdInternalConstIterator PointIdInternalConstIterator;
00085 
00087   typedef typename CellTraits::QuadEdgeType              QEType;
00088   typedef typename QEType::OriginRefType                 VertexRefType;
00089   typedef typename QEType::DualOriginRefType             FaceRefType;
00090   typedef typename QEType::PrimalDataType                PrimalDataType;
00091   typedef typename QEType::DualDataType                  DualDataType;
00092   typedef typename QEType::DualType                      QEDual;
00093 
00094 public:
00096   itkTypeMacro( QuadEdgeMeshLineCell, TCellInterface );
00097 
00098   // accessor to the new QEGeom link that replaces now inheritance.
00099   QEType* GetQEGeom( ) const { return( m_QuadEdgeGeom ); };
00100 
00101 public:
00103   QuadEdgeMeshLineCell( );
00104   virtual ~QuadEdgeMeshLineCell();
00106 
00108   void SetIdent( CellIdentifier cid );
00109 
00110   CellIdentifier GetIdent();
00111 
00113   virtual void Accept( unsigned long cellId, MultiVisitor* mv );
00114   virtual CellGeometry GetType() const;
00116 
00118   static int GetTopologyId( );
00119   virtual unsigned int GetDimension() const;
00120   virtual unsigned int GetNumberOfPoints() const;
00122 
00123   virtual CellFeatureCount GetNumberOfBoundaryFeatures( int dimension ) const;
00124   virtual bool GetBoundaryFeature( int dimension,
00125                                    CellFeatureIdentifier cellId,
00126                                    CellAutoPointer& cell );
00127 
00129   virtual void MakeCopy( CellAutoPointer& cell ) const
00130     {
00131     cell.TakeOwnership( new Self );
00132     cell->SetPointId( 0, this->GetQEGeom( )->GetOrigin( ) );
00133     cell->SetPointId( 1, this->GetQEGeom( )->GetDestination( ) );
00134     }
00136 
00141   virtual void SetPointIds( PointIdConstIterator first );
00142   virtual void SetPointIds( PointIdConstIterator first,
00143                             PointIdConstIterator last );
00144   virtual void SetPointId( int localId, PointIdentifier pId );
00146 
00147   virtual PointIdIterator PointIdsBegin()
00148     {
00149     SynchronizePointsAPI();
00150     return &m_PointIds[0];
00151     }
00152   virtual PointIdIterator PointIdsEnd()
00153     {
00154     SynchronizePointsAPI();
00155     return (&m_PointIds[1] + 1);
00156     }
00157 
00158   virtual PointIdConstIterator GetPointIds() const
00159     {
00160     SynchronizePointsAPI();
00161     return &m_PointIds[0];
00162     }
00163   virtual PointIdConstIterator PointIdsBegin() const
00164     {
00165     SynchronizePointsAPI();
00166     return &m_PointIds[0];
00167     }
00168   virtual PointIdConstIterator PointIdsEnd() const
00169     {
00170     SynchronizePointsAPI();
00171     return(&m_PointIds[1] + 1);
00172     }
00173 
00175   void SynchronizePointsAPI() const
00176     {
00177     m_PointIds[0] = GetQEGeom()->GetOrigin();
00178     m_PointIds[1] = GetQEGeom()->GetDestination();
00179     }
00181 
00183   virtual void InternalSetPointIds( PointIdInternalConstIterator first );
00184   virtual void InternalSetPointIds( 
00185     PointIdInternalConstIterator first,
00186     PointIdInternalConstIterator last );
00188 
00189   virtual PointIdInternalIterator InternalPointIdsBegin();
00190   virtual PointIdInternalIterator InternalPointIdsEnd();
00191 
00192   virtual PointIdInternalConstIterator InternalGetPointIds() const;
00193   virtual PointIdInternalConstIterator InternalPointIdsBegin() const;
00194   virtual PointIdInternalConstIterator InternalPointIdsEnd() const;
00195 
00196 private:
00197   QuadEdgeMeshLineCell( const Self& );  //purposely not implemented
00198   void operator=( const Self& ); //purposely not implemented
00199 
00204   CellIdentifier  m_Identifier;
00205   QEType*         m_QuadEdgeGeom;
00206   mutable PointIdentifier m_PointIds[2];
00207 };
00208 
00209 } // end namespace itk
00210 
00211 #ifndef ITK_MANUAL_INSTANTIATION
00212 #include "itkQuadEdgeMeshLineCell.txx"
00213 #endif 
00214 
00215 #endif 
00216 

Generated at Tue Sep 15 04:28:09 2009 for ITK by doxygen 1.5.8 written by Dimitri van Heesch, © 1997-2000