// Copyleft 2004 Brett Hartshorn (bhartsho@yahoo.com) // // Permission to copy, use, sell and distribute this software is granted // provided this copyright notice appears in all copies. // Permission to modify the code and to distribute modified code is granted // provided this copyright notice appears in all copies, and a notice // that the code was modified is included with the copyright notice. // // This software is provided "as is" without express or implied warranty, // and with no claim as to its suitability for any purpose. // // fixed bug in call_removeExpiredChildren, returns a proper bool. jan 15th 2005 - brett #include #include #include #include #include #include //#include "held_ptr.hpp" using namespace boost::python; namespace { bool call_removeExpiredChildren(osg::PagedLOD& obj, double expiryTime, osg::NodeList& removedChildren) { return obj.removeExpiredChildren(expiryTime, removedChildren) ; } class PagedLODWrapper : public osg::PagedLOD { public: PagedLODWrapper(PyObject* self_) : self(self_) {} bool removeExpiredChildren(double expiryTime, osg::NodeList& removedChildren) { return call_method(self, "removeExpiredChildren", expiryTime, removedChildren); } PyObject* self; }; } // namespace namespace PyOSG { void init_PagedLOD() { class_, boost::noncopyable> pagedLOD("PagedLOD", no_init); pagedLOD .def(init<>()) .def("traverse", &osg::PagedLOD::traverse) .def("addChild", (bool (osg::PagedLOD::*) (osg::Node*) ) &osg::PagedLOD::addChild) .def("addChild", (bool (osg::PagedLOD::*) (osg::Node*, float, float) ) &osg::PagedLOD::addChild) .def("addChild", (bool (osg::PagedLOD::*) (osg::Node*, float, float, const std::string&, float, float) ) &osg::PagedLOD::addChild) .def("removeChild", &osg::PagedLOD::removeChild) .def("setFileName", &osg::PagedLOD::setFileName) .def("getFileName", &osg::PagedLOD::getFileName, return_internal_reference<>()) .def("getNumFileNames", &osg::PagedLOD::getNumFileNames) .def("setPriorityOffset", &osg::PagedLOD::setPriorityOffset) .def("getPriorityOffset", &osg::PagedLOD::getPriorityOffset) .def("getNumPriorityOffsets", &osg::PagedLOD::getNumPriorityOffsets) .def("setPriorityScale", &osg::PagedLOD::setPriorityScale) .def("getPriorityScale", &osg::PagedLOD::getPriorityScale) .def("getNumPriorityScales", &osg::PagedLOD::getNumPriorityScales) .def("setTimeStamp", &osg::PagedLOD::setTimeStamp) .def("getTimeStamp", &osg::PagedLOD::getTimeStamp) .def("getNumTimeStamps", &osg::PagedLOD::getNumTimeStamps) .def("setNumChildrenThatCannotBeExpired", &osg::PagedLOD::setNumChildrenThatCannotBeExpired) .def("getNumChildrenThatCannotBeExpired", &osg::PagedLOD::getNumChildrenThatCannotBeExpired) .def("removeExpiredChildren", &call_removeExpiredChildren) ; } } //namespace PyOSG