// 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. // // cleaned up by brett hartshorn, may08 2004 // updated for OSG CVS july 6th 2004 by brett hartshorn #include #include #include #include #include #include "StateAttribute.hpp" #include "held_ptr.hpp" using namespace boost::python; typedef class_, bases, boost::noncopyable > AlphaFunc; namespace { DEFINE_STATEATTRIBUTE_CAST(AlphaFunc) } namespace PyOSG { void init_AlphaFunc() { REGISTER_STATEATTRIBUTE_CAST(AlphaFunc) AlphaFunc alphafunc("AlphaFunc", "Encapsulate OpenGL glAlphaFunc.\n", no_init); scope alphafunc_scope(alphafunc); alphafunc .def(init<>()) // ModeUsage defined in StateAttribute - not needed // .def("getModeUsage" // &osg::AlphaFunc::getModeUsage) .def("setFunction", (void (osg::AlphaFunc::*) (osg::AlphaFunc::ComparisonFunction, float)) &osg::AlphaFunc::setFunction, args("func", "ref"), "setFunction(func, ref)\n\n" "Set the ComparisonFunction to the specified float value.") .def("setFunction", (void (osg::AlphaFunc::*) (osg::AlphaFunc::ComparisonFunction)) &osg::AlphaFunc::setFunction, args("func"), "setFunction(func)\n\n" "Set the ComparisonFunction.") .def("getFunction", &osg::AlphaFunc::getFunction, "getFunction() -> func\n\n" "Return the current ComparisonFunction.") .def("setReferenceValue", &osg::AlphaFunc::setReferenceValue, "setReferenceValue(set)\n\n" "Set the reference value.") .def("getReferenceValue", &osg::AlphaFunc::getReferenceValue, "getReferenceValue() -> ref\n\n" "Return the current reference value.") ; enum_ cfunc("ComparisonFunction"); # define OSG_ENUM(VALUE) \ (cfunc.value(#VALUE, osg::AlphaFunc::VALUE), \ alphafunc.def(#VALUE, object(osg::AlphaFunc::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); } } // namespace PyOSG