00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
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
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
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
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& );
00201 void operator=( const Self& );
00202
00207 CellIdentifier m_Identifier;
00208 QEType* m_QuadEdgeGeom;
00209 mutable PointIdentifier m_PointIds[2];
00210 };
00211
00212 }
00213
00214 #ifndef ITK_MANUAL_INSTANTIATION
00215 #include "itkQuadEdgeMeshLineCell.txx"
00216 #endif
00217
00218 #endif
00219