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: 2008-10-03 21:23:51 $
00007   Version:   $Revision: 1.15 $
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   SelfAutoPointer New();
00114 
00116   virtual void Accept( unsigned long cellId, MultiVisitor* mv );
00117   virtual CellGeometry GetType() const;
00119 
00121   static int GetTopologyId( );
00122   virtual unsigned int GetDimension() const;
00123   virtual unsigned int GetNumberOfPoints() const;
00125 
00126   virtual CellFeatureCount GetNumberOfBoundaryFeatures( int dimension ) const;
00127   virtual bool GetBoundaryFeature( int dimension,
00128                                    CellFeatureIdentifier cellId,
00129                                    CellAutoPointer& cell );
00130 
00132   virtual void MakeCopy( CellAutoPointer& cell ) const
00133     {
00134     cell.TakeOwnership( new Self );
00135     cell->SetPointId( 0, this->GetQEGeom( )->GetOrigin( ) );
00136     cell->SetPointId( 1, this->GetQEGeom( )->GetDestination( ) );
00137     }
00139 
00144   virtual void SetPointIds( PointIdConstIterator first );
00145   virtual void SetPointIds( PointIdConstIterator first,
00146                             PointIdConstIterator last );
00147   virtual void SetPointId( int localId, PointIdentifier pId );
00149 
00150   virtual PointIdIterator PointIdsBegin()
00151     {
00152     SynchronizePointsAPI();
00153     return &m_PointIds[0];
00154     }
00155   virtual PointIdIterator PointIdsEnd()
00156     {
00157     SynchronizePointsAPI();
00158     return (&m_PointIds[1] + 1);
00159     }
00160 
00161   virtual PointIdConstIterator GetPointIds() const
00162     {
00163     SynchronizePointsAPI();
00164     return &m_PointIds[0];
00165     }
00166   virtual PointIdConstIterator PointIdsBegin() const
00167     {
00168     SynchronizePointsAPI();
00169     return &m_PointIds[0];
00170     }
00171   virtual PointIdConstIterator PointIdsEnd() const
00172     {
00173     SynchronizePointsAPI();
00174     return(&m_PointIds[1] + 1);
00175     }
00176 
00178   void SynchronizePointsAPI() const
00179     {
00180     m_PointIds[0] = GetQEGeom()->GetOrigin();
00181     m_PointIds[1] = GetQEGeom()->GetDestination();
00182     }
00184 
00186   virtual void InternalSetPointIds( PointIdInternalConstIterator first );
00187   virtual void InternalSetPointIds( 
00188     PointIdInternalConstIterator first,
00189     PointIdInternalConstIterator last );
00191 
00192   virtual PointIdInternalIterator InternalPointIdsBegin();
00193   virtual PointIdInternalIterator InternalPointIdsEnd();
00194 
00195   virtual PointIdInternalConstIterator InternalGetPointIds() const;
00196   virtual PointIdInternalConstIterator InternalPointIdsBegin() const;
00197   virtual PointIdInternalConstIterator InternalPointIdsEnd() const;
00198 
00199 private:
00200   QuadEdgeMeshLineCell( const Self& );  //purposely not implemented
00201   void operator=( const Self& ); //purposely not implemented
00202 
00207   CellIdentifier  m_Identifier;
00208   QEType*         m_QuadEdgeGeom;
00209   mutable PointIdentifier m_PointIds[2];
00210 };
00211 
00212 } // end namespace itk
00213 
00214 #ifndef ITK_MANUAL_INSTANTIATION
00215 #include "itkQuadEdgeMeshLineCell.txx"
00216 #endif 
00217 
00218 #endif 
00219 

Generated at Wed Nov 5 23:42:58 2008 for ITK by doxygen 1.5.1 written by Dimitri van Heesch, © 1997-2000