removed shared_ptr from group events.

This commit is contained in:
Michael Nilsson
2016-06-03 12:44:18 -04:00
parent f9f9e9abd1
commit dbe9066829
5 changed files with 26 additions and 34 deletions

View File

@@ -204,10 +204,10 @@ void DataPlane::subscribeToGroup(){
groupEvent->subscribe(name(), "normValuesChanged", [&](ghoul::Dictionary dict){
LDEBUG(name() + " Event normValuesChanged");
std::shared_ptr<glm::vec2> values;
glm::vec2 values;
bool success = dict.getValue("normValues", values);
if(success){
_normValues.setValue(*values);
_normValues.setValue(values);
}
});
@@ -218,10 +218,10 @@ void DataPlane::subscribeToGroup(){
groupEvent->subscribe(name(), "dataOptionsChanged", [&](ghoul::Dictionary dict){
LDEBUG(name() + " Event dataOptionsChanged");
std::shared_ptr<std::vector<int> > values;
bool success = dict.getValue("dataOptions", values);
std::vector<int> values;
bool success = dict.getValue<std::vector<int> >("dataOptions", values);
if(success){
_dataOptions.setValue(*values);
_dataOptions.setValue(values);
}
});
@@ -232,10 +232,10 @@ void DataPlane::subscribeToGroup(){
groupEvent->subscribe(name(), "backgroundValuesChanged", [&](ghoul::Dictionary dict){
LDEBUG(name() + " Event backgroundValuesChanged");
std::shared_ptr<glm::vec2> values;
glm::vec2 values;
bool success = dict.getValue("backgroundValues", values);
if(success){
_backgroundValues.setValue(*values);
_backgroundValues.setValue(values);
}
});

View File

@@ -179,10 +179,10 @@ void DataSphere::subscribeToGroup(){
groupEvent->subscribe(name(), "normValuesChanged", [&](ghoul::Dictionary dict){
LDEBUG(name() + " Event normValuesChanged");
std::shared_ptr<glm::vec2> values;
glm::vec2 values;
bool success = dict.getValue("normValues", values);
if(success){
_normValues.setValue(*values);
_normValues.setValue(values);
}
});
@@ -193,10 +193,10 @@ void DataSphere::subscribeToGroup(){
groupEvent->subscribe(name(), "dataOptionsChanged", [&](ghoul::Dictionary dict){
LDEBUG(name() + " Event dataOptionsChanged");
std::shared_ptr<std::vector<int> > values;
bool success = dict.getValue("dataOptions", values);
std::vector<int> values;
bool success = dict.getValue<std::vector<int> >("dataOptions", values);
if(success){
_dataOptions.setValue(*values);
_dataOptions.setValue(values);
}
});
@@ -207,10 +207,10 @@ void DataSphere::subscribeToGroup(){
groupEvent->subscribe(name(), "backgroundValuesChanged", [&](ghoul::Dictionary dict){
LDEBUG(name() + " Event backgroundValuesChanged");
std::shared_ptr<glm::vec2> values;
glm::vec2 values;
bool success = dict.getValue("backgroundValues", values);
if(success){
_backgroundValues.setValue(*values);
_backgroundValues.setValue(values);
}
});

View File

@@ -104,12 +104,12 @@ void IswaDataGroup::registerProperties(){
_normValues.onChange([this]{
LDEBUG("Group " + name() + " published normValuesChanged");
_groupEvent->publish("normValuesChanged", ghoul::Dictionary({{"normValues", std::make_shared<glm::vec2>(_normValues.value())}}));
_groupEvent->publish("normValuesChanged", ghoul::Dictionary({{"normValues", _normValues.value()}}));
});
_backgroundValues.onChange([this]{
LDEBUG("Group " + name() + " published backgroundValuesChanged");
_groupEvent->publish("backgroundValuesChanged", ghoul::Dictionary({{"backgroundValues", std::make_shared<glm::vec2>(_backgroundValues.value())}}));
_groupEvent->publish("backgroundValuesChanged", ghoul::Dictionary({{"backgroundValues", _backgroundValues.value()}}));
});
_transferFunctionsFile.onChange([this]{
@@ -119,7 +119,9 @@ void IswaDataGroup::registerProperties(){
_dataOptions.onChange([this]{
LDEBUG("Group " + name() + " published dataOptionsChanged");
_groupEvent->publish("dataOptionsChanged", ghoul::Dictionary({{"dataOptions", std::make_shared<std::vector<int> >(_dataOptions.value())}}));
ghoul::Dictionary dict;
dict.setValue<std::vector<int>>("dataOptions", _dataOptions.value());
_groupEvent->publish("dataOptionsChanged", dict);
});
}

View File

@@ -323,10 +323,10 @@ void KameleonPlane::subscribeToGroup(){
groupEvent->subscribe(name(), "normValuesChanged", [&](ghoul::Dictionary dict){
LDEBUG(name() + " Event normValuesChanged");
std::shared_ptr<glm::vec2> values;
glm::vec2 values;
bool success = dict.getValue("normValues", values);
if(success){
_normValues.setValue(*values);
_normValues.setValue(values);
}
});
@@ -337,10 +337,10 @@ void KameleonPlane::subscribeToGroup(){
groupEvent->subscribe(name(), "dataOptionsChanged", [&](ghoul::Dictionary dict){
LDEBUG(name() + " Event dataOptionsChanged");
std::shared_ptr<std::vector<int> > values;
bool success = dict.getValue("dataOptions", values);
std::vector<int> values;
bool success = dict.getValue<std::vector<int> >("dataOptions", values);
if(success){
_dataOptions.setValue(*values);
_dataOptions.setValue(values);
}
});
@@ -351,10 +351,10 @@ void KameleonPlane::subscribeToGroup(){
groupEvent->subscribe(name(), "backgroundValuesChanged", [&](ghoul::Dictionary dict){
LDEBUG(name() + " Event backgroundValuesChanged");
std::shared_ptr<glm::vec2> values;
glm::vec2 values;
bool success = dict.getValue("backgroundValues", values);
if(success){
_backgroundValues.setValue(*values);
_backgroundValues.setValue(values);
}
});

View File

@@ -153,15 +153,6 @@ void IswaManager::addIswaCygnet(int id, std::string type, std::string group){
}
);
}
// else{
// // Kameleonplane?
// // LERROR("No cygnet with id 0");
// std::string kwPath = "${OPENSPACE_DATA}/BATSRUS.cdf";
// if(type == "x" || type == "y" || type == "z")
// createKameleonPlane(kwPath, type, group);
// else
// createKameleonPlane(kwPath, "z", group);
// }
}
void IswaManager::addKameleonCdf(std::string groupName, int pos){
@@ -537,7 +528,6 @@ void IswaManager::createKameleonPlane(CdfInfo info, std::string cut){
std::string luaTable = parseKWToLuaTable(info, cut);
if(!luaTable.empty()){
// // std::cout << luaTable << std::endl;
std::string script = "openspace.addSceneGraphNode(" + luaTable + ");";
OsEng.scriptEngine().queueScript(script);
}