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

itkFEMLoadImplementationGenericLandmarkLoad.h

Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Insight Segmentation & Registration Toolkit
00004   Module:    $RCSfile: itkFEMLoadImplementationGenericLandmarkLoad.h,v $
00005   Language:  C++
00006   Date:      $Date: 2002/06/11 16:58:31 $
00007   Version:   $Revision: 1.3 $
00008 
00009   Copyright (c) 2002 Insight 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 __itkFEMLoadImplementationGenericLandmarkLoad_h
00019 #define __itkFEMLoadImplementationGenericLandmarkLoad_h
00020 
00021 #include "itkFEMElementBase.h"
00022 #include "itkFEMLoadLandmark.h"
00023 
00024 namespace itk {
00025 namespace fem {
00026 
00027 
00028 
00035 class LoadImplementationGenericLandmarkLoad
00036 {
00037 public:
00038   template<class TElementClassConstPointer>
00039   static void HandleLoad(TElementClassConstPointer e, Element::LoadPointer l, Element::VectorType& Fe)
00040   {
00041     // Check if we really got an object of correct class
00042     LoadLandmark::Pointer l0=dynamic_cast<LoadLandmark*>(&*l);
00043     if ( !l0 )
00044     {
00045       // Class of passed load object was not compatible!
00046       throw FEMException(__FILE__, __LINE__, "FEM error");
00047     }
00048 
00049     // Statically cast the passed pointer to the element base class and
00050     // call the real load implementation with the correct pointer types.
00051     // If cast fails, the passed pointer was of incompatible class.
00052     Implementation(static_cast<Element::ConstPointer>(e),l0,Fe);
00053   }
00054 
00055 private:
00064   static void Implementation(Element::ConstPointer element, LoadLandmark::Pointer load, Element::VectorType& Fe);
00065 
00069   LoadImplementationGenericLandmarkLoad();
00070 };
00071 
00072 
00073 
00074 
00075 #ifdef _MSC_VER
00076 // Declare a static dummy function to prevent a MSVC 6.0 SP5 from crashing.
00077 // I have no idea why things don't work when this is not declared, but it
00078 // looks like this declaration makes compiler forget about some of the
00079 // troubles it has with templates.
00080 static void Dummy( void );
00081 #endif // #ifdef _MSC_VER
00082 
00083 }} // end namespace itk::fem
00084 
00085 #endif // #ifndef __itkFEMLoadImplementationGenericLandmarkLoad_h

Generated at Fri May 21 01:14:45 2004 for ITK by doxygen 1.2.15 written by Dimitri van Heesch, © 1997-2000