Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
OpenWalnut
OpenWalnut Core
Commits
b4d91118
Commit
b4d91118
authored
Apr 12, 2010
by
Alexander Wiebel
Browse files
[ADD
#289
] progress indication and initialization of isovalue added
parent
62e4bca2
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
5 deletions
+17
-5
src/modules/marchingCubes/WMMarchingCubes.cpp
src/modules/marchingCubes/WMMarchingCubes.cpp
+17
-5
No files found.
src/modules/marchingCubes/WMMarchingCubes.cpp
View file @
b4d91118
...
...
@@ -122,9 +122,7 @@ void WMMarchingCubes::moduleMain()
// loop until the module container requests the module to quit
while
(
!
m_shutdownFlag
()
)
{
// acquire data from the input connector
m_dataSet
=
m_input
->
getData
();
if
(
!
m_dataSet
.
get
()
)
if
(
!
m_input
->
getData
().
get
()
)
{
// OK, the output has not yet sent data
// NOTE: see comment at the end of this while loop for m_moduleState
...
...
@@ -133,17 +131,30 @@ void WMMarchingCubes::moduleMain()
continue
;
}
m_isoValueProp
->
setMin
(
m_dataSet
->
getMin
()
);
m_isoValueProp
->
setMax
(
m_dataSet
->
getMax
()
);
if
(
m_dataSet
!=
m_input
->
getData
()
)
{
// acquire data from the input connector
m_dataSet
=
m_input
->
getData
();
// set appropriate constraints for properties
m_isoValueProp
->
setMin
(
m_dataSet
->
getMin
()
);
m_isoValueProp
->
setMax
(
m_dataSet
->
getMax
()
);
m_isoValueProp
->
set
(
0.5
*
(
m_dataSet
->
getMax
()
+
m_dataSet
->
getMin
()
)
);
m_moduleState
.
wait
();
// need this to avoid double executing because "set" fires the conditionset
}
// update ISO surface
debugLog
()
<<
"Computing surface ..."
;
boost
::
shared_ptr
<
WProgress
>
progress
=
boost
::
shared_ptr
<
WProgress
>
(
new
WProgress
(
"Marching Cubes"
,
2
)
);
m_progress
->
addSubProgress
(
progress
);
generateSurfacePre
(
m_isoValueProp
->
get
()
);
// TODO(wiebel): MC remove this from here
// renderMesh( load( "/tmp/isosurfaceTestMesh.vtk" ) );
++*
progress
;
debugLog
()
<<
"Rendering surface ..."
;
// settings for normal isosurface
...
...
@@ -152,6 +163,7 @@ void WMMarchingCubes::moduleMain()
renderSurface
();
debugLog
()
<<
"Done!"
;
progress
->
finish
();
// this waits for m_moduleState to fire. By default, this is only the m_shutdownFlag condition.
// NOTE: you can add your own conditions to m_moduleState using m_moduleState.add( ... )
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a 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