C++ (Qt)class Motion { ... std::map<std::string, std::string> metaData;
C++ (Qt)// MotionUtils.h#ifndef MOTION_UTILS_H #define MOTION_UTILS_H namespace SomeLibrary { class Motion;}; double GetNoiseScale( SomeLibrary::Motion * motion, double defaultValue = 0.0 );void SetNoiseScale( SomeLibrary::Motion * motion, double value ); extern const double defaultNoiseScale; #endif // MOTION_UTILS_H
C++ (Qt)double getNoiseScale( const SomeLibrary::Motion &motion, double defaultValue = 0.0 );void setNoiseScale( SomeLibrary::Motion &motion, double value ); double getNoiseScale( const SomeLibrary::Poligon &poligon, double defaultValue = 0.0 );void setNoiseScale( SomeLibrary::Poligon &poligon, double value );
C++ (Qt)class MotionHelper{public: MotionHelper( SomeLibrary::Motion &motion ) : m_motion( motion ) {} double getNoiseScale( double defVal = 0.0 ) const; void setNoiseScale( double val ); private: SomeLibrary::Motion &m_motion;};
C++ (Qt)double scale = MotionUtils::GetNoiseScale(motion);
C++ (Qt)double scale = MotionHelper(*motion).GetNoiseScale();
C++ (Qt)MotionHelper m( motion );m.setNoiseScale( 100500 );m.setPos( ... );m.setXXX(); // или MotionHelper( motion ).setNoiseScale( 100500 ).setPos( ... ).setXXX();