You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm working on Python bindings for using this library, and so far I have accomplished this with a Not so clean solution using C++ lambda expressions to avoid issues with the absl::Status returned by the Reset and Update functions of the StrokeModeler class like this:
Here you can see that the Save and Restore bindings are much clear to translate to python.
Another issue is that for this abseil implementation, I need to add into the pybind11 CMakeLists.txt file all dependencies on this project, eg:
pybind11_add_module(
smooth_lines
wrapper.cpp
#The following dependencies are not needed if there weren't an abseil dependency.${CMAKE_SOURCE_DIR}/ink-stroke-modeler/ink_stroke_modeler/types.cc
${CMAKE_SOURCE_DIR}/ink-stroke-modeler/ink_stroke_modeler/params.cc
${CMAKE_SOURCE_DIR}/ink-stroke-modeler/ink_stroke_modeler/stroke_modeler.cc
${CMAKE_SOURCE_DIR}/ink-stroke-modeler/ink_stroke_modeler/internal/wobble_smoother.cc
${CMAKE_SOURCE_DIR}/ink-stroke-modeler/ink_stroke_modeler/internal/stylus_state_modeler.cc
${CMAKE_SOURCE_DIR}/ink-stroke-modeler/ink_stroke_modeler/internal/prediction/kalman_predictor.cc
${CMAKE_SOURCE_DIR}/ink-stroke-modeler/ink_stroke_modeler/internal/prediction/stroke_end_predictor.cc
${CMAKE_SOURCE_DIR}/ink-stroke-modeler/ink_stroke_modeler/internal/prediction/kalman_filter/axis_predictor.cc
${CMAKE_SOURCE_DIR}/ink-stroke-modeler/ink_stroke_modeler/internal/prediction/kalman_filter/kalman_filter.cc
)
If abseil is not a dependency, the CMakeLists.txt file above would be much cleaner.
My suggestion is to use a custom exception class instead of using Abseil library. Not an expert in C++ so I'm not sure if a custom class is the best option, but removing the Abseil dependency would be great for this use case (and might be the same for other bindings).
The text was updated successfully, but these errors were encountered:
Hello.
I'm working on Python bindings for using this library, and so far I have accomplished this with a Not so clean solution using C++ lambda expressions to avoid issues with the absl::Status returned by the Reset and Update functions of the StrokeModeler class like this:
Here you can see that the Save and Restore bindings are much clear to translate to python.
Another issue is that for this abseil implementation, I need to add into the pybind11 CMakeLists.txt file all dependencies on this project, eg:
If abseil is not a dependency, the CMakeLists.txt file above would be much cleaner.
My suggestion is to use a custom exception class instead of using Abseil library. Not an expert in C++ so I'm not sure if a custom class is the best option, but removing the Abseil dependency would be great for this use case (and might be the same for other bindings).
The text was updated successfully, but these errors were encountered: