Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
T
tnl-dev
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Model registry
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
TNL
tnl-dev
Commits
ac40aaf0
There was an error fetching the commit references. Please try again later.
Commit
ac40aaf0
authored
11 years ago
by
Tomáš Oberhuber
Browse files
Options
Downloads
Patches
Plain Diff
Improving tnl-view to skip already processed files.
parent
ca4e7eb7
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
src/core/tnlFile.h
+11
-0
11 additions, 0 deletions
src/core/tnlFile.h
tools/share/tnl-view.cfg.desc
+1
-0
1 addition, 0 deletions
tools/share/tnl-view.cfg.desc
tools/src/tnl-view.h
+8
-0
8 additions, 0 deletions
tools/src/tnl-view.h
with
20 additions
and
0 deletions
src/core/tnlFile.h
+
11
−
0
View file @
ac40aaf0
...
...
@@ -19,6 +19,7 @@
#define TNLFILE_H_
#include
<iostream>
#include
<fstream>
#include
<stdio.h>
#include
<stdlib.h>
#include
<tnlConfig.h>
...
...
@@ -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_ */
This diff is collapsed.
Click to expand it.
tools/share/tnl-view.cfg.desc
+
1
−
0
View file @
ac40aaf0
...
...
@@ -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.];
...
...
This diff is collapsed.
Click to expand it.
tools/src/tnl-view.h
+
8
−
0
View file @
ac40aaf0
...
...
@@ -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"
);
...
...
@@ -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
;
...
...
@@ -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
)
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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!
Save comment
Cancel
Please
register
or
sign in
to comment