Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
CAMP
campvis-public
Commits
d50d9159
Commit
d50d9159
authored
Jun 16, 2014
by
Jakob Weiss
Browse files
fixed invalidation of MatrixProcessor when relevant datacontainer items change
parent
7d35a6e5
Changes
2
Hide whitespace changes
Inline
Side-by-side
modules/base/processors/matrixprocessor.cpp
View file @
d50d9159
...
...
@@ -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
modules/base/processors/matrixprocessor.h
View file @
d50d9159
...
...
@@ -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
};
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment