/* -*-c++-*- osgPython - Copyright (C) 2006 Miguel Escriva Gregori * * This library is open source and may be redistributed and/or modified under * the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or * (at your option) any later version. The full license is in LICENSE file * included with this distribution, and on the openscenegraph.org website. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * OpenSceneGraph Public License for more details. */ #include #include "Utility.h" #include "Namespace.h" #include "Type.h" #include "Value.h" #include "Method.h" #include "BasicTypes.h" #include "rtti.h" #include #include #include using namespace boost::python; namespace osgPython { /// osgPython Module definition BOOST_PYTHON_MODULE(libosgPython) { std_vector_to_python_converter(); def("loadWrapper", Namespace::loadWrapper); class_ , boost::noncopyable>("Base", no_init) .def("__getattr__", &Base::boostGetAttr) .def("__call__", &Base::boostCall0) .def("__call__", &Base::boostCall1) .def("__call__", &Base::boostCall2) .def("__call__", &Base::boostCall3) .def("__call__", &Base::boostCall4) .def("__call__", &Base::boostCall5) .def("__str__", &Base::__str__) .def("__repr__", &Base::__repr__) ; class_, bases >("Namespace", init(arg("ns")="")) .def("getTypes", &Namespace::getTypes) .def("getAllTypes", &Namespace::getAllTypes, (arg("filter")="")) .staticmethod("getAllTypes") ; class_, bases >("Type", no_init) ; class_, bases >("Value", no_init) .def("__getitem__", &Value::__getitem__) .def("__setitem__", &Value::__setitem__) .def("getTextValue", &Value::getTextValue) .staticmethod("getTextValue") .def("setTextValue", &Value::setTextValue) .staticmethod("setTextValue") ; class_, bases >("Method", no_init) ; initBasicTypes(); initRTTI(); } }