Merge master

This commit is contained in:
Matthias Hochsteger 2024-04-05 17:11:21 +02:00
parent a0f61bec3e
commit 99a14521fd
2 changed files with 32 additions and 3 deletions

View File

@ -242,9 +242,6 @@ namespace netgen
ngcore::IVec<2> Project(Point<3> p); 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; NGGUI_API extern VisualSceneMesh vsmesh;

View File

@ -2,10 +2,20 @@
#include <myadt.hpp> #include <myadt.hpp>
#include <meshing.hpp> #include <meshing.hpp>
// #include <csg.hpp>
#ifdef STLGEOM
#include <stlgeom.hpp>
#endif
// #include <parallel.hpp>
#include <visual.hpp> #include <visual.hpp>
namespace netgen namespace netgen
{ {
// extern shared_ptr<Mesh> mesh;
extern NetgenGeometry * ng_geometry; extern NetgenGeometry * ng_geometry;
VisualSceneMesh vsmesh; VisualSceneMesh vsmesh;
@ -982,6 +992,10 @@ namespace netgen
glBindTexture(GL_TEXTURE_2D, colors.texture); glBindTexture(GL_TEXTURE_2D, colors.texture);
#ifdef STLGEOM
STLGeometry * stlgeometry = dynamic_cast<STLGeometry*> (ng_geometry);
bool checkvicinity = (stlgeometry != NULL) && stldoctor.showvicinity;
#endif
glEnable (GL_NORMALIZE); glEnable (GL_NORMALIZE);
glLineWidth (1.0f); glLineWidth (1.0f);
@ -1061,6 +1075,13 @@ namespace netgen
bool drawel = (!el.IsDeleted() && el.IsVisible()); 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) if (!drawel)
continue; continue;
@ -1372,6 +1393,11 @@ namespace netgen
linetimestamp = NextTimeStamp(); linetimestamp = NextTimeStamp();
#ifdef STLGEOM
STLGeometry * stlgeometry = dynamic_cast<STLGeometry*> (ng_geometry);
bool checkvicinity = (stlgeometry != NULL) && stldoctor.showvicinity;
#endif
if (linelist) if (linelist)
glDeleteLists (linelist, 1); glDeleteLists (linelist, 1);
@ -1392,6 +1418,12 @@ namespace netgen
bool drawel = (!el.IsDeleted() && el.IsVisible()); 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) if (!drawel)
continue; continue;