Skip to content

Commit

Permalink
[SofaImgui] Allow imgui to be spawned by SofaPython3 (#93)
Browse files Browse the repository at this point in the history
* allow imgui to be spawned (eventually) by sofapython3

* forgot init file
  • Loading branch information
fredroy authored Nov 9, 2023
1 parent e281b6d commit b85d7e5
Show file tree
Hide file tree
Showing 4 changed files with 39 additions and 1 deletion.
1 change: 1 addition & 0 deletions SofaImGui/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ set(SOFAIMGUI_SOURCE_DIR src/SofaImGui)

set(HEADER_FILES
${SOFAIMGUI_SOURCE_DIR}/config.h.in
${SOFAIMGUI_SOURCE_DIR}/init.h
${SOFAIMGUI_SOURCE_DIR}/ImGuiDataWidget.h
${SOFAIMGUI_SOURCE_DIR}/ImGuiGUI.h
${SOFAIMGUI_SOURCE_DIR}/ImGuiGUIEngine.h
Expand Down
3 changes: 3 additions & 0 deletions SofaImGui/src/SofaImGui/ImGuiGUI.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,9 @@ sofa::gui::common::BaseGUI* ImGuiGUI::CreateGUI(const char* name, sofa::simulati
{
return nullptr;
}

gui->setScene(groot, filename);

return gui;
}

Expand Down
29 changes: 29 additions & 0 deletions SofaImGui/src/SofaImGui/init.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
/******************************************************************************
* SOFA, Simulation Open-Framework Architecture *
* (c) 2006 INRIA, USTL, UJF, CNRS, MGH *
* *
* This program is free software; you can redistribute it and/or modify it *
* under the terms of the GNU Lesser General Public License as published by *
* the Free Software Foundation; either version 2.1 of the License, or (at *
* your option) any later version. *
* *
* This program is distributed in the hope that it will be useful, but WITHOUT *
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or *
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License *
* for more details. *
* *
* You should have received a copy of the GNU Lesser General Public License *
* along with this program. If not, see <http://www.gnu.org/licenses/>. *
*******************************************************************************
* Authors: The SOFA Team and external contributors (see Authors.txt) *
* *
* Contact information: [email protected] *
******************************************************************************/
#pragma once

#include <SofaImGui/config.h>

namespace sofaimgui
{
SOFAIMGUI_API void init();
} // namespace sofaimgui
7 changes: 6 additions & 1 deletion SofaImGui/src/SofaImGui/initSofaImGui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
* *
* Contact information: [email protected] *
******************************************************************************/
#include <SofaImGui/config.h>
#include <SofaImGui/init.h>

#include <sofa/simulation/Node.h>
#include <sofa/gui/common/GUIManager.h>
Expand Down Expand Up @@ -78,4 +78,9 @@ const char* getModuleComponentList()
return "";
}

void init()
{
initExternalModule();
}

} // namespace sofaimgui

0 comments on commit b85d7e5

Please sign in to comment.