diff --git a/Common/Context.h b/Common/Context.h index d3f233660640e2f9a37b031ff3d529bfbcdb5033..7d7378a8276baeefc4d7ecd39acc58925c80d11f 100644 --- a/Common/Context.h +++ b/Common/Context.h @@ -251,6 +251,7 @@ class CTX { double animDelay; std::string doubleClickedGraphPointCommand; double doubleClickedGraphPointX, doubleClickedGraphPointY; + int doubleClickedView; }post; // solver options struct{ diff --git a/Common/DefaultOptions.h b/Common/DefaultOptions.h index 79c2305245a53a97946a646f433b2601d6b86af4..5a203ea8b323a6722544367a24100723d9a15ee9 100644 --- a/Common/DefaultOptions.h +++ b/Common/DefaultOptions.h @@ -1302,6 +1302,8 @@ StringXNumber PostProcessingOptions_Number[] = { "Abscissa of last double-clicked graph point" }, { F, "DoubleClickedGraphPointY" , opt_post_double_clicked_graph_point_y , 0. , "Ordinate of last double-clicked graph point" }, + { F, "DoubleClickedView" , opt_post_double_clicked_view, 0. , + "Index of last double-clicked view" }, { F|O, "ForceElementData" , opt_post_force_element_data , 0. , "Try to force saving datasets as ElementData" }, diff --git a/Common/Options.cpp b/Common/Options.cpp index 914f0834a2a1b0752723e3f096b954b608710b4e..e4ec17a867f81c1d007dcf44ebfd7406139e0148 100644 --- a/Common/Options.cpp +++ b/Common/Options.cpp @@ -6598,6 +6598,13 @@ double opt_post_double_clicked_graph_point_y(OPT_ARGS_NUM) return CTX::instance()->post.doubleClickedGraphPointY; } +double opt_post_double_clicked_view(OPT_ARGS_NUM) +{ + if(action & GMSH_SET) + CTX::instance()->post.doubleClickedView = (int)val; + return CTX::instance()->post.doubleClickedView; +} + double opt_view_nb_timestep(OPT_ARGS_NUM) { #if defined(HAVE_POST) diff --git a/Common/Options.h b/Common/Options.h index 8825ef141671876c32849d858b94cb64d7f380c6..1da21151e4e0935df324ce360264f850f4195214 100644 --- a/Common/Options.h +++ b/Common/Options.h @@ -552,6 +552,7 @@ double opt_post_force_node_data(OPT_ARGS_NUM); double opt_post_force_element_data(OPT_ARGS_NUM); double opt_post_double_clicked_graph_point_x(OPT_ARGS_NUM); double opt_post_double_clicked_graph_point_y(OPT_ARGS_NUM); +double opt_post_double_clicked_view(OPT_ARGS_NUM); double opt_view_nb_timestep(OPT_ARGS_NUM); double opt_view_nb_non_empty_timestep(OPT_ARGS_NUM); double opt_view_timestep(OPT_ARGS_NUM); diff --git a/Fltk/openglWindow.cpp b/Fltk/openglWindow.cpp index 45f3ae9e83755876595be747632ca1dc479ac464..f8b1060f36a926fca02aadaf55c438dd8b87126f 100644 --- a/Fltk/openglWindow.cpp +++ b/Fltk/openglWindow.cpp @@ -375,6 +375,7 @@ int openglWindow::handle(int event) ParseString(CTX::instance()->geom.doubleClickedVolumeCommand, true); } else if(views.size() && views[0]->getOptions()->doubleClickedCommand.size()){ + CTX::instance()->post.doubleClickedView = views[0]->getIndex(); ParseString(views[0]->getOptions()->doubleClickedCommand, true); } else if(points.size() && CTX::instance()->post.doubleClickedGraphPointCommand.size()){