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

Fix whole-element clipping for glyphs (thanks to Shahrokh Ghavamian

for reporting the bug)
parent b0639bf2
No related branches found
No related tags found
No related merge requests found
...@@ -256,6 +256,7 @@ static void drawGlyphs(drawContext *ctx, PView *p) ...@@ -256,6 +256,7 @@ static void drawGlyphs(drawContext *ctx, PView *p)
data->getValue(opt->timeStep, ent, i, j, k, val[j][k]); data->getValue(opt->timeStep, ent, i, j, k, val[j][k]);
} }
changeCoordinates(p, ent, i, numNodes, type, numComp, xyz, val); changeCoordinates(p, ent, i, numNodes, type, numComp, xyz, val);
if(!isElementVisible(opt, dim, numNodes, xyz)) continue;
if(opt->intervalsType == PViewOptions::Numeric) if(opt->intervalsType == PViewOptions::Numeric)
drawNumberGlyphs(ctx, p, numNodes, numComp, xyz, val); drawNumberGlyphs(ctx, p, numNodes, numComp, xyz, val);
if(dim == 2 && opt->normals) if(dim == 2 && opt->normals)
......
...@@ -132,5 +132,7 @@ class PView{ ...@@ -132,5 +132,7 @@ class PView{
void changeCoordinates(PView *p, int ient, int iele, void changeCoordinates(PView *p, int ient, int iele,
int numNodes, int type, int numComp, int numNodes, int type, int numComp,
double xyz[PVIEW_NMAX][3], double val[PVIEW_NMAX][9]); double xyz[PVIEW_NMAX][3], double val[PVIEW_NMAX][9]);
bool isElementVisible(PViewOptions *opt, int dim, int numNodes,
double xyz[PVIEW_NMAX][3]);
#endif #endif
...@@ -265,7 +265,7 @@ static double intersectClipPlane(int clip, int numNodes, double xyz[PVIEW_NMAX][ ...@@ -265,7 +265,7 @@ static double intersectClipPlane(int clip, int numNodes, double xyz[PVIEW_NMAX][
return val; return val;
} }
static bool isElementVisible(PViewOptions *opt, int dim, int numNodes, bool isElementVisible(PViewOptions *opt, int dim, int numNodes,
double xyz[PVIEW_NMAX][3]) double xyz[PVIEW_NMAX][3])
{ {
if(!CTX::instance()->clipWholeElements) return true; if(!CTX::instance()->clipWholeElements) return true;
......
...@@ -121,4 +121,4 @@ Michel Benhamou, Tom De Vuyst, Kris Van den Abeele, Simon Vun, Simon ...@@ -121,4 +121,4 @@ Michel Benhamou, Tom De Vuyst, Kris Van den Abeele, Simon Vun, Simon
Corbin, Thomas De-Soza, Marcus Drosson, Antoine Dechaume, Jose Paulo Corbin, Thomas De-Soza, Marcus Drosson, Antoine Dechaume, Jose Paulo
Moitinho de Almeida, Thomas Pinchard, Corrado Chisari, Axel Hackbarth, Moitinho de Almeida, Thomas Pinchard, Corrado Chisari, Axel Hackbarth,
Peter Wainwright, Jiri Hnidek, Thierry Thomas, Konstantinos Poulios, Peter Wainwright, Jiri Hnidek, Thierry Thomas, Konstantinos Poulios,
Laurent Van Miegroet. Laurent Van Miegroet, Shahrokh Ghavamian.
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment