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

test view groups

parent be121503
Branches
Tags
No related merge requests found
......@@ -273,6 +273,8 @@ StringXString ViewOptions_String[] = {
{ F|O, "GeneralizedRaiseZ" , opt_view_gen_raise2 , "v2" ,
"Generalized elevation of the view along Z-axis (in model coordinates, "
"using formula possibly containing x, y, z, s[tep], t[ime], v0, ... v8)" },
{ F|O, "Group" , opt_view_group , "" ,
"Group to which this view belongs" },
{ F, "Name" , opt_view_name , "" ,
"Default post-processing view name" },
......
......@@ -1651,6 +1651,19 @@ std::string opt_view_double_clicked_command(OPT_ARGS_STR)
#endif
}
std::string opt_view_group(OPT_ARGS_STR)
{
#if defined(HAVE_POST)
GET_VIEWo("");
if(action & GMSH_SET) {
opt->group = val;
}
return opt->group;
#else
return "";
#endif
}
std::string opt_view_filename(OPT_ARGS_STR)
{
#if defined(HAVE_POST)
......
......@@ -103,6 +103,7 @@ std::string opt_view_name(OPT_ARGS_STR);
std::string opt_view_format(OPT_ARGS_STR);
std::string opt_view_filename(OPT_ARGS_STR);
std::string opt_view_double_clicked_command(OPT_ARGS_STR);
std::string opt_view_group(OPT_ARGS_STR);
std::string opt_view_axes_label0(OPT_ARGS_STR);
std::string opt_view_axes_label1(OPT_ARGS_STR);
std::string opt_view_axes_label2(OPT_ARGS_STR);
......
......@@ -44,6 +44,7 @@ typedef unsigned long intptr_t;
#include "CreateFile.h"
#include "drawContext.h"
#include "PView.h"
#include "PViewOptions.h"
#include "treeIcons.h"
// This file contains the Gmsh/FLTK specific parts of the ONELAB
......@@ -573,7 +574,11 @@ void onelabGroup::_addSolverMenu(int num)
void onelabGroup::_addViewMenu(int num)
{
std::ostringstream path;
path << "0Modules/Post-processing/View" << num;
path << "0Modules/Post-processing/";
if(num >= 0 && num < PView::list.size() &&
PView::list[num]->getOptions()->group.size())
path << PView::list[num]->getOptions()->group << "/";
path << "View" << num;
Fl_Tree_Item *n = _tree->add(path.str().c_str());
int ww = _baseWidth - (n->depth() + 1) * _indent;
int hh = n->labelsize() + 4;
......@@ -590,6 +595,11 @@ void onelabGroup::_addViewMenu(int num)
viewButton *onelabGroup::getViewButton(int num)
{
char tmp[256];
if(num >= 0 && num < PView::list.size() &&
PView::list[num]->getOptions()->group.size())
sprintf(tmp, "0Modules/Post-processing/%s/View%d",
PView::list[num]->getOptions()->group.c_str(), num);
else
sprintf(tmp, "0Modules/Post-processing/View%d", num);
Fl_Tree_Item *n = _tree->find_item(tmp);
if(n){
......@@ -1046,11 +1056,11 @@ void onelabGroup::rebuildTree(bool deleteWidgets)
if(CTX::instance()->guiColorScheme){
_tree->openicon(&open_pixmap_dark);
_tree->closeicon(&open_pixmap_dark);
_tree->closeicon(&close_pixmap_dark);
}
else{
_tree->openicon(&open_pixmap_light);
_tree->closeicon(&open_pixmap_light);
_tree->closeicon(&close_pixmap_light);
}
_tree->sortorder(FL_TREE_SORT_ASCENDING);
_tree->selectmode(FL_TREE_SELECT_NONE);
......@@ -1128,6 +1138,7 @@ void onelabGroup::rebuildTree(bool deleteWidgets)
but->align(FL_ALIGN_LEFT | FL_ALIGN_INSIDE);
but->callback(onelab_subtree_cb, (void*)n);
#else
// FIXME: if view group, add special widget with on/off switch
Fl_Box *but = new Fl_Box(1, 1, ww, hh);
//but->labelfont(FL_HELVETICA_ITALIC);
but->align(FL_ALIGN_LEFT | FL_ALIGN_INSIDE);
......
......@@ -99,7 +99,7 @@ class PViewOptions {
int clip; // status of clip planes (bit array)
int forceNumComponents, componentMap[9];
int sampling;
std::string attributes, doubleClickedCommand;
std::string attributes, doubleClickedCommand, group;
struct{
unsigned int point, line, triangle, quadrangle;
unsigned int tetrahedron, hexahedron, prism, pyramid;
......
......@@ -69,6 +69,11 @@ Generalized elevation of the view along Z-axis (in model coordinates, using form
Default value: @code{"v2"}@*
Saved in: @code{General.OptionsFileName}
@item View.Group
Group to which this view belongs@*
Default value: @code{""}@*
Saved in: @code{General.OptionsFileName}
@item View.Name
Default post-processing view name@*
Default value: @code{""}@*
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment