|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
#ifndef TDOUBLEPARAMRELAYPROPERTY_H
|
|
Toshihiro Shimizu |
890ddd |
#define TDOUBLEPARAMRELAYPROPERTY_H
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
// TnzCore includes
|
|
Toshihiro Shimizu |
890ddd |
#include "tproperty.h"
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
// TnzBase includes
|
|
Toshihiro Shimizu |
890ddd |
#include "tdoubleparam.h"
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
#undef DVAPI
|
|
Toshihiro Shimizu |
890ddd |
#undef DVVAR
|
|
Toshihiro Shimizu |
890ddd |
#ifdef TPARAM_EXPORTS
|
|
Toshihiro Shimizu |
890ddd |
#define DVAPI DV_EXPORT_API
|
|
Toshihiro Shimizu |
890ddd |
#define DVVAR DV_EXPORT_VAR
|
|
Toshihiro Shimizu |
890ddd |
#else
|
|
Toshihiro Shimizu |
890ddd |
#define DVAPI DV_IMPORT_API
|
|
Toshihiro Shimizu |
890ddd |
#define DVVAR DV_IMPORT_VAR
|
|
Toshihiro Shimizu |
890ddd |
#endif
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
//*****************************************************************************
|
|
Toshihiro Shimizu |
890ddd |
// TDoubleParamRelayProperty declaration
|
|
Toshihiro Shimizu |
890ddd |
//*****************************************************************************
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
//! The TDoubleParamRelayProperty is a TProperty heir which can be used as
|
|
Toshihiro Shimizu |
890ddd |
//! intermediary between a TDoubleParam instance and its GUI viewers.
|
|
Toshihiro Shimizu |
890ddd |
class DVAPI TDoubleParamRelayProperty : public TProperty, public TParamObserver
|
|
Toshihiro Shimizu |
890ddd |
{
|
|
Toshihiro Shimizu |
890ddd |
TDoubleParamP m_param; //!< The referenced param
|
|
Toshihiro Shimizu |
890ddd |
double m_frame; //!< Frame at which m_param returns values
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
public:
|
|
Toshihiro Shimizu |
890ddd |
class Visitor
|
|
Toshihiro Shimizu |
890ddd |
{
|
|
Toshihiro Shimizu |
890ddd |
public:
|
|
Toshihiro Shimizu |
890ddd |
virtual void visit(TDoubleParamRelayProperty *p) = 0;
|
|
Toshihiro Shimizu |
890ddd |
};
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
public:
|
|
Toshihiro Shimizu |
890ddd |
TDoubleParamRelayProperty(const std::string &name, TDoubleParamP param = TDoubleParamP());
|
|
Toshihiro Shimizu |
890ddd |
~TDoubleParamRelayProperty();
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
TDoubleParamRelayProperty(const TDoubleParamRelayProperty &other);
|
|
Toshihiro Shimizu |
890ddd |
TDoubleParamRelayProperty &operator=(const TDoubleParamRelayProperty &other);
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
TProperty *clone() const;
|
|
Toshihiro Shimizu |
890ddd |
std::string getValueAsString();
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
void setParam(const TDoubleParamP ¶m);
|
|
Toshihiro Shimizu |
890ddd |
const TDoubleParamP &getParam() const { return m_param; }
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
void setValue(double v);
|
|
Toshihiro Shimizu |
890ddd |
double getValue() const;
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
double frame() const { return m_frame; }
|
|
Toshihiro Shimizu |
890ddd |
double &frame() { return m_frame; }
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
void accept(TProperty::Visitor &v);
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
void onChange(const TParamChange &);
|
|
Toshihiro Shimizu |
890ddd |
};
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
#endif // TDOUBLEPARAMRELAYPROPERTY_H
|