Skip to content

Commit

Permalink
Merge pull request #112 from JustinBonus/master
Browse files Browse the repository at this point in the history
Fixes in MPM ifdef switches
  • Loading branch information
fmckenna authored Apr 9, 2024
2 parents 4902e2a + c3b1ef3 commit 8cbde1d
Show file tree
Hide file tree
Showing 2 changed files with 72 additions and 60 deletions.
20 changes: 16 additions & 4 deletions EVENTS/MPM/MPM.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,8 @@ UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
// #include <SC_ToolDialog.h>
// #include <SC_RemoteAppTool.h>

// #include <QtSystemDetection>

MPM::MPM(RandomVariablesContainer *theRandomVariableIW, QWidget *parent)
: SimCenterAppWidget(parent), theRandomVariablesContainer(theRandomVariableIW)
{
Expand Down Expand Up @@ -411,11 +413,11 @@ 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)
#ifdef _WIN32

auto rootEntity = new Qt3DCore::QEntity();
auto view = new Qt3DExtras::Qt3DWindow();
QWidget *container = QWidget::createWindowContainer(view);
Expand Down Expand Up @@ -1167,17 +1169,27 @@ 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();
// mainWindowLayout->addWidget(scrollArea);
// mainWindowLayout->addWidget(updateBodiesButton);
// mainWindowLayout->addWidget(container);
mainWindowLayout->addWidget(horizontalPanels);
this->setLayout(mainWindowLayout);

connect(stackedWidget, &SlidingStackedWidget::animationFinished, [=](void){
int index = stackedWidget->currentIndex();
mpmBodies->setDigitalTwin(index);
mpmBoundaries->setDigitalTwin(index);
// #ifdef _WIN32
#if defined(Q_OS_WIN) || defined(Q_OS_WIN32) || defined(Q_OS_LINUX) || defined(Q_OS_UNIX)
updateDigitalTwin(index);
#endif
});

#endif

// QVBoxLayout *layout = new QVBoxLayout();
// mainWindowLayout->addWidget(scrollArea);
Expand Down
112 changes: 56 additions & 56 deletions Hydro-UQ.pro
Original file line number Diff line number Diff line change
Expand Up @@ -42,75 +42,75 @@ 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 {

mac {
# 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 \
Expand Down

0 comments on commit 8cbde1d

Please sign in to comment.