Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Make DagModifier a subclass of DGModifier
If you Google "pybind11 subclass" you will find a couple of threads on how to solve the problem, none of which worked in this scenario. The issue on the pybind github about subclasses (below) cites a way to subclass an existing binding that feels as robust as creating a class on the fly using type("MyClass", bases, attrs) -> pybind/pybind11#1193 Another issue recommends using py:base, which has been deprecated. -> pybind/pybind11#17 ...also it didn't work. It seems to me that because we are defining each class as an .inl rather than a .hpp or .cpp file, they are not aware of each other. To remedy this, I've included the MDGModifier binding in the MDagModifier file, with an pre-processor to prevent duplicate entries. Otherwise, the base class would be omitted in the main.cpp. I think this solution will work well when we get to other classes with many subclasses, like the whole MFn* tree.
- Loading branch information