From 722b686adbc4f109d18e606593767a8b25b7be07 Mon Sep 17 00:00:00 2001 From: JustinBonus Date: Mon, 8 Apr 2024 10:48:45 -0700 Subject: [PATCH 1/3] More ifdef switches in MPM --- EVENTS/MPM/MPM.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/EVENTS/MPM/MPM.cpp b/EVENTS/MPM/MPM.cpp index 1afa26a..4d0c278 100644 --- a/EVENTS/MPM/MPM.cpp +++ b/EVENTS/MPM/MPM.cpp @@ -1168,8 +1168,9 @@ MPM::MPM(RandomVariablesContainer *theRandomVariableIW, QWidget *parent) horizontalPanelLayout->addWidget(scrollArea); // horizontalPanelLayout->addWidget(visualizationGroup); +#ifdef _WIN32 horizontalPanelLayout->addWidget(container); - +#endif // QVBoxLayout *layout = new QVBoxLayout(); // mainWindowLayout->addWidget(scrollArea); // mainWindowLayout->addWidget(updateBodiesButton); @@ -1182,7 +1183,9 @@ MPM::MPM(RandomVariablesContainer *theRandomVariableIW, QWidget *parent) int index = stackedWidget->currentIndex(); mpmBodies->setDigitalTwin(index); mpmBoundaries->setDigitalTwin(index); +#ifdef _WIN32 updateDigitalTwin(index); +#endif }); From a8421081500c2a99bd3970571787fc0465da513f Mon Sep 17 00:00:00 2001 From: JustinBonus Date: Mon, 8 Apr 2024 13:26:52 -0700 Subject: [PATCH 2/3] Fix some OS-specific code for 3D visualizer --- EVENTS/MPM/MPM.cpp | 10 ++-- Hydro-UQ.pro | 112 ++++++++++++++++++++++----------------------- 2 files changed, 63 insertions(+), 59 deletions(-) diff --git a/EVENTS/MPM/MPM.cpp b/EVENTS/MPM/MPM.cpp index 4d0c278..285804f 100644 --- a/EVENTS/MPM/MPM.cpp +++ b/EVENTS/MPM/MPM.cpp @@ -129,6 +129,8 @@ UPDATES, ENHANCEMENTS, OR MODIFICATIONS. // #include // #include +// #include + MPM::MPM(RandomVariablesContainer *theRandomVariableIW, QWidget *parent) : SimCenterAppWidget(parent), theRandomVariablesContainer(theRandomVariableIW) { @@ -411,7 +413,7 @@ MPM::MPM(RandomVariablesContainer *theRandomVariableIW, QWidget *parent) // theTabWidget->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Maximum); -#ifdef _WIN32 +#if defined(Q_OS_WIN) || defined(Q_OS_WIN32) || defined(Q_OS_LINUX) || defined(Q_OS_UNIX) // ----------------------------------------------------------------------------------- // Create a 3D window and container widget and set the 3D window as its layout // Based on code by Alex44, 2018; https://stackoverflow.com/questions/23231012/how-to-render-in-qt3d-in-standard-gui-application) @@ -1168,7 +1170,8 @@ MPM::MPM(RandomVariablesContainer *theRandomVariableIW, QWidget *parent) horizontalPanelLayout->addWidget(scrollArea); // horizontalPanelLayout->addWidget(visualizationGroup); -#ifdef _WIN32 +// #ifdef _WIN32 +#if defined(Q_OS_WIN) || defined(Q_OS_WIN32) || defined(Q_OS_LINUX) || defined(Q_OS_UNIX) horizontalPanelLayout->addWidget(container); #endif // QVBoxLayout *layout = new QVBoxLayout(); @@ -1183,7 +1186,8 @@ MPM::MPM(RandomVariablesContainer *theRandomVariableIW, QWidget *parent) int index = stackedWidget->currentIndex(); mpmBodies->setDigitalTwin(index); mpmBoundaries->setDigitalTwin(index); -#ifdef _WIN32 +// #ifdef _WIN32 +#if defined(Q_OS_WIN) || defined(Q_OS_WIN32) || defined(Q_OS_LINUX) || defined(Q_OS_UNIX) updateDigitalTwin(index); #endif }); diff --git a/Hydro-UQ.pro b/Hydro-UQ.pro index b4a79cb..919d3ec 100644 --- a/Hydro-UQ.pro +++ b/Hydro-UQ.pro @@ -42,33 +42,33 @@ win32 { # Windows LIBS += -lAdvapi32 RC_ICONS = icons/NHERI-HydroUQ-Icon.ico - DEPENDPATH += $$PWD/../VTK/bin - INCLUDEPATH += $$PWD/../VTK/include/vtk-9.2 - LIBS += -L$$PWD/../VTK/lib \ - -lvtkViewsCore-9.2 \ - -lvtkFiltersCore-9.2 \ - -lvtkFiltersSources-9.2 \ - -lvtkCommonCore-9.2 \ - -lvtkCommonColor-9.2 \ - -lvtkFiltersGeometry-9.2 \ - -lvtkRenderingCore-9.2 \ - -lvtkInteractionStyle-9.2\ - -lvtkCommonTransforms-9.2\ - -lvtkInteractionWidgets-9.2\ - -lvtkRenderingContextOpenGL2-9.2 \ - -lvtkRenderingFreeType-9.2 \ - -lvtkRenderingGL2PSOpenGL2-9.2 \ - -lvtkRenderingAnnotation-9.2 \ - -lvtkCommonExecutionModel-9.2 \ - -lvtkCommonDataModel-9.2 \ - -lvtkGUISupportQt-9.2 \ - -lvtkRenderingOpenGL2-9.2 \ - -lvtkIOGeometry-9.2 \ - -lvtkViewsQt-9.2 \ - -lvtkImagingCore-9.2 \ - -lvtkIOImage-9.2 \ - -lvtkIOLegacy-9.2 \ - -lvtksys-9.2 + # DEPENDPATH += $$PWD/../VTK/bin + # INCLUDEPATH += $$PWD/../VTK/include/vtk-9.2 + # LIBS += -L$$PWD/../VTK/lib \ + # -lvtkViewsCore-9.2 \ + # -lvtkFiltersCore-9.2 \ + # -lvtkFiltersSources-9.2 \ + # -lvtkCommonCore-9.2 \ + # -lvtkCommonColor-9.2 \ + # -lvtkFiltersGeometry-9.2 \ + # -lvtkRenderingCore-9.2 \ + # -lvtkInteractionStyle-9.2\ + # -lvtkCommonTransforms-9.2\ + # -lvtkInteractionWidgets-9.2\ + # -lvtkRenderingContextOpenGL2-9.2 \ + # -lvtkRenderingFreeType-9.2 \ + # -lvtkRenderingGL2PSOpenGL2-9.2 \ + # -lvtkRenderingAnnotation-9.2 \ + # -lvtkCommonExecutionModel-9.2 \ + # -lvtkCommonDataModel-9.2 \ + # -lvtkGUISupportQt-9.2 \ + # -lvtkRenderingOpenGL2-9.2 \ + # -lvtkIOGeometry-9.2 \ + # -lvtkViewsQt-9.2 \ + # -lvtkImagingCore-9.2 \ + # -lvtkIOImage-9.2 \ + # -lvtkIOLegacy-9.2 \ + # -lvtksys-9.2 } else { @@ -76,41 +76,41 @@ win32 { # Mac ICON = icons/NHERI-HydroUQ-Icon.icns QMAKE_INFO_PLIST=$$PWD/Info.plist + LIBS += -L/usr/local/lib # DEPENDPATH += $$PWD/../VTK/lib # DEPENDPATH += $$PWD/../VTK/Release/bin # INCLUDEPATH += $$PWD/../VTK/Release/include/vtk-9.2 - INCLUDEPATH += $$PWD/../VTK/include/vtk-9.2 - INCLUDEPATH += /usr/local/include/vtk-9.2 - LIBS += -L$$PWD/../VTK/lib - LIBS += -L/usr/local/lib \ - -lvtkViewsCore-9.2 \ - -lvtkFiltersCore-9.2 \ - -lvtkFiltersSources-9.2 \ - -lvtkCommonCore-9.2 \ - -lvtkCommonColor-9.2 \ - -lvtkFiltersGeometry-9.2 \ - -lvtkRenderingCore-9.2 \ - -lvtkInteractionStyle-9.2\ - -lvtkCommonTransforms-9.2\ - -lvtkInteractionWidgets-9.2\ - -lvtkRenderingContextOpenGL2-9.2 \ - -lvtkRenderingFreeType-9.2 \ - -lvtkRenderingGL2PSOpenGL2-9.2 \ - -lvtkRenderingAnnotation-9.2 \ - -lvtkCommonExecutionModel-9.2 \ - -lvtkCommonDataModel-9.2 \ - -lvtkGUISupportQt-9.2 \ - -lvtkRenderingOpenGL2-9.2 \ - -lvtkIOGeometry-9.2 \ - -lvtkViewsQt-9.2 \ - -lvtkImagingCore-9.2 \ - -lvtkIOImage-9.2 \ - -lvtkIOLegacy-9.2 \ - -lvtksys-9.2 + # INCLUDEPATH += $$PWD/../VTK/include/vtk-9.2 + # INCLUDEPATH += /usr/local/include/vtk-9.2 + # LIBS += -L$$PWD/../VTK/lib \ + # -lvtkViewsCore-9.2 \ + # -lvtkFiltersCore-9.2 \ + # -lvtkFiltersSources-9.2 \ + # -lvtkCommonCore-9.2 \ + # -lvtkCommonColor-9.2 \ + # -lvtkFiltersGeometry-9.2 \ + # -lvtkRenderingCore-9.2 \ + # -lvtkInteractionStyle-9.2\ + # -lvtkCommonTransforms-9.2\ + # -lvtkInteractionWidgets-9.2\ + # -lvtkRenderingContextOpenGL2-9.2 \ + # -lvtkRenderingFreeType-9.2 \ + # -lvtkRenderingGL2PSOpenGL2-9.2 \ + # -lvtkRenderingAnnotation-9.2 \ + # -lvtkCommonExecutionModel-9.2 \ + # -lvtkCommonDataModel-9.2 \ + # -lvtkGUISupportQt-9.2 \ + # -lvtkRenderingOpenGL2-9.2 \ + # -lvtkIOGeometry-9.2 \ + # -lvtkViewsQt-9.2 \ + # -lvtkImagingCore-9.2 \ + # -lvtkIOImage-9.2 \ + # -lvtkIOLegacy-9.2 \ + # -lvtksys-9.2 } else { # Presumably Ubuntu 18.04 LTS - # INCLUDEPATH += /usr/local/include/vtk-9.2 LIBS += -L/usr/local/lib \ + # INCLUDEPATH += /usr/local/include/vtk-9.2 #-lvtkViewsCore-9.2 \ #-lvtkFiltersCore-9.2 \ #-lvtkCommonColor-9.2 \ From 7109b2c692f4b4501649dfecf62ed472b78552a7 Mon Sep 17 00:00:00 2001 From: JustinBonus Date: Mon, 8 Apr 2024 14:54:09 -0700 Subject: [PATCH 3/3] Remove hanging endif --- EVENTS/MPM/MPM.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/EVENTS/MPM/MPM.cpp b/EVENTS/MPM/MPM.cpp index 6c78a51..42f8acc 100644 --- a/EVENTS/MPM/MPM.cpp +++ b/EVENTS/MPM/MPM.cpp @@ -417,7 +417,7 @@ MPM::MPM(RandomVariablesContainer *theRandomVariableIW, QWidget *parent) // ----------------------------------------------------------------------------------- // Create a 3D window and container widget and set the 3D window as its layout // Based on code by Alex44, 2018; https://stackoverflow.com/questions/23231012/how-to-render-in-qt3d-in-standard-gui-application) -#ifdef _WIN32 + auto rootEntity = new Qt3DCore::QEntity(); auto view = new Qt3DExtras::Qt3DWindow(); QWidget *container = QWidget::createWindowContainer(view); @@ -1190,7 +1190,6 @@ MPM::MPM(RandomVariablesContainer *theRandomVariableIW, QWidget *parent) #endif }); -#endif // QVBoxLayout *layout = new QVBoxLayout(); // mainWindowLayout->addWidget(scrollArea);