Commit 0b972226 authored by Darcy Beurle's avatar Darcy Beurle

Formatting

parent 201ba8a5
......@@ -207,17 +207,26 @@ class Diagonal{
bool operator<(const Diagonal& rhs) const { return hash<rhs.get_hash(); }
};
class Tuple{
private:
MVertex *v1,*v2,*v3;
class Tuple {
private:
MVertex *v1, *v2, *v3;
MElement *element;
GFace *gf;
unsigned long long hash;
public:
Tuple() : v1(NULL), v2(NULL), v3(NULL), element(NULL), gf(NULL), hash(0.) {}
Tuple(MVertex* a, MVertex* b, MVertex* c, MElement* element2, GFace* gf2)
public:
Tuple()
: v1(NULL)
, v2(NULL)
, v3(NULL)
, element(NULL)
, gf(NULL)
, hash(0.)
{
MVertex* tmp[3] = { a,b,c };
}
Tuple(MVertex *a, MVertex *b, MVertex *c, MElement *element2, GFace *gf2)
{
MVertex *tmp[3] = {a, b, c};
std::sort(tmp, tmp + 3);
v1 = tmp[0];
v2 = tmp[1];
......@@ -226,32 +235,34 @@ class Tuple{
element = element2;
gf = gf2;
}
Tuple(MVertex* a, MVertex* b, MVertex* c)
:element(NULL), gf(NULL)
Tuple(MVertex *a, MVertex *b, MVertex *c)
: element(NULL)
, gf(NULL)
{
MVertex* tmp[3] = { a,b,c };
MVertex *tmp[3] = {a, b, c};
std::sort(tmp, tmp + 3);
v1 = tmp[0];
v2 = tmp[1];
v2 = tmp[2];
hash = a->getNum() + b->getNum() + c->getNum();
}
~Tuple() {};
MVertex* get_v1() const {return v1;}
MVertex* get_v2() const {return v2;}
MVertex* get_v3() const {return v3;}
MElement* get_element() const { return element; }
GFace* get_gf() const { return gf; }
bool same_vertices(const Tuple& rhs) const
~Tuple(){};
MVertex *get_v1() const { return v1; }
MVertex *get_v2() const { return v2; }
MVertex *get_v3() const { return v3; }
MElement *get_element() const { return element; }
GFace *get_gf() const { return gf; }
bool same_vertices(const Tuple &rhs) const
{
if (v1 == rhs.get_v1() && v2 == rhs.get_v2() && v3 == rhs.get_v3()) {
if(v1 == rhs.get_v1() && v2 == rhs.get_v2() && v3 == rhs.get_v3()) {
return true;
} else {
}
else {
return false;
}
}
unsigned long long get_hash() const { return hash; }
bool operator<(const Tuple& rhs) const { return hash< rhs.get_hash(); }
bool operator<(const Tuple &rhs) const { return hash < rhs.get_hash(); }
};
// Class in charge of answering connectivity requests on the input tetraedral
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment