diff --git a/Src/AdaptiveTreeVisualization.cpp b/Src/AdaptiveTreeVisualization.cpp index bb1c7ca..6b170e9 100644 --- a/Src/AdaptiveTreeVisualization.cpp +++ b/Src/AdaptiveTreeVisualization.cpp @@ -154,7 +154,8 @@ void _Execute( const FEMTree< Dim , Real >* tree , FILE* fp ) if( Verbose.set ) printf( "Vertices / Polygons: %d / %d\n" , (int)( mesh.outOfCorePointCount()+mesh.inCorePoints.size() ) , (int)mesh.polygonCount() ); std::vector< std::string > comments; - PlyWritePolygons< Vertex , Real , Dim >( OutMesh.value , &mesh , ASCII.set ? PLY_ASCII : PLY_BINARY_NATIVE , comments , XForm< Real , Dim+1 >::Identity() ); + if( !PlyWritePolygons< Vertex , Real , Dim >( OutMesh.value , &mesh , ASCII.set ? PLY_ASCII : PLY_BINARY_NATIVE , comments , XForm< Real , Dim+1 >::Identity() ) ) + fprintf( stderr , "[ERROR] Could not write mesh to: %s\n" , OutMesh.value ) , exit( 0 ); } } diff --git a/Src/EDTInHeat.cpp b/Src/EDTInHeat.cpp index 891cd1a..2cf8f21 100644 --- a/Src/EDTInHeat.cpp +++ b/Src/EDTInHeat.cpp @@ -41,7 +41,6 @@ DAMAGE. #include "CmdLineParser.h" #include "PPolynomial.h" #include "FEMTree.h" -#include "Ply.h" MessageWriter messageWriter; diff --git a/Src/ImageStitching.cpp b/Src/ImageStitching.cpp index 065f815..b76895e 100644 --- a/Src/ImageStitching.cpp +++ b/Src/ImageStitching.cpp @@ -139,7 +139,8 @@ struct RGBPixel void WriteImage( char* fileName , RGBPixel* pixels , int w , int h ) { unsigned int _w = w , _h = h , _c = 3; - ImageWriter::Write( fileName , (const unsigned char*)pixels , _w , _h , _c ); + if( !ImageWriter::Write( fileName , (const unsigned char*)pixels , _w , _h , _c ) ) + fprintf( stderr , "[ERROR] Could not write image to: %s\n" , fileName ) , exit( 0 ); } struct Profiler diff --git a/Src/PoissonRecon.cpp b/Src/PoissonRecon.cpp index 15767c5..f742f90 100644 --- a/Src/PoissonRecon.cpp +++ b/Src/PoissonRecon.cpp @@ -339,7 +339,8 @@ void ExtractMesh( UIntPack< FEMSigs ... > , std::tuple< SampleData ... > , FEMTr else profiler.dumpOutput2( comments , "# Got triangles:" ); std::vector< std::string > noComments; - PlyWritePolygons< Vertex , Real , Dim >( Out.value , &mesh , ASCII.set ? PLY_ASCII : PLY_BINARY_NATIVE , NoComments.set ? noComments : comments , iXForm ); + if( !PlyWritePolygons< Vertex , Real , Dim >( Out.value , &mesh , ASCII.set ? PLY_ASCII : PLY_BINARY_NATIVE , NoComments.set ? noComments : comments , iXForm ) ) + fprintf( stderr , "[ERROR] Could not write mesh to: %s\n" , Out.value ) , exit( 0 ); } template< class Real , typename ... SampleData , unsigned int ... FEMSigs > diff --git a/Src/SSDRecon.cpp b/Src/SSDRecon.cpp index 9e8a52c..f9e760f 100644 --- a/Src/SSDRecon.cpp +++ b/Src/SSDRecon.cpp @@ -359,7 +359,8 @@ void ExtractMesh( UIntPack< FEMSigs ... > , std::tuple< SampleData ... > , FEMTr else profiler.dumpOutput2( comments , "# Got triangles:" ); std::vector< std::string > noComments; - PlyWritePolygons< Vertex , Real , Dim >( Out.value , &mesh , ASCII.set ? PLY_ASCII : PLY_BINARY_NATIVE , NoComments.set ? noComments : comments , iXForm ); + if( !PlyWritePolygons< Vertex , Real , Dim >( Out.value , &mesh , ASCII.set ? PLY_ASCII : PLY_BINARY_NATIVE , NoComments.set ? noComments : comments , iXForm ) ) + fprintf( stderr , "[ERROR] Could not write mesh to: %s\n" , Out.value ) , exit( 0 ); } template< class Real , typename ... SampleData , unsigned int ... FEMSigs > diff --git a/Src/SurfaceTrimmer.cpp b/Src/SurfaceTrimmer.cpp index 0c884da..8003cc5 100644 --- a/Src/SurfaceTrimmer.cpp +++ b/Src/SurfaceTrimmer.cpp @@ -365,7 +365,9 @@ int Execute( void ) char comment[1024]; sprintf( comment , "#Trimmed In: %9.1f (s)" , Time()-t ); comments.push_back( comment ); - if( Out.set ) PlyWritePolygons< Vertex >( Out.value , vertices , gtPolygons , Vertex::PlyWriteProperties() , Vertex::PlyWriteNum , ft , comments ); + if( Out.set ) + if( !PlyWritePolygons< Vertex >( Out.value , vertices , gtPolygons , Vertex::PlyWriteProperties() , Vertex::PlyWriteNum , ft , comments ) ) + fprintf( stderr , "[ERROR] Could not write mesh to: %s\n" , Out.value ) , exit( 0 ); return EXIT_SUCCESS; }