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

itkQuadEdge.h

Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Insight Segmentation & Registration Toolkit
00004   Module:    $RCSfile: itkQuadEdge.h,v $
00005   Language:  C++
00006   Date:      $Date: 2007/02/26 15:46:54 $
00007   Version:   $Revision: 1.12 $
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 
00018 #ifndef __itkQuadEdge_h
00019 #define __itkQuadEdge_h
00020 
00021 #include "itkQuadEdgeMeshBaseIterator.h"
00022 
00023 #include "itkMacro.h"
00024 
00025 // Debugging macros for classes that do not derive from the itkObject.
00026 // FIXME: Maybe variations of these macros should be moved into
00027 // itkMacro.h
00028 //
00029 #define itkQEDebugMacro( x )                                        \
00030 {                                                                   \
00031     OStringStream itkmsg;                                    \
00032     itkmsg << "Debug: In " __FILE__ ", line " << __LINE__ << "\n"   \
00033            << " (" << this << "): " x                               \
00034            << "\n\n";                                               \
00035     OutputWindowDisplayDebugText( itkmsg.str( ).c_str( ) );  \
00036 }
00037 #define itkQEWarningMacro( x )                                      \
00038 {                                                                   \
00039     OStringStream itkmsg;                                    \
00040     itkmsg << "WARNING: In " __FILE__ ", line " << __LINE__ << "\n" \
00041            << " (" << this << "): " x                               \
00042            << "\n\n";                                               \
00043     OutputWindowDisplayWarningText( itkmsg.str( ).c_str( ) );\
00044 }
00045 
00046 
00047 // -------------------------------------------------------------------------
00056 #define itkQEAccessorsMacro( st, pt, dt )                               \
00057    pt* GetOnext()                                                       \
00058     {                                                                   \
00059     return( dynamic_cast<  pt* >( this->st::GetOnext() ) );             \
00060     }                                                                   \
00061                                                                         \
00062    dt* GetRot()                                                         \
00063     {                                                                   \
00064     return( dynamic_cast<  dt* >( this->st::GetRot() ) );               \
00065     }                                                                   \
00066                                                                         \
00067    pt* GetSym()                                                         \
00068     {                                                                   \
00069     return( dynamic_cast<  pt* >( this->st::GetSym() ) );               \
00070     }                                                                   \
00071                                                                         \
00072    pt* GetLnext()                                                       \
00073     {                                                                   \
00074     return( dynamic_cast<  pt* >( this->st::GetLnext() ) );             \
00075     }                                                                   \
00076                                                                         \
00077    pt* GetRnext()                                                       \
00078     {                                                                   \
00079     return( dynamic_cast<  pt* >( this->st::GetRnext() ) );             \
00080     }                                                                   \
00081                                                                         \
00082    pt* GetDnext()                                                       \
00083     {                                                                   \
00084     return( dynamic_cast<  pt* >( this->st::GetDnext() ) );             \
00085     }                                                                   \
00086                                                                         \
00087    pt* GetOprev()                                                       \
00088     {                                                                   \
00089     return( dynamic_cast<  pt* >( this->st::GetOprev() ) );             \
00090     }                                                                   \
00091                                                                         \
00092    pt* GetLprev()                                                       \
00093     {                                                                   \
00094     return( dynamic_cast<  pt* >( this->st::GetLprev() ) );             \
00095     }                                                                   \
00096                                                                         \
00097    pt* GetRprev()                                                       \
00098     {                                                                   \
00099     return( dynamic_cast<  pt* >( this->st::GetRprev() ) );             \
00100     }                                                                   \
00101                                                                         \
00102    pt* GetDprev()                                                       \
00103     {                                                                   \
00104     return( dynamic_cast<  pt* >( this->st::GetDprev() ) );             \
00105     }                                                                   \
00106                                                                         \
00107    dt* GetInvRot()                                                      \
00108     {                                                                   \
00109     return( dynamic_cast< dt* >( this->st::GetInvRot() ) );             \
00110     }                                                                   \
00111                                                                         \
00112    pt* GetInvOnext()                                                    \
00113     {                                                                   \
00114     return( dynamic_cast<  pt* >( this->st::GetInvOnext() ) );          \
00115     }                                                                   \
00116                                                                         \
00117    pt* GetInvLnext()                                                    \
00118     {                                                                   \
00119     return( dynamic_cast<  pt* >( this->st::GetInvLnext() ) );          \
00120     }                                                                   \
00121                                                                         \
00122    pt* GetInvRnext()                                                    \
00123     {                                                                   \
00124     return( dynamic_cast<  pt* >( this->st::GetInvRnext() ) );          \
00125     }                                                                   \
00126                                                                         \
00127    pt* GetInvDnext()                                                    \
00128     {                                                                   \
00129     return( dynamic_cast<  pt* >( this->st::GetInvDnext() ) );          \
00130     }                                                                   \
00131   const pt* GetOnext() const                                            \
00132     {                                                                   \
00133     return( dynamic_cast< const pt* >( this->st::GetOnext() ) );        \
00134     }                                                                   \
00135                                                                         \
00136   const dt* GetRot() const                                              \
00137     {                                                                   \
00138     return( dynamic_cast< const dt* >( this->st::GetRot() ) );          \
00139     }                                                                   \
00140                                                                         \
00141   const pt* GetSym() const                                              \
00142     {                                                                   \
00143     return( dynamic_cast< const pt* >( this->st::GetSym() ) );          \
00144     }                                                                   \
00145                                                                         \
00146   const pt* GetLnext() const                                            \
00147     {                                                                   \
00148     return( dynamic_cast< const pt* >( this->st::GetLnext() ) );        \
00149     }                                                                   \
00150                                                                         \
00151   const pt* GetRnext() const                                            \
00152     {                                                                   \
00153     return( dynamic_cast< const pt* >( this->st::GetRnext() ) );        \
00154     }                                                                   \
00155                                                                         \
00156   const pt* GetDnext() const                                            \
00157     {                                                                   \
00158     return( dynamic_cast< const pt* >( this->st::GetDnext() ) );        \
00159     }                                                                   \
00160                                                                         \
00161   const pt* GetOprev() const                                            \
00162     {                                                                   \
00163     return( dynamic_cast< const pt* >( this->st::GetOprev() ) );        \
00164     }                                                                   \
00165                                                                         \
00166   const pt* GetLprev() const                                            \
00167     {                                                                   \
00168     return( dynamic_cast< const pt* >( this->st::GetLprev() ) );        \
00169     }                                                                   \
00170                                                                         \
00171   const pt* GetRprev() const                                            \
00172     {                                                                   \
00173     return( dynamic_cast< const pt* >( this->st::GetRprev() ) );        \
00174     }                                                                   \
00175                                                                         \
00176   const pt* GetDprev() const                                            \
00177     {                                                                   \
00178     return( dynamic_cast< const pt* >( this->st::GetDprev() ) );        \
00179     }                                                                   \
00180                                                                         \
00181   const dt* GetInvRot() const                                           \
00182     {                                                                   \
00183     return( dynamic_cast< const dt* >( this->st::GetInvRot() ) );       \
00184     }                                                                   \
00185                                                                         \
00186   const pt* GetInvOnext() const                                         \
00187     {                                                                   \
00188     return( dynamic_cast< const pt* >( this->st::GetInvOnext() ) );     \
00189     }                                                                   \
00190                                                                         \
00191   const pt* GetInvLnext() const                                         \
00192     {                                                                   \
00193     return( dynamic_cast< const pt* >( this->st::GetInvLnext() ) );     \
00194     }                                                                   \
00195                                                                         \
00196   const pt* GetInvRnext() const                                         \
00197     {                                                                   \
00198     return( dynamic_cast< const pt* >( this->st::GetInvRnext() ) );     \
00199     }                                                                   \
00200                                                                         \
00201   const pt* GetInvDnext() const                                         \
00202     {                                                                   \
00203     return( dynamic_cast< const pt* >( this->st::GetInvDnext() ) );     \
00204     }
00205 
00206 
00207 namespace itk
00208 {
00209 
00223 class QuadEdge
00224 {
00225 public:
00227   typedef QuadEdge Self;
00228 
00230   typedef QuadEdgeMeshIterator< Self >      Iterator;
00231   typedef QuadEdgeMeshConstIterator< Self > ConstIterator;
00232 
00234   itkQEDefineIteratorMethodsMacro( Onext );
00235   itkQEDefineIteratorMethodsMacro( Sym );
00236   itkQEDefineIteratorMethodsMacro( Lnext );
00237   itkQEDefineIteratorMethodsMacro( Rnext );
00238   itkQEDefineIteratorMethodsMacro( Dnext );
00239   itkQEDefineIteratorMethodsMacro( Oprev );
00240   itkQEDefineIteratorMethodsMacro( Lprev );
00241   itkQEDefineIteratorMethodsMacro( Rprev );
00242   itkQEDefineIteratorMethodsMacro( Dprev );
00243   itkQEDefineIteratorMethodsMacro( InvOnext );
00244   itkQEDefineIteratorMethodsMacro( InvLnext );
00245   itkQEDefineIteratorMethodsMacro( InvRnext );
00246   itkQEDefineIteratorMethodsMacro( InvDnext );
00248 
00249 
00251   QuadEdge();
00252   virtual ~QuadEdge();
00254 
00256   void SetOnext( Self* onext );
00257   void SetRot( Self* rot );
00259 
00263   Self* GetOnext();
00264   Self* GetRot();
00265   const Self* GetOnext() const;
00266   const Self* GetRot() const;
00268 
00269 
00287   void Splice( Self* b );
00288 
00289 
00290   //  Second order accessors.
00291 
00294   Self* GetSym();
00295   const Self* GetSym() const; 
00297 
00300   Self* GetLnext(); 
00301   const Self* GetLnext() const;
00303 
00307   Self* GetRnext();
00308   const Self* GetRnext() const;
00310 
00314   Self* GetDnext();
00315   const Self* GetDnext() const;
00317 
00320   Self* GetOprev();
00321   const Self* GetOprev() const;
00323 
00327   Self* GetLprev();
00328   const Self* GetLprev() const;
00330 
00334   Self* GetRprev();
00335   const Self* GetRprev() const;
00337 
00341   Self* GetDprev();
00342   const Self* GetDprev() const;
00344 
00346   Self * GetInvRot();
00347   Self * GetInvOnext();
00348   Self * GetInvLnext();
00349   Self * GetInvRnext();
00350   Self * GetInvDnext();
00351   const Self * GetInvRot() const;
00352   const Self * GetInvOnext() const;
00353   const Self * GetInvLnext() const;
00354   const Self * GetInvRnext() const;
00355   const Self * GetInvDnext() const;
00357 
00359   bool IsHalfEdge() const;
00360   bool IsIsolated() const;
00361   bool IsEdgeInOnextRing( Self* testEdge ) const;
00362   bool IsLnextGivenSizeCyclic( const int size ) const;
00363   unsigned int GetOrder() const;
00365 
00366 private: 
00367 
00368   Self* m_Onext; 
00369   Self* m_Rot;   
00370 
00371 };
00372 
00373 } 
00374 
00375 #endif 
00376 

Generated at Mon Mar 12 02:20:38 2007 for ITK by doxygen 1.5.1 written by Dimitri van Heesch, © 1997-2000