HyperspaceExplorer 0.7.1
|
00001 /* 00002 Hyperspace Explorer - visualizing higher-dimensional geometry 00003 Copyright (C) 2008-2010 Lene Preuss <lene.preuss@gmail.com> 00004 00005 This program is free software; you can redistribute it and/or modify 00006 it under the terms of the GNU General Public License as published by 00007 the Free Software Foundation; either version 2 of the License, or 00008 (at your option) any later version. 00009 00010 This program is distributed in the hope that it will be useful, 00011 but WITHOUT ANY WARRANTY; without even the implied warranty of 00012 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00013 GNU General Public License for more details. 00014 00015 You should have received a copy of the GNU General Public License along 00016 with this program; if not, write to the Free Software Foundation, Inc., 00017 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 00018 (Seriously, has anyone ever done this?) 00019 00020 */ 00021 #ifndef REAL_FUNCTION_H 00022 #define REAL_FUNCTION_H 00023 00024 #include "FunctionHolder.h" 00025 00026 #include "ParametricFunction.h" 00027 #include "MultiDimensionalVector.h" 00028 00029 #include <memory> 00030 00032 00043 class RealFunction: public FunctionHolder<4, 3, double> { 00044 00045 public: 00046 00050 typedef VecMath::Vector<4> &function_type(double, double, double); 00052 typedef VecMath::Vector<4> raw_function_type (double, double, double); 00053 00054 RealFunction(); 00055 RealFunction(ParametricFunction<4, 3> *function); 00056 RealFunction(double tmin, double tmax, double dt, 00057 double umin, double umax, double du, 00058 double vmin, double vmax, double dv, 00059 ParameterMap _parms = ParameterMap()); 00060 virtual ~RealFunction(); 00061 00062 virtual void ReInit(double tmin, double tmax, double dt, 00063 double umin, double umax, double du, 00064 double vmin, double vmax, double dv); 00065 00067 virtual std::string getFunctionName() const; 00068 00070 VecMath::Vector<4> &operator () (double t, double u, double v); 00071 00073 virtual unsigned getNumParameters(); 00074 00075 protected: 00076 00077 VecMath::Vector<4> &normal(double t, double u, double v); 00078 00080 virtual void Initialize (void); 00081 00083 std::shared_ptr< ParametricFunction<4, 3> > _function; 00084 00085 private: 00086 00087 class Impl; 00088 std::unique_ptr<Impl> pImpl_; 00089 00090 }; 00091 00092 namespace { 00093 DisplayableClass displayable_class_real_function( 00094 "RealFunction", "Functions R³ -> R", "FunctionHolder" 00095 ); 00096 } 00097 #endif