Skip to content
Snippets Groups Projects
Commit 110ca529 authored by Christophe Geuzaine's avatar Christophe Geuzaine
Browse files

Force display of entities during their creation (surfaces during surface creation,
lines during line creation, etc.). This has been requested several times by
various users, so it's probably a good idea. (It can indeed be a bit confusing
when one creates a new surface and nothing changes on the screen after pressiong
'e'.)
parent fd7e3a96
No related branches found
No related tags found
No related merge requests found
// $Id: Callbacks.cpp,v 1.303 2004-12-09 03:20:40 geuzaine Exp $ // $Id: Callbacks.cpp,v 1.304 2004-12-21 03:11:48 geuzaine Exp $
// //
// Copyright (C) 1997-2004 C. Geuzaine, J.-F. Remacle // Copyright (C) 1997-2004 C. Geuzaine, J.-F. Remacle
// //
...@@ -861,10 +861,8 @@ void general_options_rotation_center_select_cb(CALLBACK_ARGS) ...@@ -861,10 +861,8 @@ void general_options_rotation_center_select_cb(CALLBACK_ARGS)
Curve *c; Curve *c;
Surface *s; Surface *s;
if(!opt_geometry_points(0, GMSH_GET, 0)) { opt_geometry_points(0, GMSH_SET | GMSH_GUI, 1);
opt_geometry_points(0, GMSH_SET | GMSH_GUI, 1); Draw();
Draw();
}
Msg(STATUS3N, "Setting rotation center"); Msg(STATUS3N, "Setting rotation center");
Msg(ONSCREEN, "Select point\n[Press 'q' to abort]"); Msg(ONSCREEN, "Select point\n[Press 'q' to abort]");
...@@ -1669,6 +1667,9 @@ void geometry_elementary_add_new_parameter_cb(CALLBACK_ARGS) ...@@ -1669,6 +1667,9 @@ void geometry_elementary_add_new_parameter_cb(CALLBACK_ARGS)
void geometry_elementary_add_new_point_cb(CALLBACK_ARGS) void geometry_elementary_add_new_point_cb(CALLBACK_ARGS)
{ {
opt_geometry_points(0, GMSH_SET | GMSH_GUI, 1);
Draw();
WID->create_geometry_context_window(1); WID->create_geometry_context_window(1);
while(1) { while(1) {
...@@ -1705,10 +1706,9 @@ static void _new_multiline(int type) ...@@ -1705,10 +1706,9 @@ static void _new_multiline(int type)
Surface *s; Surface *s;
int n, p[100]; int n, p[100];
if(!opt_geometry_points(0, GMSH_GET, 0)) { opt_geometry_points(0, GMSH_SET | GMSH_GUI, 1);
opt_geometry_points(0, GMSH_SET | GMSH_GUI, 1); opt_geometry_lines(0, GMSH_SET | GMSH_GUI, 1);
Draw(); Draw();
}
n = 0; n = 0;
while(1) { while(1) {
...@@ -1774,10 +1774,9 @@ void geometry_elementary_add_new_line_cb(CALLBACK_ARGS) ...@@ -1774,10 +1774,9 @@ void geometry_elementary_add_new_line_cb(CALLBACK_ARGS)
Surface *s; Surface *s;
int n, p[100]; int n, p[100];
if(!opt_geometry_points(0, GMSH_GET, 0)) { opt_geometry_points(0, GMSH_SET | GMSH_GUI, 1);
opt_geometry_points(0, GMSH_SET | GMSH_GUI, 1); opt_geometry_lines(0, GMSH_SET | GMSH_GUI, 1);
Draw(); Draw();
}
n = 0; n = 0;
while(1) { while(1) {
...@@ -1833,10 +1832,9 @@ void geometry_elementary_add_new_circle_cb(CALLBACK_ARGS) ...@@ -1833,10 +1832,9 @@ void geometry_elementary_add_new_circle_cb(CALLBACK_ARGS)
Surface *s; Surface *s;
int n, p[100]; int n, p[100];
if(!opt_geometry_points(0, GMSH_GET, 0)) { opt_geometry_points(0, GMSH_SET | GMSH_GUI, 1);
opt_geometry_points(0, GMSH_SET | GMSH_GUI, 1); opt_geometry_lines(0, GMSH_SET | GMSH_GUI, 1);
Draw(); Draw();
}
n = 0; n = 0;
while(1) { while(1) {
...@@ -1885,10 +1883,9 @@ void geometry_elementary_add_new_ellipse_cb(CALLBACK_ARGS) ...@@ -1885,10 +1883,9 @@ void geometry_elementary_add_new_ellipse_cb(CALLBACK_ARGS)
Surface *s; Surface *s;
int n, p[100]; int n, p[100];
if(!opt_geometry_points(0, GMSH_GET, 0)) { opt_geometry_points(0, GMSH_SET | GMSH_GUI, 1);
opt_geometry_points(0, GMSH_SET | GMSH_GUI, 1); opt_geometry_lines(0, GMSH_SET | GMSH_GUI, 1);
Draw(); Draw();
}
n = 0; n = 0;
while(1) { while(1) {
...@@ -1945,18 +1942,15 @@ static void _new_surface_volume(int mode) ...@@ -1945,18 +1942,15 @@ static void _new_surface_volume(int mode)
if(mode == 2) { if(mode == 2) {
type = ENT_SURFACE; type = ENT_SURFACE;
if(!opt_geometry_surfaces(0, GMSH_GET, 0)) { opt_geometry_surfaces(0, GMSH_SET | GMSH_GUI, 1);
opt_geometry_surfaces(0, GMSH_SET | GMSH_GUI, 1); opt_geometry_volumes(0, GMSH_SET | GMSH_GUI, 1);
Draw();
}
} }
else { else {
type = ENT_LINE; type = ENT_LINE;
if(!opt_geometry_lines(0, GMSH_GET, 0)) { opt_geometry_lines(0, GMSH_SET | GMSH_GUI, 1);
opt_geometry_lines(0, GMSH_SET | GMSH_GUI, 1); opt_geometry_surfaces(0, GMSH_SET | GMSH_GUI, 1);
Draw();
}
} }
Draw();
while(1) { while(1) {
List_Reset(List1); List_Reset(List1);
...@@ -2096,27 +2090,19 @@ static void _transform_point_line_surface(int transfo, int mode, char *what) ...@@ -2096,27 +2090,19 @@ static void _transform_point_line_surface(int transfo, int mode, char *what)
if(!strcmp(what, "Point")) { if(!strcmp(what, "Point")) {
type = ENT_POINT; type = ENT_POINT;
str = "point"; str = "point";
if(!opt_geometry_points(0, GMSH_GET, 0)) { opt_geometry_points(0, GMSH_SET | GMSH_GUI, 1);
opt_geometry_points(0, GMSH_SET | GMSH_GUI, 1);
Draw();
}
} }
else if(!strcmp(what, "Line")) { else if(!strcmp(what, "Line")) {
type = ENT_LINE; type = ENT_LINE;
str = "line"; str = "line";
if(!opt_geometry_lines(0, GMSH_GET, 0)) { opt_geometry_lines(0, GMSH_SET | GMSH_GUI, 1);
opt_geometry_lines(0, GMSH_SET | GMSH_GUI, 1);
Draw();
}
} }
else { else {
type = ENT_SURFACE; type = ENT_SURFACE;
str = "surface"; str = "surface";
if(!opt_geometry_surfaces(0, GMSH_GET, 0)) { opt_geometry_surfaces(0, GMSH_SET | GMSH_GUI, 1);
opt_geometry_surfaces(0, GMSH_SET | GMSH_GUI, 1);
Draw();
}
} }
Draw();
Msg(ONSCREEN, "Select %s\n[Press 'q' to abort]", str); Msg(ONSCREEN, "Select %s\n[Press 'q' to abort]", str);
...@@ -2468,38 +2454,27 @@ static void _add_physical(char *what) ...@@ -2468,38 +2454,27 @@ static void _add_physical(char *what)
if(!strcmp(what, "Point")) { if(!strcmp(what, "Point")) {
type = ENT_POINT; type = ENT_POINT;
str = "points"; str = "points";
if(!opt_geometry_points(0, GMSH_GET, 0)) { opt_geometry_points(0, GMSH_SET | GMSH_GUI, 1);
opt_geometry_points(0, GMSH_SET | GMSH_GUI, 1);
Draw();
}
} }
else if(!strcmp(what, "Line")) { else if(!strcmp(what, "Line")) {
type = ENT_LINE; type = ENT_LINE;
str = "lines"; str = "lines";
if(!opt_geometry_lines(0, GMSH_GET, 0)) { opt_geometry_lines(0, GMSH_SET | GMSH_GUI, 1);
opt_geometry_lines(0, GMSH_SET | GMSH_GUI, 1);
Draw();
}
} }
else if(!strcmp(what, "Surface")) { else if(!strcmp(what, "Surface")) {
type = ENT_SURFACE; type = ENT_SURFACE;
str = "surfaces"; str = "surfaces";
if(!opt_geometry_surfaces(0, GMSH_GET, 0)) { opt_geometry_surfaces(0, GMSH_SET | GMSH_GUI, 1);
opt_geometry_surfaces(0, GMSH_SET | GMSH_GUI, 1);
Draw();
}
} }
else { else {
type = ENT_VOLUME; type = ENT_VOLUME;
str = "volumes"; str = "volumes";
if(!opt_geometry_volumes(0, GMSH_GET, 0)) { opt_geometry_volumes(0, GMSH_SET | GMSH_GUI, 1);
opt_geometry_volumes(0, GMSH_SET | GMSH_GUI, 1);
Draw();
}
Msg(GERROR, "Interactive volume selection not done " Msg(GERROR, "Interactive volume selection not done "
"(you will have to edit the input file manually)"); "(you will have to edit the input file manually)");
return; return;
} }
Draw();
List1 = List_Create(5, 5, sizeof(int)); List1 = List_Create(5, 5, sizeof(int));
while(1) { while(1) {
...@@ -2666,10 +2641,8 @@ void mesh_define_length_cb(CALLBACK_ARGS) ...@@ -2666,10 +2641,8 @@ void mesh_define_length_cb(CALLBACK_ARGS)
Surface *s; Surface *s;
int n = 0, p[100]; int n = 0, p[100];
if(!opt_geometry_points(0, GMSH_GET, 0)) { opt_geometry_points(0, GMSH_SET | GMSH_GUI, 1);
opt_geometry_points(0, GMSH_SET | GMSH_GUI, 1); Draw();
Draw();
}
WID->create_mesh_context_window(0); WID->create_mesh_context_window(0);
...@@ -2716,10 +2689,8 @@ void mesh_define_recombine_cb(CALLBACK_ARGS) ...@@ -2716,10 +2689,8 @@ void mesh_define_recombine_cb(CALLBACK_ARGS)
Surface *s; Surface *s;
int n, p[100]; int n, p[100];
if(!opt_geometry_surfaces(0, GMSH_GET, 0)) { opt_geometry_surfaces(0, GMSH_SET | GMSH_GUI, 1);
opt_geometry_surfaces(0, GMSH_SET | GMSH_GUI, 1); Draw();
Draw();
}
n = 0; n = 0;
while(1) { while(1) {
...@@ -2771,31 +2742,13 @@ static void _add_transfinite(int dim) ...@@ -2771,31 +2742,13 @@ static void _add_transfinite(int dim)
char ib; char ib;
int n, p[100]; int n, p[100];
if(!opt_geometry_points(0, GMSH_GET, 0)) { opt_geometry_points(0, GMSH_SET | GMSH_GUI, 1);
opt_geometry_points(0, GMSH_SET | GMSH_GUI, 1);
Draw();
}
switch (dim) { switch (dim) {
case 1: case 1: opt_geometry_lines(0, GMSH_SET | GMSH_GUI, 1); break;
if(!opt_geometry_lines(0, GMSH_GET, 0)) { case 2: opt_geometry_surfaces(0, GMSH_SET | GMSH_GUI, 1); break;
opt_geometry_lines(0, GMSH_SET | GMSH_GUI, 1); case 3: opt_geometry_volumes(0, GMSH_SET | GMSH_GUI, 1); break;
Draw();
}
break;
case 2:
if(!opt_geometry_surfaces(0, GMSH_GET, 0)) {
opt_geometry_surfaces(0, GMSH_SET | GMSH_GUI, 1);
Draw();
}
break;
case 3:
if(!opt_geometry_volumes(0, GMSH_GET, 0)) {
opt_geometry_volumes(0, GMSH_SET | GMSH_GUI, 1);
Draw();
}
break;
} }
Draw();
n = 0; n = 0;
while(1) { while(1) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment