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
9defc3a0
Commit
9defc3a0
authored
Jul 24, 2014
by
Jakob Weiss
Browse files
core API improvement: fixed matrix processor, removed camera property
parent
53765b39
Changes
2
Hide whitespace changes
Inline
Side-by-side
modules/base/processors/matrixprocessor.cpp
View file @
9defc3a0
...
...
@@ -51,7 +51,6 @@ namespace campvis {
,
p_matrixBString
(
"MatrixB_String"
,
"Matrix B String"
,
"identity"
)
,
p_matrixBModifiers
(
"MatrixBModifiers"
,
"Matrix B Modifiers"
)
,
p_targetMatrixID
(
"TargetMatrixID"
,
"Target Matrix ID"
,
"ProbeToReference"
,
DataNameProperty
::
WRITE
)
,
p_cameraProperty
(
"Camera"
,
"Exported Camera"
)
,
_lastdc
(
nullptr
)
{
addProperty
(
p_parserMode
,
INVALID_PROPERTIES
);
...
...
@@ -68,9 +67,7 @@ namespace campvis {
addProperty
(
p_matrixBModifiers
,
INVALID_RESULT
);
addProperty
(
p_targetMatrixID
,
INVALID_RESULT
);
addProperty
(
p_cameraProperty
,
VALID
);
invalidate
(
INVALID_PROPERTIES
);
}
...
...
@@ -184,10 +181,23 @@ namespace campvis {
//update the data name dependencies
_dataDependencies
.
clear
();
//first, obtain a list of matrices that are generated by this formula
std
::
vector
<
std
::
string
>
lines
=
StringUtils
::
split
(
p_parserInputString
.
getValue
(),
"
\n
"
);
std
::
vector
<
std
::
string
>
assignees
;
for
(
size_t
i
=
0
,
s
=
lines
.
size
();
i
<
s
;
i
++
)
{
auto
parts
=
StringUtils
::
split
(
lines
[
i
],
"="
);
if
(
parts
.
size
()
>
1
)
{
assignees
.
push_back
(
parts
[
0
]);
LDEBUG
(
"Ignoring "
<<
parts
[
0
]);
}
}
// then, obtain all matrices that this formula depends on (basically all strings in brackets [...])
// ignore those that are generated by the formula itself
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]);
if
(
std
::
find
(
assignees
.
begin
(),
assignees
.
end
(),
l2
[
0
])
==
assignees
.
end
())
_dataDependencies
.
insert
(
l2
[
0
]);
}
}
...
...
@@ -368,18 +378,12 @@ namespace campvis {
// put all results into the data container
// matrix names beginning with an underscore are skipped
// _camera matrix is used to modify m_cameraProperty
for
(
auto
it
=
results
.
begin
(),
end
=
results
.
end
();
it
!=
end
;
++
it
)
{
if
(
it
->
first
[
0
]
!=
'_'
)
{
dc
.
addData
(
it
->
first
,
new
TransformData
(
it
->
second
));
}
if
(
it
->
first
==
"_camera"
)
{
tgt
::
Camera
cam
=
p_cameraProperty
.
getValue
();
cam
.
setViewMatrix
(
it
->
second
);
p_cameraProperty
.
setValue
(
cam
);
}
}
}
void
MatrixProcessor
::
DataContainerDataAdded
(
std
::
string
name
,
DataHandle
data
)
{
if
(
p_parserMode
.
getValue
())
{
...
...
modules/base/processors/matrixprocessor.h
View file @
9defc3a0
...
...
@@ -101,8 +101,6 @@ namespace campvis {
DataNameProperty
p_targetMatrixID
;
///< name for the output matrix
CameraProperty
p_cameraProperty
;
void
DataContainerDataAdded
(
std
::
string
name
,
DataHandle
data
);
protected:
...
...
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