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

itkQuadEdgeMeshMacro.h

Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Insight Segmentation & Registration Toolkit
00004   Module:    $RCSfile: itkQuadEdgeMeshMacro.h,v $
00005   Language:  C++
00006   Date:      $Date: 2007/07/06 00:58:51 $
00007   Version:   $Revision: 1.3 $
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 #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    /* If no points container are present, do nothing */                      \
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        } /* while */                                                         \
00081      } /* if */                                                              \
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    /* If no cells are present, do nothing */                                 \
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        /* Users code comes here: */
00122 
00129 #define itkQEMeshForAllCellsEndMacro(cellIterator)                           \
00130        cellIterator++;                                                       \
00131        } /* while */                                                         \
00132      } /* if */                                                              \
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       /* Users code comes here: */
00164 
00171 #define itkQEMeshForAllPrimalEdgesEndMacro                                   \
00172       } /* fi */                                                             \
00173    }                                                                         \
00174    itkQEMeshForAllCellsEndMacro                                              \
00175 }
00176 
00177 
00178 } // end namespace
00179 
00180 #endif
00181 

Generated at Sun Sep 23 13:58:24 2007 for ITK by doxygen 1.5.1 written by Dimitri van Heesch, © 1997-2000