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

renamed many plugin options to make them easier to understand

parent c0307f3a
No related branches found
No related tags found
No related merge requests found
Showing
with 83 additions and 167 deletions
...@@ -112,7 +112,7 @@ static void add_scripting(GMSH_PostPlugin *p, PView *view) ...@@ -112,7 +112,7 @@ static void add_scripting(GMSH_PostPlugin *p, PView *view)
int oldIndex = -1; int oldIndex = -1;
if(view){ if(view){
for(int i = 0; i < p->getNbOptions(); i++){ for(int i = 0; i < p->getNbOptions(); i++){
if(p->getOption(i)->str == "iView") { if(p->getOption(i)->str == "View") {
oldIndex = (int)(p->getOption(i)->def); oldIndex = (int)(p->getOption(i)->def);
p->getOption(i)->def = view->getIndex(); p->getOption(i)->def = view->getIndex();
} }
...@@ -134,7 +134,7 @@ static void add_scripting(GMSH_PostPlugin *p, PView *view) ...@@ -134,7 +134,7 @@ static void add_scripting(GMSH_PostPlugin *p, PView *view)
if(view && oldIndex != -1){ if(view && oldIndex != -1){
for(int i = 0; i < p->getNbOptions(); i++){ for(int i = 0; i < p->getNbOptions(); i++){
if(p->getOption(i)->str == "iView"){ if(p->getOption(i)->str == "View"){
p->getOption(i)->def = oldIndex; p->getOption(i)->def = oldIndex;
} }
} }
......
...@@ -18,7 +18,7 @@ StringXNumber AnnotateOptions_Number[] = { ...@@ -18,7 +18,7 @@ StringXNumber AnnotateOptions_Number[] = {
{GMSH_FULLRC, "Z", GMSH_AnnotatePlugin::callbackZ, 0.}, {GMSH_FULLRC, "Z", GMSH_AnnotatePlugin::callbackZ, 0.},
{GMSH_FULLRC, "ThreeD", GMSH_AnnotatePlugin::callback3D, 0.}, {GMSH_FULLRC, "ThreeD", GMSH_AnnotatePlugin::callback3D, 0.},
{GMSH_FULLRC, "FontSize", GMSH_AnnotatePlugin::callbackFontSize, 14.}, {GMSH_FULLRC, "FontSize", GMSH_AnnotatePlugin::callbackFontSize, 14.},
{GMSH_FULLRC, "iView", NULL, -1.} {GMSH_FULLRC, "View", NULL, -1.}
}; };
StringXString AnnotateOptions_String[] = { StringXString AnnotateOptions_String[] = {
...@@ -179,12 +179,12 @@ std::string GMSH_AnnotatePlugin::getHelp() const ...@@ -179,12 +179,12 @@ std::string GMSH_AnnotatePlugin::getHelp() const
{ {
return "Plugin(Annotate) adds the text string `Text',\n" return "Plugin(Annotate) adds the text string `Text',\n"
"in font `Font' and size `FontSize', in the view\n" "in font `Font' and size `FontSize', in the view\n"
"`iView'. If `ThreeD' is equal to 1, the plugin inserts\n" "`View'. If `ThreeD' is equal to 1, the plugin inserts\n"
"the string in model coordinates at the position\n" "the string in model coordinates at the position\n"
"(`X',`Y',`Z'). If `ThreeD' is equal to 0, the plugin\n" "(`X',`Y',`Z'). If `ThreeD' is equal to 0, the plugin\n"
"inserts the string in screen coordinates at\n" "inserts the string in screen coordinates at\n"
"the position (`X',`Y'). The string is aligned\n" "the position (`X',`Y'). The string is aligned\n"
"according to `Align'. If `iView' < 0, the plugin\n" "according to `Align'. If `View' < 0, the plugin\n"
"is run on the current view.\n" "is run on the current view.\n"
"\n" "\n"
"Plugin(Annotate) is executed in-place for list-based\n" "Plugin(Annotate) is executed in-place for list-based\n"
......
...@@ -18,7 +18,6 @@ set(SRC ...@@ -18,7 +18,6 @@ set(SRC
Skin.cpp GSHHS.cpp Skin.cpp GSHHS.cpp
MathEval.cpp ModifyComponent.cpp ExtractElements.cpp MathEval.cpp ModifyComponent.cpp ExtractElements.cpp
MakeSimplex.cpp MakeSimplex.cpp
FieldView.cpp
Integrate.cpp Gradient.cpp Curl.cpp Divergence.cpp Integrate.cpp Gradient.cpp Curl.cpp Divergence.cpp
Annotate.cpp Remove.cpp Annotate.cpp Remove.cpp
Probe.cpp Probe.cpp
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
#include "GmshDefines.h" #include "GmshDefines.h"
StringXNumber CurlOptions_Number[] = { StringXNumber CurlOptions_Number[] = {
{GMSH_FULLRC, "iView", NULL, -1.} {GMSH_FULLRC, "View", NULL, -1.}
}; };
extern "C" extern "C"
...@@ -22,7 +22,7 @@ extern "C" ...@@ -22,7 +22,7 @@ extern "C"
std::string GMSH_CurlPlugin::getHelp() const std::string GMSH_CurlPlugin::getHelp() const
{ {
return "Plugin(Curl) computes the curl of the field\n" return "Plugin(Curl) computes the curl of the field\n"
"in the view `iView'. If `iView' < 0, the plugin\n" "in the view `View'. If `View' < 0, the plugin\n"
"is run on the current view.\n" "is run on the current view.\n"
"\n" "\n"
"Plugin(Curl) creates one new view.\n"; "Plugin(Curl) creates one new view.\n";
......
...@@ -22,10 +22,10 @@ StringXNumber CutGridOptions_Number[] = { ...@@ -22,10 +22,10 @@ StringXNumber CutGridOptions_Number[] = {
{GMSH_FULLRC, "X2", GMSH_CutGridPlugin::callbackX2, 0.}, {GMSH_FULLRC, "X2", GMSH_CutGridPlugin::callbackX2, 0.},
{GMSH_FULLRC, "Y2", GMSH_CutGridPlugin::callbackY2, 1.}, {GMSH_FULLRC, "Y2", GMSH_CutGridPlugin::callbackY2, 1.},
{GMSH_FULLRC, "Z2", GMSH_CutGridPlugin::callbackZ2, 0.}, {GMSH_FULLRC, "Z2", GMSH_CutGridPlugin::callbackZ2, 0.},
{GMSH_FULLRC, "nPointsU", GMSH_CutGridPlugin::callbackU, 20}, {GMSH_FULLRC, "NumPointsU", GMSH_CutGridPlugin::callbackU, 20},
{GMSH_FULLRC, "nPointsV", GMSH_CutGridPlugin::callbackV, 20}, {GMSH_FULLRC, "NumPointsV", GMSH_CutGridPlugin::callbackV, 20},
{GMSH_FULLRC, "ConnectPoints", GMSH_CutGridPlugin::callbackConnect, 1}, {GMSH_FULLRC, "ConnectPoints", GMSH_CutGridPlugin::callbackConnect, 1},
{GMSH_FULLRC, "iView", NULL, -1.} {GMSH_FULLRC, "View", NULL, -1.}
}; };
extern "C" extern "C"
...@@ -167,16 +167,16 @@ double GMSH_CutGridPlugin::callbackConnect(int num, int action, double value) ...@@ -167,16 +167,16 @@ double GMSH_CutGridPlugin::callbackConnect(int num, int action, double value)
std::string GMSH_CutGridPlugin::getHelp() const std::string GMSH_CutGridPlugin::getHelp() const
{ {
return "Plugin(CutGrid) cuts the view `iView' with a\n" return "Plugin(CutGrid) cuts the view `View' with a\n"
"rectangular grid defined by the 3 points\n" "rectangular grid defined by the 3 points\n"
"(`X0',`Y0',`Z0') (origin), (`X1',`Y1',`Z1') (axis of\n" "(`X0',`Y0',`Z0') (origin), (`X1',`Y1',`Z1') (axis of\n"
"U) and (`X2',`Y2',`Z2') (axis of V). The number of\n" "U) and (`X2',`Y2',`Z2') (axis of V). The number of\n"
"points along U and V is set with the options\n" "points along U and V is set with the options\n"
"`nPointsU' and `nPointsV'. If `ConnectPoints' is\n" "`NumPointsU' and `NumPointsV'. If `ConnectPoints' is\n"
"zero, the plugin creates points; otherwise, the\n" "zero, the plugin creates points; otherwise, the\n"
"plugin generates quadrangles, lines or points\n" "plugin generates quadrangles, lines or points\n"
" depending on the values of `nPointsU' and\n" " depending on the values of `NumPointsU' and\n"
"`nPointsV'. If `iView' < 0, the plugin is run on\n" "`NumPointsV'. If `View' < 0, the plugin is run on\n"
"the current view.\n" "the current view.\n"
"\n" "\n"
"Plugin(CutGrid) creates one new view.\n"; "Plugin(CutGrid) creates one new view.\n";
......
...@@ -17,14 +17,14 @@ ...@@ -17,14 +17,14 @@
StringXNumber CutParametricOptions_Number[] = { StringXNumber CutParametricOptions_Number[] = {
{GMSH_FULLRC, "MinU", GMSH_CutParametricPlugin::callbackMinU, 0.}, {GMSH_FULLRC, "MinU", GMSH_CutParametricPlugin::callbackMinU, 0.},
{GMSH_FULLRC, "MaxU", GMSH_CutParametricPlugin::callbackMaxU, 2 * 3.1416}, {GMSH_FULLRC, "MaxU", GMSH_CutParametricPlugin::callbackMaxU, 2 * 3.1416},
{GMSH_FULLRC, "nPointsU", GMSH_CutParametricPlugin::callbackN, 360.}, {GMSH_FULLRC, "NumPointsU", GMSH_CutParametricPlugin::callbackN, 360.},
{GMSH_FULLRC, "ConnectPoints", GMSH_CutParametricPlugin::callbackConnect, 0.}, {GMSH_FULLRC, "ConnectPoints", GMSH_CutParametricPlugin::callbackConnect, 0.},
{GMSH_FULLRC, "iView", NULL, -1.} {GMSH_FULLRC, "View", NULL, -1.}
}; };
StringXString CutParametricOptions_String[] = { StringXString CutParametricOptions_String[] = {
{GMSH_FULLRC, "X", GMSH_CutParametricPlugin::callbackX, "0 + 1 * Cos(u)"}, {GMSH_FULLRC, "X", GMSH_CutParametricPlugin::callbackX, "0.1 + 0.5 * Cos(u)"},
{GMSH_FULLRC, "Y", GMSH_CutParametricPlugin::callbackY, "0 + 1 * Sin(u)"}, {GMSH_FULLRC, "Y", GMSH_CutParametricPlugin::callbackY, "0.1 + 0.5 * Sin(u)"},
{GMSH_FULLRC, "Z", GMSH_CutParametricPlugin::callbackZ, "0"}, {GMSH_FULLRC, "Z", GMSH_CutParametricPlugin::callbackZ, "0"},
}; };
...@@ -167,12 +167,12 @@ std::string GMSH_CutParametricPlugin::callbackZ(int num, int action, std::string ...@@ -167,12 +167,12 @@ std::string GMSH_CutParametricPlugin::callbackZ(int num, int action, std::string
std::string GMSH_CutParametricPlugin::getHelp() const std::string GMSH_CutParametricPlugin::getHelp() const
{ {
return "Plugin(CutParametric) cuts the view `iView' with\n" return "Plugin(CutParametric) cuts the view `View' with\n"
"the parametric function (`X'(u), `Y'(u), `Z'(u)),\n" "the parametric function (`X'(u), `Y'(u), `Z'(u)),\n"
"using `nPointsU' values of the parameter u in\n" "using `NumPointsU' values of the parameter u in\n"
"[`MinU', `MaxU']. If `ConnectPoints' is set, the\n" "[`MinU', `MaxU']. If `ConnectPoints' is set, the\n"
"plugin creates line elements; otherwise, the\n" "plugin creates line elements; otherwise, the\n"
"plugin generates points. If `iView' < 0, the plugin\n" "plugin generates points. If `View' < 0, the plugin\n"
"is run on the current view.\n" "is run on the current view.\n"
"\n" "\n"
"Plugin(CutParametric) creates one new view.\n"; "Plugin(CutParametric) creates one new view.\n";
......
...@@ -21,7 +21,7 @@ StringXNumber CutPlaneOptions_Number[] = { ...@@ -21,7 +21,7 @@ StringXNumber CutPlaneOptions_Number[] = {
{GMSH_FULLRC, "ExtractVolume", GMSH_CutPlanePlugin::callbackVol, 0}, {GMSH_FULLRC, "ExtractVolume", GMSH_CutPlanePlugin::callbackVol, 0},
{GMSH_FULLRC, "RecurLevel", GMSH_CutPlanePlugin::callbackRecur, 4}, {GMSH_FULLRC, "RecurLevel", GMSH_CutPlanePlugin::callbackRecur, 4},
{GMSH_FULLRC, "TargetError", GMSH_CutPlanePlugin::callbackTarget, 0.}, {GMSH_FULLRC, "TargetError", GMSH_CutPlanePlugin::callbackTarget, 0.},
{GMSH_FULLRC, "iView", NULL, -1.} {GMSH_FULLRC, "View", NULL, -1.}
}; };
extern "C" extern "C"
...@@ -112,11 +112,11 @@ double GMSH_CutPlanePlugin::callbackTarget(int num, int action, double value) ...@@ -112,11 +112,11 @@ double GMSH_CutPlanePlugin::callbackTarget(int num, int action, double value)
std::string GMSH_CutPlanePlugin::getHelp() const std::string GMSH_CutPlanePlugin::getHelp() const
{ {
return "Plugin(CutPlane) cuts the view `iView' with\n" return "Plugin(CutPlane) cuts the view `View' with\n"
"the plane `A'*X + `B'*Y + `C'*Z + `D' = 0. If\n" "the plane `A'*X + `B'*Y + `C'*Z + `D' = 0. If\n"
"`ExtractVolume' is nonzero, the plugin extracts\n" "`ExtractVolume' is nonzero, the plugin extracts\n"
"the elements on one side of the plane (depending\n" "the elements on one side of the plane (depending\n"
"on the sign of `ExtractVolume'). If `iView' < 0,\n" "on the sign of `ExtractVolume'). If `View' < 0,\n"
"the plugin is run on the current view.\n" "the plugin is run on the current view.\n"
"\n" "\n"
"Plugin(CutPlane) creates one new view.\n"; "Plugin(CutPlane) creates one new view.\n";
......
...@@ -19,7 +19,8 @@ StringXNumber CutSphereOptions_Number[] = { ...@@ -19,7 +19,8 @@ StringXNumber CutSphereOptions_Number[] = {
{GMSH_FULLRC, "R", GMSH_CutSpherePlugin::callbackR, 0.25}, {GMSH_FULLRC, "R", GMSH_CutSpherePlugin::callbackR, 0.25},
{GMSH_FULLRC, "ExtractVolume", GMSH_CutSpherePlugin::callbackVol, 0.}, {GMSH_FULLRC, "ExtractVolume", GMSH_CutSpherePlugin::callbackVol, 0.},
{GMSH_FULLRC, "RecurLevel", GMSH_CutSpherePlugin::callbackRecur, 4}, {GMSH_FULLRC, "RecurLevel", GMSH_CutSpherePlugin::callbackRecur, 4},
{GMSH_FULLRC, "iView", NULL, -1.} {GMSH_FULLRC, "TargetError", GMSH_CutSpherePlugin::callbackTarget, 0.},
{GMSH_FULLRC, "View", NULL, -1.}
}; };
extern "C" extern "C"
...@@ -100,14 +101,20 @@ double GMSH_CutSpherePlugin::callbackRecur(int num, int action, double value) ...@@ -100,14 +101,20 @@ double GMSH_CutSpherePlugin::callbackRecur(int num, int action, double value)
1, 0, 10); 1, 0, 10);
} }
double GMSH_CutSpherePlugin::callbackTarget(int num, int action, double value)
{
return callback(num, action, value, &CutSphereOptions_Number[6].def,
0.01, 0., 1.);
}
std::string GMSH_CutSpherePlugin::getHelp() const std::string GMSH_CutSpherePlugin::getHelp() const
{ {
return "Plugin(CutSphere) cuts the view `iView' with the\n" return "Plugin(CutSphere) cuts the view `View' with the\n"
"sphere (X-`Xc')^2 + (Y-`Yc')^2 + (Z-`Zc')^2 = `R'^2.\n" "sphere (X-`Xc')^2 + (Y-`Yc')^2 + (Z-`Zc')^2 = `R'^2.\n"
"If `ExtractVolume' is nonzero, the plugin extracts\n" "If `ExtractVolume' is nonzero, the plugin extracts\n"
"the elements inside (if `ExtractVolume' < 0) or\n" "the elements inside (if `ExtractVolume' < 0) or\n"
"outside (if `ExtractVolume' > 0) the sphere. If\n" "outside (if `ExtractVolume' > 0) the sphere. If\n"
"`iView' < 0, the plugin is run on the current view.\n" "`View' < 0, the plugin is run on the current view.\n"
"\n" "\n"
"Plugin(CutSphere) creates one new view.\n"; "Plugin(CutSphere) creates one new view.\n";
} }
...@@ -134,12 +141,13 @@ double GMSH_CutSpherePlugin::levelset(double x, double y, double z, ...@@ -134,12 +141,13 @@ double GMSH_CutSpherePlugin::levelset(double x, double y, double z,
PView *GMSH_CutSpherePlugin::execute(PView *v) PView *GMSH_CutSpherePlugin::execute(PView *v)
{ {
int iView = (int)CutSphereOptions_Number[6].def; int iView = (int)CutSphereOptions_Number[7].def;
_ref[0] = CutSphereOptions_Number[0].def; _ref[0] = CutSphereOptions_Number[0].def;
_ref[1] = CutSphereOptions_Number[1].def; _ref[1] = CutSphereOptions_Number[1].def;
_ref[2] = CutSphereOptions_Number[2].def; _ref[2] = CutSphereOptions_Number[2].def;
_extractVolume = (int)CutSphereOptions_Number[4].def; _extractVolume = (int)CutSphereOptions_Number[4].def;
_recurLevel = (int)CutSphereOptions_Number[5].def; _recurLevel = (int)CutSphereOptions_Number[5].def;
_targetError = CutSphereOptions_Number[6].def;
_valueIndependent = 1; _valueIndependent = 1;
_valueView = -1; _valueView = -1;
......
...@@ -23,7 +23,7 @@ class GMSH_CutSpherePlugin : public GMSH_LevelsetPlugin ...@@ -23,7 +23,7 @@ class GMSH_CutSpherePlugin : public GMSH_LevelsetPlugin
std::string getName() const { return "CutSphere"; } std::string getName() const { return "CutSphere"; }
std::string getShortHelp() const std::string getShortHelp() const
{ {
return "Cut with a sphere"; return "Cut with a sphere centered at (Xc, Yc, Zc)";
} }
std::string getHelp() const; std::string getHelp() const;
int getNbOptions() const; int getNbOptions() const;
...@@ -36,6 +36,7 @@ class GMSH_CutSpherePlugin : public GMSH_LevelsetPlugin ...@@ -36,6 +36,7 @@ class GMSH_CutSpherePlugin : public GMSH_LevelsetPlugin
static double callbackR(int, int, double); static double callbackR(int, int, double);
static double callbackVol(int, int, double); static double callbackVol(int, int, double);
static double callbackRecur(int, int, double); static double callbackRecur(int, int, double);
static double callbackTarget(int, int, double);
static void draw(void *context); static void draw(void *context);
}; };
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
#include "GmshDefines.h" #include "GmshDefines.h"
StringXNumber DivergenceOptions_Number[] = { StringXNumber DivergenceOptions_Number[] = {
{GMSH_FULLRC, "iView", NULL, -1.} {GMSH_FULLRC, "View", NULL, -1.}
}; };
extern "C" extern "C"
...@@ -22,7 +22,7 @@ extern "C" ...@@ -22,7 +22,7 @@ extern "C"
std::string GMSH_DivergencePlugin::getHelp() const std::string GMSH_DivergencePlugin::getHelp() const
{ {
return "Plugin(Divergence) computes the divergence of the\n" return "Plugin(Divergence) computes the divergence of the\n"
"field in the view `iView'. If `iView' < 0, the plugin\n" "field in the view `View'. If `View' < 0, the plugin\n"
"is run on the current view.\n" "is run on the current view.\n"
"\n" "\n"
"Plugin(Divergence) creates one new view.\n"; "Plugin(Divergence) creates one new view.\n";
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
#include "GmshDefines.h" #include "GmshDefines.h"
StringXNumber EigenvaluesOptions_Number[] = { StringXNumber EigenvaluesOptions_Number[] = {
{GMSH_FULLRC, "iView", NULL, -1.} {GMSH_FULLRC, "View", NULL, -1.}
}; };
extern "C" extern "C"
...@@ -22,8 +22,8 @@ extern "C" ...@@ -22,8 +22,8 @@ extern "C"
std::string GMSH_EigenvaluesPlugin::getHelp() const std::string GMSH_EigenvaluesPlugin::getHelp() const
{ {
return "Plugin(Eigenvalues) computes the three real\n" return "Plugin(Eigenvalues) computes the three real\n"
"eigenvalues of each tensor in the view `iView'.\n" "eigenvalues of each tensor in the view `View'.\n"
"If `iView' < 0, the plugin is run on the current view.\n" "If `View' < 0, the plugin is run on the current view.\n"
"\n" "\n"
"Plugin(Eigenvalues) creates three new scalar views.\n"; "Plugin(Eigenvalues) creates three new scalar views.\n";
} }
......
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
StringXNumber EigenvectorsOptions_Number[] = { StringXNumber EigenvectorsOptions_Number[] = {
{GMSH_FULLRC, "ScaleByEigenvalues", NULL, 1.}, {GMSH_FULLRC, "ScaleByEigenvalues", NULL, 1.},
{GMSH_FULLRC, "iView", NULL, -1.} {GMSH_FULLRC, "View", NULL, -1.}
}; };
extern "C" extern "C"
...@@ -24,12 +24,12 @@ extern "C" ...@@ -24,12 +24,12 @@ extern "C"
std::string GMSH_EigenvectorsPlugin::getHelp() const std::string GMSH_EigenvectorsPlugin::getHelp() const
{ {
return "Plugin(Eigenvectors) computes the three (right)\n" return "Plugin(Eigenvectors) computes the three (right)\n"
"eigenvectors of each tensor in the view `iView'\n" "eigenvectors of each tensor in the view `View'\n"
"and sorts them according to the value of the\n" "and sorts them according to the value of the\n"
"associated eigenvalues. If `ScaleByEigenvalues'\n" "associated eigenvalues. If `ScaleByEigenvalues'\n"
"is set, each eigenvector is scaled by its\n" "is set, each eigenvector is scaled by its\n"
"associated eigenvalue. The plugin gives an error\n" "associated eigenvalue. The plugin gives an error\n"
"if the eigenvectors are complex. If `iView' < 0,\n" "if the eigenvectors are complex. If `View' < 0,\n"
"the plugin is run on the current view.\n" "the plugin is run on the current view.\n"
"\n" "\n"
"Plugin(Eigenvectors) creates three new\n" "Plugin(Eigenvectors) creates three new\n"
......
...@@ -12,7 +12,7 @@ StringXNumber ExtractElementsOptions_Number[] = { ...@@ -12,7 +12,7 @@ StringXNumber ExtractElementsOptions_Number[] = {
{GMSH_FULLRC, "MinVal", NULL, 0.}, {GMSH_FULLRC, "MinVal", NULL, 0.},
{GMSH_FULLRC, "MaxVal", NULL, 1.}, {GMSH_FULLRC, "MaxVal", NULL, 1.},
{GMSH_FULLRC, "TimeStep", NULL, 0.}, {GMSH_FULLRC, "TimeStep", NULL, 0.},
{GMSH_FULLRC, "iView", NULL, -1.} {GMSH_FULLRC, "View", NULL, -1.}
}; };
extern "C" extern "C"
...@@ -26,9 +26,9 @@ extern "C" ...@@ -26,9 +26,9 @@ extern "C"
std::string GMSH_ExtractElementsPlugin::getHelp() const std::string GMSH_ExtractElementsPlugin::getHelp() const
{ {
return "Plugin(ExtractElements) extracts the elements\n" return "Plugin(ExtractElements) extracts the elements\n"
"from the view `iView' whose `TimeStep'-th values\n" "from the view `View' whose `TimeStep'-th values\n"
"(averaged by element) are comprised between\n" "(averaged by element) are comprised between\n"
"`MinVal' and `MaxVal'. If `iView' < 0, the plugin\n" "`MinVal' and `MaxVal'. If `View' < 0, the plugin\n"
"is run on the current view.\n" "is run on the current view.\n"
"\n" "\n"
"Plugin(ExtractElements) creates one new view.\n"; "Plugin(ExtractElements) creates one new view.\n";
......
// 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 "FieldView.h"
#include "GModel.h"
#if defined(HAVE_MESH)
#include "Field.h"
#endif
StringXNumber FieldViewOptions_Number[] = {
{GMSH_FULLRC, "Component", NULL, -1.},
{GMSH_FULLRC, "iView", NULL, -1.},
{GMSH_FULLRC, "iField", NULL, -1.}
};
extern "C"
{
GMSH_Plugin *GMSH_RegisterFieldViewPlugin()
{
return new GMSH_FieldViewPlugin();
}
}
std::string GMSH_FieldViewPlugin::getHelp() const
{
return "Plugin(FieldView) evaluates a field on the choosen view.\n";
}
int GMSH_FieldViewPlugin::getNbOptions() const
{
return sizeof(FieldViewOptions_Number) / sizeof(StringXNumber);
}
StringXNumber *GMSH_FieldViewPlugin::getOption(int iopt)
{
return &FieldViewOptions_Number[iopt];
}
PView *GMSH_FieldViewPlugin::execute(PView *v)
{
#if defined(HAVE_MESH)
//int comp = (int)FieldViewOptions_Number[0].def;
int iView = (int)FieldViewOptions_Number[1].def;
int iField = (int)FieldViewOptions_Number[2].def;
Field *field = GModel::current()->getFields()->get(iField);
if(!field){
Msg::Error("Field[%d] does not exist", iField);
return v;
}
PView *v1 = getView(iView, v);
if(!v1) return v;
field->putOnView(v1);
return v1;
#else
Msg::Error("FieldView plugin requires the mesh module");
return v;
#endif
}
// 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 _FIELD_VIEW_H_
#define _FIELD_VIEW_H_
#include "Plugin.h"
extern "C"
{
GMSH_Plugin *GMSH_RegisterFieldViewPlugin();
}
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;
StringXNumber* getOption(int iopt);
PView *execute(PView *);
};
#endif
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
#include "GmshDefines.h" #include "GmshDefines.h"
StringXNumber GradientOptions_Number[] = { StringXNumber GradientOptions_Number[] = {
{GMSH_FULLRC, "iView", NULL, -1.} {GMSH_FULLRC, "View", NULL, -1.}
}; };
extern "C" extern "C"
...@@ -22,7 +22,7 @@ extern "C" ...@@ -22,7 +22,7 @@ extern "C"
std::string GMSH_GradientPlugin::getHelp() const std::string GMSH_GradientPlugin::getHelp() const
{ {
return "Plugin(Gradient) computes the gradient of the\n" return "Plugin(Gradient) computes the gradient of the\n"
"field in the view `iView'. If `iView' < 0, the\n" "field in the view `View'. If `View' < 0, the\n"
"plugin is run on the current view.\n" "plugin is run on the current view.\n"
"\n" "\n"
"Plugin(Gradient) creates one new view.\n"; "Plugin(Gradient) creates one new view.\n";
......
...@@ -9,8 +9,8 @@ ...@@ -9,8 +9,8 @@
StringXNumber HarmonicToTimeOptions_Number[] = { StringXNumber HarmonicToTimeOptions_Number[] = {
{GMSH_FULLRC, "RealPart", NULL, 0.}, {GMSH_FULLRC, "RealPart", NULL, 0.},
{GMSH_FULLRC, "ImaginaryPart", NULL, 1.}, {GMSH_FULLRC, "ImaginaryPart", NULL, 1.},
{GMSH_FULLRC, "nSteps", NULL, 20.}, {GMSH_FULLRC, "NumSteps", NULL, 20.},
{GMSH_FULLRC, "iView", NULL, -1.} {GMSH_FULLRC, "View", NULL, -1.}
}; };
extern "C" extern "C"
...@@ -25,11 +25,11 @@ std::string GMSH_HarmonicToTimePlugin::getHelp() const ...@@ -25,11 +25,11 @@ std::string GMSH_HarmonicToTimePlugin::getHelp() const
{ {
return "Plugin(HarmonicToTime) takes the values in the\n" return "Plugin(HarmonicToTime) takes the values in the\n"
"time steps `RealPart' and `ImaginaryPart' of\n" "time steps `RealPart' and `ImaginaryPart' of\n"
"the view `iView', and creates a new view\n" "the view `View', and creates a new view\n"
"containing (`iView'[`RealPart'] * cos(p) -\n" "containing (`View'[`RealPart'] * cos(p) -\n"
"`iView'[`ImaginaryPart'] * sin(p)), with\n" "`View'[`ImaginaryPart'] * sin(p)), with\n"
"p = 2*Pi*k/`nSteps', k = 0, ..., `nSteps'-1.\n" "p = 2*Pi*k/`NumSteps', k = 0, ..., `NumSteps'-1.\n"
"If `iView' < 0, the plugin is run on the\n" "If `View' < 0, the plugin is run on the\n"
"current view.\n" "current view.\n"
"\n" "\n"
"Plugin(HarmonicToTime) creates one new view.\n"; "Plugin(HarmonicToTime) creates one new view.\n";
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
#include "PViewOptions.h" #include "PViewOptions.h"
StringXNumber IntegrateOptions_Number[] = { StringXNumber IntegrateOptions_Number[] = {
{GMSH_FULLRC, "iView", NULL, -1.} {GMSH_FULLRC, "View", NULL, -1.}
}; };
extern "C" extern "C"
...@@ -22,9 +22,9 @@ extern "C" ...@@ -22,9 +22,9 @@ extern "C"
std::string GMSH_IntegratePlugin::getHelp() const std::string GMSH_IntegratePlugin::getHelp() const
{ {
return "Plugin(Integrate) integrates scalar fields over\n" return "Plugin(Integrate) integrates scalar fields over\n"
"all the elements in the view `iView', as well\n" "all the elements in the view `View', as well\n"
"as the circulation/flux of vector fields over\n" "as the circulation/flux of vector fields over\n"
"line/surface elements. If `iView' < 0, the\n" "line/surface elements. If `View' < 0, the\n"
"plugin is run on the current view.\n" "plugin is run on the current view.\n"
"\n" "\n"
"Plugin(Integrate) creates one new view.\n"; "Plugin(Integrate) creates one new view.\n";
......
...@@ -8,12 +8,12 @@ ...@@ -8,12 +8,12 @@
StringXNumber IsosurfaceOptions_Number[] = { StringXNumber IsosurfaceOptions_Number[] = {
{GMSH_FULLRC, "Value", GMSH_IsosurfacePlugin::callbackValue, 0.}, {GMSH_FULLRC, "Value", GMSH_IsosurfacePlugin::callbackValue, 0.},
{GMSH_FULLRC, "dTimeStep", NULL, -1.},
{GMSH_FULLRC, "dView", NULL, -1.},
{GMSH_FULLRC, "ExtractVolume", GMSH_IsosurfacePlugin::callbackVol, 0.}, {GMSH_FULLRC, "ExtractVolume", GMSH_IsosurfacePlugin::callbackVol, 0.},
{GMSH_FULLRC, "RecurLevel", GMSH_IsosurfacePlugin::callbackRecur, 4}, {GMSH_FULLRC, "RecurLevel", GMSH_IsosurfacePlugin::callbackRecur, 4},
{GMSH_FULLRC, "TargetError", GMSH_IsosurfacePlugin::callbackTarget, 0}, {GMSH_FULLRC, "TargetError", GMSH_IsosurfacePlugin::callbackTarget, 0},
{GMSH_FULLRC, "iView", NULL, -1.} {GMSH_FULLRC, "View", NULL, -1.},
{GMSH_FULLRC, "OtherTimeStep", NULL, -1.},
{GMSH_FULLRC, "OtherView", NULL, -1.}
}; };
extern "C" extern "C"
...@@ -28,7 +28,7 @@ double GMSH_IsosurfacePlugin::callbackValue(int num, int action, double value) ...@@ -28,7 +28,7 @@ double GMSH_IsosurfacePlugin::callbackValue(int num, int action, double value)
{ {
double min = 0., max = 1.; double min = 0., max = 1.;
if(action > 0){ if(action > 0){
int iview = (int)IsosurfaceOptions_Number[6].def; int iview = (int)IsosurfaceOptions_Number[4].def;
if(iview < 0) iview = num; if(iview < 0) iview = num;
if(iview >= 0 && iview < (int)PView::list.size()){ if(iview >= 0 && iview < (int)PView::list.size()){
min = PView::list[iview]->getData()->getMin(); min = PView::list[iview]->getData()->getMin();
...@@ -80,20 +80,20 @@ double GMSH_IsosurfacePlugin::callbackTarget(int num, int action, double value) ...@@ -80,20 +80,20 @@ double GMSH_IsosurfacePlugin::callbackTarget(int num, int action, double value)
std::string GMSH_IsosurfacePlugin::getHelp() const std::string GMSH_IsosurfacePlugin::getHelp() const
{ {
return "Plugin(Isosurface) extracts the isosurface of value\n" return "Plugin(Isosurface) extracts the isosurface of value\n"
"`Value' from the view `iView' and draws the\n" "`Value' from the view `View', and draws the\n"
"`dTimeStep'-th value of the view `dView' on the\n" "`OtherTimeStep'-th step of the view `OtherView' on\n"
"isosurface. If `iView' < 0, the plugin is run\n" "this isosurface. If `View' < 0, the plugin is run\n"
"on the current view. If `dTimeStep' < 0, the\n" "on the current view. If `OtherTimeStep' < 0, the\n"
"plugin uses, for each time step in `iView', the\n" "plugin uses, for each time step in `View', the\n"
"corresponding time step in `dView'. If `dView'\n" "corresponding time step in `OtherView'. If `OtherView'\n"
"< 0, the plugin uses `iView' as the value source.\n" "< 0, the plugin uses `View' as the value source.\n"
"If `ExtractVolume' is nonzero, the plugin\n" "If `ExtractVolume' is nonzero, the plugin\n"
"extracts the isovolume with values greater (if\n" "extracts the isovolume with values greater (if\n"
"`ExtractVolume' > 0) or smaller (if `ExtractVolume'\n" "`ExtractVolume' > 0) or smaller (if `ExtractVolume'\n"
"< 0) than the isosurface `Value'.\n" "< 0) than the isosurface `Value'.\n"
"\n" "\n"
"Plugin(Isosurface) creates as many views as there\n" "Plugin(Isosurface) creates as many views as there\n"
"are time steps in `iView'.\n"; "are time steps in `View'.\n";
} }
int GMSH_IsosurfacePlugin::getNbOptions() const int GMSH_IsosurfacePlugin::getNbOptions() const
...@@ -116,13 +116,13 @@ double GMSH_IsosurfacePlugin::levelset(double x, double y, double z, double val) ...@@ -116,13 +116,13 @@ double GMSH_IsosurfacePlugin::levelset(double x, double y, double z, double val)
PView *GMSH_IsosurfacePlugin::execute(PView *v) PView *GMSH_IsosurfacePlugin::execute(PView *v)
{ {
int iView = (int)IsosurfaceOptions_Number[6].def; int iView = (int)IsosurfaceOptions_Number[4].def;
_valueIndependent = 0; _valueIndependent = 0;
_valueView = (int)IsosurfaceOptions_Number[2].def; _extractVolume = (int)IsosurfaceOptions_Number[1].def;
_valueTimeStep = (int)IsosurfaceOptions_Number[1].def; _recurLevel = (int)IsosurfaceOptions_Number[2].def;
_extractVolume = (int)IsosurfaceOptions_Number[3].def; _targetError = IsosurfaceOptions_Number[3].def;
_recurLevel = (int)IsosurfaceOptions_Number[4].def; _valueTimeStep = (int)IsosurfaceOptions_Number[5].def;
_targetError = IsosurfaceOptions_Number[5].def; _valueView = (int)IsosurfaceOptions_Number[6].def;
_orientation = GMSH_LevelsetPlugin::MAP; _orientation = GMSH_LevelsetPlugin::MAP;
PView *v1 = getView(iView, v); PView *v1 = getView(iView, v);
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
StringXNumber Lambda2Options_Number[] = { StringXNumber Lambda2Options_Number[] = {
{GMSH_FULLRC, "Eigenvalue", NULL, 2.}, {GMSH_FULLRC, "Eigenvalue", NULL, 2.},
{GMSH_FULLRC, "iView", NULL, -1.} {GMSH_FULLRC, "View", NULL, -1.}
}; };
extern "C" extern "C"
...@@ -28,12 +28,12 @@ std::string GMSH_Lambda2Plugin::getHelp() const ...@@ -28,12 +28,12 @@ std::string GMSH_Lambda2Plugin::getHelp() const
"the symmetric and antisymmetric parts of the\n" "the symmetric and antisymmetric parts of the\n"
"velocity gradient tensor. Vortices are well\n" "velocity gradient tensor. Vortices are well\n"
"represented by regions where Lambda(2) is\n" "represented by regions where Lambda(2) is\n"
"negative. If `iView' contains tensor elements,\n" "negative. If `View' contains tensor elements,\n"
"the plugin directly uses the tensors as the\n" "the plugin directly uses the tensors as the\n"
"values of the velocity gradient tensor; if\n" "values of the velocity gradient tensor; if\n"
"`iView' contains vector elements, the plugin\n" "`View' contains vector elements, the plugin\n"
"uses them as the velocities from which to derive\n" "uses them as the velocities from which to derive\n"
"the velocity gradient tensor. If `iView' < 0,\n" "the velocity gradient tensor. If `View' < 0,\n"
"the plugin is run on the current view.\n" "the plugin is run on the current view.\n"
"\n" "\n"
"Plugin(Lambda2) creates one new view.\n"; "Plugin(Lambda2) creates one new view.\n";
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment