Commit c3adb40e by Amaury Johnen

fix bug reversed quad (issue #293)

parent edde29c3
......@@ -350,6 +350,24 @@ double MQuadrangle::getInnerRadius()
#endif // HAVE_LAPACK
}
void MQuadrangleN::reverse()
{
MVertex *tmp;
tmp = _v[1]; _v[1] = _v[3]; _v[3] = tmp;
int npts = _order-1, base = 0;
std::vector<MVertex*>::iterator begin = _vs.begin() + base;
while (npts > 0) {
std::reverse(begin, begin + 4 * npts);
base += 4 * npts;
if (npts > 1) {
tmp = _vs[base+1]; _vs[base+1] = _vs[base+3]; _vs[base+3] = tmp;
}
npts -= 2;
begin = _vs.begin() + base + 4;
}
}
void MQuadrangle::reorient(int rot, bool swap) {
MVertex* tmp[4];
......
......@@ -451,14 +451,7 @@ class MQuadrangleN : public MQuadrangle {
if(_order== 2 && _vs.size() + 4 == 8) return 23;
return MQuadrangle::getTypeForVTK();
}
virtual void reverse()
{
MVertex *tmp;
tmp = _v[1]; _v[1] = _v[3]; _v[3] = tmp;
std::vector<MVertex*> inv;
inv.insert(inv.begin(), _vs.rbegin(), _vs.rend());
_vs = inv;
}
virtual void reverse();
// reorient the quadrangle to conform with other face
// orientation computed with MFace based on this face with respect to other
......
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