2015-12-29 23:20:20 +00:00
|
|
|
#ifndef BASEMODELERTOOL_H
|
|
|
|
#define BASEMODELERTOOL_H
|
|
|
|
|
|
|
|
#include "modeler_global.h"
|
|
|
|
|
2015-12-30 19:14:16 +00:00
|
|
|
#include "DefinitionWatcher.h"
|
|
|
|
|
2015-12-29 23:20:20 +00:00
|
|
|
#include <memory>
|
|
|
|
|
|
|
|
namespace paysages {
|
|
|
|
namespace modeler {
|
|
|
|
|
2015-12-30 19:14:16 +00:00
|
|
|
class BaseModelerTool : public DefinitionWatcher {
|
2015-12-29 23:20:20 +00:00
|
|
|
public:
|
2015-12-30 19:23:24 +00:00
|
|
|
BaseModelerTool(MainModelerWindow *ui);
|
2015-12-29 23:20:20 +00:00
|
|
|
virtual ~BaseModelerTool();
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Add an automated two-way binding between a QML int property and a scenery IntNode.
|
2015-12-30 19:14:16 +00:00
|
|
|
*
|
2016-01-06 18:55:49 +00:00
|
|
|
* If 'monitor' is true, this tool will also receive the node changes, via the DefinitionWatcher mechanism.
|
2015-12-29 23:20:20 +00:00
|
|
|
*/
|
2015-12-30 19:14:16 +00:00
|
|
|
void addIntBinding(const string &object, const string &property, const string &path, bool monitor = false);
|
2015-12-29 23:20:20 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Add an automated two-way binding between a QML int property and a scenery IntNode.
|
2015-12-30 19:14:16 +00:00
|
|
|
*
|
2016-01-06 18:55:49 +00:00
|
|
|
* If 'monitor' is true, this tool will also receive the node changes, via the DefinitionWatcher mechanism.
|
2015-12-29 23:20:20 +00:00
|
|
|
*/
|
2015-12-30 19:14:16 +00:00
|
|
|
void addFloatBinding(const string &object, const string &property, const string &path, bool monitor = false);
|
|
|
|
|
|
|
|
protected:
|
|
|
|
inline MainModelerWindow *getWindow() const {
|
2015-12-30 19:23:24 +00:00
|
|
|
return ui;
|
2015-12-30 19:14:16 +00:00
|
|
|
}
|
2015-12-29 23:20:20 +00:00
|
|
|
|
|
|
|
private:
|
|
|
|
class pimpl;
|
|
|
|
unique_ptr<pimpl> impl;
|
|
|
|
|
2015-12-30 19:23:24 +00:00
|
|
|
MainModelerWindow *ui;
|
2015-12-29 23:20:20 +00:00
|
|
|
};
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif // BASEMODELERTOOL_H
|