// 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 #include #include "StateAttribute.hpp" #include "held_ptr.hpp" using namespace boost::python; namespace { osg::Fog * asFog(osg::StateAttribute * self) { return dynamic_cast(self); } } namespace PyOSG { void init_Fog() { register_castStateAttribute("asFog", &asFog); class_, bases > fog("Fog", "Fog - encapsulates OpenGL fog state.\n" , no_init); scope fog_scope(fog); fog.def(init<>()) .def("setMode", &osg::Fog::setMode) .def("getMode", &osg::Fog::getMode) .def("setDensity", &osg::Fog::setDensity) .def("getDensity", &osg::Fog::getDensity) .def("setStart", &osg::Fog::setStart) .def("getStart", &osg::Fog::getStart) .def("setEnd", &osg::Fog::setEnd) .def("getEnd", &osg::Fog::getEnd) .def("setColor", &osg::Fog::setColor) .def("getColor", &osg::Fog::getColor, return_value_policy()) .def("setFogCoordinateSource", &osg::Fog::setFogCoordinateSource) .def("getFogCoordinateSource", &osg::Fog::getFogCoordinateSource) ; # define OSG_ENUM_MODE(VALUE) \ (mode.value(#VALUE, osg::Fog::VALUE), \ fog.def(#VALUE, object(osg::Fog::VALUE))) enum_ mode("Mode"); OSG_ENUM_MODE(LINEAR); OSG_ENUM_MODE(EXP); OSG_ENUM_MODE(EXP2); # define OSG_ENUM_SOURCE(VALUE) \ (source.value(#VALUE, osg::Fog::VALUE), \ fog.def(#VALUE, object(osg::Fog::VALUE))) enum_ source("FogCoordinateSource"); OSG_ENUM_SOURCE(FOG_COORDINATE); OSG_ENUM_SOURCE(FRAGMENT_DEPTH); } }