Loading src/core/tnlFile.h +11 −0 Original line number Diff line number Diff line Loading @@ -19,6 +19,7 @@ #define TNLFILE_H_ #include <iostream> #include <fstream> #include <stdio.h> #include <stdlib.h> #include <tnlConfig.h> Loading Loading @@ -331,5 +332,15 @@ bool tnlFile :: write( const Type* buffer, return true; }; inline bool fileExists( const tnlString& fileName ) { fstream file; file.open( fileName. getString(), ios::in ); bool result( true ); if( ! file ) result = false; file.close(); return result; }; #endif /* TNLFILE_H_ */ tools/share/tnl-view.cfg.desc +1 −0 Original line number Diff line number Diff line Loading @@ -3,6 +3,7 @@ group IO string mesh( "" ) [Mesh file. If none is given, a regular rectangular mesh is assumed.]; list of string input-files(!) [Input files.]; list of string output-files [Output files.]; bool check-output-file(false) [If the output file already exists, do not recreate it.]; list of real level-lines [List of level sets which will be drawn.]; integer output-x-size [X size of the output.]; integer output-y-size [Y size of the output.]; Loading tools/src/tnl-view.h +8 −0 Original line number Diff line number Diff line Loading @@ -35,6 +35,7 @@ bool convertObject( const Mesh& mesh, const tnlParameterContainer& parameters ) { int verbose = parameters. GetParameter< int >( "verbose"); bool checkOutputFile = parameters. GetParameter< bool >( "check-output-file" ); tnlString outputFileName( inputFileName ); RemoveFileExtension( outputFileName ); tnlString outputFormat = parameters. GetParameter< tnlString >( "output-format" ); Loading @@ -45,6 +46,12 @@ bool convertObject( const Mesh& mesh, cerr << "Unknown file format " << outputFormat << "."; return false; } if( checkOutputFile && fileExists( outputFileName ) ) { if( verbose ) cout << " file already exists. Skipping. \r" << flush; return true; } if( verbose ) cout << " writing to " << outputFileName << " ... " << flush; Loading Loading @@ -156,6 +163,7 @@ bool processFiles( const tnlParameterContainer& parameters ) { int verbose = parameters. GetParameter< int >( "verbose"); tnlString meshFile = parameters. GetParameter< tnlString >( "mesh" ); Mesh mesh; if( meshFile != "" ) if( ! mesh. load( meshFile ) ) Loading Loading
src/core/tnlFile.h +11 −0 Original line number Diff line number Diff line Loading @@ -19,6 +19,7 @@ #define TNLFILE_H_ #include <iostream> #include <fstream> #include <stdio.h> #include <stdlib.h> #include <tnlConfig.h> Loading Loading @@ -331,5 +332,15 @@ bool tnlFile :: write( const Type* buffer, return true; }; inline bool fileExists( const tnlString& fileName ) { fstream file; file.open( fileName. getString(), ios::in ); bool result( true ); if( ! file ) result = false; file.close(); return result; }; #endif /* TNLFILE_H_ */
tools/share/tnl-view.cfg.desc +1 −0 Original line number Diff line number Diff line Loading @@ -3,6 +3,7 @@ group IO string mesh( "" ) [Mesh file. If none is given, a regular rectangular mesh is assumed.]; list of string input-files(!) [Input files.]; list of string output-files [Output files.]; bool check-output-file(false) [If the output file already exists, do not recreate it.]; list of real level-lines [List of level sets which will be drawn.]; integer output-x-size [X size of the output.]; integer output-y-size [Y size of the output.]; Loading
tools/src/tnl-view.h +8 −0 Original line number Diff line number Diff line Loading @@ -35,6 +35,7 @@ bool convertObject( const Mesh& mesh, const tnlParameterContainer& parameters ) { int verbose = parameters. GetParameter< int >( "verbose"); bool checkOutputFile = parameters. GetParameter< bool >( "check-output-file" ); tnlString outputFileName( inputFileName ); RemoveFileExtension( outputFileName ); tnlString outputFormat = parameters. GetParameter< tnlString >( "output-format" ); Loading @@ -45,6 +46,12 @@ bool convertObject( const Mesh& mesh, cerr << "Unknown file format " << outputFormat << "."; return false; } if( checkOutputFile && fileExists( outputFileName ) ) { if( verbose ) cout << " file already exists. Skipping. \r" << flush; return true; } if( verbose ) cout << " writing to " << outputFileName << " ... " << flush; Loading Loading @@ -156,6 +163,7 @@ bool processFiles( const tnlParameterContainer& parameters ) { int verbose = parameters. GetParameter< int >( "verbose"); tnlString meshFile = parameters. GetParameter< tnlString >( "mesh" ); Mesh mesh; if( meshFile != "" ) if( ! mesh. load( meshFile ) ) Loading