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

option to only extract skin of visible entities

parent a4038f9a
Branches
Tags
No related merge requests found
...@@ -9,6 +9,7 @@ ...@@ -9,6 +9,7 @@
#include "GmshDefines.h" #include "GmshDefines.h"
StringXNumber SkinOptions_Number[] = { StringXNumber SkinOptions_Number[] = {
{GMSH_FULLRC, "Visible", NULL, 1.},
{GMSH_FULLRC, "View", NULL, -1.} {GMSH_FULLRC, "View", NULL, -1.}
}; };
...@@ -23,7 +24,8 @@ extern "C" ...@@ -23,7 +24,8 @@ extern "C"
std::string GMSH_SkinPlugin::getHelp() const std::string GMSH_SkinPlugin::getHelp() const
{ {
return "Plugin(Skin) extracts the boundary (skin) of " return "Plugin(Skin) extracts the boundary (skin) of "
"the view `View'.\n\n" "the view `View'. If `Visible' is set, the plugin only "
"extracts the skin of visible entities.\n\n"
"If `View' < 0, the plugin is run on the current view.\n\n" "If `View' < 0, the plugin is run on the current view.\n\n"
"Plugin(Skin) creates one new view."; "Plugin(Skin) creates one new view.";
} }
...@@ -136,7 +138,8 @@ static int getBoundary(int type, const int (**boundary)[6][4]) ...@@ -136,7 +138,8 @@ static int getBoundary(int type, const int (**boundary)[6][4])
PView *GMSH_SkinPlugin::execute(PView *v) PView *GMSH_SkinPlugin::execute(PView *v)
{ {
int iView = (int)SkinOptions_Number[0].def; int visible = (int)SkinOptions_Number[0].def;
int iView = (int)SkinOptions_Number[1].def;
PView *v1 = getView(iView, v); PView *v1 = getView(iView, v);
if(!v1) return v; if(!v1) return v;
...@@ -162,8 +165,9 @@ PView *GMSH_SkinPlugin::execute(PView *v) ...@@ -162,8 +165,9 @@ PView *GMSH_SkinPlugin::execute(PView *v)
} }
for(int ent = 0; ent < data1->getNumEntities(firstNonEmptyStep); ent++){ for(int ent = 0; ent < data1->getNumEntities(firstNonEmptyStep); ent++){
if(visible && data1->skipEntity(firstNonEmptyStep, ent)) continue;
for(int ele = 0; ele < data1->getNumElements(firstNonEmptyStep, ent); ele++){ for(int ele = 0; ele < data1->getNumElements(firstNonEmptyStep, ent); ele++){
if(data1->skipElement(firstNonEmptyStep, ent, ele)) continue; if(data1->skipElement(firstNonEmptyStep, ent, ele, visible)) continue;
int numComp = data1->getNumComponents(firstNonEmptyStep, ent, ele); int numComp = data1->getNumComponents(firstNonEmptyStep, ent, ele);
int type = data1->getType(firstNonEmptyStep, ent, ele); int type = data1->getType(firstNonEmptyStep, ent, ele);
const int (*boundary)[6][4]; const int (*boundary)[6][4];
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment