mirror of
https://github.com/NGSolve/netgen.git
synced 2025-01-27 13:20:34 +05:00
merge endMeshStep
This commit is contained in:
commit
dc3a214994
@ -129,14 +129,12 @@ namespace netgen
|
|||||||
|
|
||||||
|
|
||||||
extern int CSGGenerateMesh (CSGeometry & geom,
|
extern int CSGGenerateMesh (CSGeometry & geom,
|
||||||
shared_ptr<Mesh> & mesh, MeshingParameters & mparam,
|
shared_ptr<Mesh> & mesh, MeshingParameters & mparam);
|
||||||
int perfstepsstart, int perfstepsend);
|
|
||||||
|
|
||||||
|
|
||||||
int CSGeometry :: GenerateMesh (shared_ptr<Mesh> & mesh, MeshingParameters & mparam,
|
int CSGeometry :: GenerateMesh (shared_ptr<Mesh> & mesh, MeshingParameters & mparam)
|
||||||
int perfstepsstart, int perfstepsend)
|
|
||||||
{
|
{
|
||||||
return CSGGenerateMesh (*this, mesh, mparam, perfstepsstart, perfstepsend);
|
return CSGGenerateMesh (*this, mesh, mparam);
|
||||||
}
|
}
|
||||||
|
|
||||||
const Refinement & CSGeometry :: GetRefinement () const
|
const Refinement & CSGeometry :: GetRefinement () const
|
||||||
|
@ -313,8 +313,7 @@ namespace netgen
|
|||||||
|
|
||||||
Array<BCModification> bcmodifications;
|
Array<BCModification> bcmodifications;
|
||||||
|
|
||||||
virtual int GenerateMesh (shared_ptr<Mesh> & mesh, MeshingParameters & mparam,
|
virtual int GenerateMesh (shared_ptr<Mesh> & mesh, MeshingParameters & mparam);
|
||||||
int perfstepsstart, int perfstepsend);
|
|
||||||
|
|
||||||
virtual const Refinement & GetRefinement () const;
|
virtual const Refinement & GetRefinement () const;
|
||||||
};
|
};
|
||||||
|
@ -658,17 +658,16 @@ namespace netgen
|
|||||||
|
|
||||||
|
|
||||||
int CSGGenerateMesh (CSGeometry & geom,
|
int CSGGenerateMesh (CSGeometry & geom,
|
||||||
shared_ptr<Mesh> & mesh, MeshingParameters & mparam,
|
shared_ptr<Mesh> & mesh, MeshingParameters & mparam)
|
||||||
int perfstepsstart, int perfstepsend)
|
|
||||||
{
|
{
|
||||||
if (mesh && mesh->GetNSE() &&
|
if (mesh && mesh->GetNSE() &&
|
||||||
!geom.GetNSolids())
|
!geom.GetNSolids())
|
||||||
{
|
{
|
||||||
if (perfstepsstart < MESHCONST_MESHVOLUME)
|
if (mparam.perfstepsstart < MESHCONST_MESHVOLUME)
|
||||||
perfstepsstart = MESHCONST_MESHVOLUME;
|
mparam.perfstepsstart = MESHCONST_MESHVOLUME;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (perfstepsstart <= MESHCONST_ANALYSE)
|
if (mparam.perfstepsstart <= MESHCONST_ANALYSE)
|
||||||
{
|
{
|
||||||
if (mesh)
|
if (mesh)
|
||||||
mesh -> DeleteMesh();
|
mesh -> DeleteMesh();
|
||||||
@ -709,11 +708,11 @@ namespace netgen
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if (multithread.terminate || perfstepsend <= MESHCONST_ANALYSE)
|
if (multithread.terminate || mparam.perfstepsend <= MESHCONST_ANALYSE)
|
||||||
return TCL_OK;
|
return TCL_OK;
|
||||||
|
|
||||||
|
|
||||||
if (perfstepsstart <= MESHCONST_MESHEDGES)
|
if (mparam.perfstepsstart <= MESHCONST_MESHEDGES)
|
||||||
{
|
{
|
||||||
FindEdges (geom, *mesh, mparam, true);
|
FindEdges (geom, *mesh, mparam, true);
|
||||||
if (multithread.terminate) return TCL_OK;
|
if (multithread.terminate) return TCL_OK;
|
||||||
@ -746,11 +745,11 @@ namespace netgen
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (multithread.terminate || perfstepsend <= MESHCONST_MESHEDGES)
|
if (multithread.terminate || mparam.perfstepsend <= MESHCONST_MESHEDGES)
|
||||||
return TCL_OK;
|
return TCL_OK;
|
||||||
|
|
||||||
|
|
||||||
if (perfstepsstart <= MESHCONST_MESHSURFACE)
|
if (mparam.perfstepsstart <= MESHCONST_MESHSURFACE)
|
||||||
{
|
{
|
||||||
MeshSurface (geom, *mesh, mparam);
|
MeshSurface (geom, *mesh, mparam);
|
||||||
if (multithread.terminate) return TCL_OK;
|
if (multithread.terminate) return TCL_OK;
|
||||||
@ -791,10 +790,11 @@ namespace netgen
|
|||||||
mesh->CalcSurfacesOfNode();
|
mesh->CalcSurfacesOfNode();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (multithread.terminate || perfstepsend <= MESHCONST_OPTSURFACE)
|
if (multithread.terminate || mparam.perfstepsend <= MESHCONST_OPTSURFACE)
|
||||||
return TCL_OK;
|
return TCL_OK;
|
||||||
|
|
||||||
if (perfstepsstart <= MESHCONST_MESHVOLUME)
|
|
||||||
|
if (mparam.perfstepsstart <= MESHCONST_MESHVOLUME)
|
||||||
{
|
{
|
||||||
multithread.task = "Volume meshing";
|
multithread.task = "Volume meshing";
|
||||||
|
|
||||||
@ -825,11 +825,11 @@ namespace netgen
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
if (multithread.terminate || perfstepsend <= MESHCONST_MESHVOLUME)
|
if (multithread.terminate || mparam.perfstepsend <= MESHCONST_MESHVOLUME)
|
||||||
return TCL_OK;
|
return TCL_OK;
|
||||||
|
|
||||||
|
|
||||||
if (perfstepsstart <= MESHCONST_OPTVOLUME)
|
if (mparam.perfstepsstart <= MESHCONST_OPTVOLUME)
|
||||||
{
|
{
|
||||||
multithread.task = "Volume optimization";
|
multithread.task = "Volume optimization";
|
||||||
|
|
||||||
|
@ -626,7 +626,7 @@ DLL_HEADER void ExportCSG(py::module &m)
|
|||||||
geo->FindIdenticSurfaces(1e-8 * geo->MaxSize());
|
geo->FindIdenticSurfaces(1e-8 * geo->MaxSize());
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
geo->GenerateMesh (dummy, param, 0, 6);
|
geo->GenerateMesh (dummy, param);
|
||||||
}
|
}
|
||||||
catch (NgException ex)
|
catch (NgException ex)
|
||||||
{
|
{
|
||||||
|
@ -986,8 +986,7 @@ namespace netgen
|
|||||||
MeshingParameters & mp);
|
MeshingParameters & mp);
|
||||||
|
|
||||||
|
|
||||||
int SplineGeometry2d :: GenerateMesh (shared_ptr<Mesh> & mesh, MeshingParameters & mparam,
|
int SplineGeometry2d :: GenerateMesh (shared_ptr<Mesh> & mesh, MeshingParameters & mparam)
|
||||||
int perfstepsstart, int perfstepsend)
|
|
||||||
{
|
{
|
||||||
MeshFromSpline2D (*this, mesh, mparam);
|
MeshFromSpline2D (*this, mesh, mparam);
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -156,8 +156,7 @@ namespace netgen
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
DLL_HEADER virtual int GenerateMesh (shared_ptr<Mesh> & mesh, MeshingParameters & mparam,
|
DLL_HEADER virtual int GenerateMesh (shared_ptr<Mesh> & mesh, MeshingParameters & mparam);
|
||||||
int perfstepsstart, int perfstepsend);
|
|
||||||
|
|
||||||
void PartitionBoundary (MeshingParameters & mp, double h, Mesh & mesh2d);
|
void PartitionBoundary (MeshingParameters & mp, double h, Mesh & mesh2d);
|
||||||
|
|
||||||
|
@ -258,7 +258,7 @@ DLL_HEADER void ExportGeom2d(py::module &m)
|
|||||||
mesh->SetGeometry(self);
|
mesh->SetGeometry(self);
|
||||||
SetGlobalMesh (mesh);
|
SetGlobalMesh (mesh);
|
||||||
ng_geometry = self;
|
ng_geometry = self;
|
||||||
self->GenerateMesh(mesh, mparam, 0, 0);
|
self->GenerateMesh(mesh, mparam);
|
||||||
return mesh;
|
return mesh;
|
||||||
}))
|
}))
|
||||||
|
|
||||||
|
@ -1,5 +1,8 @@
|
|||||||
|
#ifndef INCOPENGL_HPP___
|
||||||
|
#define INCOPENGL_HPP___
|
||||||
#define GL_GLEXT_PROTOTYPES
|
#define GL_GLEXT_PROTOTYPES
|
||||||
|
|
||||||
|
#include <mydefs.hpp>
|
||||||
|
|
||||||
# if defined(TOGL_AGL) || defined(TOGL_AGL_CLASSIC) || defined(TOGL_NSOPENGL)
|
# if defined(TOGL_AGL) || defined(TOGL_AGL_CLASSIC) || defined(TOGL_NSOPENGL)
|
||||||
# include <OpenGL/gl.h>
|
# include <OpenGL/gl.h>
|
||||||
@ -17,15 +20,20 @@
|
|||||||
#include <GL/glxext.h>
|
#include <GL/glxext.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef WIN32
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// part of OpenGL 1.2, but not in Microsoft's OpenGL 1.1 header:
|
// part of OpenGL 1.2, but not in Microsoft's OpenGL 1.1 header:
|
||||||
// GL version sould be checked at runtime
|
// GL version sould be checked at runtime
|
||||||
#ifndef GL_CLAMP_TO_EDGE
|
#define GL_CLAMP_TO_EDGE 0x812F
|
||||||
#define GL_CLAMP_TO_EDGE 0x812F
|
#define GL_ARRAY_BUFFER 0x8892
|
||||||
|
#define GL_ELEMENT_ARRAY_BUFFER 0x8893
|
||||||
|
#define GL_STATIC_DRAW 0x88E4
|
||||||
|
typedef ptrdiff_t GLintptr;
|
||||||
|
typedef ptrdiff_t GLsizeiptr;
|
||||||
|
extern void (*glBindBuffer) (GLenum a, GLuint b);
|
||||||
|
extern void (*glDeleteBuffers) (GLsizei a, const GLuint *b);
|
||||||
|
extern void (*glGenBuffers) (GLsizei a, GLuint *b);
|
||||||
|
extern void (*glBufferData) (GLenum a, GLsizeiptr b, const GLvoid *c, GLenum d);
|
||||||
|
extern void (*glBufferSubData) (GLenum a, GLintptr b, GLsizeiptr c, const GLvoid *d);
|
||||||
#endif
|
#endif
|
||||||
|
DLL_HEADER void LoadOpenGLFunctionPointers();
|
||||||
|
#endif // INCOPENGL_HPP___
|
||||||
|
|
||||||
|
@ -14,12 +14,11 @@ namespace netgen
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
int NetgenGeometry :: GenerateMesh (shared_ptr<Mesh> & mesh, MeshingParameters & mparam,
|
int NetgenGeometry :: GenerateMesh (shared_ptr<Mesh> & mesh, MeshingParameters & mparam)
|
||||||
int perfstepsstart, int perfstepsend)
|
|
||||||
{
|
{
|
||||||
if (!mesh) return 1;
|
if (!mesh) return 1;
|
||||||
|
|
||||||
if (perfstepsstart <= MESHCONST_MESHVOLUME)
|
if (mparam.perfstepsstart <= MESHCONST_MESHVOLUME)
|
||||||
{
|
{
|
||||||
multithread.task = "Volume meshing";
|
multithread.task = "Volume meshing";
|
||||||
|
|
||||||
@ -37,11 +36,11 @@ namespace netgen
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if (multithread.terminate || perfstepsend <= MESHCONST_MESHVOLUME)
|
if (multithread.terminate || mparam.perfstepsend <= MESHCONST_MESHVOLUME)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
|
|
||||||
if (perfstepsstart <= MESHCONST_OPTVOLUME)
|
if (mparam.perfstepsstart <= MESHCONST_OPTVOLUME)
|
||||||
{
|
{
|
||||||
multithread.task = "Volume optimization";
|
multithread.task = "Volume optimization";
|
||||||
|
|
||||||
|
@ -18,8 +18,7 @@ namespace netgen
|
|||||||
public:
|
public:
|
||||||
virtual ~NetgenGeometry () { ; }
|
virtual ~NetgenGeometry () { ; }
|
||||||
|
|
||||||
virtual int GenerateMesh (shared_ptr<Mesh> & mesh, MeshingParameters & mparam,
|
virtual int GenerateMesh (shared_ptr<Mesh> & mesh, MeshingParameters & mparam);
|
||||||
int perfstepsstart, int perfstepsend);
|
|
||||||
|
|
||||||
virtual const Refinement & GetRefinement () const;
|
virtual const Refinement & GetRefinement () const;
|
||||||
|
|
||||||
|
@ -1091,6 +1091,11 @@ namespace netgen
|
|||||||
double elsizeweight = 0.2;
|
double elsizeweight = 0.2;
|
||||||
/// init with default values
|
/// init with default values
|
||||||
|
|
||||||
|
/// start at step
|
||||||
|
int perfstepsstart = 0;
|
||||||
|
/// end at step
|
||||||
|
int perfstepsend = 6;
|
||||||
|
|
||||||
|
|
||||||
/// from mp3:
|
/// from mp3:
|
||||||
/// give up quality class, 2d meshing
|
/// give up quality class, 2d meshing
|
||||||
|
@ -586,12 +586,18 @@ DLL_HEADER void ExportNetgenMeshing(py::module &m)
|
|||||||
;
|
;
|
||||||
|
|
||||||
|
|
||||||
|
py::enum_<MESHING_STEP>(m,"MeshingStep")
|
||||||
|
.value("MESHEDGES",MESHCONST_MESHEDGES)
|
||||||
|
.value("MESHSURFACE",MESHCONST_OPTSURFACE)
|
||||||
|
.value("MESHVOLUME",MESHCONST_OPTVOLUME)
|
||||||
|
;
|
||||||
|
|
||||||
typedef MeshingParameters MP;
|
typedef MeshingParameters MP;
|
||||||
py::class_<MP> (m, "MeshingParameters")
|
py::class_<MP> (m, "MeshingParameters")
|
||||||
.def(py::init<>())
|
.def(py::init<>())
|
||||||
.def("__init__",
|
.def("__init__",
|
||||||
[](MP *instance, double maxh, bool quad_dominated, int optsteps2d, int optsteps3d,
|
[](MP *instance, double maxh, bool quad_dominated, int optsteps2d, int optsteps3d,
|
||||||
int only3D_domain)
|
MESHING_STEP perfstepsend, int only3D_domain)
|
||||||
{
|
{
|
||||||
new (instance) MeshingParameters;
|
new (instance) MeshingParameters;
|
||||||
instance->maxh = maxh;
|
instance->maxh = maxh;
|
||||||
@ -599,13 +605,14 @@ DLL_HEADER void ExportNetgenMeshing(py::module &m)
|
|||||||
instance->optsteps2d = optsteps2d;
|
instance->optsteps2d = optsteps2d;
|
||||||
instance->optsteps3d = optsteps3d;
|
instance->optsteps3d = optsteps3d;
|
||||||
instance->only3D_domain_nr = only3D_domain;
|
instance->only3D_domain_nr = only3D_domain;
|
||||||
|
instance->perfstepsend = perfstepsend;
|
||||||
},
|
},
|
||||||
py::arg("maxh")=1000,
|
py::arg("maxh")=1000,
|
||||||
py::arg("quad_dominated")=false,
|
py::arg("quad_dominated")=false,
|
||||||
py::arg("optsteps2d") = 3,
|
py::arg("optsteps2d") = 3,
|
||||||
py::arg("optsteps3d") = 3,
|
py::arg("optsteps3d") = 3,
|
||||||
py::arg("only3D_domain") = 0,
|
py::arg("only3D_domain") = 0,
|
||||||
py::arg("onlySurface") = false
|
py::arg("perfstepsend") = MESHCONST_OPTVOLUME,
|
||||||
,
|
,
|
||||||
"create meshing parameters"
|
"create meshing parameters"
|
||||||
)
|
)
|
||||||
|
@ -1273,12 +1273,11 @@ namespace netgen
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
int OCCGenerateMesh (OCCGeometry & geom, shared_ptr<Mesh> & mesh, MeshingParameters & mparam,
|
int OCCGenerateMesh (OCCGeometry & geom, shared_ptr<Mesh> & mesh, MeshingParameters & mparam)
|
||||||
int perfstepsstart, int perfstepsend)
|
|
||||||
{
|
{
|
||||||
multithread.percent = 0;
|
multithread.percent = 0;
|
||||||
|
|
||||||
if (perfstepsstart <= MESHCONST_ANALYSE)
|
if (mparam.perfstepsstart <= MESHCONST_ANALYSE)
|
||||||
{
|
{
|
||||||
// delete mesh;
|
// delete mesh;
|
||||||
// mesh = make_shared<Mesh>();
|
// mesh = make_shared<Mesh>();
|
||||||
@ -1287,10 +1286,10 @@ namespace netgen
|
|||||||
OCCSetLocalMeshSize(geom,*mesh);
|
OCCSetLocalMeshSize(geom,*mesh);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (multithread.terminate || perfstepsend <= MESHCONST_ANALYSE)
|
if (multithread.terminate || mparam.perfstepsend <= MESHCONST_ANALYSE)
|
||||||
return TCL_OK;
|
return TCL_OK;
|
||||||
|
|
||||||
if (perfstepsstart <= MESHCONST_MESHEDGES)
|
if (mparam.perfstepsstart <= MESHCONST_MESHEDGES)
|
||||||
{
|
{
|
||||||
OCCFindEdges (geom, *mesh);
|
OCCFindEdges (geom, *mesh);
|
||||||
|
|
||||||
@ -1360,12 +1359,12 @@ namespace netgen
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
if (multithread.terminate || perfstepsend <= MESHCONST_MESHEDGES)
|
if (multithread.terminate || mparam.perfstepsend <= MESHCONST_MESHEDGES)
|
||||||
return TCL_OK;
|
return TCL_OK;
|
||||||
|
|
||||||
if (perfstepsstart <= MESHCONST_MESHSURFACE)
|
if (mparam.perfstepsstart <= MESHCONST_MESHSURFACE)
|
||||||
{
|
{
|
||||||
OCCMeshSurface (geom, *mesh, perfstepsend);
|
OCCMeshSurface (geom, *mesh, mparam.perfstepsend);
|
||||||
if (multithread.terminate) return TCL_OK;
|
if (multithread.terminate) return TCL_OK;
|
||||||
|
|
||||||
#ifdef LOG_STREAM
|
#ifdef LOG_STREAM
|
||||||
@ -1384,10 +1383,10 @@ namespace netgen
|
|||||||
mesh->CalcSurfacesOfNode();
|
mesh->CalcSurfacesOfNode();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (multithread.terminate || perfstepsend <= MESHCONST_OPTSURFACE)
|
if (multithread.terminate || mparam.perfstepsend <= MESHCONST_OPTSURFACE)
|
||||||
return TCL_OK;
|
return TCL_OK;
|
||||||
|
|
||||||
if (perfstepsstart <= MESHCONST_MESHVOLUME)
|
if (mparam.perfstepsstart <= MESHCONST_MESHVOLUME)
|
||||||
{
|
{
|
||||||
multithread.task = "Volume meshing";
|
multithread.task = "Volume meshing";
|
||||||
|
|
||||||
@ -1426,10 +1425,10 @@ namespace netgen
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
if (multithread.terminate || perfstepsend <= MESHCONST_MESHVOLUME)
|
if (multithread.terminate || mparam.perfstepsend <= MESHCONST_MESHVOLUME)
|
||||||
return TCL_OK;
|
return TCL_OK;
|
||||||
|
|
||||||
if (perfstepsstart <= MESHCONST_OPTVOLUME)
|
if (mparam.perfstepsstart <= MESHCONST_OPTVOLUME)
|
||||||
{
|
{
|
||||||
multithread.task = "Volume optimization";
|
multithread.task = "Volume optimization";
|
||||||
|
|
||||||
|
@ -1564,10 +1564,9 @@ namespace netgen
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
int OCCGeometry :: GenerateMesh (shared_ptr<Mesh> & mesh, MeshingParameters & mparam,
|
int OCCGeometry :: GenerateMesh (shared_ptr<Mesh> & mesh, MeshingParameters & mparam)
|
||||||
int perfstepsstart, int perfstepsend)
|
|
||||||
{
|
{
|
||||||
return OCCGenerateMesh (*this, mesh, mparam, perfstepsstart, perfstepsend);
|
return OCCGenerateMesh (*this, mesh, mparam);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -387,8 +387,7 @@ namespace netgen
|
|||||||
|
|
||||||
// void WriteOCC_STL(char * filename);
|
// void WriteOCC_STL(char * filename);
|
||||||
|
|
||||||
DLL_HEADER virtual int GenerateMesh (shared_ptr<Mesh> & mesh, MeshingParameters & mparam,
|
DLL_HEADER virtual int GenerateMesh (shared_ptr<Mesh> & mesh, MeshingParameters & mparam);
|
||||||
int perfstepsstart, int perfstepsend);
|
|
||||||
|
|
||||||
DLL_HEADER virtual const Refinement & GetRefinement () const;
|
DLL_HEADER virtual const Refinement & GetRefinement () const;
|
||||||
};
|
};
|
||||||
|
@ -91,10 +91,9 @@ void STLGeometry :: Save (string filename) const
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
int STLGeometry :: GenerateMesh (shared_ptr<Mesh> & mesh, MeshingParameters & mparam,
|
int STLGeometry :: GenerateMesh (shared_ptr<Mesh> & mesh, MeshingParameters & mparam)
|
||||||
int perfstepsstart, int perfstepsend)
|
|
||||||
{
|
{
|
||||||
return STLMeshingDummy (this, mesh, mparam, perfstepsstart, perfstepsend);
|
return STLMeshingDummy (this, mesh, mparam);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -452,8 +452,7 @@ namespace netgen
|
|||||||
friend class MeshingSTLSurface;
|
friend class MeshingSTLSurface;
|
||||||
|
|
||||||
|
|
||||||
virtual int GenerateMesh (shared_ptr<Mesh> & mesh, MeshingParameters & mparam,
|
virtual int GenerateMesh (shared_ptr<Mesh> & mesh, MeshingParameters & mparam);
|
||||||
int perfstepsstart, int perfstepsend);
|
|
||||||
|
|
||||||
virtual const Refinement & GetRefinement () const;
|
virtual const Refinement & GetRefinement () const;
|
||||||
};
|
};
|
||||||
@ -463,8 +462,7 @@ namespace netgen
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
extern int STLMeshingDummy (STLGeometry* stlgeometry, shared_ptr<Mesh> & mesh, MeshingParameters & mparam,
|
extern int STLMeshingDummy (STLGeometry* stlgeometry, shared_ptr<Mesh> & mesh, MeshingParameters & mparam);
|
||||||
int perfstepsstart, int perfstepsend);
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -1329,16 +1329,15 @@ void STLGeometry :: RestrictHChartDistOneChart(int chartnum, Array<int>& acttrig
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
int STLMeshingDummy (STLGeometry* stlgeometry, shared_ptr<Mesh> & mesh, MeshingParameters & mparam,
|
int STLMeshingDummy (STLGeometry* stlgeometry, shared_ptr<Mesh> & mesh, MeshingParameters & mparam)
|
||||||
int perfstepsstart, int perfstepsend)
|
|
||||||
{
|
{
|
||||||
if (perfstepsstart > perfstepsend) return 0;
|
if (mparam.perfstepsstart > mparam.perfstepsend) return 0;
|
||||||
|
|
||||||
multithread.terminate = 0;
|
multithread.terminate = 0;
|
||||||
int success = 1;
|
int success = 1;
|
||||||
//int trialcntouter = 0;
|
//int trialcntouter = 0;
|
||||||
|
|
||||||
if (perfstepsstart <= MESHCONST_MESHEDGES)
|
if (mparam.perfstepsstart <= MESHCONST_MESHEDGES)
|
||||||
{
|
{
|
||||||
if (mesh)
|
if (mesh)
|
||||||
mesh -> DeleteMesh();
|
mesh -> DeleteMesh();
|
||||||
@ -1368,8 +1367,8 @@ int STLMeshingDummy (STLGeometry* stlgeometry, shared_ptr<Mesh> & mesh, MeshingP
|
|||||||
if (multithread.terminate)
|
if (multithread.terminate)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
if (perfstepsstart <= MESHCONST_MESHSURFACE &&
|
if (mparam.perfstepsstart <= MESHCONST_MESHSURFACE &&
|
||||||
perfstepsend >= MESHCONST_MESHSURFACE)
|
mparam.perfstepsend >= MESHCONST_MESHSURFACE)
|
||||||
{
|
{
|
||||||
|
|
||||||
if (!stlgeometry->edgesfound)
|
if (!stlgeometry->edgesfound)
|
||||||
@ -1417,8 +1416,8 @@ int STLMeshingDummy (STLGeometry* stlgeometry, shared_ptr<Mesh> & mesh, MeshingP
|
|||||||
|
|
||||||
if (success)
|
if (success)
|
||||||
{
|
{
|
||||||
if (perfstepsstart <= MESHCONST_OPTSURFACE &&
|
if (mparam.perfstepsstart <= MESHCONST_OPTSURFACE &&
|
||||||
perfstepsend >= MESHCONST_OPTSURFACE)
|
mparam.perfstepsend >= MESHCONST_OPTSURFACE)
|
||||||
{
|
{
|
||||||
if (!stlgeometry->edgesfound)
|
if (!stlgeometry->edgesfound)
|
||||||
{
|
{
|
||||||
@ -1469,8 +1468,8 @@ int STLMeshingDummy (STLGeometry* stlgeometry, shared_ptr<Mesh> & mesh, MeshingP
|
|||||||
if (multithread.terminate)
|
if (multithread.terminate)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
if (perfstepsstart <= MESHCONST_MESHVOLUME &&
|
if (mparam.perfstepsstart <= MESHCONST_MESHVOLUME &&
|
||||||
perfstepsend >= MESHCONST_MESHVOLUME)
|
mparam.perfstepsend >= MESHCONST_MESHVOLUME)
|
||||||
{
|
{
|
||||||
if (stlgeometry->volumemeshed)
|
if (stlgeometry->volumemeshed)
|
||||||
{
|
{
|
||||||
@ -1540,8 +1539,8 @@ int STLMeshingDummy (STLGeometry* stlgeometry, shared_ptr<Mesh> & mesh, MeshingP
|
|||||||
if (multithread.terminate)
|
if (multithread.terminate)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
if (perfstepsstart <= MESHCONST_OPTVOLUME &&
|
if (mparam.perfstepsstart <= MESHCONST_OPTVOLUME &&
|
||||||
perfstepsend >= MESHCONST_OPTVOLUME)
|
mparam.perfstepsend >= MESHCONST_OPTVOLUME)
|
||||||
{
|
{
|
||||||
if (!stlgeometry->edgesfound)
|
if (!stlgeometry->edgesfound)
|
||||||
{
|
{
|
||||||
|
@ -4805,3 +4805,22 @@ void Ng_Redraw (bool blocking)
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef OPENGL
|
||||||
|
#ifdef WIN32
|
||||||
|
void (*glBindBuffer) (GLenum a, GLuint b);
|
||||||
|
void (*glDeleteBuffers) (GLsizei a, const GLuint *b);
|
||||||
|
void (*glGenBuffers) (GLsizei a, GLuint *b);
|
||||||
|
void (*glBufferData) (GLenum a, GLsizeiptr b, const GLvoid *c, GLenum d);
|
||||||
|
void (*glBufferSubData) (GLenum a, GLintptr b, GLsizeiptr c, const GLvoid *d);
|
||||||
|
DLL_HEADER void LoadOpenGLFunctionPointers() {
|
||||||
|
glBindBuffer = (decltype(glBindBuffer)) wglGetProcAddress("glBindBuffer");
|
||||||
|
glBufferSubData = (decltype(glBufferSubData)) wglGetProcAddress("glBufferSubData");
|
||||||
|
glBufferData = (decltype(glBufferData)) wglGetProcAddress("glBufferData");
|
||||||
|
glDeleteBuffers = (decltype(glDeleteBuffers)) wglGetProcAddress("glDeleteBuffers");
|
||||||
|
glGenBuffers = (decltype(glGenBuffers)) wglGetProcAddress("glGenBuffers");
|
||||||
|
if(!glBindBuffer) throw std::runtime_error("Could not load OpenGL functions!");
|
||||||
|
}
|
||||||
|
#else // WIN32
|
||||||
|
DLL_HEADER void LoadOpenGLFunctionPointers() { }
|
||||||
|
#endif // WIN32
|
||||||
|
#endif // OPENGL
|
||||||
|
@ -43,7 +43,7 @@ class DLL_HEADER VisualSceneSolution : public VisualScene
|
|||||||
Point<3> p;
|
Point<3> p;
|
||||||
};
|
};
|
||||||
|
|
||||||
// #define USE_BUFFERS
|
#define USE_BUFFERS
|
||||||
#ifdef USE_BUFFERS
|
#ifdef USE_BUFFERS
|
||||||
bool has_surfel_vbo = false;
|
bool has_surfel_vbo = false;
|
||||||
GLuint surfel_vbo[4]; //
|
GLuint surfel_vbo[4]; //
|
||||||
|
@ -1328,8 +1328,9 @@ namespace netgen
|
|||||||
// vsmesh.SetMesh (mesh);
|
// vsmesh.SetMesh (mesh);
|
||||||
SetGlobalMesh (mesh);
|
SetGlobalMesh (mesh);
|
||||||
mesh -> SetGeometry(ng_geometry);
|
mesh -> SetGeometry(ng_geometry);
|
||||||
|
mparam.perfstepsstart = perfstepsstart;
|
||||||
int res = ng_geometry -> GenerateMesh (mesh, mparam, perfstepsstart, perfstepsend);
|
mparam.perfstepsend = perfstepsend;
|
||||||
|
int res = ng_geometry -> GenerateMesh (mesh, mparam);
|
||||||
|
|
||||||
if (res != MESHING3_OK)
|
if (res != MESHING3_OK)
|
||||||
{
|
{
|
||||||
@ -1938,6 +1939,7 @@ namespace netgen
|
|||||||
if (nodisplay)
|
if (nodisplay)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
LoadOpenGLFunctionPointers();
|
||||||
fontbase = Togl_LoadBitmapFont( togl, TOGL_BITMAP_8_BY_13 );
|
fontbase = Togl_LoadBitmapFont( togl, TOGL_BITMAP_8_BY_13 );
|
||||||
Set_OpenGLText_Callback (&MyOpenGLText_GUI);
|
Set_OpenGLText_Callback (&MyOpenGLText_GUI);
|
||||||
|
|
||||||
@ -2078,6 +2080,8 @@ namespace netgen
|
|||||||
// possible values: 12,14,16,18,20,22,24,28,32
|
// possible values: 12,14,16,18,20,22,24,28,32
|
||||||
font = selectFont(18);
|
font = selectFont(18);
|
||||||
|
|
||||||
|
LoadOpenGLFunctionPointers();
|
||||||
|
|
||||||
glMatrixMode(GL_PROJECTION);
|
glMatrixMode(GL_PROJECTION);
|
||||||
glLoadIdentity();
|
glLoadIdentity();
|
||||||
glMatrixMode(GL_MODELVIEW);
|
glMatrixMode(GL_MODELVIEW);
|
||||||
|
Loading…
Reference in New Issue
Block a user