14#ifndef OSGSIM_BLINKSQUENCE
15#define OSGSIM_BLINKSQUENCE 1
63 inline void getPulse(
unsigned int i,
double& length,
osg::Vec4& color)
const;
66 inline void setPulse(
unsigned int i,
double length,
const osg::Vec4& color);
87 inline double localTime(
double time)
const;
90 inline osg::Vec4 color(
double time,
double length)
const;
138 PulseData::const_iterator itr =
_pulseData.begin();
141 while (lt>itr->first)
150 if (lt+length<=itr->first)
161 double len = length-(itr->first-lt);
166 while (len>itr->first)
169 color += itr->second*itr->first;
175 color += itr->second*len;
Vec4f Vec4
Definition Vec4:21
The osgSim library is a NodeKit that extends the core scene graph to support nodes and drawables that...
Definition BlinkSequence:27
Copy Op(erator) used to control whether shallow or deep copy is used during copy construction and clo...
Definition CopyOp:41
@ SHALLOW_COPY
Definition CopyOp:47
Base class/standard interface for objects which require IO support, cloning and reference counting.
Definition Object:61
Smart pointer for handling referenced counted objects.
Definition ref_ptr:32
sequence group which can be used to synchronize related blink sequences.
Definition BlinkSequence:31
META_Object(osgSim, SequenceGroup)
SequenceGroup(const SequenceGroup &bs, const osg::CopyOp ©op=osg::CopyOp::SHALLOW_COPY)
double _baseTime
Definition BlinkSequence:43
double getBaseTime() const
Definition BlinkSequence:41
SequenceGroup(double baseTime)
void setBaseTime(double t)
Definition BlinkSequence:40
void getPulse(unsigned int i, double &length, osg::Vec4 &color) const
return the pulse data at position i.
Definition BlinkSequence:119
PulseData _pulseData
Definition BlinkSequence:101
double _pulsePeriod
Definition BlinkSequence:99
void setSequenceGroup(SequenceGroup *sg)
set the sequence group which can be used to synchronize related blink sequences.
Definition BlinkSequence:72
void setPulse(unsigned int i, double length, const osg::Vec4 &color)
set pulse of specified color and duration to the BlinkSequence.
Definition BlinkSequence:126
SequenceGroup * getSequenceGroup()
get the non const sequence group.
Definition BlinkSequence:75
double getPhaseShift() const
get the pahse shift.
Definition BlinkSequence:84
void setPhaseShift(double ps)
set the phase shift of the blink sequence, this would be used to shift a sequence within a sequence g...
Definition BlinkSequence:81
double _phaseShift
Definition BlinkSequence:100
std::vector< IntervalColor > PulseData
Definition BlinkSequence:97
double getPulsePeriod() const
get the total pulse period of the blink sequence, which is equal to the sum of all the pulse periods.
Definition BlinkSequence:69
osg::ref_ptr< SequenceGroup > _sequenceGroup
Definition BlinkSequence:102
const SequenceGroup * getSequenceGroup() const
get the const sequence group.
Definition BlinkSequence:78
META_Object(osgSim, BlinkSequence)
void addPulse(double length, const osg::Vec4 &color)
add a pulse of specified color and duration to the BlinkSequence.
Definition BlinkSequence:113
std::pair< double, osg::Vec4 > IntervalColor
Definition BlinkSequence:96
double localTime(double time) const
compute the local time clamped to this BlinkSequences period, and accounting for the phase shift and ...
Definition BlinkSequence:106
osg::Vec4 color(double time, double length) const
compute the color for the time interval sepecifed.
Definition BlinkSequence:134
BlinkSequence(const BlinkSequence &bs, const osg::CopyOp ©op=osg::CopyOp::SHALLOW_COPY)
int getNumPulses() const
return the number of pulses.
Definition BlinkSequence:60
#define OSGSIM_EXPORT
Definition Export:38