"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "pariso/isosurface/isotransformation.cpp" between
mathmod-10.1-source.zip and mathmod-11.0-source.zip

About: MathMod is a mathematical modeling software that visualize and animate implicit and parametric surfaces.

isotransformation.cpp  (mathmod-10.1-source):isotransformation.cpp  (mathmod-11.0-source)
/*************************************************************************** /***************************************************************************
* Copyright (C) 2020 by Abderrahman Taha * * Copyright (C) 2021 by Abderrahman Taha *
* * * *
* * * *
* This program is free software; you can redistribute it and/or modify * * This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by * * it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or * * the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. * * (at your option) any later version. *
* * * *
* This program is distributed in the hope that it will be useful, * * This program is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of * * but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. * * GNU General Public License for more details. *
* * * *
* You should have received a copy of the GNU General Public License * * You should have received a copy of the GNU General Public License *
* along with this program; if not, write to the * * along with this program; if not, write to the *
* Free Software Foundation, Inc., * * Free Software Foundation, Inc., *
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA *
***************************************************************************/ ***************************************************************************/
#include "isotransformation.h" #include "isotransformation.h"
void IsoTransformation::Twist() void IsoTransformation::Twist()
{ {
scalex = scaley = scalez=1; scalex = scaley = scalez=1;
twistx = twisty = twistz = 0; twistx = twisty = twistz = 0;
} }
QString IsoTransformation::Twistx(QString ImplicitFunction) QString IsoTransformation::Twistx(QString ImplicitFunction)
{ {
/* /*
double vals[2]={0,0}; double vals[2]={0,0};
QString after_1, after_2, angle, XlimitSup, XlimitInf; QString after_1, after_2, angle, XlimitSup, XlimitInf;
double tmp; double tmp;
for(int j=0; j<Nb_functs; j++) for(int j=0; j<Nb_functs; j++)
{ {
implicitFunctionParser[i].AddFunction(FunctNames[j], Fct[j]); implicitFunctionParser[i].AddFunction(FunctNames[j], Fct[j]);
} }
if(twistx != 0 || scalex !=1) if(twistx != 0 || scalex !=1)
{ {
angle = "1/("+XlimitSup+"-"+XlimitInf+")"; angle = "1/("+XlimitSup+"-"+XlimitInf+")";
ExpressionEvaluator.Parse(angle, "t"); ExpressionEvaluator.Parse(angle, "t");
tmp = ExpressionEvaluator.Eval(vals); tmp = ExpressionEvaluator.Eval(vals);
tmp *= twistx*2*PI/scalex; tmp *= twistx*2*PI/scalex;
angle = QString::number(tmp)+"*x"; angle = QString::number(tmp)+"*x";
after_1 = "(y*cos("+angle+") - z*sin("+angle+"))"; after_1 = "(y*cos("+angle+") - z*sin("+angle+"))";
after_2 = "(y*sin("+angle+") + z*cos("+angle+"))"; after_2 = "(y*sin("+angle+") + z*cos("+angle+"))";
ImplicitFunction = ImplicitFunction_save; ImplicitFunction = ImplicitFunction_save;
ImplicitFunction.replace(QChar('y'), "u"); ImplicitFunction.replace(QChar('y'), "u");
ImplicitFunction.replace(QChar('z'), "v"); ImplicitFunction.replace(QChar('z'), "v");
ImplicitFunction.replace(QChar('u'), after_1); ImplicitFunction.replace(QChar('u'), after_1);
ImplicitFunction.replace(QChar('v'), after_2); ImplicitFunction.replace(QChar('v'), after_2);
} }*/
*/
return ImplicitFunction; return ImplicitFunction;
} }
QString IsoTransformation::Twisty(QString ImplicitFunction) QString IsoTransformation::Twisty(QString ImplicitFunction)
{ {
return ImplicitFunction; return ImplicitFunction;
} }
QString IsoTransformation::Twistz(QString ImplicitFunction) QString IsoTransformation::Twistz(QString ImplicitFunction)
{ {
return ImplicitFunction; return ImplicitFunction;
} }
 End of changes. 12 change blocks. 
13 lines changed or deleted 2 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)