00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017 #ifndef __itkQuadEdgeMeshMacro_h
00018 #define __itkQuadEdgeMeshMacro_h
00019
00020 namespace itk
00021 {
00022
00024
00046 #define itkQEMeshForAllPointsMacro( MeshType, \
00047 MeshInstance, \
00048 PointVariable, \
00049 PointIndex ) \
00050 { \
00051 typedef typename MeshType::PointType PointType; \
00052 typedef typename MeshType::PointIdentifier PointIdentifier; \
00053 typedef typename MeshType::PointsContainer PointsContainer; \
00054 typedef typename MeshType::PointsContainerIterator \
00055 PointsContainerIterator; \
00056 \
00057 PointsContainer* points = (MeshInstance)->GetPoints( ); \
00058 \
00059 if( ! points ) \
00060 { \
00061 itkWarningMacro( "No point container in itkQEMeshForAllPointsMacro" ); \
00062 } \
00063 else \
00064 { \
00065 PointsContainerIterator pointIterator = points->Begin(); \
00066 while( pointIterator != points->End( ) ) \
00067 { \
00068 PointType PointVariable = pointIterator.Value( ); \
00069 PointIdentifier PointIndex = pointIterator.Index( );
00070
00071
00078 #define itkQEMeshForAllPointsEndMacro \
00079 pointIterator++; \
00080 } \
00081 } \
00082 }
00083
00085
00104 #define itkQEMeshForAllCellsMacro( MeshType, \
00105 MeshInstance, \
00106 cellIterator ) \
00107 { \
00108 typedef typename MeshType::CellsContainer CellsContainer; \
00109 typedef typename MeshType::CellsContainerIterator \
00110 CellsContainerIterator; \
00111 \
00112 if( ! MeshInstance->GetCells( ) ) \
00113 { \
00114 itkWarningMacro( "No Cells container in itkQEMeshForAllCellsMacro" ); \
00115 } \
00116 else \
00117 { \
00118 CellsContainerIterator cellIterator = MeshInstance->GetCells()->Begin();\
00119 while( cellIterator != MeshInstance->GetCells()->End() ) \
00120 { \
00121
00122
00129 #define itkQEMeshForAllCellsEndMacro \
00130 cellIterator++; \
00131 } \
00132 } \
00133 }
00134
00136
00152 #define itkQEMeshForAllPrimalEdgesMacro( MeshType, \
00153 MeshInstance, \
00154 EdgeVariable ) \
00155 { \
00156 typedef typename MeshType::QEPrimal QEPrimal; \
00157 \
00158 itkQEMeshForAllCellsMacro( MeshType, MeshInstance, cellIterator ) \
00159 { \
00160 if( QEPrimal* EdgeVariable = \
00161 dynamic_cast< QEPrimal* >( cellIterator.Value( ) ) ) \
00162 { \
00163
00164
00171 #define itkQEMeshForAllPrimalEdgesEndMacro \
00172 } \
00173 } \
00174 itkQEMeshForAllCellsEndMacro \
00175 }
00176
00177
00178 }
00179
00180 #endif
00181