Go to the documentation of this file.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
00123
00130 #define itkQEMeshForAllCellsEndMacro(cellIterator) \
00131 cellIterator++; \
00132 } \
00133 } \
00134 }
00135
00137
00153 #define itkQEMeshForAllPrimalEdgesMacro( MeshType, \
00154 MeshInstance, \
00155 EdgeVariable ) \
00156 { \
00157 typedef typename MeshType::QEPrimal QEPrimal; \
00158 \
00159 itkQEMeshForAllCellsMacro( MeshType, MeshInstance, cellIterator ) \
00160 { \
00161 if( QEPrimal* EdgeVariable = \
00162 dynamic_cast< QEPrimal* >( cellIterator.Value( ) ) ) \
00163 { \
00164
00165
00172 #define itkQEMeshForAllPrimalEdgesEndMacro \
00173 } \
00174 } \
00175 itkQEMeshForAllCellsEndMacro \
00176 }
00177
00178
00179 }
00180
00181 #endif
00182