// Copyright (C) 2002-2005 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 "StateAttribute.hpp" #include "held_ptr.hpp" using namespace boost::python; namespace { osg::Depth * asDepth(osg::StateAttribute * self) { return dynamic_cast(self); } } // namespace namespace PyOSG { void init_Depth() { register_castStateAttribute("asDepth", &asDepth); class_, bases, boost::noncopyable > depth("Depth", "Encapsulate OpenGL glDepthFunc/Mask/Range functions.\n", no_init); scope depth_scope(depth); depth .def(init<>()) .def(init()) .def(init()) .def(init()) .def(init()) .def("setFunction", &osg::Depth::setFunction) .def("getFunction", &osg::Depth::getFunction) .def("setRange", &osg::Depth::setRange) .def("getZNear", &osg::Depth::getZNear) .def("getZFar", &osg::Depth::getZFar) .def("setWriteMask", &osg::Depth::setWriteMask) .def("getWriteMask", &osg::Depth::getWriteMask) ; enum_ function("Function"); # define OSG_ENUM(VALUE) \ (function.value(#VALUE, osg::Depth::VALUE), \ depth.def(#VALUE, object(osg::Depth::VALUE))) OSG_ENUM(NEVER); OSG_ENUM(LESS); OSG_ENUM(EQUAL); OSG_ENUM(LEQUAL); OSG_ENUM(GREATER); OSG_ENUM(NOTEQUAL); OSG_ENUM(GEQUAL); OSG_ENUM(ALWAYS); scope(); } } // namespace PyOSG