ColormapEnable needs to be turned on/off in GUI for renderable after transfer from Glue. Not rendering points w/ nan attr val.

This commit is contained in:
Jacob Molin
2022-05-24 22:50:18 -06:00
parent df79184faf
commit 83379d481c
3 changed files with 22 additions and 13 deletions
@@ -55,7 +55,8 @@ SoftwareConnection::SoftwareConnection(SoftwareConnection&& sc)
{}
SoftwareConnection::~SoftwareConnection() {
LINFO(fmt::format("Remove software connection {}", _id));
// TODO: Destructor being called on Connection for some reason
LINFO(fmt::format("Removing software connection {}", _id));
if (!_isConnected) return;
_isConnected = false;
@@ -241,19 +241,22 @@ void PointDataMessageHandler::handleAttributeDataMessage(const std::vector<char>
module->storeData(key, std::move(attributeData));
auto callback = [this, identifier, keyEnum] {
switch (keyEnum) {
case storage::Key::ColormapAttrData : {
std::function<void()> callback;
switch (keyEnum) {
case storage::Key::ColormapAttrData : {
callback = [this, identifier, keyEnum] {
openspace::global::scriptEngine->queueScript(
fmt::format(
"openspace.setPropertyValueSingle('Scene.{}.Renderable.ColormapEnabled', {});",
identifier, "true"
),
scripting::ScriptEngine::RemoteScripting::Yes
);
break;
}
case storage::Key::LinearSizeAttrData : {
);
};
break;
}
case storage::Key::LinearSizeAttrData : {
callback = [this, identifier] {
openspace::global::scriptEngine->queueScript(
fmt::format(
"openspace.setPropertyValueSingle('Scene.{}.Renderable.LinearSizeEnabled', {});",
@@ -261,12 +264,12 @@ void PointDataMessageHandler::handleAttributeDataMessage(const std::vector<char>
),
scripting::ScriptEngine::RemoteScripting::Yes
);
break;
}
default:
break;
};
break;
}
};
default:
break;
}
addCallback(identifier, { callback, allDataToWaitFor });
}
@@ -54,6 +54,11 @@ Fragment getFragment() {
discard;
}
// Don't show points with no value for that attribute
if (colormapEnabled && isnan(ge_colormapAttributeScalar)) {
discard;
}
const float radius = 0.5;
float distance = length(coords - radius);
if (distance > 0.6) discard;