Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
gmsh
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Larry Price
gmsh
Commits
b8b36a96
Commit
b8b36a96
authored
12 years ago
by
Christophe Geuzaine
Browse files
Options
Downloads
Patches
Plain Diff
make sure -format recognizes all the same formats as CreateFile
parent
2795e213
No related branches found
No related tags found
No related merge requests found
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
Common/CommandLine.cpp
+8
-26
8 additions, 26 deletions
Common/CommandLine.cpp
Common/CreateFile.cpp
+44
-39
44 additions, 39 deletions
Common/CreateFile.cpp
Common/CreateFile.h
+3
-2
3 additions, 2 deletions
Common/CreateFile.h
with
55 additions
and
67 deletions
Common/CommandLine.cpp
+
8
−
26
View file @
b8b36a96
...
@@ -631,32 +631,14 @@ void GetOptions(int argc, char *argv[])
...
@@ -631,32 +631,14 @@ void GetOptions(int argc, char *argv[])
CTX
::
instance
()
->
mesh
.
fileFormat
=
FORMAT_MSH
;
CTX
::
instance
()
->
mesh
.
fileFormat
=
FORMAT_MSH
;
CTX
::
instance
()
->
mesh
.
mshFileVersion
=
2.0
;
CTX
::
instance
()
->
mesh
.
mshFileVersion
=
2.0
;
}
}
else
if
(
!
strcmp
(
argv
[
i
],
"msh"
))
else
{
CTX
::
instance
()
->
mesh
.
fileFormat
=
FORMAT_MSH
;
int
format
=
GetFileFormatFromExtension
(
std
::
string
(
"."
)
+
argv
[
i
]);
else
if
(
!
strcmp
(
argv
[
i
],
"unv"
))
if
(
format
<
0
){
CTX
::
instance
()
->
mesh
.
fileFormat
=
FORMAT_UNV
;
Msg
::
Error
(
"Unknown mesh format `%s', using `msh' instead"
,
argv
[
i
]);
else
if
(
!
strcmp
(
argv
[
i
],
"vrml"
))
format
=
FORMAT_MSH
;
CTX
::
instance
()
->
mesh
.
fileFormat
=
FORMAT_VRML
;
}
else
if
(
!
strcmp
(
argv
[
i
],
"ply2"
))
CTX
::
instance
()
->
mesh
.
fileFormat
=
format
;
CTX
::
instance
()
->
mesh
.
fileFormat
=
FORMAT_PLY2
;
}
else
if
(
!
strcmp
(
argv
[
i
],
"stl"
))
CTX
::
instance
()
->
mesh
.
fileFormat
=
FORMAT_STL
;
else
if
(
!
strcmp
(
argv
[
i
],
"mesh"
))
CTX
::
instance
()
->
mesh
.
fileFormat
=
FORMAT_MESH
;
else
if
(
!
strcmp
(
argv
[
i
],
"bdf"
))
CTX
::
instance
()
->
mesh
.
fileFormat
=
FORMAT_BDF
;
else
if
(
!
strcmp
(
argv
[
i
],
"p3d"
))
CTX
::
instance
()
->
mesh
.
fileFormat
=
FORMAT_P3D
;
else
if
(
!
strcmp
(
argv
[
i
],
"cgns"
))
CTX
::
instance
()
->
mesh
.
fileFormat
=
FORMAT_CGNS
;
else
if
(
!
strcmp
(
argv
[
i
],
"diff"
))
CTX
::
instance
()
->
mesh
.
fileFormat
=
FORMAT_DIFF
;
else
if
(
!
strcmp
(
argv
[
i
],
"med"
))
CTX
::
instance
()
->
mesh
.
fileFormat
=
FORMAT_MED
;
else
if
(
!
strcmp
(
argv
[
i
],
"ir3"
))
CTX
::
instance
()
->
mesh
.
fileFormat
=
FORMAT_IR3
;
else
Msg
::
Fatal
(
"Unknown mesh format"
);
i
++
;
i
++
;
}
}
else
else
...
...
This diff is collapsed.
Click to expand it.
Common/CreateFile.cpp
+
44
−
39
View file @
b8b36a96
...
@@ -27,9 +27,8 @@
...
@@ -27,9 +27,8 @@
#include
"gl2yuv.h"
#include
"gl2yuv.h"
#endif
#endif
int
G
uess
FileFormatFrom
FileName
(
std
::
string
fileName
)
int
G
et
FileFormatFrom
Extension
(
const
std
::
string
&
ext
)
{
{
std
::
string
ext
=
SplitFileName
(
fileName
)[
2
];
if
(
ext
==
".geo"
)
return
FORMAT_GEO
;
if
(
ext
==
".geo"
)
return
FORMAT_GEO
;
else
if
(
ext
==
".msh"
)
return
FORMAT_MSH
;
else
if
(
ext
==
".msh"
)
return
FORMAT_MSH
;
else
if
(
ext
==
".pos"
)
return
FORMAT_POS
;
else
if
(
ext
==
".pos"
)
return
FORMAT_POS
;
...
@@ -73,6 +72,12 @@ int GuessFileFormatFromFileName(std::string fileName)
...
@@ -73,6 +72,12 @@ int GuessFileFormatFromFileName(std::string fileName)
else
return
-
1
;
else
return
-
1
;
}
}
int
GuessFileFormatFromFileName
(
const
std
::
string
&
fileName
)
{
std
::
string
ext
=
SplitFileName
(
fileName
)[
2
];
return
GetFileFormatFromExtension
(
ext
);
}
std
::
string
GetDefaultFileName
(
int
format
)
std
::
string
GetDefaultFileName
(
int
format
)
{
{
std
::
vector
<
std
::
string
>
split
=
SplitFileName
(
GModel
::
current
()
->
getFileName
());
std
::
vector
<
std
::
string
>
split
=
SplitFileName
(
GModel
::
current
()
->
getFileName
());
...
@@ -158,10 +163,10 @@ static PixelBuffer *GetCompositePixelBuffer(GLenum format, GLenum type)
...
@@ -158,10 +163,10 @@ static PixelBuffer *GetCompositePixelBuffer(GLenum format, GLenum type)
}
}
#endif
#endif
void
CreateOutputFile
(
std
::
string
fileName
,
int
format
,
bool
redraw
)
void
CreateOutputFile
(
const
std
::
string
&
fileName
,
int
format
,
bool
redraw
)
{
{
if
(
fileName
.
empty
())
std
::
string
name
=
fileName
;
fileN
ame
=
GetDefaultFileName
(
format
);
if
(
name
.
empty
())
n
ame
=
GetDefaultFileName
(
format
);
int
oldFormat
=
CTX
::
instance
()
->
print
.
fileFormat
;
int
oldFormat
=
CTX
::
instance
()
->
print
.
fileFormat
;
CTX
::
instance
()
->
print
.
fileFormat
=
format
;
CTX
::
instance
()
->
print
.
fileFormat
=
format
;
...
@@ -169,120 +174,120 @@ void CreateOutputFile(std::string fileName, int format, bool redraw)
...
@@ -169,120 +174,120 @@ void CreateOutputFile(std::string fileName, int format, bool redraw)
bool
error
=
false
;
bool
error
=
false
;
if
(
redraw
)
if
(
redraw
)
Msg
::
StatusBar
(
2
,
true
,
"Writing '%s'..."
,
fileN
ame
.
c_str
());
Msg
::
StatusBar
(
2
,
true
,
"Writing '%s'..."
,
n
ame
.
c_str
());
switch
(
format
)
{
switch
(
format
)
{
case
FORMAT_AUTO
:
case
FORMAT_AUTO
:
CreateOutputFile
(
fileN
ame
,
GuessFileFormatFromFileName
(
fileN
ame
),
false
);
CreateOutputFile
(
n
ame
,
GuessFileFormatFromFileName
(
n
ame
),
false
);
break
;
break
;
case
FORMAT_OPT
:
case
FORMAT_OPT
:
PrintOptions
(
0
,
GMSH_FULLRC
,
1
,
1
,
fileN
ame
.
c_str
());
PrintOptions
(
0
,
GMSH_FULLRC
,
1
,
1
,
n
ame
.
c_str
());
break
;
break
;
case
FORMAT_MSH
:
case
FORMAT_MSH
:
if
(
GModel
::
current
()
->
getMeshPartitions
().
size
()
&&
if
(
GModel
::
current
()
->
getMeshPartitions
().
size
()
&&
CTX
::
instance
()
->
mesh
.
mshFilePartitioned
==
1
)
CTX
::
instance
()
->
mesh
.
mshFilePartitioned
==
1
)
GModel
::
current
()
->
writePartitionedMSH
GModel
::
current
()
->
writePartitionedMSH
(
fileN
ame
,
CTX
::
instance
()
->
mesh
.
binary
,
CTX
::
instance
()
->
mesh
.
saveAll
,
(
n
ame
,
CTX
::
instance
()
->
mesh
.
binary
,
CTX
::
instance
()
->
mesh
.
saveAll
,
CTX
::
instance
()
->
mesh
.
saveParametric
,
CTX
::
instance
()
->
mesh
.
scalingFactor
);
CTX
::
instance
()
->
mesh
.
saveParametric
,
CTX
::
instance
()
->
mesh
.
scalingFactor
);
else
if
(
GModel
::
current
()
->
getMeshPartitions
().
size
()
&&
else
if
(
GModel
::
current
()
->
getMeshPartitions
().
size
()
&&
CTX
::
instance
()
->
mesh
.
mshFilePartitioned
==
2
)
CTX
::
instance
()
->
mesh
.
mshFilePartitioned
==
2
)
GModel
::
current
()
->
writeMSH
GModel
::
current
()
->
writeMSH
(
fileN
ame
,
CTX
::
instance
()
->
mesh
.
mshFileVersion
,
(
n
ame
,
CTX
::
instance
()
->
mesh
.
mshFileVersion
,
CTX
::
instance
()
->
mesh
.
binary
,
CTX
::
instance
()
->
mesh
.
saveAll
,
CTX
::
instance
()
->
mesh
.
binary
,
CTX
::
instance
()
->
mesh
.
saveAll
,
CTX
::
instance
()
->
mesh
.
saveParametric
,
CTX
::
instance
()
->
mesh
.
scalingFactor
,
CTX
::
instance
()
->
mesh
.
saveParametric
,
CTX
::
instance
()
->
mesh
.
scalingFactor
,
0
,
-
1000
);
0
,
-
1000
);
else
else
GModel
::
current
()
->
writeMSH
GModel
::
current
()
->
writeMSH
(
fileN
ame
,
CTX
::
instance
()
->
mesh
.
mshFileVersion
,
(
n
ame
,
CTX
::
instance
()
->
mesh
.
mshFileVersion
,
CTX
::
instance
()
->
mesh
.
binary
,
CTX
::
instance
()
->
mesh
.
saveAll
,
CTX
::
instance
()
->
mesh
.
binary
,
CTX
::
instance
()
->
mesh
.
saveAll
,
CTX
::
instance
()
->
mesh
.
saveParametric
,
CTX
::
instance
()
->
mesh
.
scalingFactor
);
CTX
::
instance
()
->
mesh
.
saveParametric
,
CTX
::
instance
()
->
mesh
.
scalingFactor
);
break
;
break
;
case
FORMAT_STL
:
case
FORMAT_STL
:
GModel
::
current
()
->
writeSTL
GModel
::
current
()
->
writeSTL
(
fileN
ame
,
CTX
::
instance
()
->
mesh
.
binary
,
CTX
::
instance
()
->
mesh
.
saveAll
,
(
n
ame
,
CTX
::
instance
()
->
mesh
.
binary
,
CTX
::
instance
()
->
mesh
.
saveAll
,
CTX
::
instance
()
->
mesh
.
scalingFactor
);
CTX
::
instance
()
->
mesh
.
scalingFactor
);
break
;
break
;
case
FORMAT_VRML
:
case
FORMAT_VRML
:
GModel
::
current
()
->
writeVRML
GModel
::
current
()
->
writeVRML
(
fileN
ame
,
CTX
::
instance
()
->
mesh
.
saveAll
,
CTX
::
instance
()
->
mesh
.
scalingFactor
);
(
n
ame
,
CTX
::
instance
()
->
mesh
.
saveAll
,
CTX
::
instance
()
->
mesh
.
scalingFactor
);
break
;
break
;
case
FORMAT_PLY2
:
case
FORMAT_PLY2
:
GModel
::
current
()
->
writePLY2
(
fileN
ame
);
GModel
::
current
()
->
writePLY2
(
n
ame
);
break
;
break
;
case
FORMAT_UNV
:
case
FORMAT_UNV
:
GModel
::
current
()
->
writeUNV
GModel
::
current
()
->
writeUNV
(
fileN
ame
,
CTX
::
instance
()
->
mesh
.
saveAll
,
CTX
::
instance
()
->
mesh
.
saveGroupsOfNodes
,
(
n
ame
,
CTX
::
instance
()
->
mesh
.
saveAll
,
CTX
::
instance
()
->
mesh
.
saveGroupsOfNodes
,
CTX
::
instance
()
->
mesh
.
scalingFactor
);
CTX
::
instance
()
->
mesh
.
scalingFactor
);
break
;
break
;
case
FORMAT_VTK
:
case
FORMAT_VTK
:
GModel
::
current
()
->
writeVTK
GModel
::
current
()
->
writeVTK
(
fileN
ame
,
CTX
::
instance
()
->
mesh
.
binary
,
CTX
::
instance
()
->
mesh
.
saveAll
,
(
n
ame
,
CTX
::
instance
()
->
mesh
.
binary
,
CTX
::
instance
()
->
mesh
.
saveAll
,
CTX
::
instance
()
->
mesh
.
scalingFactor
,
CTX
::
instance
()
->
mesh
.
scalingFactor
,
CTX
::
instance
()
->
bigEndian
);
CTX
::
instance
()
->
bigEndian
);
break
;
break
;
case
FORMAT_MESH
:
case
FORMAT_MESH
:
GModel
::
current
()
->
writeMESH
GModel
::
current
()
->
writeMESH
(
fileN
ame
,
CTX
::
instance
()
->
mesh
.
saveElementTagType
,
(
n
ame
,
CTX
::
instance
()
->
mesh
.
saveElementTagType
,
CTX
::
instance
()
->
mesh
.
saveAll
,
CTX
::
instance
()
->
mesh
.
scalingFactor
);
CTX
::
instance
()
->
mesh
.
saveAll
,
CTX
::
instance
()
->
mesh
.
scalingFactor
);
break
;
break
;
case
FORMAT_MAIL
:
case
FORMAT_MAIL
:
GModel
::
current
()
->
writeMAIL
GModel
::
current
()
->
writeMAIL
(
fileN
ame
,
CTX
::
instance
()
->
mesh
.
saveAll
,
CTX
::
instance
()
->
mesh
.
scalingFactor
);
(
n
ame
,
CTX
::
instance
()
->
mesh
.
saveAll
,
CTX
::
instance
()
->
mesh
.
scalingFactor
);
break
;
break
;
case
FORMAT_IR3
:
case
FORMAT_IR3
:
GModel
::
current
()
->
writeIR3
GModel
::
current
()
->
writeIR3
(
fileN
ame
,
CTX
::
instance
()
->
mesh
.
saveElementTagType
,
(
n
ame
,
CTX
::
instance
()
->
mesh
.
saveElementTagType
,
CTX
::
instance
()
->
mesh
.
saveAll
,
CTX
::
instance
()
->
mesh
.
scalingFactor
);
CTX
::
instance
()
->
mesh
.
saveAll
,
CTX
::
instance
()
->
mesh
.
scalingFactor
);
break
;
break
;
case
FORMAT_BDF
:
case
FORMAT_BDF
:
GModel
::
current
()
->
writeBDF
GModel
::
current
()
->
writeBDF
(
fileN
ame
,
CTX
::
instance
()
->
mesh
.
bdfFieldFormat
,
(
n
ame
,
CTX
::
instance
()
->
mesh
.
bdfFieldFormat
,
CTX
::
instance
()
->
mesh
.
saveElementTagType
,
CTX
::
instance
()
->
mesh
.
saveAll
,
CTX
::
instance
()
->
mesh
.
saveElementTagType
,
CTX
::
instance
()
->
mesh
.
saveAll
,
CTX
::
instance
()
->
mesh
.
scalingFactor
);
CTX
::
instance
()
->
mesh
.
scalingFactor
);
break
;
break
;
case
FORMAT_DIFF
:
case
FORMAT_DIFF
:
GModel
::
current
()
->
writeDIFF
GModel
::
current
()
->
writeDIFF
(
fileN
ame
,
CTX
::
instance
()
->
mesh
.
binary
,
CTX
::
instance
()
->
mesh
.
saveAll
,
(
n
ame
,
CTX
::
instance
()
->
mesh
.
binary
,
CTX
::
instance
()
->
mesh
.
saveAll
,
CTX
::
instance
()
->
mesh
.
scalingFactor
);
CTX
::
instance
()
->
mesh
.
scalingFactor
);
break
;
break
;
case
FORMAT_INP
:
case
FORMAT_INP
:
GModel
::
current
()
->
writeINP
GModel
::
current
()
->
writeINP
(
fileN
ame
,
CTX
::
instance
()
->
mesh
.
saveAll
,
CTX
::
instance
()
->
mesh
.
scalingFactor
);
(
n
ame
,
CTX
::
instance
()
->
mesh
.
saveAll
,
CTX
::
instance
()
->
mesh
.
scalingFactor
);
break
;
break
;
case
FORMAT_P3D
:
case
FORMAT_P3D
:
GModel
::
current
()
->
writeP3D
GModel
::
current
()
->
writeP3D
(
fileN
ame
,
CTX
::
instance
()
->
mesh
.
saveAll
,
CTX
::
instance
()
->
mesh
.
scalingFactor
);
(
n
ame
,
CTX
::
instance
()
->
mesh
.
saveAll
,
CTX
::
instance
()
->
mesh
.
scalingFactor
);
break
;
break
;
case
FORMAT_CGNS
:
case
FORMAT_CGNS
:
GModel
::
current
()
->
writeCGNS
GModel
::
current
()
->
writeCGNS
(
fileN
ame
,
CTX
::
instance
()
->
mesh
.
zoneDefinition
,
CTX
::
instance
()
->
cgnsOptions
,
(
n
ame
,
CTX
::
instance
()
->
mesh
.
zoneDefinition
,
CTX
::
instance
()
->
cgnsOptions
,
CTX
::
instance
()
->
mesh
.
scalingFactor
);
CTX
::
instance
()
->
mesh
.
scalingFactor
);
break
;
break
;
case
FORMAT_MED
:
case
FORMAT_MED
:
GModel
::
current
()
->
writeMED
GModel
::
current
()
->
writeMED
(
fileN
ame
,
CTX
::
instance
()
->
mesh
.
saveAll
,
CTX
::
instance
()
->
mesh
.
scalingFactor
);
(
n
ame
,
CTX
::
instance
()
->
mesh
.
saveAll
,
CTX
::
instance
()
->
mesh
.
scalingFactor
);
break
;
break
;
case
FORMAT_POS
:
case
FORMAT_POS
:
GModel
::
current
()
->
writePOS
GModel
::
current
()
->
writePOS
(
fileN
ame
,
CTX
::
instance
()
->
print
.
posElementary
,
(
n
ame
,
CTX
::
instance
()
->
print
.
posElementary
,
CTX
::
instance
()
->
print
.
posElement
,
CTX
::
instance
()
->
print
.
posGamma
,
CTX
::
instance
()
->
print
.
posElement
,
CTX
::
instance
()
->
print
.
posGamma
,
CTX
::
instance
()
->
print
.
posEta
,
CTX
::
instance
()
->
print
.
posRho
,
CTX
::
instance
()
->
print
.
posEta
,
CTX
::
instance
()
->
print
.
posRho
,
CTX
::
instance
()
->
print
.
posDisto
,
CTX
::
instance
()
->
mesh
.
saveAll
,
CTX
::
instance
()
->
print
.
posDisto
,
CTX
::
instance
()
->
mesh
.
saveAll
,
...
@@ -290,16 +295,16 @@ void CreateOutputFile(std::string fileName, int format, bool redraw)
...
@@ -290,16 +295,16 @@ void CreateOutputFile(std::string fileName, int format, bool redraw)
break
;
break
;
case
FORMAT_GEO
:
case
FORMAT_GEO
:
GModel
::
current
()
->
writeGEO
(
fileN
ame
,
CTX
::
instance
()
->
print
.
geoLabels
,
GModel
::
current
()
->
writeGEO
(
n
ame
,
CTX
::
instance
()
->
print
.
geoLabels
,
CTX
::
instance
()
->
print
.
geoOnlyPhysicals
);
CTX
::
instance
()
->
print
.
geoOnlyPhysicals
);
break
;
break
;
case
FORMAT_BREP
:
case
FORMAT_BREP
:
GModel
::
current
()
->
writeOCCBREP
(
fileN
ame
);
GModel
::
current
()
->
writeOCCBREP
(
n
ame
);
break
;
break
;
case
FORMAT_STEP
:
case
FORMAT_STEP
:
GModel
::
current
()
->
writeOCCSTEP
(
fileN
ame
);
GModel
::
current
()
->
writeOCCSTEP
(
n
ame
);
break
;
break
;
#if defined(HAVE_FLTK)
#if defined(HAVE_FLTK)
...
@@ -311,9 +316,9 @@ void CreateOutputFile(std::string fileName, int format, bool redraw)
...
@@ -311,9 +316,9 @@ void CreateOutputFile(std::string fileName, int format, bool redraw)
{
{
if
(
!
FlGui
::
available
())
break
;
if
(
!
FlGui
::
available
())
break
;
FILE
*
fp
=
fopen
(
fileN
ame
.
c_str
(),
"wb"
);
FILE
*
fp
=
fopen
(
n
ame
.
c_str
(),
"wb"
);
if
(
!
fp
){
if
(
!
fp
){
Msg
::
Error
(
"Unable to open file '%s'"
,
fileN
ame
.
c_str
());
Msg
::
Error
(
"Unable to open file '%s'"
,
n
ame
.
c_str
());
error
=
true
;
error
=
true
;
break
;
break
;
}
}
...
@@ -348,13 +353,13 @@ void CreateOutputFile(std::string fileName, int format, bool redraw)
...
@@ -348,13 +353,13 @@ void CreateOutputFile(std::string fileName, int format, bool redraw)
{
{
if
(
!
FlGui
::
available
())
break
;
if
(
!
FlGui
::
available
())
break
;
FILE
*
fp
=
fopen
(
fileN
ame
.
c_str
(),
"wb"
);
FILE
*
fp
=
fopen
(
n
ame
.
c_str
(),
"wb"
);
if
(
!
fp
){
if
(
!
fp
){
Msg
::
Error
(
"Unable to open file '%s'"
,
fileN
ame
.
c_str
());
Msg
::
Error
(
"Unable to open file '%s'"
,
n
ame
.
c_str
());
error
=
true
;
error
=
true
;
break
;
break
;
}
}
std
::
string
base
=
SplitFileName
(
fileN
ame
)[
1
];
std
::
string
base
=
SplitFileName
(
n
ame
)[
1
];
GLint
width
=
FlGui
::
instance
()
->
getCurrentOpenglWindow
()
->
w
();
GLint
width
=
FlGui
::
instance
()
->
getCurrentOpenglWindow
()
->
w
();
GLint
height
=
FlGui
::
instance
()
->
getCurrentOpenglWindow
()
->
h
();
GLint
height
=
FlGui
::
instance
()
->
getCurrentOpenglWindow
()
->
h
();
GLint
viewport
[
4
]
=
{
0
,
0
,
width
,
height
};
GLint
viewport
[
4
]
=
{
0
,
0
,
width
,
height
};
...
@@ -419,13 +424,13 @@ void CreateOutputFile(std::string fileName, int format, bool redraw)
...
@@ -419,13 +424,13 @@ void CreateOutputFile(std::string fileName, int format, bool redraw)
{
{
if
(
!
FlGui
::
available
())
break
;
if
(
!
FlGui
::
available
())
break
;
FILE
*
fp
=
fopen
(
fileN
ame
.
c_str
(),
"w"
);
FILE
*
fp
=
fopen
(
n
ame
.
c_str
(),
"w"
);
if
(
!
fp
){
if
(
!
fp
){
Msg
::
Error
(
"Unable to open file '%s'"
,
fileN
ame
.
c_str
());
Msg
::
Error
(
"Unable to open file '%s'"
,
n
ame
.
c_str
());
error
=
true
;
error
=
true
;
break
;
break
;
}
}
std
::
string
base
=
SplitFileName
(
fileN
ame
)[
1
];
std
::
string
base
=
SplitFileName
(
n
ame
)[
1
];
GLint
width
=
FlGui
::
instance
()
->
getCurrentOpenglWindow
()
->
w
();
GLint
width
=
FlGui
::
instance
()
->
getCurrentOpenglWindow
()
->
w
();
GLint
height
=
FlGui
::
instance
()
->
getCurrentOpenglWindow
()
->
h
();
GLint
height
=
FlGui
::
instance
()
->
getCurrentOpenglWindow
()
->
h
();
GLint
viewport
[
4
]
=
{
0
,
0
,
width
,
height
};
GLint
viewport
[
4
]
=
{
0
,
0
,
width
,
height
};
...
@@ -487,7 +492,7 @@ void CreateOutputFile(std::string fileName, int format, bool redraw)
...
@@ -487,7 +492,7 @@ void CreateOutputFile(std::string fileName, int format, bool redraw)
"PSEARCH_ALG EXHAUSTIVE
\n
BSEARCH_ALG CROSS2
\n
"
"PSEARCH_ALG EXHAUSTIVE
\n
BSEARCH_ALG CROSS2
\n
"
"IQSCALE 1
\n
PQSCALE 1
\n
BQSCALE 25
\n
REFERENCE_FRAME DECODED
\n
"
"IQSCALE 1
\n
PQSCALE 1
\n
BQSCALE 25
\n
REFERENCE_FRAME DECODED
\n
"
"OUTPUT %s
\n
INPUT_CONVERT *
\n
INPUT_DIR %s
\n
INPUT
\n
"
,
"OUTPUT %s
\n
INPUT_CONVERT *
\n
INPUT_DIR %s
\n
INPUT
\n
"
,
pattern
.
c_str
(),
repeat
,
fileN
ame
.
c_str
(),
pattern
.
c_str
(),
repeat
,
n
ame
.
c_str
(),
CTX
::
instance
()
->
homeDir
.
c_str
());
CTX
::
instance
()
->
homeDir
.
c_str
());
for
(
unsigned
int
i
=
0
;
i
<
frames
.
size
();
i
++
){
for
(
unsigned
int
i
=
0
;
i
<
frames
.
size
();
i
++
){
fprintf
(
fp
,
"%s"
,
frames
[
i
].
c_str
());
fprintf
(
fp
,
"%s"
,
frames
[
i
].
c_str
());
...
@@ -526,7 +531,7 @@ void CreateOutputFile(std::string fileName, int format, bool redraw)
...
@@ -526,7 +531,7 @@ void CreateOutputFile(std::string fileName, int format, bool redraw)
CTX
::
instance
()
->
printing
=
0
;
CTX
::
instance
()
->
printing
=
0
;
if
(
redraw
&&
!
error
)
if
(
redraw
&&
!
error
)
Msg
::
StatusBar
(
2
,
true
,
"Done writing '%s'"
,
fileN
ame
.
c_str
());
Msg
::
StatusBar
(
2
,
true
,
"Done writing '%s'"
,
n
ame
.
c_str
());
#if defined(HAVE_OPENGL)
#if defined(HAVE_OPENGL)
if
(
redraw
)
drawContext
::
global
()
->
draw
();
if
(
redraw
)
drawContext
::
global
()
->
draw
();
...
...
This diff is collapsed.
Click to expand it.
Common/CreateFile.h
+
3
−
2
View file @
b8b36a96
...
@@ -8,8 +8,9 @@
...
@@ -8,8 +8,9 @@
#include
<string>
#include
<string>
int
GuessFileFormatFromFileName
(
std
::
string
fileName
);
int
GetFileFormatFromExtension
(
const
std
::
string
&
fileName
);
int
GuessFileFormatFromFileName
(
const
std
::
string
&
fileName
);
std
::
string
GetDefaultFileName
(
int
format
);
std
::
string
GetDefaultFileName
(
int
format
);
void
CreateOutputFile
(
std
::
string
fileName
,
int
format
,
bool
redraw
=
true
);
void
CreateOutputFile
(
const
std
::
string
&
fileName
,
int
format
,
bool
redraw
=
true
);
#endif
#endif
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