Fix a bug in TemplateProperty preventing new bool values to be set

Add "isEnabled" flag BoolProperty to all renderables
This commit is contained in:
Alexander Bock
2014-09-18 08:46:46 +02:00
parent 27901c1629
commit 0fbdbb8dab
7 changed files with 38 additions and 24 deletions
+7 -2
View File
@@ -59,9 +59,8 @@ Renderable* Renderable::createFromDictionary(const ghoul::Dictionary& dictionary
}
Renderable::Renderable(const ghoul::Dictionary& dictionary)
: _enabled("enabled", "Is Enabled", true)
{
// std::string name;
// dictionary.getValue(constants::scenegraphnode::keyName, name);
setName("renderable");
// get path if available
@@ -70,6 +69,8 @@ Renderable::Renderable(const ghoul::Dictionary& dictionary)
dictionary.getValue(constants::scenegraph::keyPathModule, _relativePath);
_relativePath += "/";
}
addProperty(_enabled);
}
Renderable::~Renderable()
@@ -104,4 +105,8 @@ std::string Renderable::findPath(const std::string& path) {
return "";
}
bool Renderable::isVisible() const {
return _enabled;
}
} // namespace openspace
-1
View File
@@ -110,7 +110,6 @@ int property_setValue(lua_State* L) {
return 0;
}
//if (propertyValue.type() != prop->type()) {
if (type != prop->typeLua())
LERROR("Property '" << uri << "' does not accept input of type '"
<< luaTypeToString(type) << "'. Requested type: '"
+2 -1
View File
@@ -269,7 +269,8 @@ void SceneGraphNode::render(const Camera* camera, const psc& parentPosition)
if (!_boundingSphereVisible) {
return;
}
if (_renderableVisible && _renderableToggle) {
if (_renderableVisible && _renderableToggle && _renderable->isVisible()) {
// LDEBUG("Render");
_renderable->render(camera, thisPosition);
}