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

New options to enable/desable all default post-processing/solver plugins
parent 28103b3a
Branches
Tags
No related merge requests found
......@@ -197,13 +197,13 @@ public :
int force_num, compute_bb, vertex_arrays;
int draw, scales, link, horizontal_scales ;
int smooth, anim_cycle, combine_time, combine_remove_orig ;
int file_format;
int file_format, plugins;
double anim_delay ;
}post;
// solver options
struct{
int max_delay ;
int max_delay, plugins ;
}solver;
// print options
......
......@@ -888,6 +888,9 @@ StringXNumber SolverOptions_Number[] = {
{ F|O, "MaximumDelay" , opt_solver_max_delay , 4.0 ,
"Maximum delay allowed for solver response (in seconds)" },
{ F|O, "Plugins" , opt_solver_plugins , 0. ,
"Enable default solver plugins?" },
{ F|O, "ClientServer0" , opt_solver_client_server0 , 1. ,
"Connect solver 0 to the Gmsh server" },
{ F|O, "MergeViews0" , opt_solver_merge_views0 , 1. ,
......@@ -952,6 +955,9 @@ StringXNumber PostProcessingOptions_Number[] = {
{ F, "NbViews" , opt_post_nb_views , 0. ,//this default val is not used
"Current number of views merged" },
{ F|O, "Plugins" , opt_post_plugins , 1. ,
"Enable default post-processing plugins?" },
{ F|O, "Scales" , opt_post_scales , 1. ,
"Show value scales" },
{ F|O, "Smoothing" , opt_post_smooth , 0. ,
......
// $Id: Options.cpp,v 1.196 2004-10-26 01:04:50 geuzaine Exp $
// $Id: Options.cpp,v 1.197 2004-10-28 08:13:09 geuzaine Exp $
//
// Copyright (C) 1997-2004 C. Geuzaine, J.-F. Remacle
//
......@@ -4107,6 +4107,13 @@ double opt_solver_max_delay(OPT_ARGS_NUM)
return CTX.solver.max_delay;
}
double opt_solver_plugins(OPT_ARGS_NUM)
{
if(action & GMSH_SET)
CTX.solver.plugins = (int)val;
return CTX.solver.plugins;
}
double opt_solver_client_server(OPT_ARGS_NUM)
{
#if defined(HAVE_FLTK)
......@@ -4304,6 +4311,13 @@ double opt_post_combine_remove_orig(OPT_ARGS_NUM)
return CTX.post.combine_remove_orig;
}
double opt_post_plugins(OPT_ARGS_NUM)
{
if(action & GMSH_SET)
CTX.post.plugins = (int)val;
return CTX.post.plugins;
}
double opt_post_nb_views(OPT_ARGS_NUM)
{
return List_Nbr(CTX.post.list);
......
......@@ -422,6 +422,7 @@ double opt_mesh_nb_prisms(OPT_ARGS_NUM);
double opt_mesh_nb_pyramids(OPT_ARGS_NUM);
double opt_mesh_cpu_time(OPT_ARGS_NUM);
double opt_solver_max_delay(OPT_ARGS_NUM);
double opt_solver_plugins(OPT_ARGS_NUM);
double opt_solver_client_server(OPT_ARGS_NUM);
double opt_solver_client_server0(OPT_ARGS_NUM);
double opt_solver_client_server1(OPT_ARGS_NUM);
......@@ -448,6 +449,7 @@ double opt_post_smooth(OPT_ARGS_NUM);
double opt_post_anim_delay(OPT_ARGS_NUM);
double opt_post_anim_cycle(OPT_ARGS_NUM);
double opt_post_combine_remove_orig(OPT_ARGS_NUM);
double opt_post_plugins(OPT_ARGS_NUM);
double opt_post_nb_views(OPT_ARGS_NUM);
double opt_post_file_format(OPT_ARGS_NUM);
double opt_view_nb_timestep(OPT_ARGS_NUM);
......
// $Id: Main.cpp,v 1.72 2004-09-28 17:13:49 geuzaine Exp $
// $Id: Main.cpp,v 1.73 2004-10-28 08:13:09 geuzaine Exp $
//
// Copyright (C) 1997-2004 C. Geuzaine, J.-F. Remacle
//
......@@ -88,13 +88,11 @@ int main(int argc, char *argv[])
M.BGM.bgm = NULL;
M.Grid.init = 0;
// Initialize the default plugins
GMSH_PluginManager::instance()->registerDefaultPlugins();
// Generate automatic documentation (before getting user-defined options)
if(argc == 2 && !strcmp(argv[1], "-doc")){
// force all plugins for the doc
GMSH_PluginManager::instance()->registerDefaultPlugins();
Print_OptionsDoc();
exit(0);
}
......@@ -114,6 +112,10 @@ int main(int argc, char *argv[])
signal(SIGSEGV, Signal);
signal(SIGFPE, Signal);
// Initialize the default plugins
GMSH_PluginManager::instance()->registerDefaultPlugins();
// Non-interactive Gmsh
if(CTX.batch) {
......
# $Id: Makefile,v 1.59 2004-10-28 06:11:22 geuzaine Exp $
# $Id: Makefile,v 1.60 2004-10-28 08:13:09 geuzaine Exp $
#
# Copyright (C) 1997-2004 C. Geuzaine, J.-F. Remacle
#
......@@ -108,7 +108,7 @@ Callbacks.o: Callbacks.cpp ../Common/Gmsh.h ../Common/Message.h \
../Parser/OpenFile.h ../Common/CommandLine.h ../Common/Context.h \
../Common/Options.h GUI.h Opengl_Window.h Colorbar_Window.h \
File_Picker.h Callbacks.h ../Plugin/Plugin.h ../Plugin/PluginManager.h \
../Common/Visibility.h ../Geo/MinMax.h Solvers.h
../Common/Visibility.h ../Geo/MinMax.h ../Numeric/Numeric.h Solvers.h
Opengl.o: Opengl.cpp ../Common/Gmsh.h ../Common/Message.h \
../DataStr/Malloc.h ../DataStr/List.h ../DataStr/Tree.h \
../DataStr/avl.h ../DataStr/Tools.h ../Common/GmshUI.h \
......
# $Id: Makefile,v 1.56 2004-10-28 06:11:23 geuzaine Exp $
# $Id: Makefile,v 1.57 2004-10-28 08:13:09 geuzaine Exp $
#
# Copyright (C) 1997-2004 C. Geuzaine, J.-F. Remacle
#
......@@ -76,7 +76,8 @@ Plugin.o: Plugin.cpp Plugin.h ../Common/Options.h ../Common/Message.h \
SphericalRaise.h DisplacementRaise.h StructuralSolver.h ../Geo/Geo.h \
../Mesh/Mesh.h ../Mesh/Vertex.h ../Mesh/Element.h ../Mesh/Simplex.h \
../Mesh/Face.h ../Mesh/Edge.h ../Geo/ExtrudeParams.h ../Mesh/STL.h \
../Mesh/Metric.h ../Mesh/Matrix.h ../Common/GmshUI.h Evaluate.h
../Mesh/Metric.h ../Mesh/Matrix.h ../Common/GmshUI.h Evaluate.h \
../Common/Context.h
Levelset.o: Levelset.cpp Levelset.h Plugin.h ../Common/Options.h \
../Common/Message.h ../Common/Views.h ../Common/ColorTable.h \
../DataStr/List.h ../Common/VertexArray.h ../Common/SmoothNormals.h \
......
// $Id: Plugin.cpp,v 1.60 2004-10-28 03:40:16 geuzaine Exp $
// $Id: Plugin.cpp,v 1.61 2004-10-28 08:13:09 geuzaine Exp $
//
// Copyright (C) 1997-2004 C. Geuzaine, J.-F. Remacle
//
......@@ -49,9 +49,12 @@
#include "DisplacementRaise.h"
#include "StructuralSolver.h"
#include "Evaluate.h"
#include "Context.h"
using namespace std;
extern Context_T CTX;
const char *GMSH_PluginEntry = "GMSH_RegisterPlugin";
GMSH_PluginManager *GMSH_PluginManager::_instance = 0;
......@@ -76,12 +79,6 @@ GMSH_Plugin *GMSH_PluginManager::find(char *pluginName)
GMSH_Solve_Plugin *GMSH_PluginManager::findSolverPlugin()
{
// to avoid showing the solver plugin popups for "regular" users,
// let's just say for the moment that we don't have any solver
// plugins if the environment variable is not defined...
if(!getenv("GMSHPLUGINSHOME"))
return 0;
iter it = allPlugins.begin();
iter ite = allPlugins.end();
for (;it!=ite;++it) {
......@@ -159,9 +156,13 @@ GMSH_PluginManager *GMSH_PluginManager::instance()
void GMSH_PluginManager::registerDefaultPlugins()
{
// SOLVE PLUGINS
if(CTX.solver.plugins){
allPlugins.insert(std::pair < char *, GMSH_Plugin * >
("StructuralSolver", GMSH_RegisterStructuralSolverPlugin()));
}
// POST PLUGINS
if(CTX.post.plugins){
allPlugins.insert(std::pair < char *, GMSH_Plugin * >
("StreamLines", GMSH_RegisterStreamLinesPlugin()));
allPlugins.insert(std::pair < char *, GMSH_Plugin * >
......@@ -196,6 +197,7 @@ void GMSH_PluginManager::registerDefaultPlugins()
allPlugins.insert(std::pair < char *, GMSH_Plugin * >
("CutParametric", GMSH_RegisterCutParametricPlugin()));
#endif
}
#if defined(HAVE_FLTK)
struct dirent **list;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment