ITK  4.1.0
Insight Segmentation and Registration Toolkit
itkQuadEdgeMeshEulerOperatorSplitEdgeFunction.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 __itkQuadEdgeMeshEulerOperatorSplitEdgeFunction_h
00019 #define __itkQuadEdgeMeshEulerOperatorSplitEdgeFunction_h
00020 
00021 #include "itkQuadEdgeMeshEulerOperatorSplitVertexFunction.h"
00022 
00023 namespace itk
00024 {
00034 template< class TMesh, class TQEType >
00035 class ITK_EXPORT QuadEdgeMeshEulerOperatorSplitEdgeFunction:
00036   public QuadEdgeMeshFunctionBase< TMesh, TQEType * >
00037 {
00038 public:
00039 
00041   typedef QuadEdgeMeshEulerOperatorSplitEdgeFunction   Self;
00042   typedef QuadEdgeMeshFunctionBase< TMesh, TQEType * > Superclass;
00043   typedef SmartPointer< Self >                         Pointer;
00044   typedef SmartPointer< const Self >                   ConstPointer;
00045 
00046   itkNewMacro(Self);
00048   itkTypeMacro(QuadEdgeMeshEulerOperatorSplitEdgeFunction, QuadEdgeMeshFunctionBase);
00049 
00051   typedef TQEType QEType;
00052 
00053   typedef typename Superclass::MeshType      MeshType;
00054   typedef typename Superclass::OutputType    OutputType;
00055   typedef typename MeshType::PointIdentifier PointIdentifier;
00056 
00057   typedef QuadEdgeMeshEulerOperatorSplitVertexFunction< MeshType, QEType > SplitVertex;
00058 
00060   virtual OutputType Evaluate(QEType *e)
00061   {
00062     if ( !e )
00063       {
00064       itkDebugMacro("Input is not an edge.");
00065       return ( (QEType *)0 );
00066       }
00068 
00069     if ( !this->m_Mesh )
00070       {
00071       itkDebugMacro("No mesh present.");
00072       return ( (QEType *)0 );
00073       }
00074 
00075     m_SplitVertex->SetInput(this->m_Mesh);
00076     return ( m_SplitVertex->Evaluate( e->GetLprev(), e->GetSym() ) );
00077   }
00078 
00079   const PointIdentifier GetNewPointID()
00080   {
00081     return ( m_SplitVertex->GetNewPointID() );
00082   }
00083 
00084 protected:
00085   QuadEdgeMeshEulerOperatorSplitEdgeFunction()
00086   {
00087     m_SplitVertex = SplitVertex::New();
00088   }
00089 
00090   ~QuadEdgeMeshEulerOperatorSplitEdgeFunction(){}
00091 private:
00092   QuadEdgeMeshEulerOperatorSplitEdgeFunction(const Self &); //purposely not
00093                                                             // implemented
00094   void operator=(const Self &);                             //purposely not
00095                                                             // implemented
00096 
00097   typename SplitVertex::Pointer m_SplitVertex;
00098 };
00099 } // namespace itk
00100 
00101 #endif
00102 
00103 // eof - itkQuadEdgeMeshEulerOperatorSplitEdgeFunction.h
00104