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 {
// The color of the entity (ignored if set to transparent blue)
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
enum ModelType {
UnknownModel,
......@@ -243,14 +252,11 @@ class GEntity {
bool getAllElementsVisible(){ return _allElementsVisible ? true : false; }
void setAllElementsVisible(bool val){ _allElementsVisible = val ? 1 : 0; }
// 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;
// Gets the number of mesh vertices in the entity
unsigned int getNumMeshVertices() { return mesh_vertices.size(); }
// Vertex arrays to draw the mesh efficiently
VertexArray *va_lines, *va_triangles;
// Gets the mesh vertex at the given index
MVertex *getMeshVertex(unsigned int index) { return mesh_vertices[index]; }
};
class GEntityLessThan {
......
......@@ -69,12 +69,15 @@ void NgAddOn_Init()
Ng_Result NgAddOn_GenerateVolumeMesh(Ng_Mesh *mesh, double maxh)
{
Mesh *m = (Mesh*)mesh;
MeshingParameters mparam;
mparam.uselocalh = 1;
mparam.maxh = maxh;
m->CalcLocalH();
MeshVolume(mparam, *m);
//RemoveIllegalElements(*m);
//OptimizeVolume (mparam, *m);
//OptimizeVolume(mparam, *m);
return NG_OK;
}
......@@ -82,10 +85,13 @@ Ng_Result NgAddOn_GenerateVolumeMesh(Ng_Mesh *mesh, double maxh)
Ng_Result NgAddOn_OptimizeVolumeMesh(Ng_Mesh *mesh, double maxh)
{
Mesh *m = (Mesh*)mesh;
MeshingParameters mparam;
mparam.uselocalh = 1;
mparam.maxh = maxh;
m->CalcLocalH();
//MeshVolume (mparam, *m);
//MeshVolume(mparam, *m);
RemoveIllegalElements(*m);
OptimizeVolume(mparam, *m);
return NG_OK;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment