ITK  4.1.0
Insight Segmentation and Registration Toolkit
itkQuadEdgeMeshTopologyChecker.h
Go to the documentation of this file.
00001 /*=========================================================================
00002  *
00003  *  Copyright Insight Software Consortium
00004  *
00005  *  Licensed under the Apache License, Version 2.0 (the "License");
00006  *  you may not use this file except in compliance with the License.
00007  *  You may obtain a copy of the License at
00008  *
00009  *         http://www.apache.org/licenses/LICENSE-2.0.txt
00010  *
00011  *  Unless required by applicable law or agreed to in writing, software
00012  *  distributed under the License is distributed on an "AS IS" BASIS,
00013  *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
00014  *  See the License for the specific language governing permissions and
00015  *  limitations under the License.
00016  *
00017  *=========================================================================*/
00018 #ifndef __itkQuadEdgeMeshTopologyChecker_h
00019 #define __itkQuadEdgeMeshTopologyChecker_h
00020 
00021 #include "itkQuadEdgeMeshBoundaryEdgesMeshFunction.h"
00022 
00023 namespace itk
00024 {
00040 template< class TMesh >
00041 class ITK_EXPORT QuadEdgeMeshTopologyChecker:public Object
00042 {
00043 public:
00044   // Standard types
00045   typedef QuadEdgeMeshTopologyChecker Self;
00046   typedef Object                      Superclass;
00047   typedef SmartPointer< Self >        Pointer;
00048   typedef SmartPointer< const Self >  ConstPointer;
00049 
00050   typedef TMesh                                             MeshType;
00051   typedef typename MeshType::QEPrimal                       QEPrimal;
00052   typedef typename MeshType::EdgeCellType                   EdgeCellType;
00053   typedef typename MeshType::CellsContainerConstIterator    CellsContainerConstIterator;
00054   typedef QuadEdgeMeshBoundaryEdgesMeshFunction< MeshType > BoundaryEdges;
00055 
00056   typedef typename MeshType::PointIdentifier                PointIdentifier;
00057   typedef typename MeshType::CellIdentifier                 CellIdentifier;
00058 
00059 public:
00060   itkNewMacro(Self);
00061   itkTypeMacro(QuadEdgeMeshTopologyChecker, Object);
00062 
00063   itkSetConstObjectMacro(Mesh, MeshType);
00064 
00065   typedef ::itk::IdentifierType     IdentifierType;
00066   typedef ::itk::OffsetValueType    OffsetValueType;
00067 
00068   itkSetMacro(ExpectedNumberOfPoints, PointIdentifier);
00069   itkSetMacro(ExpectedNumberOfEdges, CellIdentifier);
00070   itkSetMacro(ExpectedNumberOfFaces, CellIdentifier);
00071   itkSetMacro(ExpectedNumberOfBoundaries, CellIdentifier);
00072   itkSetMacro(ExpectedGenus, OffsetValueType);
00073 
00074   bool ValidateEulerCharacteristic() const;
00075 
00076 protected:
00077   QuadEdgeMeshTopologyChecker();
00078   ~QuadEdgeMeshTopologyChecker(){}
00079   void PrintSelf(std::ostream & os, Indent indent) const;
00080 
00081 private:
00082   QuadEdgeMeshTopologyChecker(const Self &); //purposely not implemented
00083   void operator=(const Self &);              //purposely not implemented
00084 
00085   typedef typename MeshType::ConstPointer MeshPointer;
00086 
00087   MeshPointer m_Mesh;
00088 
00089   PointIdentifier  m_ExpectedNumberOfPoints;
00090   CellIdentifier   m_ExpectedNumberOfEdges;
00091   CellIdentifier   m_ExpectedNumberOfFaces;
00092   CellIdentifier   m_ExpectedNumberOfBoundaries;
00093   OffsetValueType  m_ExpectedGenus;
00094 };
00095 }
00096 
00097 #ifndef ITK_MANUAL_INSTANTIATION
00098 #include "itkQuadEdgeMeshTopologyChecker.hxx"
00099 #endif
00100 
00101 #endif
00102