Skip to content

Conversation

@servantftransperfect
Copy link
Contributor

This pull request updates the Landmark class to improve its compatibility and encapsulation when used with SWIG (Simplified Wrapper and Interface Generator) for language bindings. The main changes ensure that internal data members are properly hidden from SWIG while still providing controlled access via properties.

SWIG compatibility and encapsulation improvements:

  • Wrapped the non-const getter methods getX() and getRgb() in #ifndef SWIG guards in Landmark.hpp to prevent SWIG from exposing direct references to internal members. [1] [2]
  • Added %ignore aliceVision::sfmData::Landmark::_X; in Landmark.i to explicitly hide the _X member from SWIG-generated bindings.

SWIG interface enhancements:

  • Added a SWIG property X using getX and setX to allow controlled access to the landmark's 3D position in language bindings, without exposing the internal member directly.

@CedricThebault CedricThebault merged commit fa74559 into develop Jan 15, 2026
4 checks passed
@CedricThebault CedricThebault deleted the fix/landmarkSwig branch January 15, 2026 10:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants