vertex conflict for insert_third

Use vertex conflict instead of orientation in insert_third for
the case of three points. This change is to make SDG more L2
agnostic.

Given are three point sites s1, s2, s3.

The orientation of (s1,s2,s3) is not collinear if and only if the
two vertex conflict quadruples (s1,s2,inf,s3) and (s2,s1,inf,s3)
are of opposite signs.

The orientation of (s1,s2,s3) is right turn if and only if the
vertex conflict quadruple (s2,s1,inf,s3) is NEGATIVE.
This commit is contained in:
Panagiotis Cheilaris 2013-02-19 15:16:56 +01:00
parent 120bd950cd
commit 1a9b0dc079
1 changed files with 7 additions and 4 deletions

View File

@ -139,11 +139,14 @@ insert_third(const Site_2& t, const Storage_site_2& ss)
Site_2 s2 = f->vertex(1)->site();
Site_2 s3 = f->vertex(2)->site();
Orientation o =
geom_traits().orientation_2_object()(s1, s2, s3);
Sign s12i3 = geom_traits().vertex_conflict_2_object()(s1, s2, s3);
Sign s21i3 = geom_traits().vertex_conflict_2_object()(s2, s1, s3);
if ( o != COLLINEAR ) {
if ( o == RIGHT_TURN ) {
CGAL_assertion(s12i3 != ZERO);
CGAL_assertion(s21i3 != ZERO);
if ( s12i3 != s21i3 ) {
if ( s21i3 == NEGATIVE ) {
f->reorient();
for (int i = 0; i < 3; i++) {
f->neighbor(i)->reorient();