interface

This commit is contained in:
Joachim Schoeberl 2010-05-17 09:00:30 +00:00
parent 8f59f8bdf8
commit 33322c741c
3 changed files with 44 additions and 0 deletions

View File

@ -111,6 +111,40 @@ namespace netgen
public:
Ng_Vertices vertices;
};
template <>
class Ng_Node<2>
{
class Ng_Vertices
{
public:
int nv;
const int * ptr;
int Size() const { return nv; }
int operator[] (int i) const { return ptr[i]-1; }
};
class Ng_Edges
{
public:
int ned;
const int * ptr;
int Size() const { return ned; }
int operator[] (int i) const { return ptr[i]-1; }
};
public:
Ng_Vertices vertices;
Ng_Edges edges;
};
template <int DIM>
DLL_HEADER Ng_Node<DIM> Ng_GetNode (int nr);

View File

@ -87,6 +87,7 @@ public:
void GetFaceVertices (int fnr, int * vertices) const;
void GetEdgeVertices (int enr, int & v1, int & v2) const;
const int * GetEdgeVerticesPtr (int enr) const { return &edge2vert[enr][0]; }
const int * GetFaceVerticesPtr (int fnr) const { return &face2vert[fnr][0]; }
void GetFaceEdges (int fnr, Array<int> & edges, bool withorientation = false) const;
ELEMENT_TYPE GetFaceType (int fnr) const;

View File

@ -263,4 +263,13 @@ namespace netgen
}
template <> DLL_HEADER Ng_Node<2> Ng_GetNode<2> (int nr)
{
Ng_Node<2> node;
node.vertices.ptr = mesh->GetTopology().GetFaceVerticesPtr(nr);
node.vertices.nv = (node.vertices.ptr[3] == 0) ? 3 : 4;
return node;
}
}