OGS
main.cpp File Reference
#include <QVTKOpenGLNativeWidget.h>
#include <vtkSmartPointer.h>
#include <QApplication>
#include <QSurfaceFormat>
#include <memory>
#include "InfoLib/GitInfo.h"
#include "VtkVis/VtkConsoleOutputWindow.h"
#include "mainwindow.h"
Include dependency graph for main.cpp:

Go to the source code of this file.

Functions

int main (int argc, char *argv[])
 

Function Documentation

◆ main()

int main ( int argc,
char * argv[] )

Definition at line 21 of file main.cpp.

22{
23#ifdef NDEBUG
25#else
27#endif
28
29 // needed to ensure appropriate OpenGL context is created for VTK rendering.
30 QSurfaceFormat::setDefaultFormat(QVTKOpenGLNativeWidget::defaultFormat());
31
32 auto myOutputWindow = vtkSmartPointer<VtkConsoleOutputWindow>::New();
33 vtkOutputWindow::SetInstance(myOutputWindow);
34
35 QApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
36 QApplication a(argc, argv);
37 QApplication::setApplicationName("OpenGeoSys - Data Explorer");
38 QApplication::setApplicationVersion(
39 QString::fromStdString(GitInfoLib::GitInfo::ogs_version));
40 QApplication::setOrganizationName("OpenGeoSys Community");
41 QApplication::setOrganizationDomain("opengeosys.org");
42 setlocale(LC_NUMERIC, "C");
43 QLocale::setDefault(QLocale::German);
44 auto w = std::make_unique<MainWindow>();
45 w->setWindowTitle(w->windowTitle() + " - " +
46 QString::fromStdString(GitInfoLib::GitInfo::ogs_version));
47 if (QCoreApplication::arguments().size() > 1)
48 {
49 w->loadFileOnStartUp(QCoreApplication::arguments().at(1));
50 }
51 w->show();
52 int returncode = QApplication::exec();
53
54 return returncode;
55}
void initOGSLogger(std::string const &log_level)
Definition Logging.cpp:64
GITINFOLIB_EXPORT const std::string ogs_version
constexpr int size(int const displacement_dim)
Vectorized tensor size for given displacement dimension.

References BaseLib::initOGSLogger(), and GitInfoLib::GitInfo::ogs_version.