HyperspaceExplorer 0.7.1
CustomFunctionSlot.impl.h
00001 /*
00002 Hyperspace Explorer - visualizing higher-dimensional geometry
00003 Copyright (C) 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 
00019 */
00020 
00022 
00023 #ifndef CUSTOM_FUNCTION_SLOT_IMPL_H
00024 #define CUSTOM_FUNCTION_SLOT_IMPL_H
00025 
00026 #include "CustomFunction.h"
00027 
00029 
00035     template<class function>
00036             void C4DView::CustomFunctionSlot<function>::createCustomFunction(
00037                     C4DView *view) {
00038                 function *tmp = new function (
00039                     view->Values()->tmin (), view->Values()->tmax (), view->Values()->dt (),
00040                     view->Values()->umin (), view->Values()->umax (), view->Values()->du (),
00041                     view->Values()->vmin (), view->Values()->vmax (), view->Values()->dv ());
00042                 if (tmp->isValid()) {
00043                         view->setF(tmp);
00044                         QString sym (((function *)(view->F()).get ())->symbolic());
00045 
00046                     view->AssignValues(view->F());
00047                     view->Redraw ();
00048                 } else {
00049                     delete tmp;
00050                     view->UpdateStatus("Failed to load custom function");
00051                 }
00052             }
00053 
00055 
00061     template<class function>
00062         void C4DView::CustomFunctionSlot<function>::createCustomSurface(
00063                     C4DView *view) {
00064             function *tmp = new function (
00065                 view->Values()->tmin (), view->Values()->tmax (), view->Values()->dt (),
00066                 view->Values()->umin (), view->Values()->umax (), view->Values()->du ());
00067             if (tmp->isValid()) {
00068                 view->setF(tmp);
00069                 QString sym (((function *)(view->F()).get ())->symbolic());
00070 
00071                 view->AssignValues(view->F());
00072                 view->Redraw ();
00073             } else {
00074                 delete tmp;
00075                 view->UpdateStatus("Failed to load custom function");
00076             }
00077         }
00078 
00079 #endif
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Friends

Generated on Mon Apr 9 2012 20:25:16 for HyperspaceExplorer 0.7.1 by doxygen 1.7.4  -  Hosted bySourceForge.net Logo