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: 2008-10-03 21:30:29 $
00007   Version:   $Revision: 1.5 $
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 
00123 
00130 #define itkQEMeshForAllCellsEndMacro(cellIterator)                           \
00131        cellIterator++;                                                       \
00132        } /* while */                                                         \
00133      } /* if */                                                              \
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       /* Users code comes here: */
00165 
00172 #define itkQEMeshForAllPrimalEdgesEndMacro                                   \
00173       } /* fi */                                                             \
00174    }                                                                         \
00175    itkQEMeshForAllCellsEndMacro                                              \
00176 }
00177 
00178 
00179 } // end namespace
00180 
00181 #endif
00182 

Generated at Tue Sep 15 04:28:09 2009 for ITK by doxygen 1.5.8 written by Dimitri van Heesch, © 1997-2000