00001 //------------------------------------------------------------------------------ 00002 // This file is part of the OpenStructure project <www.openstructure.org> 00003 // 00004 // Copyright (C) 2008-2010 by the OpenStructure authors 00005 // Copyright (C) 2003-2010 by the IPLT authors 00006 // 00007 // This library is free software; you can redistribute it and/or modify it under 00008 // the terms of the GNU Lesser General Public License as published by the Free 00009 // Software Foundation; either version 3.0 of the License, or (at your option) 00010 // any later version. 00011 // This library is distributed in the hope that it will be useful, but WITHOUT 00012 // ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 00013 // FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more 00014 // details. 00015 // 00016 // You should have received a copy of the GNU Lesser General Public License 00017 // along with this library; if not, write to the Free Software Foundation, Inc., 00018 // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 00019 //------------------------------------------------------------------------------ 00020 00021 /* 00022 template function implementation, to serve 00023 as the basis for RealFunction and ComplexFunction 00024 00025 Author: Ansgar Philippsen 00026 */ 00027 00028 #ifndef IMG_FUNCTION_IMPL_H 00029 #define IMG_FUNCTION_IMPL_H 00030 00031 #include <ost/img/module_config.hh> 00032 #include "function_base.hh" 00033 00034 namespace ost { namespace img { namespace detail { 00035 00036 template <typename T> 00037 class TEMPLATE_EXPORT FunctionImpl: public Function { 00038 public: 00039 00041 // Data interface 00042 00043 virtual DataType GetType() const; 00044 00046 // Function interface 00047 00048 virtual Real GetIntpolReal(const Vec3 &v) const; 00049 virtual Complex GetIntpolComplex(const Vec3 &v) const; 00050 00052 // FunctionImpl interface 00053 00058 virtual T Func(const Vec3 &v) const = 0; 00059 00060 protected: 00062 FunctionImpl(DataDomain d); 00063 00064 FunctionImpl(const FunctionImpl& f); 00065 00066 FunctionImpl& operator=(const FunctionImpl& f); 00067 }; 00068 00069 }}} // namespaces 00070 00071 #endif
1.5.8