// 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 #include #include "held_ptr.hpp" using namespace boost::python; namespace PyOSGSim { void init_BlinkSequence() { class_, bases > sequencegroup("SequenceGroup", no_init); sequencegroup .def(init() ) ; class_, bases > blinksequence("BlinkSequence", no_init); blinksequence .def(init<>() ) .def("addPulse", &osgSim::BlinkSequence::addPulse, "add a pulse of specified color and duration to the BlinkSequence.\n" ) .def("getNumPulses", &osgSim::BlinkSequence::getNumPulses, "return the number of pulses.\n" ) /** return the pulse data at position i. */ //inline void getPulse(unsigned int i, double& length,osg::Vec4& color) const; .def("getPulsePeriod", &osgSim::BlinkSequence::getPulsePeriod, "get the total pulse period of the blink sequence, which is equal to the sum of all the pulse periods.\n" ) .def("setSequenceGroup", &osgSim::BlinkSequence::setSequenceGroup, "set the sequence group which can be used to synchronize related blink sequences.\n" ) .def("getSequenceGroup", (osgSim::SequenceGroup *(osgSim::BlinkSequence::*)()) &osgSim::BlinkSequence::getSequenceGroup, "get the sequence group.\n", return_value_policy() ) .def("setPhaseShift", &osgSim::BlinkSequence::setPhaseShift, "set the phase shift of the blink sequence, this would be used to shift a sequence within a sequence group.\n" ) .def("getPhaseShift", &osgSim::BlinkSequence::getPhaseShift, "get the pahse shift.\n" ) .def("localTime", &osgSim::BlinkSequence::localTime, "compute the local time clamped to this BlinkSequences period, and accounting for the phase shift and sequence group.\n" ) .def("color", &osgSim::BlinkSequence::color, "compute the color for the time interval sepecifed. Averages the colors if the length is greater than the current pulse.\n" ) ; } }