//C++ header - Open Scene Graph - Copyright (C) 1998-2002 Robert Osfield //Distributed under the terms of the GNU Library General Public License (LGPL) //as published by the Free Software Foundation. //osgParticle - Copyright (C) 2002 Marco Jez #ifndef OSGPARTICLE_VARIABLERATECOUNTER_ #define OSGPARTICLE_VARIABLERATECOUNTER_ 1 #include #include #include #include namespace osgParticle { class VariableRateCounter: public Counter { public: inline VariableRateCounter(); inline VariableRateCounter(const VariableRateCounter ©, const osg::CopyOp ©op = osg::CopyOp::SHALLOW_COPY); virtual const char *className() const { return "VariableRateCounter"; } virtual bool isSameKindAs(const osg::Object *obj) const { return dynamic_cast(obj) != 0; } inline const rangef &getRateRange() const; inline void setRateRange(const rangef &r); inline void setRateRange(float minrange, float maxrange); protected: virtual ~VariableRateCounter() {} private: rangef rate_range_; }; // INLINE FUNCTIONS inline VariableRateCounter::VariableRateCounter() : Counter(), rate_range_(1, 1) { } inline VariableRateCounter::VariableRateCounter(const VariableRateCounter ©, const osg::CopyOp ©op) : Counter(copy, copyop), rate_range_(copy.rate_range_) { } inline const rangef &VariableRateCounter::getRateRange() const { return rate_range_; } inline void VariableRateCounter::setRateRange(const rangef &r) { rate_range_ = r; } inline void VariableRateCounter::setRateRange(float minrange, float maxrange) { rate_range_.set(minrange, maxrange); } } #endif