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

Automatic visibility for entity creation

parent ad7ca84f
No related branches found
No related tags found
No related merge requests found
// $Id: Callbacks.cpp,v 1.32 2001-02-18 19:24:06 geuzaine Exp $ // $Id: Callbacks.cpp,v 1.33 2001-02-19 15:21:54 geuzaine Exp $
#include "Gmsh.h" #include "Gmsh.h"
#include "GmshUI.h" #include "GmshUI.h"
...@@ -560,6 +560,11 @@ static void _new_line_spline(int dim){ ...@@ -560,6 +560,11 @@ static void _new_line_spline(int dim){
int ib; int ib;
static int n, p[100]; static int n, p[100];
if(!opt_geometry_points(0,GMSH_GET,0)){
opt_geometry_points(0,GMSH_SET|GMSH_GUI,1);
Draw();
}
n = 0; n = 0;
while(1){ while(1){
Msg(STATUS3N,"Select Point ('e'=end, 'q'=quit)"); Msg(STATUS3N,"Select Point ('e'=end, 'q'=quit)");
...@@ -601,6 +606,11 @@ void geometry_elementary_add_new_circle_cb(CALLBACK_ARGS){ ...@@ -601,6 +606,11 @@ void geometry_elementary_add_new_circle_cb(CALLBACK_ARGS){
int ib; int ib;
static int n, p[100]; static int n, p[100];
if(!opt_geometry_points(0,GMSH_GET,0)){
opt_geometry_points(0,GMSH_SET|GMSH_GUI,1);
Draw();
}
n=0; n=0;
while(1){ while(1){
if(n == 0) Msg(STATUS3N,"Select Center ('q'=quit)"); if(n == 0) Msg(STATUS3N,"Select Center ('q'=quit)");
...@@ -632,6 +642,11 @@ void geometry_elementary_add_new_ellipsis_cb(CALLBACK_ARGS){ ...@@ -632,6 +642,11 @@ void geometry_elementary_add_new_ellipsis_cb(CALLBACK_ARGS){
int ib; int ib;
static int n, p[100]; static int n, p[100];
if(!opt_geometry_points(0,GMSH_GET,0)){
opt_geometry_points(0,GMSH_SET|GMSH_GUI,1);
Draw();
}
n=0; n=0;
while(1){ while(1){
if(n == 0) Msg(STATUS3N,"Select Center ('q'=quit)"); if(n == 0) Msg(STATUS3N,"Select Center ('q'=quit)");
...@@ -668,10 +683,20 @@ static void _new_surface_volume(int mode){ ...@@ -668,10 +683,20 @@ static void _new_surface_volume(int mode){
Liste1 = List_Create(10,10,sizeof(int)); Liste1 = List_Create(10,10,sizeof(int));
Liste2 = List_Create(10,10,sizeof(int)); Liste2 = List_Create(10,10,sizeof(int));
if(mode == 2) if(mode == 2){
type = ENT_SURFACE; type = ENT_SURFACE;
else if(!opt_geometry_surfaces(0,GMSH_GET,0)){
opt_geometry_surfaces(0,GMSH_SET|GMSH_GUI,1);
Draw();
}
}
else{
type = ENT_LINE; type = ENT_LINE;
if(!opt_geometry_lines(0,GMSH_GET,0)){
opt_geometry_lines(0,GMSH_SET|GMSH_GUI,1);
Draw();
}
}
while(1){ while(1){
List_Reset(Liste1); List_Reset(Liste1);
...@@ -744,12 +769,27 @@ static void _transform_point_curve_surface(int transfo, int mode, char *what){ ...@@ -744,12 +769,27 @@ static void _transform_point_curve_surface(int transfo, int mode, char *what){
Surface *s; Surface *s;
int type, num; int type, num;
if(!strcmp(what,"Point")) if(!strcmp(what,"Point")) {
type = ENT_POINT; type = ENT_POINT;
else if(!strcmp(what,"Line")) if(!opt_geometry_points(0,GMSH_GET,0)){
opt_geometry_points(0,GMSH_SET|GMSH_GUI,1);
Draw();
}
}
else if(!strcmp(what,"Line")){
type = ENT_LINE; type = ENT_LINE;
else if(!opt_geometry_lines(0,GMSH_GET,0)){
opt_geometry_lines(0,GMSH_SET|GMSH_GUI,1);
Draw();
}
}
else{
type = ENT_SURFACE; type = ENT_SURFACE;
if(!opt_geometry_surfaces(0,GMSH_GET,0)){
opt_geometry_surfaces(0,GMSH_SET|GMSH_GUI,1);
Draw();
}
}
while(1){ while(1){
Msg(STATUS3N,"Select %s ('q'=quit)", what); Msg(STATUS3N,"Select %s ('q'=quit)", what);
...@@ -956,15 +996,34 @@ static void _add_physical(char *what){ ...@@ -956,15 +996,34 @@ static void _add_physical(char *what){
int ib, type, zone; int ib, type, zone;
List_T *Liste1; List_T *Liste1;
if(!strcmp(what,"Point")) if(!strcmp(what,"Point")){
type = ENT_POINT; type = ENT_POINT;
else if(!strcmp(what,"Line")) if(!opt_geometry_points(0,GMSH_GET,0)){
opt_geometry_points(0,GMSH_SET|GMSH_GUI,1);
Draw();
}
}
else if(!strcmp(what,"Line")){
type = ENT_LINE; type = ENT_LINE;
else if(!strcmp(what,"Surface")) if(!opt_geometry_lines(0,GMSH_GET,0)){
opt_geometry_lines(0,GMSH_SET|GMSH_GUI,1);
Draw();
}
}
else if(!strcmp(what,"Surface")){
type = ENT_SURFACE; type = ENT_SURFACE;
if(!opt_geometry_surfaces(0,GMSH_GET,0)){
opt_geometry_surfaces(0,GMSH_SET|GMSH_GUI,1);
Draw();
}
}
else{ else{
Msg(GERROR, "Interactive Volume Selection not done: " Msg(GERROR, "Interactive Volume Selection not done: "
"Please edit the input file manually"); "Please edit the input file manually");
if(!opt_geometry_volumes(0,GMSH_GET,0)){
opt_geometry_volumes(0,GMSH_SET|GMSH_GUI,1);
Draw();
}
return; return;
} }
...@@ -1039,6 +1098,11 @@ void mesh_define_length_cb (CALLBACK_ARGS){ ...@@ -1039,6 +1098,11 @@ void mesh_define_length_cb (CALLBACK_ARGS){
int ib; int ib;
static int n=0, p[100]; static int n=0, p[100];
if(!opt_geometry_points(0,GMSH_GET,0)){
opt_geometry_points(0,GMSH_SET|GMSH_GUI,1);
Draw();
}
WID->create_mesh_context_window(0); WID->create_mesh_context_window(0);
while(1){ while(1){
...@@ -1072,6 +1136,11 @@ void mesh_define_recombine_cb (CALLBACK_ARGS){ ...@@ -1072,6 +1136,11 @@ void mesh_define_recombine_cb (CALLBACK_ARGS){
int ib; int ib;
static int n, p[100]; static int n, p[100];
if(!opt_geometry_surfaces(0,GMSH_GET,0)){
opt_geometry_surfaces(0,GMSH_SET|GMSH_GUI,1);
Draw();
}
n=0; n=0;
while(1){ while(1){
Msg(STATUS3N,"Select Surface ('e'=end, 'q'=quit)"); Msg(STATUS3N,"Select Surface ('e'=end, 'q'=quit)");
...@@ -1107,6 +1176,32 @@ static void _add_transfinite(int dim){ ...@@ -1107,6 +1176,32 @@ static void _add_transfinite(int dim){
int ib; int ib;
static int n, p[100]; static int n, p[100];
if(!opt_geometry_points(0,GMSH_GET,0)){
opt_geometry_points(0,GMSH_SET|GMSH_GUI,1);
Draw();
}
switch (dim) {
case 1 :
if(!opt_geometry_lines(0,GMSH_GET,0)){
opt_geometry_lines(0,GMSH_SET|GMSH_GUI,1);
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;
}
n=0; n=0;
while(1){ while(1){
switch (dim) { switch (dim) {
......
New in 1.15: Added automatic visibility for entity creation;
New in 1.14: Corrected a few bugs in the GUI (most of them were New in 1.14: Corrected a few bugs in the GUI (most of them were
introduced in 1.13); Added interactive color selection; Made the introduced in 1.13); Added interactive color selection; Made the
option database bidirectional (i.e. scripts now correctly update the option database bidirectional (i.e. scripts now correctly update the
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment