diff --git a/Fltk/fieldWindow.cpp b/Fltk/fieldWindow.cpp index c20975a7db1bffc714f02d1321d0876b6e1e0a53..1f072c3fccfe67658d7f622bb0c29844f02a65d6 100644 --- a/Fltk/fieldWindow.cpp +++ b/Fltk/fieldWindow.cpp @@ -48,7 +48,8 @@ static void field_new_cb(Fl_Widget *w, void *data) FieldManager *fields = GModel::current()->getFields(); int id = fields->newId(); add_field(id, mb->text(), GModel::current()->getFileName()); - FlGui::instance()->fields->editField((*fields)[id]); + if((*fields)[id]) + FlGui::instance()->fields->editField((*fields)[id]); } static void field_apply_cb(Fl_Widget *w, void *data) diff --git a/Fltk/pluginWindow.cpp b/Fltk/pluginWindow.cpp index 87e961c0da5fbb6c3dd1c9cad4411886078c29ac..9041e638e534fd90caa1dbde40e54af9328cb982 100644 --- a/Fltk/pluginWindow.cpp +++ b/Fltk/pluginWindow.cpp @@ -220,13 +220,25 @@ void pluginWindow::_createDialogBox(GMSH_Plugin *p, int x, int y, p->dialogBox = new PluginDialogBox; p->dialogBox->group = new Fl_Group(x, y, width, height); + Fl_Box *title = new Fl_Box(x, y, width, BH, strdup(p->getName().c_str())); + title->labelfont(FL_BOLD); + title->labelsize(FL_NORMAL_SIZE + 3); + title->align(FL_ALIGN_INSIDE); + + Fl_Box *help = new Fl_Box + (x, y + BH, width, BH + WB, strdup(p->getShortHelp().c_str())); + help->align(FL_ALIGN_WRAP | FL_ALIGN_CLIP | FL_ALIGN_TOP | FL_ALIGN_INSIDE); + + int top = 2 * BH + WB; + { - Fl_Tabs *o = new Fl_Tabs(x, y, width, height); + Fl_Tabs *o = new Fl_Tabs(x, y + top, width, height - top); { - Fl_Group *g = new Fl_Group(x, y + BH, width, height - BH, "Options"); + Fl_Group *g = new Fl_Group + (x, y + top + BH, width, height - top - BH, "Options"); Fl_Scroll *s = new Fl_Scroll - (x + WB, y + WB + BH, width - 2 * WB, height - 2 * BH - 3 * WB); + (x + WB, y + top + BH + WB, width - 2 * WB, height - top - 2 * BH - 3 * WB); int m = p->getNbOptionsStr(); if(m > MAX_PLUGIN_OPTIONS) m = MAX_PLUGIN_OPTIONS; @@ -238,7 +250,7 @@ void pluginWindow::_createDialogBox(GMSH_Plugin *p, int x, int y, for(int i = 0; i < m; i++) { StringXString *sxs = p->getOptionStr(i); p->dialogBox->input[i] = new Fl_Input - (x + WB, y + WB + (k + 1) * BH, IW, BH, sxs->str); + (x + WB, y + top + (k + 1) * BH + WB, IW, BH, sxs->str); p->dialogBox->input[i]->align(FL_ALIGN_RIGHT); p->dialogBox->input[i]->value(sxs->def.c_str()); k++; @@ -246,7 +258,7 @@ void pluginWindow::_createDialogBox(GMSH_Plugin *p, int x, int y, for(int i = 0; i < n; i++) { StringXNumber *sxn = p->getOption(i); p->dialogBox->value[i] = new Fl_Value_Input - (x + WB, y + WB + (k + 1) * BH, IW, BH, sxn->str); + (x + WB, y + top + (k + 1) * BH + WB, IW, BH, sxn->str); p->dialogBox->value[i]->align(FL_ALIGN_RIGHT); p->dialogBox->value[i]->value(sxn->def); k++; @@ -258,18 +270,16 @@ void pluginWindow::_createDialogBox(GMSH_Plugin *p, int x, int y, (x + width - BB - WB, y + height - BH - WB, BB, BH, "Run"); run->callback(plugin_run_cb, (void*)p); - g->resizable(new Fl_Box(x + WB, y + 2 * BH, WB, WB)); + g->resizable(new Fl_Box(x + WB, y + 4 * BH + WB, WB, WB)); g->end(); - o->resizable(g); } { - Fl_Group *g = new Fl_Group(x, y + BH, width, height - BH, "Help"); + Fl_Group *g = new Fl_Group + (x, y + top + BH, width, height - top - BH, "Help"); Fl_Browser *o = new Fl_Browser - (x + WB, y + WB + BH, width - 2 * WB, height - 2 * WB - 2 * BH); - o->add(" "); - add_multiline_in_browser(o, "@c@b@.", p->getName().c_str(), false); + (x + WB, y + top + BH + WB, width - 2 * WB, height - top - 2 * BH - 3 * WB); o->add(" "); add_multiline_in_browser(o, "", p->getHelp().c_str(), false); o->add(" "); @@ -335,7 +345,7 @@ pluginWindow::pluginWindow(int deltaFontSize) record->type(FL_TOGGLE_BUTTON); record->tooltip("Append scripting command to file options when plugin is run"); - Fl_Box *resize_box = new Fl_Box(3*WB + L1+L2, WB, WB, height - 2 * WB); + Fl_Box *resize_box = new Fl_Box(L1 + L2 + 3 * WB, WB, 1, 1); win->resizable(resize_box); win->size_range(width0, height0); diff --git a/Plugin/Annotate.cpp b/Plugin/Annotate.cpp index a926092a704042a9ce76e1210e85b22d57b18606..2441d2017b53f8084ec514521e901fecaad48d5b 100644 --- a/Plugin/Annotate.cpp +++ b/Plugin/Annotate.cpp @@ -16,7 +16,7 @@ StringXNumber AnnotateOptions_Number[] = { {GMSH_FULLRC, "X", GMSH_AnnotatePlugin::callbackX, 50.}, {GMSH_FULLRC, "Y", GMSH_AnnotatePlugin::callbackY, 30.}, {GMSH_FULLRC, "Z", GMSH_AnnotatePlugin::callbackZ, 0.}, - {GMSH_FULLRC, "ThereD", GMSH_AnnotatePlugin::callback3D, 0.}, + {GMSH_FULLRC, "ThreeD", GMSH_AnnotatePlugin::callback3D, 0.}, {GMSH_FULLRC, "FontSize", GMSH_AnnotatePlugin::callbackFontSize, 14.}, {GMSH_FULLRC, "iView", NULL, -1.} }; diff --git a/Plugin/Annotate.h b/Plugin/Annotate.h index 26ef63615cb4a5ff9f65fbdd29b40f4e3b378c2e..c893d213b2c873c0d996e5dd63b7e4be075abd2b 100644 --- a/Plugin/Annotate.h +++ b/Plugin/Annotate.h @@ -24,6 +24,7 @@ class GMSH_AnnotatePlugin : public GMSH_PostPlugin public: GMSH_AnnotatePlugin(){} std::string getName() const { return "Annotate"; } + std::string getShortHelp() const { return "Add a text annotation"; } std::string getHelp() const; int getNbOptions() const; StringXNumber *getOption(int iopt); diff --git a/Plugin/CMakeLists.txt b/Plugin/CMakeLists.txt index 7e4269a4a7fc763e23169f98d33ca2db4d45fe9e..34f32a792fdec46adf67e214b8b4e4bdc0214235 100644 --- a/Plugin/CMakeLists.txt +++ b/Plugin/CMakeLists.txt @@ -6,7 +6,7 @@ set(SRC Plugin.cpp PluginManager.cpp Levelset.cpp - CutPlane.cpp CutSphere.cpp CutMap.cpp + CutPlane.cpp CutSphere.cpp Isosurface.cpp Smooth.cpp CutParametric.cpp Lambda2.cpp Eigenvectors.cpp Eigenvalues.cpp @@ -16,9 +16,9 @@ set(SRC Triangulate.cpp Tetrahedralize.cpp Warp.cpp SphericalRaise.cpp Skin.cpp GSHHS.cpp - Extract.cpp ExtractElements.cpp ExtractEdges.cpp + MathEval.cpp ModifyComponent.cpp ExtractElements.cpp MakeSimplex.cpp - Evaluate.cpp FieldView.cpp + FieldView.cpp Integrate.cpp Gradient.cpp Curl.cpp Divergence.cpp Annotate.cpp Remove.cpp Probe.cpp diff --git a/Plugin/Curl.h b/Plugin/Curl.h index d6156f1c239c9b03fde6c40433408ddcbb459ebe..1306509df23553099f82853a5d0856a4c9c673f5 100644 --- a/Plugin/Curl.h +++ b/Plugin/Curl.h @@ -18,6 +18,10 @@ class GMSH_CurlPlugin : public GMSH_PostPlugin public: GMSH_CurlPlugin(){} std::string getName() const { return "Curl"; } + std::string getShortHelp() const + { + return "Compute the curl of a vector view"; + } std::string getHelp() const; int getNbOptions() const; StringXNumber *getOption(int iopt); diff --git a/Plugin/CutGrid.h b/Plugin/CutGrid.h index 1f86da5e1e6b81546637c25a53ca3f5c45a18862..a8613baff429cdcf44df3a453cb10add224ec16f 100644 --- a/Plugin/CutGrid.h +++ b/Plugin/CutGrid.h @@ -26,6 +26,10 @@ class GMSH_CutGridPlugin : public GMSH_PostPlugin public: GMSH_CutGridPlugin(){} std::string getName() const { return "CutGrid"; } + std::string getShortHelp() const + { + return "Cut with a regular grid defined by 3 points"; + } std::string getHelp() const; int getNbOptions() const; StringXNumber *getOption(int iopt); diff --git a/Plugin/CutParametric.h b/Plugin/CutParametric.h index e45705c64e5b80a2bcd85b00fbc794ac29545a82..e99666322de087451650208bd59c17b6dff78aa1 100644 --- a/Plugin/CutParametric.h +++ b/Plugin/CutParametric.h @@ -28,6 +28,10 @@ class GMSH_CutParametricPlugin : public GMSH_PostPlugin public: GMSH_CutParametricPlugin(){} std::string getName() const { return "CutParametric"; } + std::string getShortHelp() const + { + return "Cut with the parametric curve (X(u), Y(u), Z(u))"; + } std::string getHelp() const; int getNbOptions() const; StringXNumber *getOption(int iopt); diff --git a/Plugin/CutPlane.h b/Plugin/CutPlane.h index c8cf5747dbbd52f4313938584fed4f5b5d1b8578..778b3e47a546156c73584a0d052cedcc0867fa29 100644 --- a/Plugin/CutPlane.h +++ b/Plugin/CutPlane.h @@ -22,6 +22,10 @@ class GMSH_CutPlanePlugin : public GMSH_LevelsetPlugin public: GMSH_CutPlanePlugin(){} std::string getName() const { return "CutPlane"; } + std::string getShortHelp() const + { + return "Cut with the plane A*X + B*Y + C*Z + D = 0"; + } std::string getHelp() const; int getNbOptions() const; StringXNumber *getOption(int iopt); diff --git a/Plugin/CutSphere.h b/Plugin/CutSphere.h index ec634d64e3ed22ed7239f0fb2a787400d9768a8b..f5746bf54c0a26d73d3ff31b6ac4619c490b5fad 100644 --- a/Plugin/CutSphere.h +++ b/Plugin/CutSphere.h @@ -21,6 +21,10 @@ class GMSH_CutSpherePlugin : public GMSH_LevelsetPlugin public: GMSH_CutSpherePlugin(){} std::string getName() const { return "CutSphere"; } + std::string getShortHelp() const + { + return "Cut with a sphere"; + } std::string getHelp() const; int getNbOptions() const; StringXNumber *getOption(int iopt); diff --git a/Plugin/Divergence.h b/Plugin/Divergence.h index d100c25c7d39032cd9c8996641db2ae0f4074e83..d5b8fc87652815503d3739c41a7cfd8738c4c592 100644 --- a/Plugin/Divergence.h +++ b/Plugin/Divergence.h @@ -18,6 +18,10 @@ class GMSH_DivergencePlugin : public GMSH_PostPlugin public: GMSH_DivergencePlugin(){} std::string getName() const { return "Divergence"; } + std::string getShortHelp() const + { + return "Compute the divergence of a vector view"; + } std::string getHelp() const; int getNbOptions() const; StringXNumber *getOption(int iopt); diff --git a/Plugin/Eigenvalues.h b/Plugin/Eigenvalues.h index 219ce4238aa826143e7cc9144f70f0522942e7ae..ad2e4603c2f6bb848600bbc9af4ed786c4d761fd 100644 --- a/Plugin/Eigenvalues.h +++ b/Plugin/Eigenvalues.h @@ -18,6 +18,10 @@ class GMSH_EigenvaluesPlugin : public GMSH_PostPlugin public: GMSH_EigenvaluesPlugin(){} std::string getName() const { return "Eigenvalues"; } + std::string getShortHelp() const + { + return "Compute eigenvalues of a tensor view"; + } std::string getHelp() const; int getNbOptions() const; StringXNumber *getOption(int iopt); diff --git a/Plugin/Eigenvectors.h b/Plugin/Eigenvectors.h index b1a89b09db1b2b96bd9c7fa404d18e0359b652f2..7a9c4e361bd271cabd40473caa220cef3d85ed54 100644 --- a/Plugin/Eigenvectors.h +++ b/Plugin/Eigenvectors.h @@ -18,6 +18,10 @@ class GMSH_EigenvectorsPlugin : public GMSH_PostPlugin public: GMSH_EigenvectorsPlugin(){} std::string getName() const { return "Eigenvectors"; } + std::string getShortHelp() const + { + return "Compute eigenvectors of a tensor view"; + } std::string getHelp() const; int getNbOptions() const; StringXNumber *getOption(int iopt); diff --git a/Plugin/ExtractEdges.cpp b/Plugin/ExtractEdges.cpp deleted file mode 100644 index 88498748415118411ebb4683434e33a4737de1e1..0000000000000000000000000000000000000000 --- a/Plugin/ExtractEdges.cpp +++ /dev/null @@ -1,65 +0,0 @@ -// Gmsh - Copyright (C) 1997-2009 C. Geuzaine, J.-F. Remacle -// -// See the LICENSE.txt file for license information. Please report all -// bugs and problems to <gmsh@geuz.org>. - -#include "ExtractEdges.h" - -StringXNumber ExtractEdgesOptions_Number[] = { - {GMSH_FULLRC, "Angle", NULL, 22.}, - {GMSH_FULLRC, "iView", NULL, -1.} -}; - -extern "C" -{ - GMSH_Plugin *GMSH_RegisterExtractEdgesPlugin() - { - return new GMSH_ExtractEdgesPlugin(); - } -} - -std::string GMSH_ExtractEdgesPlugin::getHelp() const -{ - return "Plugin(ExtractEdges) extracts the geometry edges\n" - "from the surface view `iView', using `Angle' as\n" - "the dihedral angle tolerance. If `iView' < 0, then\n" - "plugin is run on the current view.\n" - "\n" - "Plugin(ExtractEdges) creates one new view.\n"; -} - -int GMSH_ExtractEdgesPlugin::getNbOptions() const -{ - return sizeof(ExtractEdgesOptions_Number) / sizeof(StringXNumber); -} - -StringXNumber *GMSH_ExtractEdgesPlugin::getOption(int iopt) -{ - return &ExtractEdgesOptions_Number[iopt]; -} - -PView *GMSH_ExtractEdgesPlugin::execute(PView *v) -{ - int iView = (int)ExtractEdgesOptions_Number[1].def; - //double angle = ExtractEdgesOptions_Number[0].def; - - PView *v1 = getView(iView, v); - if(!v1) return v; - - PViewData *data1 = v1->getData(); - - PView *v2 = new PView(); - PViewDataList *data2 = getDataList(v2); - - //BDS_Mesh bds; - //bds.import_view(v1, CTX::instance()->lc * 1.e-12); - //bds.classify(angle * M_PI / 180.); - - Msg::Error("classify(angle, edge_prolongation) must be reinterfaced"); - - data2->setName(data1->getName() + "_ExtractEdges"); - data2->setFileName(data1->getName() + "_ExtractEdges.pos"); - data2->finalize(); - - return v2; -} diff --git a/Plugin/ExtractEdges.h b/Plugin/ExtractEdges.h deleted file mode 100644 index 443be94e5b2fa2cef0958e76b436e4f974e8b965..0000000000000000000000000000000000000000 --- a/Plugin/ExtractEdges.h +++ /dev/null @@ -1,27 +0,0 @@ -// Gmsh - Copyright (C) 1997-2009 C. Geuzaine, J.-F. Remacle -// -// See the LICENSE.txt file for license information. Please report all -// bugs and problems to <gmsh@geuz.org>. - -#ifndef _EXTRACT_EDGES_H_ -#define _EXTRACT_EDGES_H_ - -#include "Plugin.h" - -extern "C" -{ - GMSH_Plugin *GMSH_RegisterExtractEdgesPlugin(); -} - -class GMSH_ExtractEdgesPlugin : public GMSH_PostPlugin -{ - public: - GMSH_ExtractEdgesPlugin(){} - std::string getName() const { return "ExtractEdges"; } - std::string getHelp() const; - int getNbOptions() const; - StringXNumber* getOption(int iopt); - PView *execute(PView *); -}; - -#endif diff --git a/Plugin/ExtractElements.h b/Plugin/ExtractElements.h index 66611d0219e3e14d643bdf0d01fcc209cb8b5037..1d1405bed3b00b2b58f1bb4c9ea86f2f0dc5f526 100644 --- a/Plugin/ExtractElements.h +++ b/Plugin/ExtractElements.h @@ -18,6 +18,10 @@ class GMSH_ExtractElementsPlugin : public GMSH_PostPlugin public: GMSH_ExtractElementsPlugin(){} std::string getName() const { return "ExtractElements"; } + std::string getShortHelp() const + { + return "Extract elements in given value range"; + } std::string getHelp() const; int getNbOptions() const; StringXNumber* getOption(int iopt); diff --git a/Plugin/FieldView.h b/Plugin/FieldView.h index b381159e027c7d06536fd714c6b953904ee25d70..3d60a0bb5cd19f5a38d2dc381303ca6f2dd2e4d9 100644 --- a/Plugin/FieldView.h +++ b/Plugin/FieldView.h @@ -17,6 +17,10 @@ class GMSH_FieldViewPlugin : public GMSH_PostPlugin { public: std::string getName() const { return "FieldView"; } + std::string getShortHelp() const + { + return "Visualize background mesh field"; + } std::string getHelp() const; std::string getAuthor() const { return "J. Lambrechts"; } int getNbOptions() const; diff --git a/Plugin/GSHHS.cpp b/Plugin/GSHHS.cpp index ce67809a0f8c1a03f9f69e53127a3baae04fd7f8..004b60aaf530ee71623fdbae079df040daaa4763 100644 --- a/Plugin/GSHHS.cpp +++ b/Plugin/GSHHS.cpp @@ -877,6 +877,10 @@ public: } }; std::string getName() const { return "GSHHS"; } + std::string getShortHelp() const + { + return "Import and process GSHHS data sets"; + } std::string getHelp() const; std::string getAuthor() const { return "J. Lambrechts"; } int getNbOptions() const; diff --git a/Plugin/Gradient.h b/Plugin/Gradient.h index 0bf3355901775bf7d828230cd0d8e76af489ccd4..fe556c09049dc7f4413a9d025c833983acf97a64 100644 --- a/Plugin/Gradient.h +++ b/Plugin/Gradient.h @@ -18,6 +18,10 @@ class GMSH_GradientPlugin : public GMSH_PostPlugin public: GMSH_GradientPlugin(){} std::string getName() const { return "Gradient"; } + std::string getShortHelp() const + { + return "Compute the gradient of a scalar view"; + } std::string getHelp() const; int getNbOptions() const; StringXNumber *getOption(int iopt); diff --git a/Plugin/HarmonicToTime.h b/Plugin/HarmonicToTime.h index df6cc92ef99eddb053e45972529a91f582d29930..5bbb7324273d9a0bb24f2c3f60bb9bec92fefca2 100644 --- a/Plugin/HarmonicToTime.h +++ b/Plugin/HarmonicToTime.h @@ -18,6 +18,10 @@ class GMSH_HarmonicToTimePlugin : public GMSH_PostPlugin public: GMSH_HarmonicToTimePlugin(){} std::string getName() const { return "HarmonicToTime"; } + std::string getShortHelp() const + { + return "Transform harmonic data into time domain"; + } std::string getHelp() const; int getNbOptions() const; StringXNumber* getOption(int iopt); diff --git a/Plugin/HomologyComputation.cpp b/Plugin/HomologyComputation.cpp index 2b58529890fcc362b7e91f450df2e011ad4a7eb1..523744929cad12599d1c16b261b46bb37c6c64af 100644 --- a/Plugin/HomologyComputation.cpp +++ b/Plugin/HomologyComputation.cpp @@ -39,10 +39,10 @@ extern "C" std::string GMSH_HomologyComputationPlugin::getHelp() const { - return "Plugin(HomologyComputation) computes generators \n" + return "Plugin(Homology) computes generators \n" "for (relative) homology groups and their thick cuts. \n" "\n" - "Plugin(HomologyComputation) creates new views.\n"; + "Plugin(Homology) creates new views.\n"; } int GMSH_HomologyComputationPlugin::getNbOptions() const diff --git a/Plugin/HomologyComputation.h b/Plugin/HomologyComputation.h index a792885670f32488adcdbe78d0b9c1ce714645e3..3029ff0fc3d81f94690b59500304bbf071151532 100644 --- a/Plugin/HomologyComputation.h +++ b/Plugin/HomologyComputation.h @@ -22,7 +22,11 @@ class GMSH_HomologyComputationPlugin : public GMSH_PostPlugin { public: GMSH_HomologyComputationPlugin(){} - std::string getName() const { return "HomologyComputation"; } + std::string getName() const { return "Homology"; } + std::string getShortHelp() const + { + return "Compute relative homology groups"; + } std::string getHelp() const; std::string getAuthor() const { return "M. Pellikka"; } int getNbOptions() const; diff --git a/Plugin/Integrate.h b/Plugin/Integrate.h index 1433e5f0965de469e1fa48f0d768ae58e12f666e..8b163e92ec20a718c7ae8038a119a2632afc2aac 100644 --- a/Plugin/Integrate.h +++ b/Plugin/Integrate.h @@ -18,6 +18,10 @@ class GMSH_IntegratePlugin : public GMSH_PostPlugin public: GMSH_IntegratePlugin(){} std::string getName() const { return "Integrate"; } + std::string getShortHelp() const + { + return "Integrate data"; + } std::string getHelp() const; int getNbOptions() const; StringXNumber* getOption(int iopt); diff --git a/Plugin/CutMap.cpp b/Plugin/Isosurface.cpp similarity index 51% rename from Plugin/CutMap.cpp rename to Plugin/Isosurface.cpp index a92f18870857a5ffd0e0ecc47140af5ceb6a24a7..364df957070f652f03450babc9bc7cb5e1ae1064 100644 --- a/Plugin/CutMap.cpp +++ b/Plugin/Isosurface.cpp @@ -3,32 +3,32 @@ // See the LICENSE.txt file for license information. Please report all // bugs and problems to <gmsh@geuz.org>. -#include "CutMap.h" +#include "Isosurface.h" #include "Context.h" -StringXNumber CutMapOptions_Number[] = { - {GMSH_FULLRC, "A", GMSH_CutMapPlugin::callbackA, 0.}, +StringXNumber IsosurfaceOptions_Number[] = { + {GMSH_FULLRC, "Value", GMSH_IsosurfacePlugin::callbackValue, 0.}, {GMSH_FULLRC, "dTimeStep", NULL, -1.}, {GMSH_FULLRC, "dView", NULL, -1.}, - {GMSH_FULLRC, "ExtractVolume", GMSH_CutMapPlugin::callbackVol, 0.}, - {GMSH_FULLRC, "RecurLevel", GMSH_CutMapPlugin::callbackRecur, 4}, - {GMSH_FULLRC, "TargetError", GMSH_CutMapPlugin::callbackTarget, 0}, + {GMSH_FULLRC, "ExtractVolume", GMSH_IsosurfacePlugin::callbackVol, 0.}, + {GMSH_FULLRC, "RecurLevel", GMSH_IsosurfacePlugin::callbackRecur, 4}, + {GMSH_FULLRC, "TargetError", GMSH_IsosurfacePlugin::callbackTarget, 0}, {GMSH_FULLRC, "iView", NULL, -1.} }; extern "C" { - GMSH_Plugin *GMSH_RegisterCutMapPlugin() + GMSH_Plugin *GMSH_RegisterIsosurfacePlugin() { - return new GMSH_CutMapPlugin(); + return new GMSH_IsosurfacePlugin(); } } -double GMSH_CutMapPlugin::callbackA(int num, int action, double value) +double GMSH_IsosurfacePlugin::callbackValue(int num, int action, double value) { double min = 0., max = 1.; if(action > 0){ - int iview = (int)CutMapOptions_Number[6].def; + int iview = (int)IsosurfaceOptions_Number[6].def; if(iview < 0) iview = num; if(iview >= 0 && iview < (int)PView::list.size()){ min = PView::list[iview]->getData()->getMin(); @@ -44,7 +44,7 @@ double GMSH_CutMapPlugin::callbackA(int num, int action, double value) return 0.; } -double GMSH_CutMapPlugin::callbackVol(int num, int action, double value) +double GMSH_IsosurfacePlugin::callbackVol(int num, int action, double value) { switch(action){ // configure the input field case 1: return 1.; @@ -55,7 +55,7 @@ double GMSH_CutMapPlugin::callbackVol(int num, int action, double value) return 0.; } -double GMSH_CutMapPlugin::callbackRecur(int num, int action, double value) +double GMSH_IsosurfacePlugin::callbackRecur(int num, int action, double value) { switch(action){ // configure the input field case 1: return 1.; @@ -66,7 +66,7 @@ double GMSH_CutMapPlugin::callbackRecur(int num, int action, double value) return 0.; } -double GMSH_CutMapPlugin::callbackTarget(int num, int action, double value) +double GMSH_IsosurfacePlugin::callbackTarget(int num, int action, double value) { switch(action){ // configure the input field case 1: return 0.01; @@ -77,10 +77,10 @@ double GMSH_CutMapPlugin::callbackTarget(int num, int action, double value) return 0.; } -std::string GMSH_CutMapPlugin::getHelp() const +std::string GMSH_IsosurfacePlugin::getHelp() const { - return "Plugin(CutMap) extracts the isosurface of value\n" - "`A' from the view `iView' and draws the\n" + return "Plugin(Isosurface) extracts the isosurface of value\n" + "`Value' from the view `iView' and draws the\n" "`dTimeStep'-th value of the view `dView' on the\n" "isosurface. If `iView' < 0, the plugin is run\n" "on the current view. If `dTimeStep' < 0, the\n" @@ -90,39 +90,39 @@ std::string GMSH_CutMapPlugin::getHelp() const "If `ExtractVolume' is nonzero, the plugin\n" "extracts the isovolume with values greater (if\n" "`ExtractVolume' > 0) or smaller (if `ExtractVolume'\n" - "< 0) than the isosurface `A'.\n" + "< 0) than the isosurface `Value'.\n" "\n" - "Plugin(CutMap) creates as many views as there\n" + "Plugin(Isosurface) creates as many views as there\n" "are time steps in `iView'.\n"; } -int GMSH_CutMapPlugin::getNbOptions() const +int GMSH_IsosurfacePlugin::getNbOptions() const { - return sizeof(CutMapOptions_Number) / sizeof(StringXNumber); + return sizeof(IsosurfaceOptions_Number) / sizeof(StringXNumber); } -StringXNumber *GMSH_CutMapPlugin::getOption(int iopt) +StringXNumber *GMSH_IsosurfacePlugin::getOption(int iopt) { - return &CutMapOptions_Number[iopt]; + return &IsosurfaceOptions_Number[iopt]; } -double GMSH_CutMapPlugin::levelset(double x, double y, double z, double val) const +double GMSH_IsosurfacePlugin::levelset(double x, double y, double z, double val) const { - // we must look into the map for Map(x,y,z) - A + // we must look into the map for Map(x,y,z) - Value // this is the case when the map is the same as the view, - // the result is the extraction of isovalue A - return val - CutMapOptions_Number[0].def; + // the result is the extraction of isovalue Value + return val - IsosurfaceOptions_Number[0].def; } -PView *GMSH_CutMapPlugin::execute(PView *v) +PView *GMSH_IsosurfacePlugin::execute(PView *v) { - int iView = (int)CutMapOptions_Number[6].def; + int iView = (int)IsosurfaceOptions_Number[6].def; _valueIndependent = 0; - _valueView = (int)CutMapOptions_Number[2].def; - _valueTimeStep = (int)CutMapOptions_Number[1].def; - _extractVolume = (int)CutMapOptions_Number[3].def; - _recurLevel = (int)CutMapOptions_Number[4].def; - _targetError = CutMapOptions_Number[5].def; + _valueView = (int)IsosurfaceOptions_Number[2].def; + _valueTimeStep = (int)IsosurfaceOptions_Number[1].def; + _extractVolume = (int)IsosurfaceOptions_Number[3].def; + _recurLevel = (int)IsosurfaceOptions_Number[4].def; + _targetError = IsosurfaceOptions_Number[5].def; _orientation = GMSH_LevelsetPlugin::MAP; PView *v1 = getView(iView, v); diff --git a/Plugin/CutMap.h b/Plugin/Isosurface.h similarity index 56% rename from Plugin/CutMap.h rename to Plugin/Isosurface.h index 6ca74cf5795d59f7ae750a26b8667ed6b647f528..86dfeeac2e0003f96caf4e4d95af09dfe84d7fc5 100644 --- a/Plugin/CutMap.h +++ b/Plugin/Isosurface.h @@ -3,27 +3,31 @@ // See the LICENSE.txt file for license information. Please report all // bugs and problems to <gmsh@geuz.org>. -#ifndef _CUT_MAP_H_ -#define _CUT_MAP_H_ +#ifndef _ISOSURFACE_H_ +#define _ISOSURFACE_H_ #include "Levelset.h" extern "C" { - GMSH_Plugin *GMSH_RegisterCutMapPlugin(); + GMSH_Plugin *GMSH_RegisterIsosurfacePlugin(); } -class GMSH_CutMapPlugin : public GMSH_LevelsetPlugin +class GMSH_IsosurfacePlugin : public GMSH_LevelsetPlugin { double levelset(double x, double y, double z, double val) const; public: - GMSH_CutMapPlugin(){} - std::string getName() const { return "CutMap"; } + GMSH_IsosurfacePlugin(){} + std::string getShortHelp() const + { + return "Extract a single isosurface"; + } + std::string getName() const { return "Isosurface"; } std::string getHelp() const; int getNbOptions() const; - StringXNumber *getOption(int iopt); + StringXNumber *getOption(int iopt); PView *execute(PView *); - static double callbackA(int, int, double); + static double callbackValue(int, int, double); static double callbackVol(int, int, double); static double callbackRecur(int, int, double); static double callbackTarget(int, int, double); diff --git a/Plugin/Lambda2.h b/Plugin/Lambda2.h index f6b4aa586a96adcc587d2c1048c6487d942a1146..8c97ba6fbb5a8fd2c414dd6b7306bec9c195fac4 100644 --- a/Plugin/Lambda2.h +++ b/Plugin/Lambda2.h @@ -18,6 +18,10 @@ class GMSH_Lambda2Plugin : public GMSH_PostPlugin public: GMSH_Lambda2Plugin(){} std::string getName() const { return "Lambda2"; } + std::string getShortHelp() const + { + return "Detect vortices"; + } std::string getHelp() const; std::string getAuthor() const { return "E. Marchandise"; } int getNbOptions() const; diff --git a/Plugin/LongitudeLatitude.cpp b/Plugin/LongitudeLatitude.cpp index 2838fb322db539b6bd2c13c88ce7369c3eed5210..4b48d90816a15846c2f8e3b5cec2648e55c899fd 100644 --- a/Plugin/LongitudeLatitude.cpp +++ b/Plugin/LongitudeLatitude.cpp @@ -20,8 +20,8 @@ extern "C" std::string GMSH_LongituteLatitudePlugin::getHelp() const { - return "Plugin(LongituteLatitude) Project the view `iView'\n" - "in Longitude-Latitude. If `iView' < 0, the plugin\n" + return "Plugin(LongituteLatitude) projects the view `iView'\n" + "in longitude-latitude. If `iView' < 0, the plugin\n" "is run on the current view.\n" "\n" "Plugin(LongituteLatitude) is executed in place.\n"; diff --git a/Plugin/LongitudeLatitude.h b/Plugin/LongitudeLatitude.h index 8c44703db34d8ab2b02c96af48d34a4b36fbfe67..f5c34751f7cc673933cf5cb2ae0f96023509227e 100644 --- a/Plugin/LongitudeLatitude.h +++ b/Plugin/LongitudeLatitude.h @@ -17,6 +17,10 @@ class GMSH_LongituteLatitudePlugin : public GMSH_PostPlugin { public: std::string getName() const { return "LongitudeLatitude"; } + std::string getShortHelp() const + { + return "Project in longitude-latitude"; + } std::string getHelp() const; std::string getAuthor() const { return "J. Lambrechts"; } int getNbOptions() const; diff --git a/Plugin/MakeSimplex.h b/Plugin/MakeSimplex.h index e9ec5ca910cb6713baf0a4919c75ccf689ec0817..a030ef19b1e0781c6a11d58f1eacdb20fd223a9a 100644 --- a/Plugin/MakeSimplex.h +++ b/Plugin/MakeSimplex.h @@ -18,6 +18,10 @@ class GMSH_MakeSimplexPlugin : public GMSH_PostPlugin public: GMSH_MakeSimplexPlugin(){} std::string getName() const { return "MakeSimplex"; } + std::string getShortHelp() const + { + return "Transform quad/hex/prisms into tri/tets"; + } std::string getHelp() const; int getNbOptions() const; StringXNumber* getOption(int iopt); diff --git a/Plugin/Extract.cpp b/Plugin/MathEval.cpp similarity index 81% rename from Plugin/Extract.cpp rename to Plugin/MathEval.cpp index 8d8101ffc63a079490fc186d2f6ff29bbc1a1860..9b4dde93e08aa95340fcaa3d08b668ea1cb6e914 100644 --- a/Plugin/Extract.cpp +++ b/Plugin/MathEval.cpp @@ -5,18 +5,18 @@ #include "GmshConfig.h" #include "GmshDefines.h" -#include "Extract.h" +#include "MathEval.h" #include "mathEvaluator.h" #include "OctreePost.h" -StringXNumber ExtractOptions_Number[] = { +StringXNumber MathEvalOptions_Number[] = { {GMSH_FULLRC, "TimeStep", NULL, -1.}, {GMSH_FULLRC, "iView", NULL, -1.}, {GMSH_FULLRC, "ExternalView", NULL, -1.}, {GMSH_FULLRC, "ExternalTimeStep", NULL, -1.} }; -StringXString ExtractOptions_String[] = { +StringXString MathEvalOptions_String[] = { {GMSH_FULLRC, "Expression0", NULL, "Sqrt(v0^2+v1^2+v2^2)"}, {GMSH_FULLRC, "Expression1", NULL, ""}, {GMSH_FULLRC, "Expression2", NULL, ""}, @@ -30,17 +30,16 @@ StringXString ExtractOptions_String[] = { extern "C" { - GMSH_Plugin *GMSH_RegisterExtractPlugin() + GMSH_Plugin *GMSH_RegisterMathEvalPlugin() { - return new GMSH_ExtractPlugin(); + return new GMSH_MathEvalPlugin(); } } -std::string GMSH_ExtractPlugin::getHelp() const +std::string GMSH_MathEvalPlugin::getHelp() const { - return "Plugin(Extract) extracts a combination of\n" - "components from the `TimeStep'th time step\n" - "in the view `iView'. If only `Expression0' is\n" + return "Plugin(MathEval) creates a new view using\n" + "data from `iView'. If only `Expression0' is\n" "given (and `Expression1', ..., `Expression8' are\n" "all empty), the plugin creates a scalar view.\n" "If `Expression0', `Expression1' and/or\n" @@ -51,35 +50,35 @@ std::string GMSH_ExtractPlugin::getHelp() const "mathematical functions (Exp, Log, Sqrt, Sin, Cos,\n" "Fabs, etc.) and operators (+, -, *, /, ^), all\n" "expressions can contain the symbols v0, v1, v2,\n" - " ..., vn, which represent the n components of the\n" - "field, w0, w1, w2,..., wn which represent the n components\n" - "of the external view and the symbols x, y and z,\n" - "which represent the three spatial coordinates.\n" + " ..., vn, which represent the n components in\n" + "`iView', w0, w1, w2,..., wn which represent the n\n" + "components of `ExternalView' and the symbols x,\n" + "y and z, which represent the three spatial coordinates.\n" "If `TimeStep' < 0, the plugin extracts data from \n" "all the time steps in the view.\n" "If `iView' < 0, the plugin is run on the current view.\n" "\n" - "Plugin(Extract) creates one new view.\n"; + "Plugin(MathEval) creates one new view.\n"; } -int GMSH_ExtractPlugin::getNbOptions() const +int GMSH_MathEvalPlugin::getNbOptions() const { - return sizeof(ExtractOptions_Number) / sizeof(StringXNumber); + return sizeof(MathEvalOptions_Number) / sizeof(StringXNumber); } -StringXNumber *GMSH_ExtractPlugin::getOption(int iopt) +StringXNumber *GMSH_MathEvalPlugin::getOption(int iopt) { - return &ExtractOptions_Number[iopt]; + return &MathEvalOptions_Number[iopt]; } -int GMSH_ExtractPlugin::getNbOptionsStr() const +int GMSH_MathEvalPlugin::getNbOptionsStr() const { - return sizeof(ExtractOptions_String) / sizeof(StringXString); + return sizeof(MathEvalOptions_String) / sizeof(StringXString); } -StringXString *GMSH_ExtractPlugin::getOptionStr(int iopt) +StringXString *GMSH_MathEvalPlugin::getOptionStr(int iopt) { - return &ExtractOptions_String[iopt]; + return &MathEvalOptions_String[iopt]; } static std::vector<double> *incrementList(PViewDataList *data, int numComp, @@ -130,21 +129,21 @@ static std::vector<double> *incrementList(PViewDataList *data, int numComp, return 0; } -PView *GMSH_ExtractPlugin::execute(PView *view) +PView *GMSH_MathEvalPlugin::execute(PView *view) { - int timeStep = (int)ExtractOptions_Number[0].def; - int iView = (int)ExtractOptions_Number[1].def; - int iExternalView = (int)ExtractOptions_Number[2].def; - int stepExternal = (int)ExtractOptions_Number[3].def; + int timeStep = (int)MathEvalOptions_Number[0].def; + int iView = (int)MathEvalOptions_Number[1].def; + int iExternalView = (int)MathEvalOptions_Number[2].def; + int stepExternal = (int)MathEvalOptions_Number[3].def; std::vector<std::string> expr(9); - for(int i = 0; i < 9; i++) expr[i] = ExtractOptions_String[i].def; + for(int i = 0; i < 9; i++) expr[i] = MathEvalOptions_String[i].def; PView *v1 = getView(iView, view); if(!v1) return view; PViewData *data1 = v1->getData(); if(data1->hasMultipleMeshes()){ - Msg::Error("Extract plugin cannot be applied to multi-mesh views"); + Msg::Error("MathEval plugin cannot be applied to multi-mesh views"); return view; } PView *externalView = NULL; @@ -154,12 +153,12 @@ PView *GMSH_ExtractPlugin::execute(PView *view) if(iExternalView>=0){ externalView = getView(iExternalView, view); if(!externalView){ - Msg::Error("Extract plugin cannot found external view %i",iExternalView); + Msg::Error("MathEval plugin cannot found external view %i",iExternalView); return view; } dataExternal = externalView->getData(); if(dataExternal->hasMultipleMeshes()){ - Msg::Error("Extract plugin cannot be applied to multi-mesh views"); + Msg::Error("MathEval plugin cannot be applied to multi-mesh views"); return view; } if((data1->getNumEntities() != dataExternal->getNumEntities()) || @@ -257,8 +256,8 @@ PView *GMSH_ExtractPlugin::execute(PView *view) else data2->Time.push_back(data1->getTime(timeStep)); - data2->setName(data1->getName() + "_Extract"); - data2->setFileName(data1->getName() + "_Extract.pos"); + data2->setName(data1->getName() + "_MathEval"); + data2->setFileName(data1->getName() + "_MathEval.pos"); data2->finalize(); return v2; diff --git a/Plugin/Extract.h b/Plugin/MathEval.h similarity index 57% rename from Plugin/Extract.h rename to Plugin/MathEval.h index 142e1e7f583874c8e2b8d70a51926e94c49c6c17..3a46e979fb6417b1dbd43dfb79b685f7a4f9c829 100644 --- a/Plugin/Extract.h +++ b/Plugin/MathEval.h @@ -3,21 +3,25 @@ // See the LICENSE.txt file for license information. Please report all // bugs and problems to <gmsh@geuz.org>. -#ifndef _EXTRACT_H_ -#define _EXTRACT_H_ +#ifndef _MATH_EVAL_H_ +#define _MATH_EVAL_H_ #include "Plugin.h" extern "C" { - GMSH_Plugin *GMSH_RegisterExtractPlugin(); + GMSH_Plugin *GMSH_RegisterMathEvalPlugin(); } -class GMSH_ExtractPlugin : public GMSH_PostPlugin +class GMSH_MathEvalPlugin : public GMSH_PostPlugin { public: - GMSH_ExtractPlugin(){} - std::string getName() const { return "Extract"; } + GMSH_MathEvalPlugin(){} + std::string getName() const { return "MathEval"; } + std::string getShortHelp() const + { + return "Create a view using mathematical expressions"; + } std::string getHelp() const; int getNbOptions() const; StringXNumber* getOption(int iopt); diff --git a/Plugin/Evaluate.cpp b/Plugin/ModifyComponent.cpp similarity index 83% rename from Plugin/Evaluate.cpp rename to Plugin/ModifyComponent.cpp index e85ed2b24f685ce6b0f7e4629c4f7fd6207d5ea4..4a92d717deec1238bca1fa1b154b5e7b49ac888b 100644 --- a/Plugin/Evaluate.cpp +++ b/Plugin/ModifyComponent.cpp @@ -5,11 +5,11 @@ #include <vector> #include "GmshConfig.h" -#include "Evaluate.h" +#include "ModifyComponent.h" #include "OctreePost.h" #include "mathEvaluator.h" -StringXNumber EvaluateOptions_Number[] = { +StringXNumber ModifyComponentOptions_Number[] = { {GMSH_FULLRC, "Component", NULL, -1.}, {GMSH_FULLRC, "TimeStep", NULL, -1.}, {GMSH_FULLRC, "ExternalView", NULL, -1.}, @@ -17,21 +17,21 @@ StringXNumber EvaluateOptions_Number[] = { {GMSH_FULLRC, "iView", NULL, -1.} }; -StringXString EvaluateOptions_String[] = { +StringXString ModifyComponentOptions_String[] = { {GMSH_FULLRC, "Expression", NULL, "v0*Sin(x)"} }; extern "C" { - GMSH_Plugin *GMSH_RegisterEvaluatePlugin() + GMSH_Plugin *GMSH_RegisterModifyComponentPlugin() { - return new GMSH_EvaluatePlugin(); + return new GMSH_ModifyComponentPlugin(); } } -std::string GMSH_EvaluatePlugin::getHelp() const +std::string GMSH_ModifyComponentPlugin::getHelp() const { - return "Plugin(Evaluate) sets the `Component'-th\n" + return "Plugin(ModifyComponent) sets the `Component'-th\n" "component of the `TimeStep'-th time step in the\n" "view `iView' to the expression `Expression'.\n" "`Expression' can contain:\n" @@ -75,36 +75,36 @@ std::string GMSH_EvaluatePlugin::getHelp() const "`ExternalView' < 0, the plugin uses `iView'\n" "instead.\n" "\n" - "Plugin(Evaluate) is executed in-place.\n"; + "Plugin(ModifyComponent) is executed in-place.\n"; } -int GMSH_EvaluatePlugin::getNbOptions() const +int GMSH_ModifyComponentPlugin::getNbOptions() const { - return sizeof(EvaluateOptions_Number) / sizeof(StringXNumber); + return sizeof(ModifyComponentOptions_Number) / sizeof(StringXNumber); } -StringXNumber *GMSH_EvaluatePlugin::getOption(int iopt) +StringXNumber *GMSH_ModifyComponentPlugin::getOption(int iopt) { - return &EvaluateOptions_Number[iopt]; + return &ModifyComponentOptions_Number[iopt]; } -int GMSH_EvaluatePlugin::getNbOptionsStr() const +int GMSH_ModifyComponentPlugin::getNbOptionsStr() const { - return sizeof(EvaluateOptions_String) / sizeof(StringXString); + return sizeof(ModifyComponentOptions_String) / sizeof(StringXString); } -StringXString *GMSH_EvaluatePlugin::getOptionStr(int iopt) +StringXString *GMSH_ModifyComponentPlugin::getOptionStr(int iopt) { - return &EvaluateOptions_String[iopt]; + return &ModifyComponentOptions_String[iopt]; } -PView *GMSH_EvaluatePlugin::execute(PView *view) +PView *GMSH_ModifyComponentPlugin::execute(PView *view) { - int component = (int)EvaluateOptions_Number[0].def; - int timeStep = (int)EvaluateOptions_Number[1].def; - int externalView = (int)EvaluateOptions_Number[2].def; - int externalTimeStep = (int)EvaluateOptions_Number[3].def; - int iView = (int)EvaluateOptions_Number[4].def; + int component = (int)ModifyComponentOptions_Number[0].def; + int timeStep = (int)ModifyComponentOptions_Number[1].def; + int externalView = (int)ModifyComponentOptions_Number[2].def; + int externalTimeStep = (int)ModifyComponentOptions_Number[3].def; + int iView = (int)ModifyComponentOptions_Number[4].def; PView *v1 = getView(iView, view); if(!v1) return view; @@ -144,7 +144,7 @@ PView *GMSH_EvaluatePlugin::execute(PView *view) "w", "w0", "w1", "w2", "w3", "w4", "w5", "w6", "w7", "w8"}; unsigned int numVariables = sizeof(names) / sizeof(names[0]); std::vector<std::string> expressions(1), variables(numVariables); - expressions[0] = EvaluateOptions_String[0].def; + expressions[0] = ModifyComponentOptions_String[0].def; for(unsigned int i = 0; i < numVariables; i++) variables[i] = names[i]; mathEvaluator f(expressions, variables); if(expressions.empty()) return view; diff --git a/Plugin/Evaluate.h b/Plugin/ModifyComponent.h similarity index 54% rename from Plugin/Evaluate.h rename to Plugin/ModifyComponent.h index 0fb3207aee5b7c0cb1c7c76964eff9621612392f..fbea63668456b0c427faed49e5b44e636c5ee20e 100644 --- a/Plugin/Evaluate.h +++ b/Plugin/ModifyComponent.h @@ -3,21 +3,25 @@ // See the LICENSE.txt file for license information. Please report all // bugs and problems to <gmsh@geuz.org>. -#ifndef _EVALUATE_H_ -#define _EVALUATE_H_ +#ifndef _MODIFY_COMPONENT_H_ +#define _MODIFY_COMPONENT_H_ #include "Plugin.h" extern "C" { - GMSH_Plugin *GMSH_RegisterEvaluatePlugin(); + GMSH_Plugin *GMSH_RegisterModifyComponentPlugin(); } -class GMSH_EvaluatePlugin : public GMSH_PostPlugin +class GMSH_ModifyComponentPlugin : public GMSH_PostPlugin { public: - GMSH_EvaluatePlugin(){} - std::string getName() const { return "Evaluate"; } + GMSH_ModifyComponentPlugin(){} + std::string getName() const { return "ModifyComponent"; } + std::string getShortHelp() const + { + return "Modify a component using a mathematical expression"; + } std::string getHelp() const; int getNbOptions() const; StringXNumber* getOption(int iopt); diff --git a/Plugin/ModulusPhase.h b/Plugin/ModulusPhase.h index 7b739542089b6c6f6dd6a78235b95fa4e0c1bda1..dee8dfcb5800a6e1b9839dc86d25c529821669ad 100644 --- a/Plugin/ModulusPhase.h +++ b/Plugin/ModulusPhase.h @@ -18,6 +18,10 @@ class GMSH_ModulusPhasePlugin : public GMSH_PostPlugin public: GMSH_ModulusPhasePlugin(){} std::string getName() const { return "ModulusPhase"; } + std::string getShortHelp() const + { + return "Compute modulus/phase of a complex view"; + } std::string getHelp() const; int getNbOptions() const; StringXNumber *getOption(int iopt); diff --git a/Plugin/Particles.h b/Plugin/Particles.h index b960a17752d9ada78544da2dd397501a38e448ea..15a41a16443d34b005804b2a5401d6a26a7e38df 100644 --- a/Plugin/Particles.h +++ b/Plugin/Particles.h @@ -20,6 +20,10 @@ class GMSH_ParticlesPlugin : public GMSH_PostPlugin public: GMSH_ParticlesPlugin(){} std::string getName() const { return "Particles"; } + std::string getShortHelp() const + { + return "Compute particle trajectories in force field"; + } std::string getHelp() const; int getNbOptions() const; StringXNumber *getOption(int iopt); diff --git a/Plugin/Plugin.h b/Plugin/Plugin.h index 7af9b593236f9f304c9d3abf523aa4b67a08fd07..e5e38a80a738587b485a26126d466baf698545fd 100644 --- a/Plugin/Plugin.h +++ b/Plugin/Plugin.h @@ -46,6 +46,7 @@ class GMSH_Plugin // return plugin type, name and info virtual GMSH_PLUGIN_TYPE getType() const = 0; virtual std::string getName() const = 0; + virtual std::string getShortHelp() const = 0; virtual std::string getHelp() const = 0; virtual std::string getAuthor() const { return "C. Geuzaine, J.-F. Remacle"; } virtual std::string getCopyright() const { return "C. Geuzaine, J.-F. Remacle"; } diff --git a/Plugin/PluginManager.cpp b/Plugin/PluginManager.cpp index c3c1e1f7cff35582c7e8f53cab1c7dc1a3dc7cfd..e521cb0b7fd635b91689d4576c962f3c190170c0 100644 --- a/Plugin/PluginManager.cpp +++ b/Plugin/PluginManager.cpp @@ -10,7 +10,7 @@ #include "Context.h" #include "Plugin.h" #include "PluginManager.h" -#include "CutMap.h" +#include "Isosurface.h" #include "CutGrid.h" #include "StreamLines.h" #include "Particles.h" @@ -18,9 +18,8 @@ #include "CutParametric.h" #include "CutSphere.h" #include "Skin.h" -#include "Extract.h" +#include "MathEval.h" #include "ExtractElements.h" -#include "ExtractEdges.h" #include "HarmonicToTime.h" #include "ModulusPhase.h" #include "Integrate.h" @@ -40,7 +39,7 @@ #include "Eigenvectors.h" #include "Eigenvalues.h" #include "Lambda2.h" -#include "Evaluate.h" +#include "ModifyComponent.h" #include "Probe.h" #include "FieldView.h" #include "GSHHS.h" @@ -153,7 +152,7 @@ void PluginManager::registerDefaultPlugins() allPlugins.insert(std::pair<std::string, GMSH_Plugin*> ("CutGrid", GMSH_RegisterCutGridPlugin())); allPlugins.insert(std::pair<std::string, GMSH_Plugin*> - ("CutMap", GMSH_RegisterCutMapPlugin())); + ("Isosurface", GMSH_RegisterIsosurfacePlugin())); allPlugins.insert(std::pair<std::string, GMSH_Plugin*> ("CutPlane", GMSH_RegisterCutPlanePlugin())); allPlugins.insert(std::pair<std::string, GMSH_Plugin*> @@ -161,13 +160,13 @@ void PluginManager::registerDefaultPlugins() allPlugins.insert(std::pair<std::string, GMSH_Plugin*> ("Skin", GMSH_RegisterSkinPlugin())); allPlugins.insert(std::pair<std::string, GMSH_Plugin*> - ("Extract", GMSH_RegisterExtractPlugin())); + ("MathEval", GMSH_RegisterMathEvalPlugin())); + allPlugins.insert(std::pair<std::string, GMSH_Plugin*> + ("ModifyComponent", GMSH_RegisterModifyComponentPlugin())); allPlugins.insert(std::pair<std::string, GMSH_Plugin*> ("ExtractElements", GMSH_RegisterExtractElementsPlugin())); -#if 0 // waiting for BDS rewrite allPlugins.insert(std::pair<std::string, GMSH_Plugin*> - ("ExtractEdges", GMSH_RegisterExtractEdgesPlugin())); -#endif + ("CutParametric", GMSH_RegisterCutParametricPlugin())); allPlugins.insert(std::pair<std::string, GMSH_Plugin*> ("MakeSimplex", GMSH_RegisterMakeSimplexPlugin())); allPlugins.insert(std::pair<std::string, GMSH_Plugin*> @@ -208,19 +207,15 @@ void PluginManager::registerDefaultPlugins() ("FieldView", GMSH_RegisterFieldViewPlugin())); allPlugins.insert(std::pair<std::string, GMSH_Plugin*> ("Triangulate", GMSH_RegisterTriangulatePlugin())); + allPlugins.insert(std::pair<std::string, GMSH_Plugin*> + ("GSHHS", GMSH_RegisterGSHHSPlugin())); #if defined(HAVE_TETGEN) allPlugins.insert(std::pair<std::string, GMSH_Plugin*> ("Tetrahedralize", GMSH_RegisterTetrahedralizePlugin())); #endif - allPlugins.insert(std::pair<std::string, GMSH_Plugin*> - ("GSHHS", GMSH_RegisterGSHHSPlugin())); - allPlugins.insert(std::pair<std::string, GMSH_Plugin*> - ("Evaluate", GMSH_RegisterEvaluatePlugin())); - allPlugins.insert(std::pair<std::string, GMSH_Plugin*> - ("CutParametric", GMSH_RegisterCutParametricPlugin())); #if defined(HAVE_KBIPACK) allPlugins.insert(std::pair<std::string, GMSH_Plugin*> - ("HomologyComputation", GMSH_RegisterHomologyComputationPlugin())); + ("Homology", GMSH_RegisterHomologyComputationPlugin())); #endif } diff --git a/Plugin/Probe.h b/Plugin/Probe.h index 8a4eab7a7d380c18043b66a5485a66adb6c6af3f..43a7eb6f43f6d76019d50795eab45d2d62e1fa3d 100644 --- a/Plugin/Probe.h +++ b/Plugin/Probe.h @@ -21,6 +21,10 @@ class GMSH_ProbePlugin : public GMSH_PostPlugin public: GMSH_ProbePlugin(){} std::string getName() const { return "Probe"; } + std::string getShortHelp() const + { + return "Get value of a view at one given point"; + } std::string getHelp() const; int getNbOptions() const; StringXNumber *getOption(int iopt); diff --git a/Plugin/Remove.h b/Plugin/Remove.h index 7f3f5793a0bf9803db7a758a86481a4e3f871f68..bfb79e1578d6c84a8e9fac7f86021fedb3fb02d1 100644 --- a/Plugin/Remove.h +++ b/Plugin/Remove.h @@ -18,6 +18,10 @@ class GMSH_RemovePlugin : public GMSH_PostPlugin public: GMSH_RemovePlugin(){} std::string getName() const { return "Remove"; } + std::string getShortHelp() const + { + return "Remove selected data from a view"; + } std::string getHelp() const; int getNbOptions() const; StringXNumber *getOption(int iopt); diff --git a/Plugin/Skin.h b/Plugin/Skin.h index 150ca9e613c4380c11a1446371dff37a388ad26b..14568aa84560574b4f1a8737b30826daed0d4406 100644 --- a/Plugin/Skin.h +++ b/Plugin/Skin.h @@ -18,6 +18,10 @@ class GMSH_SkinPlugin : public GMSH_PostPlugin public: GMSH_SkinPlugin(){} std::string getName() const { return "Skin"; } + std::string getShortHelp() const + { + return "Extract boundary of a view"; + } std::string getHelp() const; int getNbOptions() const; StringXNumber *getOption(int iopt); diff --git a/Plugin/Smooth.h b/Plugin/Smooth.h index d53c57a36e18294cd6cff1edcc4d61a1c836b140..2deefe37b3bfde231873d2100399a526413a6fc2 100644 --- a/Plugin/Smooth.h +++ b/Plugin/Smooth.h @@ -18,6 +18,10 @@ class GMSH_SmoothPlugin : public GMSH_PostPlugin public: GMSH_SmoothPlugin(){} std::string getName() const { return "Smooth"; } + std::string getShortHelp() const + { + return "Apply nodal smoothing"; + } std::string getHelp() const; int getNbOptions() const; StringXNumber *getOption(int iopt); diff --git a/Plugin/SphericalRaise.h b/Plugin/SphericalRaise.h index 8dec8f7bddc2f5f561e237b4963e3369e2519dca..6070e7b3759423eb3e927759c8482424d910707a 100644 --- a/Plugin/SphericalRaise.h +++ b/Plugin/SphericalRaise.h @@ -18,6 +18,10 @@ class GMSH_SphericalRaisePlugin : public GMSH_PostPlugin public: GMSH_SphericalRaisePlugin(){} std::string getName() const { return "SphericalRaise"; } + std::string getShortHelp() const + { + return "Create spherical elevation plot"; + } std::string getHelp() const; int getNbOptions() const; StringXNumber *getOption(int iopt); diff --git a/Plugin/StreamLines.h b/Plugin/StreamLines.h index a3a480095138539aa255391365f83e51ab2cd01e..2d1b0db967ef22aa8ff4fe2b5fe84a0c2cda3caa 100644 --- a/Plugin/StreamLines.h +++ b/Plugin/StreamLines.h @@ -20,6 +20,10 @@ class GMSH_StreamLinesPlugin : public GMSH_PostPlugin public: GMSH_StreamLinesPlugin(){} std::string getName() const { return "StreamLines"; } + std::string getShortHelp() const + { + return "Compute particle trajectories in velocity field"; + } std::string getHelp() const; int getNbOptions() const; StringXNumber *getOption(int iopt); diff --git a/Plugin/Tetrahedralize.h b/Plugin/Tetrahedralize.h index 0ee60cf10cea016eb8a52f4e8d78de78c97c09d4..527913b7c212fcddf1af1e83c04cfb5387c71cf6 100644 --- a/Plugin/Tetrahedralize.h +++ b/Plugin/Tetrahedralize.h @@ -18,6 +18,10 @@ class GMSH_TetrahedralizePlugin : public GMSH_PostPlugin public: GMSH_TetrahedralizePlugin(){} std::string getName() const { return "Tetrahedralize"; } + std::string getShortHelp() const + { + return "Mesh 3D point cloud"; + } std::string getHelp() const; int getNbOptions() const; StringXNumber* getOption(int iopt); diff --git a/Plugin/Transform.h b/Plugin/Transform.h index 2384d9bad3dd69f3b3f45e73351b9091e2a1624a..123a61d06f62c818c18d726ea67fe9ba81d00589 100644 --- a/Plugin/Transform.h +++ b/Plugin/Transform.h @@ -18,6 +18,10 @@ class GMSH_TransformPlugin : public GMSH_PostPlugin public: GMSH_TransformPlugin(){} std::string getName() const { return "Transform"; } + std::string getShortHelp() const + { + return "Apply simple geometrical transformation"; + } std::string getHelp() const; int getNbOptions() const; StringXNumber *getOption(int iopt); diff --git a/Plugin/Triangulate.h b/Plugin/Triangulate.h index 4b804c7ad09a0acabf5f236c05895e3e5e6df4c8..6fed20fe2eb440487587c95057713220499f319b 100644 --- a/Plugin/Triangulate.h +++ b/Plugin/Triangulate.h @@ -18,6 +18,10 @@ class GMSH_TriangulatePlugin : public GMSH_PostPlugin public: GMSH_TriangulatePlugin(){} std::string getName() const { return "Triangulate"; } + std::string getShortHelp() const + { + return "Mesh 2D point cloud"; + } std::string getHelp() const; int getNbOptions() const; StringXNumber* getOption(int iopt); diff --git a/Plugin/Warp.h b/Plugin/Warp.h index fbd8cee35da4dfb156f1ee9a88bad1bfb5427cfd..e2862a4c8eee69c3c04995ecf1a0c4fa5e652e04 100644 --- a/Plugin/Warp.h +++ b/Plugin/Warp.h @@ -18,6 +18,10 @@ class GMSH_WarpPlugin : public GMSH_PostPlugin public: GMSH_WarpPlugin(){} std::string getName() const { return "Warp"; } + std::string getShortHelp() const + { + return "Deform view using a vector field"; + } std::string getHelp() const; int getNbOptions() const; StringXNumber *getOption(int iopt); diff --git a/benchmarks/misc/bgmesh2d.geo b/benchmarks/misc/bgmesh2d.geo index 2d68270a13e086115f16e4f6f5b0d929859fb8d8..1003fe3af09fbebf58f0fc96722d90e3e7922a66 100644 --- a/benchmarks/misc/bgmesh2d.geo +++ b/benchmarks/misc/bgmesh2d.geo @@ -1890,6 +1890,6 @@ ST( 5.0004023e-01, 5.0000472e-01, 0, 5.0002530e-01, 5.0002198e-01, 0, 5.000 // Warning: you have a value of 0.0 as your mesh size somewhere in the // view above... Let's add an epsilon to make it disappear -Plugin(Evaluate).Expression = "v + 1.e-6"; -Plugin(Evaluate).Run; +Plugin(ModifyComponent).Expression = "v + 1.e-6"; +Plugin(ModifyComponent).Run; Background Mesh View[0]; diff --git a/doc/VERSIONS.txt b/doc/VERSIONS.txt index e5a5f39ebb687809a63c0b28b4ece852e971d3d6..582d4cfc921ede6c9d0e20705c0fff2eb7fe772b 100644 --- a/doc/VERSIONS.txt +++ b/doc/VERSIONS.txt @@ -2,7 +2,8 @@ geometrical entities (useful for remeshing); new option to force the type of views dynamically; bumped mesh version format to 2.2 (change in the meaning of the partion tags; this only affect partioned -meshes); small bug fixes and usability improvements. +meshes); renamed several post-processing plugins to clarify their +function; many small bug fixes and usability improvements. 2.4.2 (Sep 21, 2009): solver code refactoring + better IDE integration. diff --git a/tutorial/t9.geo b/tutorial/t9.geo index 424d23cb540b023ddae7496ed4498ec5e8168254..dcaeaa2f470ff4cd3a38401f1ab73149ccf3b5fc 100644 --- a/tutorial/t9.geo +++ b/tutorial/t9.geo @@ -10,7 +10,7 @@ // capabilities. For example, post-processing plugins can modify a // view, or create a new view based on previously loaded // views. Several default plugins are statically linked with Gmsh, -// e.g. CutMap, CutPlane, CutSphere, Skin, Transform or Smooth. +// e.g. Isosurface, CutPlane, CutSphere, Skin, Transform or Smooth. // Plugins can be controlled in the same way as other options: either // from the graphical interface (right click on the view button, then // `Plugins'), or from the command file. @@ -19,12 +19,12 @@ Include "view3.pos" ; -// We then set some options for the `CutMap' plugin (which extracts an -// isovalue surface from a 3D scalar view), and run it: +// We then set some options for the `Isosurface' plugin (which +// extracts an isosurface from a 3D scalar view), and run it: -Plugin(CutMap).A = 0.67 ; // iso-value level -Plugin(CutMap).iView = 0 ; // source view is View[0] -Plugin(CutMap).Run ; +Plugin(Isosurface).Value = 0.67 ; // iso-value level +Plugin(Isosurface).iView = 0 ; // source view is View[0] +Plugin(Isosurface).Run ; // We also set some options for the `CutPlane' plugin (which computes // a section of a 3D view), and then run it: