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

gui entry for compounds

parent c3ada9e6
Branches
Tags
No related merge requests found
......@@ -1344,7 +1344,9 @@ static void action_point_line_surface_volume(int action, int mode, const char *w
case 9:
add_recosurf(List1, GModel::current()->getFileName());
break;
case 10:
add_compound(what, List1, GModel::current()->getFileName());
break;
default:
Msg::Error("Unknown action on selected entities");
break;
......@@ -1987,6 +1989,16 @@ static void mesh_define_embedded_cb(Fl_Widget *w, void *data)
add_transfinite_embedded(2, true);
}
static void mesh_define_compound_cb(Fl_Widget *w, void *data)
{
FlGui::instance()->menu->setContext(menu_mesh_define_compound, 0);
}
static void mesh_define_compound_entity_cb(Fl_Widget *w, void *data)
{
action_point_line_surface_volume(10, 0, (const char *)data);
}
static void view_toggle_cb(Fl_Widget *w, void *data)
{
int num = (int)(long)data;
......@@ -2542,6 +2554,7 @@ contextItem menu_mesh[] = {
{"Embedded points", (Fl_Callback *)mesh_define_embedded_cb, (void*)"point" } ,
{"Recombine", (Fl_Callback *)mesh_define_recombine_cb } ,
{"Transfinite", (Fl_Callback *)mesh_define_transfinite_cb } ,
{"Compound", (Fl_Callback *)mesh_define_compound_cb } ,
{""}
};
contextItem menu_mesh_define_transfinite[] = {
......@@ -2551,6 +2564,13 @@ contextItem menu_mesh[] = {
{"Volume", (Fl_Callback *)mesh_define_transfinite_volume_cb} ,
{""}
};
contextItem menu_mesh_define_compound[] = {
{"1Mesh>Define>Compound"} ,
{"Line", (Fl_Callback *)mesh_define_compound_entity_cb, (void*)"Line"} ,
{"Surface", (Fl_Callback *)mesh_define_compound_entity_cb, (void*)"Surface"} ,
{"Volume", (Fl_Callback *)mesh_define_compound_entity_cb, (void*)"Volume"} ,
{""}
};
contextItem menu_mesh_delete[] = {
{"1Mesh>Edit>Delete"} ,
{"Elements", (Fl_Callback *)mesh_delete_parts_cb, (void*)"elements"} ,
......
......@@ -50,6 +50,7 @@ extern contextItem menu_mesh_edit[];
extern contextItem menu_mesh_delete[];
extern contextItem menu_mesh_define[];
extern contextItem menu_mesh_define_transfinite[];
extern contextItem menu_mesh_define_compound[];
extern contextItem menu_mesh_degree[];
extern contextItem menu_solver[];
extern contextItem menu_post[];
......
......@@ -311,6 +311,14 @@ void add_physical(std::string type, List_T *list, std::string fileName)
add_infile(sstream.str(), fileName);
}
void add_compound(std::string type, List_T *list, std::string fileName)
{
std::ostringstream sstream;
sstream << "Compound " << type << "(" << NEWREG() << ") = {"
<< list2string(list) << "};";
add_infile(sstream.str(), fileName);
}
void translate(int add, List_T *list, std::string fileName, std::string what,
std::string tx, std::string ty, std::string tz)
{
......
......@@ -36,6 +36,7 @@ void add_surf(std::string type, List_T *list, std::string fileName);
void add_surfloop(List_T *list, std::string fileName, int *numvol);
void add_vol(List_T *list, std::string fileName);
void add_physical(std::string type, List_T *list, std::string fileName);
void add_compound(std::string type, List_T *list, std::string fileName);
void translate(int add, List_T *list, std::string fileName, std::string what,
std::string tx, std::string ty, std::string tz);
void rotate(int add, List_T *list, std::string fileName, std::string what,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment