16.12.2021, 9:00 - 11:00: Due to updates GitLab may be unavailable for some minutes between 09:00 and 11:00.

Commit d50d9159 authored by CAMP C++ Builder's avatar CAMP C++ Builder
Browse files

fixed invalidation of MatrixProcessor when relevant datacontainer items change

parent 7d35a6e5
......@@ -54,7 +54,7 @@ namespace campvis {
, _lastdc(nullptr)
{
addProperty(p_parserMode, INVALID_PROPERTIES);
addProperty(p_parserInputString, INVALID_RESULT);
addProperty(p_parserInputString, INVALID_PROPERTIES | INVALID_RESULT);
addProperty(p_matrixAType, INVALID_PROPERTIES | INVALID_RESULT);
addProperty(p_matrixAID, INVALID_RESULT);
......@@ -181,6 +181,15 @@ namespace campvis {
}
}
//update the data name dependencies
_dataDependencies.clear();
auto l1 = StringUtils::split(p_parserInputString.getValue(), "[");
for (size_t i = 1, s = l1.size(); i < s; ++i) {
auto l2 = StringUtils::split(l1[i], "]");
LDEBUG("Data Name: " << l2[0]);
_dataDependencies.insert(l2[0]);
}
validate(INVALID_PROPERTIES);
}
......@@ -370,7 +379,13 @@ namespace campvis {
void MatrixProcessor::DataContainerDataAdded(const std::string &name, const DataHandle &data)
{
if (name == p_matrixAID.getValue() || name == p_matrixBID.getValue())
invalidate(INVALID_RESULT);
if (p_parserMode.getValue()) {
if (_dataDependencies.find(name) != _dataDependencies.end())
invalidate(INVALID_RESULT);
}
else {
if (name == p_matrixAID.getValue() || name == p_matrixBID.getValue())
invalidate(INVALID_RESULT);
}
}
}
\ No newline at end of file
......@@ -28,6 +28,7 @@
//#define MATRIX_PROCESSOR_DEBUGGING
#include <string>
#include <set>
#include <tgt/matrix.h>
......@@ -174,9 +175,11 @@ namespace campvis {
*/
void parseString(const std::string & parserInput, DataContainer & dc);
DataContainer * _lastdc;
static const std::string loggerCat_;
private:
DataContainer * _lastdc;
std::set<std::string> _dataDependencies; ///< set of data container element names that the current formula depends on
};
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment