Skip to content

Commit d870f37

Browse files
committed
Fix bug when no run-time visualization is enabled (neither Irrlicht nor VSG)
1 parent 9ff180f commit d870f37

4 files changed

Lines changed: 15 additions & 15 deletions

File tree

CMakeLists.txt

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -416,10 +416,20 @@ set(HCGUI_HEADERS
416416

417417
set(HCGUI_SOURCES
418418
src/gui/guihelper.cpp
419-
src/gui/guihelperIRR.cpp
420-
src/gui/guihelperVSG.cpp
421419
)
422420

421+
if(HYDROCHRONO_ENABLE_IRRLICHT)
422+
set(HCGUI_SOURCES ${HCGUI_SOURCES}
423+
src/gui/guihelperIRR.cpp
424+
)
425+
endif()
426+
427+
if(HYDROCHRONO_ENABLE_VSG)
428+
set(HCGUI_SOURCES ${HCGUI_SOURCES}
429+
src/gui/guihelperVSG.cpp
430+
)
431+
endif()
432+
423433
add_library(HydroChronoGUI ${HCGUI_SOURCES} ${HCGUI_HEADERS})
424434

425435
target_compile_features(HydroChronoGUI PUBLIC ${HC_CXX_STANDARD})

src/gui/guihelperIRR.cpp

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,8 @@
11
#include "guihelper_impl.h"
22
using namespace hydroc::gui;
33

4-
#ifdef HYDROCHRONO_HAVE_IRRLICHT
5-
6-
#include <IEventReceiver.h> // irrlicht
7-
#include <chrono_irrlicht/ChIrrMeshTools.h>
4+
#include <IEventReceiver.h> // irrlicht
5+
#include <chrono_irrlicht/ChIrrMeshTools.h>
86

97
using namespace chrono::irrlicht;
108

@@ -291,5 +289,3 @@ bool GUIImplIRR::IsRunning(double timestep) {
291289
return true;
292290
// ========== END TEMPORARY DIAGNOSTIC CODE ==========
293291
}
294-
295-
#endif // HYDROCHRONO_HAVE_IRRLICHT

src/gui/guihelperVSG.cpp

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
#include "guihelper_impl.h"
22
using namespace hydroc::gui;
33

4-
#ifdef HYDROCHRONO_HAVE_VSG
5-
64
using namespace chrono::vsg3d;
75

86
// -----------------------------------------------------------------------------
@@ -83,5 +81,3 @@ bool GUIImplVSG::IsRunning(double timestep) {
8381

8482
return true;
8583
}
86-
87-
#endif // HYDROCHRONO_HAVE_VSG

src/gui/guihelper_impl.h

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ namespace gui {
3030
// Base class for private GUI implementation.
3131
class GUIImpl {
3232
public:
33+
GUIImpl() {}
3334
virtual ~GUIImpl() {}
3435
GUIImpl(const GUIImpl&) = delete;
3536
GUIImpl& operator=(const GUIImpl&) = delete;
@@ -40,9 +41,6 @@ class GUIImpl {
4041
}
4142
virtual void SetCamera(double x, double y, double z, double dirx, double diry, double dirz) {}
4243
virtual bool IsRunning(double timestep) { return true; }
43-
44-
protected:
45-
GUIImpl() {}
4644
};
4745

4846
#ifdef HYDROCHRONO_HAVE_IRRLICHT

0 commit comments

Comments
 (0)