diff --git a/include/pinocchio/bindings/python/parsers/python.hpp b/include/pinocchio/bindings/python/parsers/python.hpp index 394b2c5bb4..f0571388ab 100644 --- a/include/pinocchio/bindings/python/parsers/python.hpp +++ b/include/pinocchio/bindings/python/parsers/python.hpp @@ -5,39 +5,12 @@ #ifndef __pinocchio_python_parser_python_hpp__ #define __pinocchio_python_parser_python_hpp__ -#include "pinocchio/multibody/model.hpp" +#include "pinocchio/macros.hpp" -#include +// clang-format off +PINOCCHIO_PRAGMA_DEPRECATED_HEADER(pinocchio/bindings/python/parsers/python.hpp, pinocchio/parsers/python.hpp) +// clang-format on -#if defined _WIN32 - #ifdef pinocchio_pywrap_EXPORTS - #define PINOCCHIO_PYWRAP_DLLAPI __declspec(dllexport) - #else - #define PINOCCHIO_PYWRAP_DLLAPI __declspec(dllimport) - #endif // pinocchio_pywrap_EXPORTS -#else - #define PINOCCHIO_PYWRAP_DLLAPI -#endif // _WIN32 - -namespace pinocchio -{ - namespace python - { - /// \brief Load a model from a Python script. - /// - /// This function raises a Python error in case of incistency in the Python code. - /// - /// \input filename The full path to the model file. - /// \input var_name Name of the Python variable which contains the model in the script. - /// - /// \returns The model constructed by the Python script. - /// - // TODO: look inside the context of Python and find an occurence of object Model - PINOCCHIO_PYWRAP_DLLAPI - Model buildModel(const std::string & filename, const std::string & var_name = "model"); - - } // namespace python - -} // namespace pinocchio +#include "pinocchio/parsers/python.hpp" #endif // ifndef __pinocchio_python_parser_python_hpp__ diff --git a/include/pinocchio/parsers/python.hpp b/include/pinocchio/parsers/python.hpp index 6acc9ddfdb..c3ee294a61 100644 --- a/include/pinocchio/parsers/python.hpp +++ b/include/pinocchio/parsers/python.hpp @@ -5,6 +5,28 @@ #ifndef __pinocchio_parser_python_hpp__ #define __pinocchio_parser_python_hpp__ -#include "pinocchio/bindings/python/parsers/python.hpp" +#include "pinocchio/python_parser/config.hpp" +#include "pinocchio/multibody/model.hpp" + +namespace pinocchio +{ + namespace python + { + /// \brief Load a model from a Python script. + /// + /// This function raises a Python error in case of inconsistency in the Python code. + /// + /// \input filename The full path to the model file. + /// \input var_name Name of the Python variable which contains the model in the script. + /// + /// \returns The model constructed by the Python script. + /// + // TODO: look inside the context of Python and find an occurence of object Model + PINOCCHIO_PYTHON_PARSER_DLLAPI + Model buildModel(const std::string & filename, const std::string & var_name = "model"); + + } // namespace python + +} // namespace pinocchio #endif // ifndef __pinocchio_parser_python_hpp__ diff --git a/sources.cmake b/sources.cmake index acb07d3b5d..ddbdb3290f 100644 --- a/sources.cmake +++ b/sources.cmake @@ -370,7 +370,7 @@ set(${PROJECT_NAME}_PYTHON_PARSER_PUBLIC_HEADERS ${PROJECT_SOURCE_DIR}/include/pinocchio/parsers/python.hpp) set(${PROJECT_NAME}_PYTHON_PARSER_SOURCES - ${PROJECT_SOURCE_DIR}/bindings/python/parsers/python/model.cpp) + ${PROJECT_SOURCE_DIR}/src/parsers/python/model.cpp) set(${PROJECT_NAME}_EXTRA_SOURCES ${PROJECT_SOURCE_DIR}/src/extra/reachable-workspace.cpp) diff --git a/bindings/python/parsers/python/model.cpp b/src/parsers/python/model.cpp similarity index 97% rename from bindings/python/parsers/python/model.cpp rename to src/parsers/python/model.cpp index ee896968d7..dc7bd914ad 100644 --- a/bindings/python/parsers/python/model.cpp +++ b/src/parsers/python/model.cpp @@ -2,11 +2,13 @@ // Copyright (c) 2016-2023 CNRS INRIA // -#include "pinocchio/bindings/python/parsers/python.hpp" +#include "pinocchio/parsers/python.hpp" #include #include +#include + // Boost 1.58 #if BOOST_VERSION / 100 % 1000 == 58 #include