"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "main.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.

main.cpp  (mathmod-10.1-source):main.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 *
skipping to change at line 27 skipping to change at line 27
* 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 "json_parser/parisodef.h" #include "json_parser/parisodef.h"
#include "ui_modules/drawingoptions.h" #include "ui_modules/drawingoptions.h"
#include "ui_modules/mathmod.h" #include "ui_modules/mathmod.h"
#include "ui_modules/parametersoptions.h" #include "ui_modules/parametersoptions.h"
#include <QApplication> #include <QApplication>
#include <QTextStream> #include <QTextStream>
#include <QGuiApplication>
#include <QSurfaceFormat>
#include <QOpenGLContext>
#ifdef Q_WS_X11 #ifdef Q_WS_X11
#include <X11/Xlib.h> #include <X11/Xlib.h>
#endif #endif
int main(int argc, char *argv[]) int main(int argc, char *argv[])
{ {
// QCoreApplication::setAttribute(Qt::AA_UseDesktopOpenGL); // QCoreApplication::setAttribute(Qt::AA_UseDesktopOpenGL);
QApplication app(argc, argv); QApplication app(argc, argv);
QSurfaceFormat fmt;
fmt.setDepthBufferSize(24);
QSurfaceFormat::setDefaultFormat(fmt);
// Request OpenGL 3.3 core or OpenGL ES 3.0.
if (QOpenGLContext::openGLModuleType() == QOpenGLContext::LibGL) {
qDebug("Requesting 3.3 core context");
//app.setVersion(3, 3);
//fmt.setProfile(QSurfaceFormat::CoreProfile);
} else {
qDebug("Requesting 3.0 context");
//fmt.setVersion(3, 0);
}
Parametersoptions Parameters; Parametersoptions Parameters;
Parameters.MainApp = &app; Parameters.MainApp = &app;
Parameters.LoadConfig(app, argc, argv); Parameters.LoadConfig(app, argc, argv);
// Creation of the two most important objects: // Creation of the two most important objects:
MathMod mm(nullptr, uint(Parameters.Threads[0]), MathMod mm(nullptr, uint(Parameters.Threads[0]),
uint(Parameters.InitParGrid), uint(Parameters.InitIsoGrid), uint(Parameters.InitParGrid), uint(Parameters.InitIsoGrid),
uint(Parameters.CalculFactor[0]), uint(Parameters.CalculFactor[1] ), uint(Parameters.CalculFactor[0]), uint(Parameters.CalculFactor[1] ),
uint(Parameters.CalculFactor[2])); uint(Parameters.CalculFactor[2]));
DrawingOptions drawingopt; DrawingOptions drawingopt;
// save references: // save references:
drawingopt.Parameters = &Parameters; drawingopt.Parameters = &Parameters;
drawingopt.MathmodRef = &mm; drawingopt.MathmodRef = &mm;
mm.Parent = &drawingopt; mm.Parent = &drawingopt;
mm.ui.glWidget->Xgrid = mm.ui.glWidget->Ygrid = mm.ui.glWidget->Zgrid=uint(P mm.Xgrid = mm.Ygrid = mm.Zgrid=uint(Parameters.InitIsoGrid);
arameters.InitIsoGrid); mm.Ugrid = mm.Vgrid = uint(Parameters.InitParGrid);
mm.ui.glWidget->Ugrid = mm.ui.glWidget->Vgrid = uint(Parameters.InitParGrid)
;
// GUI update: // GUI update:
drawingopt.UpdateGui(argc); drawingopt.UpdateGui(argc);
if (drawingopt.IsolistItemRef != nullptr) if (drawingopt.IsolistItemRef != nullptr)
drawingopt.ui.ObjectClasse->expandItem(drawingopt.IsolistItemRef); drawingopt.ui.ObjectClasse->expandItem(drawingopt.IsolistItemRef);
QObject::connect(drawingopt.MathmodRef->IsoObjet->masterthread,
QObject::connect(drawingopt.MathmodRef->ui.glWidget->IsoObjet->masterthread,
SIGNAL(mySignal(int)), drawingopt.ui.progressBar, SIGNAL(mySignal(int)), drawingopt.ui.progressBar,
SLOT(setValue(int))); SLOT(setValue(int)));
QObject::connect(drawingopt.MathmodRef->ui.glWidget->ParObjet->masterthread, QObject::connect(drawingopt.MathmodRef->ParObjet->masterthread,
SIGNAL(mySignal(int)), drawingopt.ui.progressBar, SIGNAL(mySignal(int)), drawingopt.ui.progressBar,
SLOT(setValue(int))); SLOT(setValue(int)));
QObject::connect(drawingopt.MathmodRef->ui.glWidget->IsoObjet, QObject::connect(drawingopt.MathmodRef->IsoObjet,
SIGNAL(ErrorSignal(int)), &drawingopt, SIGNAL(ErrorSignal(int)), &drawingopt,
SLOT(MemoryErrorMsg(int))); SLOT(MemoryErrorMsg(int)));
QObject::connect(drawingopt.MathmodRef->ui.glWidget->ParObjet, QObject::connect(drawingopt.MathmodRef->ParObjet,
SIGNAL(ErrorSignal(int)), &drawingopt, SIGNAL(ErrorSignal(int)), &drawingopt,
SLOT(MemoryErrorMsg(int))); SLOT(MemoryErrorMsg(int)));
QObject::connect(drawingopt.MathmodRef->ui.glWidget->IsoObjet, QObject::connect(drawingopt.MathmodRef->IsoObjet,
SIGNAL(UpdateMessageSignal(QString)), SIGNAL(UpdateMessageSignal(QString)),
drawingopt.ui.Messagetext, SLOT(setText(QString))); drawingopt.ui.Messagetext, SLOT(setText(QString)));
QObject::connect(drawingopt.MathmodRef->ui.glWidget->ParObjet, QObject::connect(drawingopt.MathmodRef->ParObjet,
SIGNAL(UpdateMessageSignal(QString)), SIGNAL(UpdateMessageSignal(QString)),
drawingopt.ui.Messagetext, SLOT(setText(QString))); drawingopt.ui.Messagetext, SLOT(setText(QString)));
QObject::connect(drawingopt.MathmodRef->ui.glWidget->ParObjet, QObject::connect(drawingopt.MathmodRef->ParObjet,
SIGNAL(finished()), drawingopt.MathmodRef->ui.glWidget, SIGNAL(finished()), drawingopt.MathmodRef,
SLOT(UpdateGL()), Qt::UniqueConnection); SLOT(UpdateGL()), Qt::UniqueConnection);
QObject::connect(drawingopt.MathmodRef->ui.glWidget->IsoObjet, QObject::connect(drawingopt.MathmodRef->IsoObjet,
SIGNAL(finished()), drawingopt.MathmodRef->ui.glWidget, SIGNAL(finished()), drawingopt.MathmodRef,
SLOT(UpdateGL()), Qt::UniqueConnection); SLOT(UpdateGL()), Qt::UniqueConnection);
QObject::connect(drawingopt.Parameters->ui.ApplypushButton, SIGNAL(clicked() ), QObject::connect(drawingopt.Parameters->ui.ApplypushButton, SIGNAL(clicked() ),
&drawingopt, SLOT(ApplypushButton_clicked())); &drawingopt, SLOT(ApplypushButton_clicked()));
drawingopt.show(); drawingopt.show();
mm.show(); mm.show();
drawingopt.raise(); drawingopt.raise();
mm.LoadShadersFiles();
drawingopt.on_choice_activated(Parameters.model); drawingopt.on_choice_activated(Parameters.model);
return app.exec(); return app.exec();
} }
 End of changes. 13 change blocks. 
17 lines changed or deleted 32 lines changed or added

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