mirror of
https://github.com/OpenSpace/OpenSpace.git
synced 2026-01-08 04:31:08 -06:00
removed shared_ptr from group events.
This commit is contained in:
@@ -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);
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
@@ -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);
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user