Delete cygnets

This commit is contained in:
Sebastian Piwell
2016-04-04 11:58:42 -04:00
parent 66a9aeb008
commit 7eb312d10b
12 changed files with 117 additions and 37 deletions
+6
View File
@@ -203,6 +203,7 @@ void GUI::initialize() {
//io.GetClipboardTextFn = ImImpl_GetClipboardTextFn; // @TODO implement? ---abock
_property.initialize();
_iSWAproperty.initialize();
_performance.initialize();
_help.initialize();
}
@@ -249,6 +250,7 @@ void GUI::initializeGL() {
_property.initializeGL();
_iSWAproperty.initializeGL();
_performance.initializeGL();
_help.initializeGL();
}
@@ -260,6 +262,7 @@ void GUI::deinitializeGL() {
glDeleteBuffers(1, &vbo);
_property.deinitializeGL();
_iSWAproperty.deinitializeGL();
_performance.deinitializeGL();
_help.deinitializeGL();
}
@@ -288,6 +291,8 @@ void GUI::endFrame() {
if (_property.isEnabled())
_property.render();
if (_iSWAproperty.isEnabled())
_iSWAproperty.render();
if (_performance.isEnabled())
_performance.render();
if (_help.isEnabled())
@@ -387,6 +392,7 @@ void GUI::renderMainWindow() {
ImGui::Begin("OpenSpace GUI", nullptr);
ImGui::Checkbox("Properties", &_property._isEnabled);
ImGui::Checkbox("iSWA Properties", &_iSWAproperty._isEnabled);
ImGui::Checkbox("Performance", &_performance._isEnabled);
_origin.render();
_time.render();
@@ -195,7 +195,7 @@ namespace {
std::string name = prop->guiName();
bool pressed = ImGui::Button((ownerName + "." + name).c_str());
if (pressed)
executeScript(prop->fullyQualifiedIdentifier(), "0");
executeScript(prop->fullyQualifiedIdentifier(), "nil");
}
//void renderBoolProperty(Property* prop, const std::string& ownerName) {
@@ -383,6 +383,37 @@ void GuiPropertyComponent::registerProperty(properties::Property* prop) {
//handleProperty(dictionary);
}
void GuiPropertyComponent::unregisterProperties(std::string owner){
auto it = _propertiesByOwner.find(owner);
if(it != _propertiesByOwner.end()){
for(prop : it->second){
std::string className = prop->className();
if (className == "BoolProperty")
_boolProperties.insert(prop);
else if (className == "IntProperty")
_intProperties.insert(prop);
else if (className == "FloatProperty")
_floatProperties.insert(prop);
else if (className == "StringProperty")
_stringProperties.insert(prop);
else if (className == "Vec2Property")
_vec2Properties.insert(prop);
else if (className == "Vec3Property")
_vec3Properties.insert(prop);
else if (className == "Vec4Property")
_vec4Properties.insert(prop);
else if (className == "OptionProperty")
_optionProperties.insert(prop);
else if (className == "TriggerProperty")
_triggerProperties.insert(prop);
else if (className == "SelectionProperty")
_selectionProperties.insert(prop);
}
it->second.clear();
_propertiesByOwner.erase(it);
}
}
void GuiPropertyComponent::handleProperty(const ghoul::Dictionary& dictionary) {
//static const std::string TypeKey = "Type";
//static const std::string IdentifierKey = "Identifier";