Skip to content

Module wrapping tasks

Christopher Bruns edited this page Jul 6, 2015 · 3 revisions

Initial module wrapping tasks

  1. Choose a module to wrap, e.g. osgViewer
  2. Create folder src/modules/<module>/
  3. Create CMakeLists.txt
  4. Create wrap_module.py
  5. Create wrap_<module>.h, including #include directives, and any desired class aliases
  6. Debug the wrapping, investigating:
  • Warnings and errors from pyplusplus, while running "python wrap_module.py"
  • Compile errors while building the module (cmake build)
  • Runtime errors while loading the module from python
  • Runtime behavior while trying to use the module from python

Final module wrapping tasks:

  • Wrap every namespace/osg-include-folder as a python module. So far, I have wrapped these:
    • osg
    • osgDB
    • osgGA
    • osgText
    • osgUtil
    • osgViewer
  • Include every C++ .h header file in each module, in src/modules//wrap_<module>.h; so far I have completed these:
    • osgText
    • osgGA
    • osgViewer
    • osgDB
  • Review all warnings issued by pyplusplus during wrapper generation.
    • For example, create pure-python implementations of multiple-enums-with-same-value not handled by boost::python
  • Review all the classes and methods I excluded in src/modules//wrap_module.py, to see which can be rescued by more careful wrapping.
  • Use indexing_suite to expose pythonic access to all osg container classes. So far I have done these:
    • osg Vec[234]*
    • osg Vec[234]Array
    • (some others...)
  • Create "from_python" converter for, at least, Vec3f and Vec4f, so devs could use lists, tuples, or numpy arrays, or whatever, in their place.
  • Create wrapper aliases, especially for stl template classes with really long names in generated_code/

Clone this wiki locally