diff --git a/libsrc/visualization/mvdraw.hpp b/libsrc/visualization/mvdraw.hpp index 171fb628..687c7750 100644 --- a/libsrc/visualization/mvdraw.hpp +++ b/libsrc/visualization/mvdraw.hpp @@ -242,9 +242,6 @@ namespace netgen ngcore::IVec<2> Project(Point<3> p); }; - void DrawElement(const Mesh & mesh, SurfaceElementIndex sei); - void DrawElement(const Mesh & mesh, ElementIndex sei); - NGGUI_API extern VisualSceneMesh vsmesh; diff --git a/libsrc/visualization/vsmesh.cpp b/libsrc/visualization/vsmesh.cpp index 4bea3006..b1f3971d 100644 --- a/libsrc/visualization/vsmesh.cpp +++ b/libsrc/visualization/vsmesh.cpp @@ -2,10 +2,20 @@ #include #include +// #include + +#ifdef STLGEOM +#include +#endif + + +// #include + #include namespace netgen { + // extern shared_ptr mesh; extern NetgenGeometry * ng_geometry; VisualSceneMesh vsmesh; @@ -982,6 +992,10 @@ namespace netgen glBindTexture(GL_TEXTURE_2D, colors.texture); +#ifdef STLGEOM + STLGeometry * stlgeometry = dynamic_cast (ng_geometry); + bool checkvicinity = (stlgeometry != NULL) && stldoctor.showvicinity; +#endif glEnable (GL_NORMALIZE); glLineWidth (1.0f); @@ -1061,6 +1075,13 @@ namespace netgen bool drawel = (!el.IsDeleted() && el.IsVisible()); +#ifdef STLGEOM + if (checkvicinity) + for (int j = 0; j < el.GetNP(); j++) + if (!stlgeometry->Vicinity(el.GeomInfoPi(j+1).trignum)) + drawel = 0; +#endif + if (!drawel) continue; @@ -1372,6 +1393,11 @@ namespace netgen linetimestamp = NextTimeStamp(); +#ifdef STLGEOM + STLGeometry * stlgeometry = dynamic_cast (ng_geometry); + bool checkvicinity = (stlgeometry != NULL) && stldoctor.showvicinity; +#endif + if (linelist) glDeleteLists (linelist, 1); @@ -1392,6 +1418,12 @@ namespace netgen bool drawel = (!el.IsDeleted() && el.IsVisible()); +#ifdef STLGEOM + if (checkvicinity) + for (int j = 0; j < el.GetNP(); j++) + if (!stlgeometry->Vicinity(el.GeomInfoPi(j+1).trignum)) + drawel = 0; +#endif if (!drawel) continue;