// Copyright (C) 2002-2003 Gideon May (gideon@computer.org) // // 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. #include #include #include #include #include #include #include #include #include #include #include "held_ptr.hpp" #include "Math.hpp" using namespace boost::python; namespace PyOSG { void init_ShapeDrawable() { { class_, bases, boost::noncopyable > hints("TessellationHints", no_init); scope hints_scope(hints); hints.def(init<>()); hints.def("setTessellationMode", &osg::TessellationHints::setTessellationMode); hints.def("getTessellationMode", &osg::TessellationHints::getTessellationMode); hints.def("setDetailRatio", &osg::TessellationHints::setDetailRatio); hints.def("getDetailRatio", &osg::TessellationHints::getDetailRatio); hints.def("setTargetNumFaces", &osg::TessellationHints::setTargetNumFaces); hints.def("getTargetNumFaces", &osg::TessellationHints::getTargetNumFaces); hints.def("setCreateFrontFace", &osg::TessellationHints::setCreateFrontFace); hints.def("getCreateFrontFace", &osg::TessellationHints::getCreateFrontFace); hints.def("setCreateBackFace", &osg::TessellationHints::setCreateBackFace); hints.def("getCreateBackFace", &osg::TessellationHints::getCreateBackFace); hints.def("setCreateNormals", &osg::TessellationHints::setCreateNormals); hints.def("getCreateNormals", &osg::TessellationHints::getCreateNormals); hints.def("setCreateTextureCoords", &osg::TessellationHints::setCreateTextureCoords); hints.def("getCreateTextureCoords", &osg::TessellationHints::getCreateTextureCoords); hints.def("setCreateTop", &osg::TessellationHints::setCreateTop); hints.def("getCreateTop", &osg::TessellationHints::getCreateTop); hints.def("setCreateBody", &osg::TessellationHints::setCreateBody); hints.def("getCreateBody", &osg::TessellationHints::getCreateBody); hints.def("setCreateBottom", &osg::TessellationHints::setCreateBottom); hints.def("getCreateBottom", &osg::TessellationHints::getCreateBottom); ; # define OSG_ENUM_MODE(VALUE) \ (mode.value(#VALUE, osg::TessellationHints::VALUE), \ hints.def(#VALUE, object(osg::TessellationHints::VALUE))) enum_ mode("TessellationMode"); OSG_ENUM_MODE(USE_SHAPE_DEFAULTS); OSG_ENUM_MODE(USE_TARGET_NUM_FACES); } class_, bases, boost::noncopyable >("ShapeDrawable", no_init) .def(init<>()) .def(init()) .def(init()) .def("setColor", &osg::ShapeDrawable::setColor, "Set the color of the shape.") .def("getColor", &osg::ShapeDrawable::getColor, return_value_policy(), "Get the color of the shape.") .def("setTessellationHints", &osg::ShapeDrawable::setTessellationHints) .def("getTessellationHints", (osg::TessellationHints*(osg::ShapeDrawable::*)()) &osg::ShapeDrawable::getTessellationHints, return_value_policy()) .def("drawImplementation", &osg::ShapeDrawable::drawImplementation, "draw ShapeDrawable directly ignoring an OpenGL display list which could be attached.\n" "This is the internal draw method which does the drawing itself,\n" "and is the method to override when deriving from ShapeDrawable for user-drawn objects.\n") ; } } // namespace PyOSG