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

added getNumMeshVertex, getMeshVertex

parent c4ec83d5
No related branches found
No related tags found
No related merge requests found
...@@ -55,8 +55,17 @@ class GEntity { ...@@ -55,8 +55,17 @@ class GEntity {
// The color of the entity (ignored if set to transparent blue) // The color of the entity (ignored if set to transparent blue)
unsigned int _color; unsigned int _color;
public: public: // these will become protected at some point
// The mesh vertices uniquely owned by the entity
std::vector<MVertex*> mesh_vertices;
// The physical entitites (if any) that contain this entity
std::vector<int> physicals;
// Vertex arrays to draw the mesh efficiently
VertexArray *va_lines, *va_triangles;
public:
// All known native model types // All known native model types
enum ModelType { enum ModelType {
UnknownModel, UnknownModel,
...@@ -243,14 +252,11 @@ class GEntity { ...@@ -243,14 +252,11 @@ class GEntity {
bool getAllElementsVisible(){ return _allElementsVisible ? true : false; } bool getAllElementsVisible(){ return _allElementsVisible ? true : false; }
void setAllElementsVisible(bool val){ _allElementsVisible = val ? 1 : 0; } void setAllElementsVisible(bool val){ _allElementsVisible = val ? 1 : 0; }
// The mesh vertices uniquely owned by the entity // Gets the number of mesh vertices in the entity
std::vector<MVertex*> mesh_vertices; unsigned int getNumMeshVertices() { return mesh_vertices.size(); }
// The physical entitites (if any) that contain this entity
std::vector<int> physicals;
// Vertex arrays to draw the mesh efficiently // Gets the mesh vertex at the given index
VertexArray *va_lines, *va_triangles; MVertex *getMeshVertex(unsigned int index) { return mesh_vertices[index]; }
}; };
class GEntityLessThan { class GEntityLessThan {
......
...@@ -69,8 +69,11 @@ void NgAddOn_Init() ...@@ -69,8 +69,11 @@ void NgAddOn_Init()
Ng_Result NgAddOn_GenerateVolumeMesh(Ng_Mesh *mesh, double maxh) Ng_Result NgAddOn_GenerateVolumeMesh(Ng_Mesh *mesh, double maxh)
{ {
Mesh *m = (Mesh*)mesh; Mesh *m = (Mesh*)mesh;
MeshingParameters mparam; MeshingParameters mparam;
mparam.uselocalh = 1;
mparam.maxh = maxh; mparam.maxh = maxh;
m->CalcLocalH(); m->CalcLocalH();
MeshVolume(mparam, *m); MeshVolume(mparam, *m);
//RemoveIllegalElements(*m); //RemoveIllegalElements(*m);
...@@ -82,8 +85,11 @@ Ng_Result NgAddOn_GenerateVolumeMesh(Ng_Mesh *mesh, double maxh) ...@@ -82,8 +85,11 @@ Ng_Result NgAddOn_GenerateVolumeMesh(Ng_Mesh *mesh, double maxh)
Ng_Result NgAddOn_OptimizeVolumeMesh(Ng_Mesh *mesh, double maxh) Ng_Result NgAddOn_OptimizeVolumeMesh(Ng_Mesh *mesh, double maxh)
{ {
Mesh *m = (Mesh*)mesh; Mesh *m = (Mesh*)mesh;
MeshingParameters mparam; MeshingParameters mparam;
mparam.uselocalh = 1;
mparam.maxh = maxh; mparam.maxh = maxh;
m->CalcLocalH(); m->CalcLocalH();
//MeshVolume(mparam, *m); //MeshVolume(mparam, *m);
RemoveIllegalElements(*m); RemoveIllegalElements(*m);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment