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
b6a9ae83
Commit
b6a9ae83
authored
13 years ago
by
Christophe Geuzaine
Browse files
Options
Downloads
Patches
Plain Diff
onelab refinements
parent
82e30611
No related branches found
No related tags found
No related merge requests found
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
Common/onelab.h
+7
-1
7 additions, 1 deletion
Common/onelab.h
Fltk/graphicWindow.cpp
+19
-1
19 additions, 1 deletion
Fltk/graphicWindow.cpp
Fltk/onelabWindow.cpp
+30
-5
30 additions, 5 deletions
Fltk/onelabWindow.cpp
Fltk/onelabWindow.h
+2
-0
2 additions, 0 deletions
Fltk/onelabWindow.h
with
58 additions
and
7 deletions
Common/onelab.h
+
7
−
1
View file @
b6a9ae83
...
@@ -378,12 +378,17 @@ namespace onelab{
...
@@ -378,12 +378,17 @@ namespace onelab{
}
}
public
:
public
:
parameterSpace
(){}
parameterSpace
(){}
~
parameterSpace
()
~
parameterSpace
(){
clear
();
}
void
clear
()
{
{
std
::
set
<
parameter
*>
ps
;
std
::
set
<
parameter
*>
ps
;
_getAllParameters
(
ps
);
_getAllParameters
(
ps
);
for
(
std
::
set
<
parameter
*>::
iterator
it
=
ps
.
begin
();
it
!=
ps
.
end
();
it
++
)
for
(
std
::
set
<
parameter
*>::
iterator
it
=
ps
.
begin
();
it
!=
ps
.
end
();
it
++
)
delete
*
it
;
delete
*
it
;
_numbers
.
clear
();
_strings
.
clear
();
_regions
.
clear
();
_functions
.
clear
();
}
}
bool
set
(
number
&
p
,
bool
value
=
true
){
return
_set
(
p
,
_numbers
,
value
);
}
bool
set
(
number
&
p
,
bool
value
=
true
){
return
_set
(
p
,
_numbers
,
value
);
}
bool
set
(
string
&
p
,
bool
value
=
true
){
return
_set
(
p
,
_strings
,
value
);
}
bool
set
(
string
&
p
,
bool
value
=
true
){
return
_set
(
p
,
_strings
,
value
);
}
...
@@ -487,6 +492,7 @@ namespace onelab{
...
@@ -487,6 +492,7 @@ namespace onelab{
if
(
!
_server
)
_server
=
new
server
(
address
);
if
(
!
_server
)
_server
=
new
server
(
address
);
return
_server
;
return
_server
;
}
}
void
clear
(){
_parameterSpace
.
clear
();
}
template
<
class
T
>
bool
set
(
T
&
p
,
bool
value
=
true
)
template
<
class
T
>
bool
set
(
T
&
p
,
bool
value
=
true
)
{
{
return
_parameterSpace
.
set
(
p
,
value
);
return
_parameterSpace
.
set
(
p
,
value
);
...
...
This diff is collapsed.
Click to expand it.
Fltk/graphicWindow.cpp
+
19
−
1
View file @
b6a9ae83
...
@@ -93,6 +93,23 @@ static void gmsh_clscale(Fl_Color c)
...
@@ -93,6 +93,23 @@ static void gmsh_clscale(Fl_Color c)
bl
;
vv
(
-
0.2
,
0.2
);
vv
(
0.9
,
0.2
);
vv
(
-
0.2
,
-
0.9
);
el
;
bl
;
vv
(
-
0.2
,
0.2
);
vv
(
0.9
,
0.2
);
vv
(
-
0.2
,
-
0.9
);
el
;
}
}
static
void
gmsh_gear
(
Fl_Color
c
)
{
fl_color
(
c
);
fl_line_style
(
FL_SOLID
,
2
);
fl_begin_line
();
fl_arc
(
0.0
,
0.0
,
0.5
,
0.0
,
360.0
);
fl_end_line
();
for
(
int
i
=
0
;
i
<
8
;
i
++
){
fl_rotate
(
i
*
360.
/
8.
);
fl_begin_complex_polygon
();
fl_vertex
(
0.5
,
-
0.13
);
fl_vertex
(
1.0
,
-
0.13
);
fl_vertex
(
1.0
,
0.13
);
fl_vertex
(
0.5
,
0.13
);
fl_end_complex_polygon
();
}
fl_line_style
(
FL_SOLID
);
}
#undef vv
#undef vv
#undef bl
#undef bl
#undef el
#undef el
...
@@ -469,6 +486,7 @@ graphicWindow::graphicWindow(bool main, int numTiles)
...
@@ -469,6 +486,7 @@ graphicWindow::graphicWindow(bool main, int numTiles)
fl_add_symbol
(
"gmsh_rotate"
,
gmsh_rotate
,
1
);
fl_add_symbol
(
"gmsh_rotate"
,
gmsh_rotate
,
1
);
fl_add_symbol
(
"gmsh_models"
,
gmsh_models
,
1
);
fl_add_symbol
(
"gmsh_models"
,
gmsh_models
,
1
);
fl_add_symbol
(
"gmsh_clscale"
,
gmsh_clscale
,
1
);
fl_add_symbol
(
"gmsh_clscale"
,
gmsh_clscale
,
1
);
fl_add_symbol
(
"gmsh_gear"
,
gmsh_gear
,
1
);
first
=
false
;
first
=
false
;
}
}
...
...
This diff is collapsed.
Click to expand it.
Fltk/onelabWindow.cpp
+
30
−
5
View file @
b6a9ae83
...
@@ -74,12 +74,16 @@ bool onelab::localNetworkClient::run(const std::string &what)
...
@@ -74,12 +74,16 @@ bool onelab::localNetworkClient::run(const std::string &what)
_pid
=
0
;
_pid
=
0
;
onelabGmshServer
*
server
=
new
onelabGmshServer
(
this
);
onelabGmshServer
*
server
=
new
onelabGmshServer
(
this
);
std
::
string
sockname
=
"localhost:1631"
;
std
::
string
sockname
=
CTX
::
instance
()
->
solver
.
socketName
;
std
::
string
command
=
_commandLine
+
" "
+
what
+
" -onelab "
+
sockname
+
" &"
;
std
::
string
command
=
_commandLine
+
" "
+
what
+
" -onelab "
+
sockname
;
#if !defined(WIN32)
command
+=
" &"
;
#endif
int
sock
;
int
sock
;
try
{
try
{
sock
=
server
->
Start
(
command
.
c_str
(),
sockname
.
c_str
(),
30
);
sock
=
server
->
Start
(
command
.
c_str
(),
sockname
.
c_str
(),
CTX
::
instance
()
->
solver
.
timeout
);
}
}
catch
(
const
char
*
err
){
catch
(
const
char
*
err
){
Msg
::
Error
(
"%s (on socket '%s')"
,
err
,
sockname
.
c_str
());
Msg
::
Error
(
"%s (on socket '%s')"
,
err
,
sockname
.
c_str
());
...
@@ -228,6 +232,14 @@ void onelab_cb(Fl_Widget *w, void *data)
...
@@ -228,6 +232,14 @@ void onelab_cb(Fl_Widget *w, void *data)
if
(
!
data
)
return
;
if
(
!
data
)
return
;
std
::
string
action
((
const
char
*
)
data
);
std
::
string
action
((
const
char
*
)
data
);
if
(
action
==
"reset"
){
onelab
::
server
::
instance
()
->
clear
();
if
(
onelab
::
server
::
instance
()
->
findClient
(
"Gmsh"
)
!=
onelab
::
server
::
instance
()
->
lastClient
())
geometry_reload_cb
(
0
,
0
);
action
=
"initial check"
;
}
if
(
action
==
"choose model"
){
if
(
action
==
"choose model"
){
if
(
fileChooser
(
FILE_CHOOSER_SINGLE
,
"Choose"
,
"*.pro"
))
if
(
fileChooser
(
FILE_CHOOSER_SINGLE
,
"Choose"
,
"*.pro"
))
FlGui
::
instance
()
->
onelab
->
setModelName
(
fileChooserGetName
(
1
));
FlGui
::
instance
()
->
onelab
->
setModelName
(
fileChooserGetName
(
1
));
...
@@ -252,8 +264,10 @@ void onelab_cb(Fl_Widget *w, void *data)
...
@@ -252,8 +264,10 @@ void onelab_cb(Fl_Widget *w, void *data)
}
}
else
if
(
action
==
"compute"
){
else
if
(
action
==
"compute"
){
geometry_reload_cb
(
0
,
0
);
geometry_reload_cb
(
0
,
0
);
if
(
FlGui
::
instance
()
->
onelab
->
meshAuto
()){
mesh_3d_cb
(
0
,
0
);
mesh_3d_cb
(
0
,
0
);
mesh_save_cb
(
0
,
(
void
*
)
"force overwrite"
);
mesh_save_cb
(
0
,
(
void
*
)
"force overwrite"
);
}
onelab
::
server
::
instance
()
->
setChanged
(
false
,
"Gmsh"
);
onelab
::
server
::
instance
()
->
setChanged
(
false
,
"Gmsh"
);
}
}
}
}
...
@@ -349,6 +363,16 @@ onelabWindow::onelabWindow(int deltaFontSize)
...
@@ -349,6 +363,16 @@ onelabWindow::onelabWindow(int deltaFontSize)
_butt
[
1
]
=
new
Fl_Button
(
width
-
2
*
WB
-
2
*
BB
,
height
-
WB
-
BH
,
BB
,
BH
,
"Check"
);
_butt
[
1
]
=
new
Fl_Button
(
width
-
2
*
WB
-
2
*
BB
,
height
-
WB
-
BH
,
BB
,
BH
,
"Check"
);
_butt
[
1
]
->
callback
(
onelab_cb
,
(
void
*
)
"check"
);
_butt
[
1
]
->
callback
(
onelab_cb
,
(
void
*
)
"check"
);
static
Fl_Menu_Item
gear_menu
[]
=
{
{
"Reset database"
,
0
,
onelab_cb
,
(
void
*
)
"reset"
},
{
"Mesh automatically"
,
0
,
0
,
0
,
FL_MENU_TOGGLE
},
{
0
}
};
gear_menu
[
1
].
set
();
_gear
=
new
Fl_Menu_Button
(
_butt
[
1
]
->
x
()
-
WB
-
BB
/
2
,
_butt
[
1
]
->
y
(),
BB
/
2
,
BH
,
"@-1gmsh_gear"
);
_gear
->
menu
(
gear_menu
);
Fl_Box
*
resbox
=
new
Fl_Box
(
WB
,
height
-
BH
-
3
*
WB
,
WB
,
WB
);
Fl_Box
*
resbox
=
new
Fl_Box
(
WB
,
height
-
BH
-
3
*
WB
,
WB
,
WB
);
_win
->
resizable
(
resbox
);
_win
->
resizable
(
resbox
);
...
@@ -358,6 +382,7 @@ onelabWindow::onelabWindow(int deltaFontSize)
...
@@ -358,6 +382,7 @@ onelabWindow::onelabWindow(int deltaFontSize)
FL_NORMAL_SIZE
+=
deltaFontSize
;
FL_NORMAL_SIZE
+=
deltaFontSize
;
// FIXME adding GetDP client
onelab
::
server
::
instance
()
->
registerClient
onelab
::
server
::
instance
()
->
registerClient
(
new
onelab
::
localNetworkClient
(
"GetDP"
,
(
new
onelab
::
localNetworkClient
(
"GetDP"
,
opt_solver_executable0
(
0
,
GMSH_GET
,
""
)));
opt_solver_executable0
(
0
,
GMSH_GET
,
""
)));
...
...
This diff is collapsed.
Click to expand it.
Fltk/onelabWindow.h
+
2
−
0
View file @
b6a9ae83
...
@@ -21,6 +21,7 @@ class onelabWindow{
...
@@ -21,6 +21,7 @@ class onelabWindow{
Fl_Tree
*
_tree
;
Fl_Tree
*
_tree
;
Fl_Button
*
_butt
[
2
];
Fl_Button
*
_butt
[
2
];
Fl_Input
*
_model
;
Fl_Input
*
_model
;
Fl_Menu_Button
*
_gear
;
std
::
vector
<
Fl_Widget
*>
_treeWidgets
;
std
::
vector
<
Fl_Widget
*>
_treeWidgets
;
public:
public:
onelabWindow
(
int
deltaFontSize
=
0
);
onelabWindow
(
int
deltaFontSize
=
0
);
...
@@ -31,6 +32,7 @@ class onelabWindow{
...
@@ -31,6 +32,7 @@ class onelabWindow{
void
show
(){
_win
->
show
();
}
void
show
(){
_win
->
show
();
}
std
::
string
getModelName
(){
return
_model
->
value
();
}
std
::
string
getModelName
(){
return
_model
->
value
();
}
void
setModelName
(
const
std
::
string
&
name
){
_model
->
value
(
name
.
c_str
());
}
void
setModelName
(
const
std
::
string
&
name
){
_model
->
value
(
name
.
c_str
());
}
int
meshAuto
(){
return
_gear
->
menu
()[
1
].
value
();
}
std
::
string
getPath
(
Fl_Tree_Item
*
item
)
std
::
string
getPath
(
Fl_Tree_Item
*
item
)
{
{
char
path
[
1024
];
char
path
[
1024
];
...
...
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