Merge remote-tracking branch 'cgal/5.1.x-branch' into master

This commit is contained in:
Sébastien Loriot 2020-10-20 13:35:25 +02:00
commit 209bee81b3
6 changed files with 67 additions and 88 deletions

View File

@ -7,30 +7,6 @@ CXX_FLAGS="-DCGAL_NDEBUG -ftemplate-backtrace-limit=0"
function mytime {
/usr/bin/time -f "Spend time of %C: %E (real)" "$@"
}
function build_examples {
mkdir -p build-travis
cd build-travis
mytime cmake -DCGAL_DIR="/usr/local/lib/cmake/CGAL" -DCMAKE_CXX_FLAGS="${CXX_FLAGS}" ..
mytime make -j2 VERBOSE=1
}
function build_tests {
build_examples
}
function build_demo {
mkdir -p build-travis
cd build-travis
EXTRA_CXX_FLAGS=
case "$CC" in
clang*)
EXTRA_CXX_FLAGS="-Werror=inconsistent-missing-override"
;;
esac
mytime cmake -DCGAL_DIR="/usr/local/lib/cmake/CGAL" -DCGAL_DONT_OVERRIDE_CMAKE_FLAGS:BOOL=ON -DCMAKE_CXX_FLAGS="${CXX_FLAGS} ${EXTRA_CXX_FLAGS}" ..
mytime make -j2 VERBOSE=1
}
old_IFS=$IFS
IFS=$' '
ROOT="$PWD/.."
@ -93,7 +69,25 @@ cd $ROOT
exit 1
fi
echo "Matrix is up to date."
exit 0
#check if non standard cgal installation works
cd $ROOT
mkdir build_test
cd build_test
mytime cmake -DCMAKE_INSTALL_PREFIX=install/ -DCGAL_BUILD_THREE_DOC=TRUE ..
mytime make install
# test install with minimal downstream example
mkdir installtest
cd installtest
touch main.cpp
mkdir build
echo 'project(Example)' >> CMakeLists.txt
echo 'set(PROJECT_SRCS ${PROJECT_SOURCE_DIR}/main.cpp)' >> CMakeLists.txt
echo 'find_package(CGAL REQUIRED)' >> CMakeLists.txt
echo 'add_executable(${PROJECT_NAME} ${PROJECT_SRCS})' >> CMakeLists.txt
echo 'target_link_libraries(${PROJECT_NAME} CGAL::CGAL)' >> CMakeLists.txt
echo '#include "CGAL/remove_outliers.h"' >> main.cpp
cd build
mytime cmake -DCMAKE_INSTALL_PREFIX=../../install -DCGAL_BUILD_THREE_DOC=TRUE ..
fi
if [ "$ARG" = "Installation" ]
@ -116,7 +110,7 @@ cd $ROOT
IFS=$old_IFS
if [ -n "$TRAVIS_PULL_REQUEST_BRANCH" ] && [ "$ARG" != Polyhedron_demo ]; then
if [ -n "$TRAVIS_PULL_REQUEST_BRANCH" ]; then
DO_IGNORE=FALSE
. $ROOT/.travis/test_package.sh "$ROOT" "$ARG"
echo "DO_IGNORE is $DO_IGNORE"
@ -125,67 +119,22 @@ cd $ROOT
fi
fi
IFS=$' '
EXAMPLES="$ARG/examples/$ARG"
TEST="$ARG/test/$ARG"
DEMOS=$ROOT/$ARG/demo/*
if [ -d "$ROOT/$EXAMPLES" ]
then
cd $ROOT/$EXAMPLES
if [ -f ./CMakeLists.txt ]; then
build_examples
else
for dir in ./*
do
if [ -f $dir/CMakeLists.txt ]; then
cd $ROOT/$EXAMPLES/$dir
build_examples
fi
done
fi
elif [ "$ARG" != Polyhedron_demo ]; then
echo "No example found for $ARG"
mkdir -p build-travis
cd build-travis
WITHDEMOS=ON
if [ "$ARG" = "Polyhedron" ]; then
WITHDEMOS=OFF
fi
EXTRA_CXX_FLAGS=
case "$CC" in
clang*)
EXTRA_CXX_FLAGS="-Werror=inconsistent-missing-override"
;;
esac
if [ -d "$ROOT/$TEST" ]
then
cd $ROOT/$TEST
if [ -f ./CMakeLists.txt ]; then
build_tests
else
for dir in ./*
do
if [ -f $dir/CMakeLists.txt ]; then
cd $ROOT/$TEST/$dir
build_tests
fi
done
fi
elif [ "$ARG" != Polyhedron_demo ]; then
echo "No test found for $ARG"
fi
#Packages like Periodic_3_triangulation_3 contain multiple demos
for DEMO in $DEMOS; do
DEMO=${DEMO#"$ROOT"}
echo $DEMO
#If there is no demo subdir, try in GraphicsView
if [ ! -d "$ROOT/$DEMO" ] || [ ! -f "$ROOT/$DEMO/CMakeLists.txt" ]; then
DEMO="GraphicsView/demo/$ARG"
fi
if [ "$ARG" != Polyhedron ] && [ -d "$ROOT/$DEMO" ]
then
cd $ROOT/$DEMO
build_demo
elif [ "$ARG" != Polyhedron_demo ]; then
echo "No demo found for $ARG"
fi
done
if [ "$ARG" = Polyhedron_demo ]; then
DEMO=Polyhedron/demo/Polyhedron
cd "$ROOT/$DEMO"
build_demo
fi
mytime cmake -DCMAKE_CXX_FLAGS="${CXX_FLAGS} ${EXTRA_CXX_FLAGS}" -DCGAL_DONT_OVERRIDE_CMAKE_FLAGS:BOOL=ON -DBUILD_TESTING=ON -DWITH_tests=ON -DWITH_examples=ON -DWITH_demos=$WITHDEMOS ..
mytime ctest -j2 -L $ARG'([_][A-Z]|$)' -E execution___of__ --output-on-failure
done
IFS=$old_IFS
# Local Variables:

View File

@ -171,7 +171,7 @@ public:
Weighted_point_2 transform(const Aff_transformation_2 &t) const
{
return Weighted_point_2(t.transform(point(),weight()));
return Weighted_point_2(t.transform(point()),weight());
}
};

View File

@ -186,7 +186,7 @@ public:
Weighted_point_3 transform(const Aff_transformation_3 &t) const
{
return Weighted_point_3(t.transform(point(),weight()));
return Weighted_point_3(t.transform(point()),weight());
}
};

View File

@ -63,6 +63,8 @@ _test_cls_aff_transformation_2(const R& )
CGAL::Point_2<R> p3( n1, n0, n4 ); // (-3, 0)
CGAL::Point_2<R> p4( n7, n2,-n6 ); // ( 4,11)
CGAL::Weighted_point_2<R> wp4( p4, n1 );
CGAL::Direction_2<R> d0(n13, n0);
CGAL::Direction_2<R> d1(n0, n13);
CGAL::Direction_2<R> dir = (p2 - p4).direction();
@ -72,6 +74,7 @@ _test_cls_aff_transformation_2(const R& )
CGAL::Point_2<R> tp2;
CGAL::Point_2<R> tp3;
CGAL::Point_2<R> tp4;
CGAL::Weighted_point_2<R> twp4;
CGAL::Segment_2<R> seg(p1,p2);
CGAL::Segment_2<R> tseg;
CGAL::Ray_2<R> ray(p3,p2);
@ -160,11 +163,14 @@ _test_cls_aff_transformation_2(const R& )
tp2 = p2.transform( a[i] );
tp3 = p3.transform( a[i] );
tp4 = p4.transform( a[i] );
twp4 = wp4.transform( a[i] );
tseg = seg.transform( a[i] );
tray = ray.transform( a[i] );
tlin = lin.transform( a[i] );
ttri = tri.transform( a[i] );
tisor= isor.transform( a[i]);
assert( twp4.point() == tp4 );
assert( twp4.weight() == wp4.weight() );
assert( tseg == CGAL::Segment_2<R>(tp1, tp2) );
assert( tray == CGAL::Ray_2<R>(tp3, tp2) );
assert( tlin == CGAL::Line_2<R>(tp2, tp4) || nonexact);
@ -173,11 +179,13 @@ _test_cls_aff_transformation_2(const R& )
inv = a[i].inverse();
tp4 = tp4.transform( inv );
twp4 = twp4.transform( inv );
tseg = tseg.transform( inv );
tray = tray.transform( inv );
tlin = tlin.transform( inv );
ttri = ttri.transform( inv );
assert( tp4 == p4 || nonexact );
assert( twp4 == wp4 || nonexact );
assert( tseg == seg || nonexact );
assert( tray == ray || nonexact );
assert( tlin == lin || nonexact );

View File

@ -61,6 +61,7 @@ _test_cls_aff_transformation_3(const R& )
CGAL::Point_3<R> p2( n5, n4,-n12, n4 ); // ( 5, 1,-4)
CGAL::Point_3<R> p3( n1, n0, n14, n4 ); // (-3, 0, 7)
CGAL::Point_3<R> p4( n7, n2, n8, -n6 ); // ( 4,11, 9)
CGAL::Weighted_point_3<R> wp4( p4, n7 );
CGAL::Direction_3<R> d0(n13, n0, n0);
CGAL::Direction_3<R> d1(n0, n13, n0);
@ -75,6 +76,7 @@ _test_cls_aff_transformation_3(const R& )
CGAL::Point_3<R> tp2;
CGAL::Point_3<R> tp3;
CGAL::Point_3<R> tp4;
CGAL::Weighted_point_3<R> twp4;
CGAL::Segment_3<R> seg(p1,p2);
CGAL::Segment_3<R> tseg;
CGAL::Ray_3<R> ray(p3,p2);
@ -174,12 +176,15 @@ _test_cls_aff_transformation_3(const R& )
tp2 = p2.transform( a[i] );
tp3 = p3.transform( a[i] );
tp4 = p4.transform( a[i] );
twp4 = wp4.transform( a[i] );
tpla = pla.transform( a[i] );
tseg = seg.transform( a[i] );
tray = ray.transform( a[i] );
tlin = lin.transform( a[i] );
ttri = tri.transform( a[i] );
ttet = tet.transform( a[i] );
assert( twp4.point() == tp4 );
assert( twp4.weight() == wp4.weight() );
assert( tpla == CGAL::Plane_3<R>( tp1, tp2, tp3) || nonexact );
assert( tseg == CGAL::Segment_3<R>(tp1, tp2) );
assert( tray == CGAL::Ray_3<R>(tp3, tp2) );
@ -188,6 +193,7 @@ _test_cls_aff_transformation_3(const R& )
assert( ttet == CGAL::Tetrahedron_3<R>(tp1, tp2, tp3, tp4) );
inv = a[i].inverse();
tp4 = tp4.transform( inv );
twp4 = twp4.transform( inv );
tpla = tpla.transform( inv );
tseg = tseg.transform( inv );
tray = tray.transform( inv );
@ -195,6 +201,7 @@ _test_cls_aff_transformation_3(const R& )
ttri = ttri.transform( inv );
ttet = ttet.transform( inv );
assert( tp4 == p4 || nonexact );
assert( twp4 == wp4 || nonexact );
assert( tpla == pla || nonexact );
assert( tseg == seg || nonexact );
assert( tray == ray || nonexact );

View File

@ -1296,6 +1296,7 @@ private:
}
typedef std::pair<Exact_point, vertex_descriptor> Pair_type;
std::vector<Pair_type> duplicated_points;
for(const Pair_type& p : points)
{
std::size_t vid = get(m_vertex_id_pmap, p.second);
@ -1320,9 +1321,23 @@ private:
max_neg_t = t;
}
}
p.second->pole = cell_dual[max_neg_i];
// max_neg_i is -1 only when duplicated the point is duplicated
// (null edge or non-manifold issue resolved with duplication)
if (max_neg_i!=-1)
p.second->pole = cell_dual[max_neg_i];
else
duplicated_points.push_back(p);
}
for (const Pair_type& p : duplicated_points)
{
typename Delaunay::Locate_type lt;
int li, lj;
typename Delaunay::Cell_handle cell = T.locate (p.first, lt, li, lj);
CGAL_assertion(lt==Delaunay::VERTEX);
p.second->pole = cell->vertex(li)->info()->pole; // copy the pole of the point present in the DT3
}
m_are_poles_computed = true;
}