Closed GoogleCodeExporter closed 8 years ago
Original comment by Lince3D@gmail.com
on 12 Jan 2012 at 8:41
Tarea liberada.
Original comment by anderson...@gmail.com
on 22 Jan 2012 at 3:21
Original comment by Lince3D@gmail.com
on 24 Jan 2012 at 8:58
Original comment by jwl...@gmail.com
on 26 Jan 2012 at 8:41
Original comment by jwl...@gmail.com
on 26 Jan 2012 at 8:57
Resultado de la revisión:
-Hay comprobaciones de más. Si se quitaran no sería necesario añadir asserts
que añaden warnings (buscar ">>>>" abajo):
-----{
if (ls1.IntersectionPoint(ls2, vAux) == EQIntersections::E_One) // Check if AD and BC edges cross themselves
{
// It checks both triangles (ABvAux and CDvAux)
return (( PointsInSameSideOfLine(vPoint, vAux, this->A, this->B) &&
PointsInSameSideOfLine(vPoint, this->A, this->B, vAux) &&
PointsInSameSideOfLine(vPoint, this->B, vAux, this->A) ) ||
( PointsInSameSideOfLine(vPoint, this->C, vAux, this->D) &&
PointsInSameSideOfLine(vPoint, vAux, this->D, this->C) &&
PointsInSameSideOfLine(vPoint, this->D, this->C, vAux) ));
}
else // Check if AB and CD edges cross themselves
{
ls1 = QLineSegment2D(this->A, this->B);
ls2 = QLineSegment2D(this->C, this->D);
>>>>if (ls1.IntersectionPoint(ls2, vAux) == EQIntersections::E_One)
{
// It checks both triangles (ADvAux and BCvAux)
return (( PointsInSameSideOfLine(vPoint, this->A, vAux, this->D) &&
PointsInSameSideOfLine(vPoint, vAux, this->D, this->A) &&
PointsInSameSideOfLine(vPoint, this->D, this->A, vAux) ) ||
( PointsInSameSideOfLine(vPoint, this->B, this->C, vAux) &&
PointsInSameSideOfLine(vPoint, this->C, vAux, this->B) &&
PointsInSameSideOfLine(vPoint, vAux, this->B, this->C) ));
}
// Something is wrong! : Its crossed quadrilateral but there are no intersections between edges.
else
QE_ASSERT(false)
}
-----}
Ese bloque if, con su else, no es necesario puesto que ya has comrpbado,
perimero, que es crossed, y segundo, que no son dos de los lados los que
cruzan, por tanto, por fuerza, son los otros 2 lados y no tienes que
comprobarlo. Es decir, tal caso "extraño" no se dará nunca.
-Lo mismo ocurre aquí (de nuevo, buscar por >>>>):
-----{
>>>>else if (this->IsConcaveHere(this->D, this->A, this->C, this->B)) // Its
concave in D vertex
{
// We check the two triangles around D vertex
return (( PointsInSameSideOfLine(vPoint, this->B, this->D, this->A) &&
PointsInSameSideOfLine(vPoint, this->D, this->A, this->B) &&
PointsInSameSideOfLine(vPoint, this->A, this->B, this->D) ) ||
( PointsInSameSideOfLine(vPoint, this->C, this->D, this->B) &&
PointsInSameSideOfLine(vPoint, this->D, this->B, this->C) &&
PointsInSameSideOfLine(vPoint, this->B, this->C, this->D) ));
}
else // Something is wrong! : its concave but no vertex has concavity
QE_ASSERT(false)
------}
Aquí, éste es el último caso de la comprobación de los 4 vértices. Si los
3 primeros no son, por fuerza será el 4º.
Original comment by Lince3D@gmail.com
on 28 Jan 2012 at 11:46
Original comment by jwl...@gmail.com
on 30 Jan 2012 at 10:28
Resultado de la revisión: Correcta.
Original comment by Lince3D@gmail.com
on 30 Jan 2012 at 5:29
Original issue reported on code.google.com by
Lince3D@gmail.com
on 12 Jan 2012 at 8:41