Auto filter at start

This commit is contained in:
Sebastian Piwell
2016-06-03 14:16:15 -04:00
parent e3dae7abc3
commit 4ae4ecca3c
3 changed files with 14 additions and 3 deletions

View File

@@ -34,7 +34,7 @@ DataPlane::DataPlane(const ghoul::Dictionary& dictionary)
:DataCygnet(dictionary)
,_useLog("useLog","Use Logarithm", false)
,_useHistogram("useHistogram", "Auto Contrast", false)
,_autoFilter("autoFilter", "Auto Filter", false)
,_autoFilter("autoFilter", "Auto Filter", true)
,_normValues("normValues", "Normalize Values", glm::vec2(1.0,1.0), glm::vec2(0), glm::vec2(5.0))
,_backgroundValues("backgroundValues", "Background Values", glm::vec2(0.0), glm::vec2(0), glm::vec2(1.0))
,_transferFunctionsFile("transferfunctions", "Transfer Functions", "${SCENE}/iswa/tfs/default.tf")
@@ -136,9 +136,9 @@ bool DataPlane::createGeometry() {
// x y z w s t
-x, -y, -z, w, 0, 1,
x, y, z, w, 1, 0,
-x, ((x>1)?y:-y), z, w, 0, 0,
-x, ((x>0)?y:-y), z, w, 0, 0,
-x, -y, -z, w, 0, 1,
x, ((x>1)?-y:y), -z, w, 1, 1,
x, ((x>0)?-y:y), -z, w, 1, 1,
x, y, z, w, 1, 0,
};
@@ -246,6 +246,8 @@ void DataPlane::subscribeToGroup(){
groupEvent->subscribe(name(), "updateGroup", [&](ghoul::Dictionary dict){
LDEBUG(name() + " Event updateGroup");
if(_autoFilter.value())
_backgroundValues.setValue(_dataProcessor->filterValues());
updateTexture();
});
}

View File

@@ -66,7 +66,9 @@ bool IswaBaseGroup::isType(std::string type){
}
void IswaBaseGroup::updateGroup(){
LDEBUG("Group " + name() + " published updateGroup");
_groupEvent->publish("updateGroup", ghoul::Dictionary());
}
void IswaBaseGroup::clearGroup(){

View File

@@ -188,6 +188,11 @@ bool KameleonPlane::initialize(){
std::dynamic_pointer_cast<DataProcessorKameleon>(_dataProcessor)->dimensions(_dimensions);
_dataProcessor->addDataValues(_kwPath, _dataOptions);
// if this datacygnet has added new values then reload texture
// for the whole group, including this datacygnet, and return after.
if(_group){
_group->updateGroup();
}
updateTextureResource();
return true;
@@ -365,6 +370,8 @@ void KameleonPlane::subscribeToGroup(){
groupEvent->subscribe(name(), "updateGroup", [&](ghoul::Dictionary dict){
LDEBUG(name() + " Event updateGroup");
if(_autoFilter.value())
_backgroundValues.setValue(_dataProcessor->filterValues());
updateTexture();
});