Merge fix

This commit is contained in:
Sebastian Piwell
2016-05-25 14:47:25 -04:00
12 changed files with 230 additions and 223 deletions
+54 -60
View File
@@ -76,6 +76,59 @@ bool DataPlane::initialize(){
if(_group){
_dataProcessor = _group->dataProcessor();
_groupEvent->subscribe(name(), "useLogChanged", [&](const ghoul::Dictionary& dict){
LDEBUG(name() + " Event useLogChanged");
_useLog.setValue(dict.value<bool>("useLog"));
});
_groupEvent->subscribe(name(), "normValuesChanged", [&](ghoul::Dictionary dict){
LDEBUG(name() + " Event normValuesChanged");
std::shared_ptr<glm::vec2> values;
bool success = dict.getValue("normValues", values);
if(success){
_normValues.setValue(*values);
}
});
_groupEvent->subscribe(name(), "useHistogramChanged", [&](ghoul::Dictionary dict){
LDEBUG(name() + " Event useHistogramChanged");
_useHistogram.setValue(dict.value<bool>("useHistogram"));
});
_groupEvent->subscribe(name(), "dataOptionsChanged", [&](ghoul::Dictionary dict){
LDEBUG(name() + " Event dataOptionsChanged");
std::shared_ptr<std::vector<int> > values;
bool success = dict.getValue("dataOptions", values);
if(success){
_dataOptions.setValue(*values);
}
});
_groupEvent->subscribe(name(), "transferFunctionsChanged", [&](ghoul::Dictionary dict){
LDEBUG(name() + " Event transferFunctionsChanged");
_transferFunctionsFile.setValue(dict.value<std::string>("transferFunctions"));
});
_groupEvent->subscribe(name(), "backgroundValuesChanged", [&](ghoul::Dictionary dict){
LDEBUG(name() + " Event backgroundValuesChanged");
std::shared_ptr<glm::vec2> values;
bool success = dict.getValue("backgroundValues", values);
if(success){
_backgroundValues.setValue(*values);
}
});
_groupEvent->subscribe(name(), "autoFilterChanged", [&](ghoul::Dictionary dict){
LDEBUG(name() + " Event autoFilterChanged");
_autoFilter.setValue(dict.value<bool>("autoFilter"));
});
_groupEvent->subscribe(name(), "updateGroup", [&](ghoul::Dictionary dict){
LDEBUG(name() + " Event updateGroup");
loadTexture();
});
}else{
OsEng.gui()._iswa.registerProperty(&_useLog);
OsEng.gui()._iswa.registerProperty(&_useHistogram);
@@ -111,69 +164,9 @@ bool DataPlane::initialize(){
_dataOptions.onChange([this](){ loadTexture();} );
_transferFunctionsFile.onChange([this](){
LDEBUG(name() + " Event setTransferFunctionsFileChanged");
setTransferFunctions(_transferFunctionsFile.value());
});
_groupEvent->subscribe(name(), "useLogChanged", [&](const ghoul::Dictionary& dict){
LDEBUG(name() + " Event useLogChanged");
_useLog.setValue(dict.value<bool>("useLog"));
});
_groupEvent->subscribe(name(), "normValuesChanged", [&](ghoul::Dictionary dict){
LDEBUG(name() + " Event normValuesChanged");
std::shared_ptr<glm::vec2> values;
bool success = dict.getValue("normValues", values);
if(success){
_normValues.setValue(*values);
}
});
_groupEvent->subscribe(name(), "useHistogramChanged", [&](ghoul::Dictionary dict){
LDEBUG(name() + " Event useHistogramChanged");
_useHistogram.setValue(dict.value<bool>("useHistogram"));
});
_groupEvent->subscribe(name(), "autoFilterChanged", [&](ghoul::Dictionary dict){
LDEBUG(name() + " Event autoFilterChanged");
_autoFilter.setValue(dict.value<bool>("autoFilter"));
});
_groupEvent->subscribe(name(), "dataOptionsChanged", [&](ghoul::Dictionary dict){
LDEBUG(name() + " Event dataOptionsChanged");
std::shared_ptr<std::vector<int> > values;
bool success = dict.getValue("dataOptions", values);
if(success){
_dataOptions.setValue(*values);
}
});
_groupEvent->subscribe(name(), "transferFunctionsChanged", [&](ghoul::Dictionary dict){
LDEBUG(name() + " Event transferFunctionsChanged");
_transferFunctionsFile.setValue(dict.value<std::string>("transferFunctions"));
});
_groupEvent->subscribe(name(), "backgroundValuesChanged", [&](ghoul::Dictionary dict){
LDEBUG(name() + " Event backgroundValuesChanged");
std::shared_ptr<glm::vec2> values;
bool success = dict.getValue("backgroundValues", values);
if(success){
_backgroundValues.setValue(*values);
}
});
_groupEvent->subscribe(name(), "clearGroup", [&](ghoul::Dictionary dict){
LDEBUG(name() + " Event clearGroup");
OsEng.scriptEngine().queueScript("openspace.removeSceneGraphNode('" + name() + "')");
});
_groupEvent->subscribe(name(), "updateGroup", [&](ghoul::Dictionary dict){
LDEBUG(name() + " Event updateGroup");
// deinitialize();
updateTexture();
});
return true;
}
@@ -197,6 +190,7 @@ bool DataPlane::loadTexture() {
if(!_dataOptions.options().size()){ // load options for value selection
fillOptions();
_dataProcessor->addValues(_dataBuffer, _dataOptions);
_group->updateGroup();
}
std::vector<float*> data = _dataProcessor->readData2(_dataBuffer, _dataOptions);