Issue/453 (#556)

* Introduced guiName to PropertyOwner
  * Added requirement that PropertyOwner::identifier may not contain whitespaces
  * Changed Name to Identifier in asset and scene files
  * Added new PropertyOwner to RenderEngine that owns the ScreenSpaceRenderables
  * Moved Name and GuiPath into GUI group
  * Added user-facing names to layer groups
This commit is contained in:
Alexander Bock
2018-03-16 09:21:29 -04:00
committed by GitHub
parent 7a93a4fa37
commit db7ae7e384
234 changed files with 2921 additions and 1676 deletions

View File

@@ -123,6 +123,22 @@ documentation::Documentation ScreenSpaceRenderable::Documentation() {
"the application and can be written to disk on application startup into "
"the FactoryDocumentation."
},
{
KeyName,
new StringVerifier,
Optional::Yes,
"Specifies the name of this screenspace renderable. This does not have "
"to be unique to the scene, but it is recommended to be."
},
{
KeyIdentifier,
new StringVerifier,
Optional::Yes,
"This is the unique identifier for this screenspace renderable. It has "
"to be unique amongst all existing screenspace nodes that already have "
"been added to the scene. The identifier is not allowed to have any "
"whitespace or '.' and must not be empty."
},
{
EnabledInfo.identifier,
new BoolVerifier,
@@ -190,9 +206,10 @@ std::unique_ptr<ScreenSpaceRenderable> ScreenSpaceRenderable::createFromDictiona
);
std::string renderableType = dictionary.value<std::string>(KeyType);
auto factory = FactoryManager::ref().factory<ScreenSpaceRenderable>();
return factory->create(renderableType, dictionary);
return FactoryManager::ref().factory<ScreenSpaceRenderable>()->create(
renderableType,
dictionary
);
}
ScreenSpaceRenderable::ScreenSpaceRenderable(const ghoul::Dictionary& dictionary)
@@ -220,6 +237,15 @@ ScreenSpaceRenderable::ScreenSpaceRenderable(const ghoul::Dictionary& dictionary
, _shader(nullptr)
, _radius(PlaneDepth)
{
if (dictionary.hasKey(KeyIdentifier)) {
setIdentifier(dictionary.value<std::string>(KeyIdentifier));
}
if (dictionary.hasKey(KeyName)) {
setGuiName(dictionary.value<std::string>(KeyName));
}
addProperty(_enabled);
addProperty(_useFlatScreen);
addProperty(_euclideanPosition);
@@ -296,7 +322,7 @@ ScreenSpaceRenderable::ScreenSpaceRenderable(const ghoul::Dictionary& dictionary
_delete.onChange([this](){
std::string script =
"openspace.removeScreenSpaceRenderable('" + name() + "');";
"openspace.removeScreenSpaceRenderable('" + identifier() + "');";
OsEng.scriptEngine().queueScript(
script,
scripting::ScriptEngine::RemoteScripting::No