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

tets

parent 29f82023
No related branches found
No related tags found
No related merge requests found
......@@ -114,6 +114,26 @@ class BarycenterLessThan{
}
};
class BarycenterHash {
public:
std::size_t operator()(const Barycenter &b) const
{
return b.x()+b.y()+b.z();
}
};
class BarycenterEqual {
public:
bool operator ()(const Barycenter &a, const Barycenter &b) const
{
return (fabs(a.x()-b.x()) < BarycenterLessThan::tolerance &&
fabs(a.y()-b.y()) < BarycenterLessThan::tolerance &&
fabs(a.z()-b.z()) < BarycenterLessThan::tolerance);
}
};
//#include <tr1/unordered_set>
class VertexArray{
private:
int _numVerticesPerElement;
......@@ -123,6 +143,8 @@ class VertexArray{
std::vector<MElement*> _elements;
std::set<ElementData<3>, ElementDataLessThan<3> > _data3;
std::set<Barycenter, BarycenterLessThan> _barycenters;
//std::tr1::unordered_set<Barycenter, BarycenterHash, BarycenterEqual> _barycenters;
// add stuff in the arrays
void _addVertex(float x, float y, float z);
void _addNormal(float nx, float ny, float nz);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment