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
5bba0f8a
Commit
5bba0f8a
authored
16 years ago
by
Stefen Guzik
Browse files
Options
Downloads
Patches
Plain Diff
Fixed broken CGNS dialog declarations
parent
937b05c3
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
Fltk/fileDialogs.cpp
+79
-75
79 additions, 75 deletions
Fltk/fileDialogs.cpp
with
79 additions
and
75 deletions
Fltk/fileDialogs.cpp
+
79
−
75
View file @
5bba0f8a
...
...
@@ -954,12 +954,81 @@ int generic_mesh_dialog(const char *name, const char *title, int format,
return
0
;
}
#if defined(HAVE_LIBCGNS)
struct
CGNSWriteDialog
;
// Forward declarations of some callbacks
void
cgnsw_gc_location_cb
(
Fl_Widget
*
widget
,
void
*
data
);
void
cgnsw_write_dummy_bc_cb
(
Fl_Widget
*
widget
,
void
*
data
);
void
cgnsw_bc_location_cb
(
Fl_Widget
*
widget
,
void
*
data
);
void
cgnsw_write_normals_cb
(
Fl_Widget
*
widget
,
void
*
data
);
void
cgnsw_normal_source_cb
(
Fl_Widget
*
widget
,
void
*
data
);
// Pointers to required widgets
struct
CGNSWriteDialog
{
Fl_Window
*
window
;
Fl_Choice
*
choiceZoneDef
;
Fl_Input
*
inputBaseName
;
Fl_Input
*
inputZoneName
;
Fl_Input
*
inputInterfaceName
;
Fl_Input
*
inputPatchName
;
Fl_Round_Button
*
roundButton0GCatVertex
;
Fl_Round_Button
*
roundButton1GCatFace
;
Fl_Check_Button
*
checkButtonWriteBC
;
Fl_Round_Button
*
roundButton0BCatVertex
;
Fl_Round_Button
*
roundButton1BCatFace
;
Fl_Check_Button
*
checkButtonWriteNormals
;
Fl_Round_Button
*
roundButton0NormalGeo
;
Fl_Round_Button
*
roundButton1NormalElem
;
Fl_Choice
*
choiceVecDim
;
Fl_Check_Button
*
checkButtonUnknownUserDef
;
const
char
*
filename
;
int
status
;
void
write_all_options
()
{
opt_mesh_zone_definition
(
0
,
GMSH_SET
|
GMSH_GUI
,
choiceZoneDef
->
value
());
CTX
.
mesh
.
cgns_options
.
baseName
=
inputBaseName
->
value
();
CTX
.
mesh
.
cgns_options
.
zoneName
=
inputZoneName
->
value
();
CTX
.
mesh
.
cgns_options
.
interfaceName
=
inputInterfaceName
->
value
();
CTX
.
mesh
.
cgns_options
.
patchName
=
inputPatchName
->
value
();
CTX
.
mesh
.
cgns_options
.
gridConnectivityLocation
=
roundButton1GCatFace
->
value
();
CTX
.
mesh
.
cgns_options
.
writeBC
=
checkButtonWriteBC
->
value
();
CTX
.
mesh
.
cgns_options
.
bocoLocation
=
roundButton1BCatFace
->
value
();
CTX
.
mesh
.
cgns_options
.
normalSource
=
(
checkButtonWriteNormals
->
value
())
?
roundButton1NormalElem
->
value
()
+
1
:
0
;
CTX
.
mesh
.
cgns_options
.
vectorDim
=
choiceVecDim
->
value
()
+
2
;
CTX
.
mesh
.
cgns_options
.
writeUserDef
=
checkButtonUnknownUserDef
->
value
();
}
void
read_all_options
()
{
choiceZoneDef
->
value
(
CTX
.
mesh
.
zone_definition
);
inputBaseName
->
value
(
CTX
.
mesh
.
cgns_options
.
baseName
.
c_str
());
inputZoneName
->
value
(
CTX
.
mesh
.
cgns_options
.
zoneName
.
c_str
());
inputInterfaceName
->
value
(
CTX
.
mesh
.
cgns_options
.
interfaceName
.
c_str
());
inputPatchName
->
value
(
CTX
.
mesh
.
cgns_options
.
patchName
.
c_str
());
checkButtonWriteBC
->
value
(
CTX
.
mesh
.
cgns_options
.
writeBC
);
checkButtonWriteNormals
->
value
(
CTX
.
mesh
.
cgns_options
.
normalSource
);
choiceVecDim
->
value
(
CTX
.
mesh
.
cgns_options
.
vectorDim
-
2
);
checkButtonUnknownUserDef
->
value
(
CTX
.
mesh
.
cgns_options
.
writeUserDef
);
// Call all callbacks to ensure consistent options
cgnsw_gc_location_cb
((
CTX
.
mesh
.
cgns_options
.
gridConnectivityLocation
)
?
roundButton1GCatFace
:
roundButton0GCatVertex
,
this
);
// The order of the next 4 is important
cgnsw_normal_source_cb
((
CTX
.
mesh
.
cgns_options
.
normalSource
==
2
)
?
roundButton1NormalElem
:
roundButton0NormalGeo
,
this
);
cgnsw_write_normals_cb
(
checkButtonWriteNormals
,
this
);
cgnsw_bc_location_cb
((
CTX
.
mesh
.
cgns_options
.
bocoLocation
)
?
roundButton1BCatFace
:
roundButton0BCatVertex
,
this
);
cgnsw_write_dummy_bc_cb
(
checkButtonWriteBC
,
this
);
}
};
static
void
cgnsw_gc_location_cb
(
Fl_Widget
*
widget
,
void
*
data
)
void
cgnsw_gc_location_cb
(
Fl_Widget
*
widget
,
void
*
data
)
{
CGNSWriteDialog
*
dlg
=
static_cast
<
CGNSWriteDialog
*>
(
data
);
if
(
widget
==
dlg
->
roundButton0GCatVertex
)
{
...
...
@@ -972,7 +1041,7 @@ static void cgnsw_gc_location_cb(Fl_Widget *widget, void *data)
}
}
static
void
cgnsw_write_dummy_bc_cb
(
Fl_Widget
*
widget
,
void
*
data
)
void
cgnsw_write_dummy_bc_cb
(
Fl_Widget
*
widget
,
void
*
data
)
{
CGNSWriteDialog
*
dlg
=
static_cast
<
CGNSWriteDialog
*>
(
data
);
if
(
dlg
->
checkButtonWriteBC
->
value
())
{
...
...
@@ -994,7 +1063,7 @@ static void cgnsw_write_dummy_bc_cb(Fl_Widget *widget, void *data)
}
}
static
void
cgnsw_bc_location_cb
(
Fl_Widget
*
widget
,
void
*
data
)
void
cgnsw_bc_location_cb
(
Fl_Widget
*
widget
,
void
*
data
)
{
CGNSWriteDialog
*
dlg
=
static_cast
<
CGNSWriteDialog
*>
(
data
);
if
(
widget
==
dlg
->
roundButton0BCatVertex
)
{
...
...
@@ -1012,7 +1081,7 @@ static void cgnsw_bc_location_cb(Fl_Widget *widget, void *data)
}
}
static
void
cgnsw_write_normals_cb
(
Fl_Widget
*
widget
,
void
*
data
)
void
cgnsw_write_normals_cb
(
Fl_Widget
*
widget
,
void
*
data
)
{
CGNSWriteDialog
*
dlg
=
static_cast
<
CGNSWriteDialog
*>
(
data
);
if
(
dlg
->
checkButtonWriteNormals
->
value
())
{
...
...
@@ -1026,7 +1095,7 @@ static void cgnsw_write_normals_cb(Fl_Widget *widget, void *data)
}
}
static
void
cgnsw_normal_source_cb
(
Fl_Widget
*
widget
,
void
*
data
)
void
cgnsw_normal_source_cb
(
Fl_Widget
*
widget
,
void
*
data
)
{
CGNSWriteDialog
*
dlg
=
static_cast
<
CGNSWriteDialog
*>
(
data
);
if
(
widget
==
dlg
->
roundButton0NormalGeo
)
{
...
...
@@ -1039,14 +1108,14 @@ static void cgnsw_normal_source_cb(Fl_Widget *widget, void *data)
}
}
static
void
cgnsw_defaults_cb
(
Fl_Widget
*
widget
,
void
*
data
)
void
cgnsw_defaults_cb
(
Fl_Widget
*
widget
,
void
*
data
)
{
CGNSWriteDialog
*
dlg
=
static_cast
<
CGNSWriteDialog
*>
(
data
);
CTX
.
mesh
.
cgns_options
.
setDefaults
();
dlg
->
read_all_options
();
}
static
void
cgnsw_write_cb
(
Fl_Widget
*
widget
,
void
*
data
)
void
cgnsw_write_cb
(
Fl_Widget
*
widget
,
void
*
data
)
{
CGNSWriteDialog
*
dlg
=
static_cast
<
CGNSWriteDialog
*>
(
data
);
...
...
@@ -1059,78 +1128,13 @@ static void cgnsw_write_cb(Fl_Widget *widget, void *data)
dlg
->
status
=
1
;
}
static
void
cgnsw_cancel_cb
(
Fl_Widget
*
widget
,
void
*
data
)
void
cgnsw_cancel_cb
(
Fl_Widget
*
widget
,
void
*
data
)
{
CGNSWriteDialog
*
dlg
=
static_cast
<
CGNSWriteDialog
*>
(
data
);
dlg
->
window
->
hide
();
dlg
->
status
=
0
;
}
// Pointers to required widgets
struct
CGNSWriteDialog
{
Fl_Window
*
window
;
Fl_Choice
*
choiceZoneDef
;
Fl_Input
*
inputBaseName
;
Fl_Input
*
inputZoneName
;
Fl_Input
*
inputInterfaceName
;
Fl_Input
*
inputPatchName
;
Fl_Round_Button
*
roundButton0GCatVertex
;
Fl_Round_Button
*
roundButton1GCatFace
;
Fl_Check_Button
*
checkButtonWriteBC
;
Fl_Round_Button
*
roundButton0BCatVertex
;
Fl_Round_Button
*
roundButton1BCatFace
;
Fl_Check_Button
*
checkButtonWriteNormals
;
Fl_Round_Button
*
roundButton0NormalGeo
;
Fl_Round_Button
*
roundButton1NormalElem
;
Fl_Choice
*
choiceVecDim
;
Fl_Check_Button
*
checkButtonUnknownUserDef
;
const
char
*
filename
;
int
status
;
void
write_all_options
()
{
opt_mesh_zone_definition
(
0
,
GMSH_SET
|
GMSH_GUI
,
choiceZoneDef
->
value
());
CTX
.
mesh
.
cgns_options
.
baseName
=
inputBaseName
->
value
();
CTX
.
mesh
.
cgns_options
.
zoneName
=
inputZoneName
->
value
();
CTX
.
mesh
.
cgns_options
.
interfaceName
=
inputInterfaceName
->
value
();
CTX
.
mesh
.
cgns_options
.
patchName
=
inputPatchName
->
value
();
CTX
.
mesh
.
cgns_options
.
gridConnectivityLocation
=
roundButton1GCatFace
->
value
();
CTX
.
mesh
.
cgns_options
.
writeBC
=
checkButtonWriteBC
->
value
();
CTX
.
mesh
.
cgns_options
.
bocoLocation
=
roundButton1BCatFace
->
value
();
CTX
.
mesh
.
cgns_options
.
normalSource
=
(
checkButtonWriteNormals
->
value
())
?
roundButton1NormalElem
->
value
()
+
1
:
0
;
CTX
.
mesh
.
cgns_options
.
vectorDim
=
choiceVecDim
->
value
()
+
2
;
CTX
.
mesh
.
cgns_options
.
writeUserDef
=
checkButtonUnknownUserDef
->
value
();
}
void
read_all_options
()
{
choiceZoneDef
->
value
(
CTX
.
mesh
.
zone_definition
);
inputBaseName
->
value
(
CTX
.
mesh
.
cgns_options
.
baseName
.
c_str
());
inputZoneName
->
value
(
CTX
.
mesh
.
cgns_options
.
zoneName
.
c_str
());
inputInterfaceName
->
value
(
CTX
.
mesh
.
cgns_options
.
interfaceName
.
c_str
());
inputPatchName
->
value
(
CTX
.
mesh
.
cgns_options
.
patchName
.
c_str
());
checkButtonWriteBC
->
value
(
CTX
.
mesh
.
cgns_options
.
writeBC
);
checkButtonWriteNormals
->
value
(
CTX
.
mesh
.
cgns_options
.
normalSource
);
choiceVecDim
->
value
(
CTX
.
mesh
.
cgns_options
.
vectorDim
-
2
);
checkButtonUnknownUserDef
->
value
(
CTX
.
mesh
.
cgns_options
.
writeUserDef
);
// Call all callbacks to ensure consistent options
cgnsw_gc_location_cb
((
CTX
.
mesh
.
cgns_options
.
gridConnectivityLocation
)
?
roundButton1GCatFace
:
roundButton0GCatVertex
,
this
);
// The order of the next 4 is important
cgnsw_normal_source_cb
((
CTX
.
mesh
.
cgns_options
.
normalSource
==
2
)
?
roundButton1NormalElem
:
roundButton0NormalGeo
,
this
);
cgnsw_write_normals_cb
(
checkButtonWriteNormals
,
this
);
cgnsw_bc_location_cb
((
CTX
.
mesh
.
cgns_options
.
bocoLocation
)
?
roundButton1BCatFace
:
roundButton0BCatVertex
,
this
);
cgnsw_write_dummy_bc_cb
(
checkButtonWriteBC
,
this
);
}
};
int
cgns_write_dialog
(
const
char
*
filename
)
{
static
CGNSWriteDialog
dlg
;
...
...
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