Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CCPACSPositioning is not exposed to swig #936

Open
joergbrech opened this issue Dec 5, 2022 · 1 comment
Open

CCPACSPositioning is not exposed to swig #936

joergbrech opened this issue Dec 5, 2022 · 1 comment
Assignees

Comments

@joergbrech
Copy link
Contributor

joergbrech commented Dec 5, 2022

from tixi3 import tixi3wrapper
from tigl3 import tigl3wrapper
import tigl3.configuration

# Create a handle to the tixi document
tixi_handle = tixi3wrapper.Tixi3()
tixi_handle.open("simpletest.cpacs.xml")

# get dihedral using TiXI
xpath = '/cpacs/vehicles/aircraft/model/wings/wing[1]/positionings/positioning[1]/dihedralAngle'
print(tixi_handle.getDoubleElement(xpath))

# get dihedral using TiGL
config_handle = tigl3wrapper.Tigl3()
config_handle.open(tixi_handle, "")
config_mgr = tigl3.configuration.CCPACSConfigurationManager_get_instance()
config = config_mgr.get_configuration(config_handle._handle.value)
wing = config.get_wing(1)
wing_uid = 'Wing'
help(wing.get_positionings()) # <-- no getter, i.e. wing.get_positionings().get_positioning(i) is not implemented in CCPACSPositionings
help(wing.get_positionings().get_positionings()) # <-- SwigPyObject, should be vector of unique_ptr to CCPACSPositioning
@joergbrech
Copy link
Contributor Author

@merakulix and I discussed this and we prefer to implement getters in CCPACSPositionings for the cpacs traversal in Python. Exposing std::vector and std::unique_ptr via swig to Python adds an unnecessary level of complexity, see RISCSoftware/cpacs_tigl_gen#59.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant