// Copyright (C) 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 "held_ptr.hpp" using namespace boost::python; namespace { void setColors(osgSim::ColorRange* self, list clist) { int elcount = len(clist); if (elcount == 0) return; std::vector colors; for (int i=0; i(clist[i])); } self->setColors(colors); } osgSim::ColorRange * init_3(float min, float max, list clist) { osgSim::ColorRange * crange = new osgSim::ColorRange(min, max); setColors(crange, clist); return crange; } } namespace PyOSGSim { void init_ColorRange() { class_, bases > color_range("ColorRange", no_init); color_range.def(init()); color_range.def("__init__", make_constructor(&init_3)); color_range.def("setColors", &setColors); } }