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
c7f1d603
Commit
c7f1d603
authored
Nov 21, 2009
by
Alexander Wiebel
Browse files
[FIX] fixed check for bad file stream
[ADD] exception when bad file stream encountered
parent
274911e8
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
5 deletions
+5
-5
src/modules/marchingCubes/WMMarchingCubes.cpp
src/modules/marchingCubes/WMMarchingCubes.cpp
+5
-5
No files found.
src/modules/marchingCubes/WMMarchingCubes.cpp
View file @
c7f1d603
...
...
@@ -126,7 +126,7 @@ void WMMarchingCubes::moduleMain()
// TODO(wiebel): MC set correct isoValue here
generateSurface
(
110
);
// generateSurface( 200 );
// TODO(wiebel): MC remove this from here
// renderMesh( load( "/tmp/isosurfaceTestMesh.vtk" ) );
...
...
@@ -584,7 +584,7 @@ void WMMarchingCubes::renderMesh( WTriangleMesh* mesh )
WKernel
::
getRunningKernel
()
->
getGraphicsEngine
()
->
getScene
()
->
addChild
(
geode
);
osgDB
::
writeNodeFile
(
*
geode
,
"/tmp/saved.osg"
);
//for debugging
//
osgDB::writeNodeFile( *geode, "/tmp/saved.osg" ); //for debugging
}
// TODO(wiebel): MC move this to a separate module in the future
...
...
@@ -669,9 +669,10 @@ WTriangleMesh WMMarchingCubes::load( std::string fileName )
std
::
ifstream
ifs
;
ifs
.
open
(
fileName
.
c_str
(),
std
::
ifstream
::
in
);
if
(
ifs
||
ifs
.
bad
()
)
if
(
!
ifs
||
ifs
.
bad
()
)
{
WLogger
::
getLogger
()
->
addLogMessage
(
"Load broken file '"
+
fileName
+
"'"
,
"Marching Cubes"
,
LL_ERROR
);
WLogger
::
getLogger
()
->
addLogMessage
(
"Try load broken file '"
+
fileName
+
"'"
,
"Marching Cubes"
,
LL_ERROR
);
throw
std
::
runtime_error
(
"Problem during reading file. Probably file not found."
);
}
std
::
string
line
;
...
...
@@ -686,7 +687,6 @@ WTriangleMesh WMMarchingCubes::load( std::string fileName )
}
header
.
push_back
(
line
);
}
if
(
header
.
at
(
0
)
!=
"# vtk DataFile Version 2.0"
)
{
WLogger
::
getLogger
()
->
addLogMessage
(
"Unsupported format version string: "
+
header
.
at
(
0
),
"Marching Cubes"
,
LL_WARNING
);
...
...
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