ITK  4.1.0
Insight Segmentation and Registration Toolkit
itkQuadEdgeMeshEulerOperatorJoinVertexFunction.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 __itkQuadEdgeMeshEulerOperatorJoinVertexFunction_h
00019 #define __itkQuadEdgeMeshEulerOperatorJoinVertexFunction_h
00020 
00021 #include "itkQuadEdgeMeshFunctionBase.h"
00022 
00023 #include <stack>
00024 
00025 namespace itk
00026 {
00056 template< class TMesh, class TQEType >
00057 class ITK_EXPORT QuadEdgeMeshEulerOperatorJoinVertexFunction:
00058   public QuadEdgeMeshFunctionBase< TMesh, TQEType * >
00059 {
00060 public:
00061 
00063   typedef QuadEdgeMeshEulerOperatorJoinVertexFunction  Self;
00064   typedef SmartPointer< Self >                         Pointer;
00065   typedef SmartPointer< const Self      >              ConstPointer;
00066   typedef QuadEdgeMeshFunctionBase< TMesh, TQEType * > Superclass;
00067 
00068   itkNewMacro(Self);
00070   itkTypeMacro(QuadEdgeMeshEulerOperatorJoinVertexFunction, QuadEdgeMeshFunctionBase);
00071 
00073   typedef TQEType QEType;
00074 
00075   typedef typename Superclass::MeshType   MeshType;
00076   typedef typename Superclass::OutputType OutputType;
00077 
00078   typedef typename MeshType::PointIdentifier PointIdentifier;
00079   typedef typename MeshType::CellIdentifier  CellIdentifier;
00080   typedef typename MeshType::FaceRefType     FaceRefType;
00081 
00083   virtual OutputType Evaluate(QEType *h);
00084 
00085   enum EdgeStatusType {
00086     STANDARD_CONFIG = 0,
00087     EDGE_NULL,                     //1
00088     MESH_NULL,                     //2
00089     EDGE_ISOLATED,                 //3
00090     TOO_MANY_COMMON_VERTICES,      //4
00091     TETRAHEDRON_CONFIG,            //5
00092     QUADEDGE_ISOLATED,             //6
00093     FACE_ISOLATED,                 //7
00094     SAMOSA_CONFIG,                 //8
00095     EYE_CONFIG,                    //9
00096     EDGE_JOINING_DIFFERENT_BORDERS //10
00097     };
00098 
00099   itkGetConstMacro(OldPointID, PointIdentifier);
00100   itkGetConstMacro(EdgeStatus, EdgeStatusType);
00101 protected:
00102   QuadEdgeMeshEulerOperatorJoinVertexFunction();
00103   ~QuadEdgeMeshEulerOperatorJoinVertexFunction() {}
00104 
00105   void PrintSelf(std::ostream & os, Indent indent) const;
00106 
00107   PointIdentifier m_OldPointID;
00108 
00109   EdgeStatusType m_EdgeStatus;
00110 
00117   PointIdentifier CommonVertexNeighboor(QEType *e);
00118 
00125   bool IsTetrahedron(QEType *e);
00126 
00135   bool IsFaceIsolated(QEType *e, const bool & iWasLeftFace,
00136                       std::stack< TQEType * > & oToBeDeleted);
00137 
00138   bool IsSamosa(QEType *e);
00139 
00140   bool IsEye(QEType *e);
00141 
00142   bool IsEdgeLinkingTwoDifferentBorders(QEType *e);
00143 
00144   EdgeStatusType CheckStatus(QEType *e, std::stack< TQEType * > & oToBeDeleted);
00145 
00146   QEType * Process(QEType *e);
00147 
00148   QEType * ProcessIsolatedQuadEdge(QEType *e);
00149 
00150   QEType * ProcessIsolatedFace(QEType *e, std::stack< QEType * > & EdgesToBeDeleted
00151                                );
00152 
00153 private:
00154   QuadEdgeMeshEulerOperatorJoinVertexFunction(const Self &); //purposely not
00155                                                              // implemented
00156   void operator=(const Self &);                              //purposely not
00157 
00158   // implemented
00159 };
00160 } // namespace itk
00161 
00162 #include "itkQuadEdgeMeshEulerOperatorJoinVertexFunction.hxx"
00163 
00164 #endif
00165 
00166 // eof - itkQuadEdgeMeshEulerOperatorJoinVertexFunction.h
00167