Renamed some "main" variables
they may cause compile errors on mingw
This commit is contained in:
parent
e5372c61e4
commit
b574483d34
4 changed files with 13 additions and 13 deletions
|
@ -6,7 +6,7 @@
|
||||||
#include "DefinitionNode.h"
|
#include "DefinitionNode.h"
|
||||||
#include "ModelerCameras.h"
|
#include "ModelerCameras.h"
|
||||||
|
|
||||||
AtmosphereModeler::AtmosphereModeler(MainModelerWindow *main) : BaseModelerTool(main) {
|
AtmosphereModeler::AtmosphereModeler(MainModelerWindow *ui) : BaseModelerTool(ui) {
|
||||||
addFloatBinding("atmosphere_humidity", "value", "/atmosphere/humidity");
|
addFloatBinding("atmosphere_humidity", "value", "/atmosphere/humidity");
|
||||||
addFloatBinding("atmosphere_sun_direction", "phi", "/atmosphere/sun/phi", true);
|
addFloatBinding("atmosphere_sun_direction", "phi", "/atmosphere/sun/phi", true);
|
||||||
addFloatBinding("atmosphere_sun_direction", "theta", "/atmosphere/sun/theta", true);
|
addFloatBinding("atmosphere_sun_direction", "theta", "/atmosphere/sun/theta", true);
|
||||||
|
@ -15,7 +15,7 @@ AtmosphereModeler::AtmosphereModeler(MainModelerWindow *main) : BaseModelerTool(
|
||||||
addFloatBinding("atmosphere_moon_direction", "theta", "/atmosphere/moon/theta", true);
|
addFloatBinding("atmosphere_moon_direction", "theta", "/atmosphere/moon/theta", true);
|
||||||
// addFloatBinding("atmosphere_moon_radius", "value", "/atmosphere/moon/radius");
|
// addFloatBinding("atmosphere_moon_radius", "value", "/atmosphere/moon/radius");
|
||||||
|
|
||||||
main->setQmlProperty("atmosphere_daytime", "value", main->getScenery()->getAtmosphere()->getDaytime());
|
ui->setQmlProperty("atmosphere_daytime", "value", ui->getScenery()->getAtmosphere()->getDaytime());
|
||||||
}
|
}
|
||||||
|
|
||||||
void AtmosphereModeler::nodeChanged(const DefinitionNode *node, const DefinitionDiff *) {
|
void AtmosphereModeler::nodeChanged(const DefinitionNode *node, const DefinitionDiff *) {
|
||||||
|
|
|
@ -10,7 +10,7 @@ namespace modeler {
|
||||||
|
|
||||||
class AtmosphereModeler : protected BaseModelerTool {
|
class AtmosphereModeler : protected BaseModelerTool {
|
||||||
public:
|
public:
|
||||||
AtmosphereModeler(MainModelerWindow *window);
|
AtmosphereModeler(MainModelerWindow *ui);
|
||||||
|
|
||||||
virtual void nodeChanged(const DefinitionNode *node, const DefinitionDiff *diff) override;
|
virtual void nodeChanged(const DefinitionNode *node, const DefinitionDiff *diff) override;
|
||||||
};
|
};
|
||||||
|
|
|
@ -14,19 +14,19 @@ class BaseModelerTool::pimpl {
|
||||||
vector<unique_ptr<FloatPropertyBind>> float_bindings;
|
vector<unique_ptr<FloatPropertyBind>> float_bindings;
|
||||||
};
|
};
|
||||||
|
|
||||||
BaseModelerTool::BaseModelerTool(MainModelerWindow *main) : impl(new pimpl), window(main) {
|
BaseModelerTool::BaseModelerTool(MainModelerWindow *ui) : impl(new pimpl), ui(ui) {
|
||||||
}
|
}
|
||||||
|
|
||||||
BaseModelerTool::~BaseModelerTool() {
|
BaseModelerTool::~BaseModelerTool() {
|
||||||
}
|
}
|
||||||
|
|
||||||
void BaseModelerTool::addIntBinding(const string &object, const string &property, const string &path, bool monitor) {
|
void BaseModelerTool::addIntBinding(const string &object, const string &property, const string &path, bool monitor) {
|
||||||
auto node = static_cast<IntNode *>(window->getScenery()->findByPath(path));
|
auto node = static_cast<IntNode *>(ui->getScenery()->findByPath(path));
|
||||||
if (node) {
|
if (node) {
|
||||||
impl->int_bindings.push_back(make_unique<IntPropertyBind>(window, object, property, node));
|
impl->int_bindings.push_back(make_unique<IntPropertyBind>(ui, object, property, node));
|
||||||
|
|
||||||
if (monitor) {
|
if (monitor) {
|
||||||
startWatching(window->getScenery(), path, false);
|
startWatching(ui->getScenery(), path, false);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
Logs::error("UI") << "Can't find int node for binding : " << path << endl;
|
Logs::error("UI") << "Can't find int node for binding : " << path << endl;
|
||||||
|
@ -34,12 +34,12 @@ void BaseModelerTool::addIntBinding(const string &object, const string &property
|
||||||
}
|
}
|
||||||
|
|
||||||
void BaseModelerTool::addFloatBinding(const string &object, const string &property, const string &path, bool monitor) {
|
void BaseModelerTool::addFloatBinding(const string &object, const string &property, const string &path, bool monitor) {
|
||||||
auto node = static_cast<FloatNode *>(window->getScenery()->findByPath(path));
|
auto node = static_cast<FloatNode *>(ui->getScenery()->findByPath(path));
|
||||||
if (node) {
|
if (node) {
|
||||||
impl->float_bindings.push_back(make_unique<FloatPropertyBind>(window, object, property, node));
|
impl->float_bindings.push_back(make_unique<FloatPropertyBind>(ui, object, property, node));
|
||||||
|
|
||||||
if (monitor) {
|
if (monitor) {
|
||||||
startWatching(window->getScenery(), path, false);
|
startWatching(ui->getScenery(), path, false);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
Logs::error("UI") << "Can't find float node for binding : " << path << endl;
|
Logs::error("UI") << "Can't find float node for binding : " << path << endl;
|
||||||
|
|
|
@ -12,7 +12,7 @@ namespace modeler {
|
||||||
|
|
||||||
class BaseModelerTool : public DefinitionWatcher {
|
class BaseModelerTool : public DefinitionWatcher {
|
||||||
public:
|
public:
|
||||||
BaseModelerTool(MainModelerWindow *window);
|
BaseModelerTool(MainModelerWindow *ui);
|
||||||
virtual ~BaseModelerTool();
|
virtual ~BaseModelerTool();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -31,14 +31,14 @@ class BaseModelerTool : public DefinitionWatcher {
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
inline MainModelerWindow *getWindow() const {
|
inline MainModelerWindow *getWindow() const {
|
||||||
return window;
|
return ui;
|
||||||
}
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
class pimpl;
|
class pimpl;
|
||||||
unique_ptr<pimpl> impl;
|
unique_ptr<pimpl> impl;
|
||||||
|
|
||||||
MainModelerWindow *window;
|
MainModelerWindow *ui;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue