// 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 "StateAttribute.hpp" #include "held_ptr.hpp" using namespace boost::python; namespace { osg::LogicOp * asLogicOp(osg::StateAttribute * self) { return dynamic_cast(self); } } namespace PyOSG { void init_LogicOp() { register_castStateAttribute("asLogicOp", &asLogicOp); class_, bases > logicOp("LogicOp", " Encapsulates OpenGL LogicOp state.\n", no_init); scope logicOp_scope(logicOp); logicOp .def(init<>()) .def(init()) .def("setOpcode", &osg::LogicOp::setOpcode) .def("getOpcode", &osg::LogicOp::getOpcode) ; # define OSG_ENUM_OPCODE(VALUE) \ (opcode.value(#VALUE, osg::LogicOp::VALUE), \ logicOp.def(#VALUE, object(osg::LogicOp::VALUE))) enum_ opcode("Opcode"); OSG_ENUM_OPCODE(CLEAR); OSG_ENUM_OPCODE(SET); OSG_ENUM_OPCODE(COPY); OSG_ENUM_OPCODE(COPY_INVERTED); OSG_ENUM_OPCODE(NOOP); OSG_ENUM_OPCODE(INVERT); OSG_ENUM_OPCODE(AND); OSG_ENUM_OPCODE(NAND); OSG_ENUM_OPCODE(OR); OSG_ENUM_OPCODE(NOR); OSG_ENUM_OPCODE(XOR); OSG_ENUM_OPCODE(EQUIV); OSG_ENUM_OPCODE(AND_REVERSE); OSG_ENUM_OPCODE(AND_INVERTED); OSG_ENUM_OPCODE(OR_REVERSE); OSG_ENUM_OPCODE(OR_INVERTED); } } // namespace PyOSG