Skip to content

Support all types of mappings#593

Merged
hugtalbot merged 1 commit intosofa-framework:masterfrom
alxbilger:mappings
Mar 12, 2026
Merged

Support all types of mappings#593
hugtalbot merged 1 commit intosofa-framework:masterfrom
alxbilger:mappings

Conversation

@alxbilger
Copy link
Contributor

This is all the types defined in Mapping.cpp

Copy link
Contributor

@fredroy fredroy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mapping.{h,cpp} is more universal 🥸 (not explicit on double)


void moduleAddMapping(py::module &m) {
declareMapping<Rigid3dTypes, Vec3dTypes>(m);
declareMapping<Vec1dTypes, Vec1dTypes>(m);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
declareMapping<Vec1dTypes, Vec1dTypes>(m);
declareMapping<Vec1Types, Vec1Types>(m);

I just do one just to show, and you will need to modify the alias before (using sofa::defaulttype::Vec1Types blabla)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I hesitated to do that because depending on SReal, we don't end up with the same class name for the Python class (Mapping_Vec1d_Vec2d vs Mapping_Vec1f_Vec2f). Perhaps we can think about having a more generic name such as Mapping_Vec1_Vec2...

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The force field bindings also support only double

@alxbilger alxbilger requested a review from fredroy March 11, 2026 08:31
@hugtalbot hugtalbot merged commit 707fdc8 into sofa-framework:master Mar 12, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants