[sfcgal] 02/06: New upstream version 1.3.2
Bas Couwenberg
sebastic at debian.org
Fri Sep 15 19:09:13 UTC 2017
This is an automated email from the git hooks/post-receive script.
sebastic pushed a commit to branch master
in repository sfcgal.
commit f39e695d3a8979c383ff6cfa1b2f7cb4dc4d5aed
Author: Bas Couwenberg <sebastic at xs4all.nl>
Date: Fri Sep 15 20:49:10 2017 +0200
New upstream version 1.3.2
---
CMakeLists.txt | 4 ++--
NEWS | 2 ++
src/algorithm/Intersection3D.cpp | 32 ++++++++++++++++++++++++++++----
src/algorithm/connection.cpp | 4 ++++
src/algorithm/connection.h | 2 +-
src/algorithm/distance.cpp | 2 +-
src/algorithm/distance3d.cpp | 10 +++++++---
src/algorithm/isValid.cpp | 2 +-
8 files changed, 46 insertions(+), 12 deletions(-)
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 4f1f201..3977716 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -25,7 +25,7 @@ set( CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake/Modules;${CMAKE_MODULE_PATH}"
set( SFCGAL_VERSION_MAJOR 1 )
set( SFCGAL_VERSION_MINOR 3 )
-set( SFCGAL_VERSION_PATCH 1 )
+set( SFCGAL_VERSION_PATCH 2 )
set( SFCGAL_VERSION "${SFCGAL_VERSION_MAJOR}.${SFCGAL_VERSION_MINOR}.${SFCGAL_VERSION_PATCH}" )
@@ -134,7 +134,7 @@ include_directories( ${CMAKE_BINARY_DIR}/include )
# They will overwrite files from the CGAL installation
if( "${CGAL_VERSION}" VERSION_LESS "4.3" )
include_directories( patches/CGAL-4.2 )
-else()
+elseif( "${CGAL_VERSION}" VERSION_LESS "4.10")
include_directories( patches/CGAL-4.3 )
add_definitions( "-DCGAL_INTERSECTION_VERSION=1" )
endif()
diff --git a/NEWS b/NEWS
index 973fd40..58e9a44 100644
--- a/NEWS
+++ b/NEWS
@@ -1,3 +1,5 @@
+1.3.2 (2017-09-13):
+ * Fix compilation with CGAL 4.10. CGAL 4.10.1 is needed
1.3.1 (2017-05-29):
* Add a SFCGAL-osg library for OSG specific functions
* Fix C API geometry_is_planar
diff --git a/src/algorithm/Intersection3D.cpp b/src/algorithm/Intersection3D.cpp
index 3011856..989d0c3 100644
--- a/src/algorithm/Intersection3D.cpp
+++ b/src/algorithm/Intersection3D.cpp
@@ -31,6 +31,7 @@
#include <SFCGAL/detail/triangulate/triangulateInGeometrySet.h>
#include <CGAL/IO/Polyhedron_iostream.h>
+#include <CGAL/Polygon_mesh_processing/corefinement.h>
#include <SFCGAL/detail/Point_inside_polyhedron.h>
@@ -108,10 +109,13 @@ void _intersection_solid_segment( const PrimitiveHandle<3>& pa, const PrimitiveH
}
-#if CGAL_VERSION_NR < 1040301000 // version 4.3
+#if CGAL_VERSION_NR < 1040301000 // 4.3
+
// Before 4.3, we pass CGAL::Tag_true to mark boundary halfedges
typedef CGAL::Node_visitor_refine_polyhedra<MarkedPolyhedron, Kernel, CGAL::Tag_true> Split_visitor;
-#else
+
+#elif CGAL_VERSION_NR < 1041001000 // < 4.10
+
// Starting with 4.3, we must now pass a property_map
template<class Polyhedron>
struct Edge_mark_property_map {
@@ -128,6 +132,25 @@ struct Edge_mark_property_map {
}
};
typedef CGAL::Node_visitor_refine_polyhedra<MarkedPolyhedron,Kernel,Edge_mark_property_map<MarkedPolyhedron> > Split_visitor;
+
+#else
+
+template<class Polyhedron>
+struct Edge_mark_property_map {
+ typedef bool value_type;
+ typedef value_type reference;
+ typedef std::pair<typename Polyhedron::Halfedge_handle,Polyhedron*> key_type;
+ typedef boost::read_write_property_map_tag category;
+
+ friend reference get( Edge_mark_property_map,const key_type& key ) {
+ return key.first->mark;
+ }
+ friend void put( Edge_mark_property_map,key_type key,value_type v ) {
+ key.first->mark=v;
+ }
+};
+typedef CGAL::Node_visitor_refine_polyhedra<MarkedPolyhedron, CGAL::Default, CGAL::Default,Edge_mark_property_map<MarkedPolyhedron> > Split_visitor;
+
#endif
typedef std::vector<Kernel::Point_3> Polyline_3;
@@ -138,10 +161,11 @@ struct Is_not_marked {
}
};
+
void _intersection_solid_triangle( const MarkedPolyhedron& pa, const CGAL::Triangle_3<Kernel>& tri, GeometrySet<3>& output )
{
BOOST_ASSERT( pa.is_closed() );
- Split_visitor visitor( NULL, true );
+ Split_visitor visitor;
MarkedPolyhedron polyb;
polyb.make_triangle( tri.vertex( 0 ), tri.vertex( 1 ), tri.vertex( 2 ) );
@@ -258,7 +282,7 @@ void _intersection_solid_triangle( const MarkedPolyhedron& pa, const CGAL::Trian
output.addPrimitive( seg );
}
}
- }
+}
}
void _intersection_solid_solid( const MarkedPolyhedron& pa, const MarkedPolyhedron& pb, GeometrySet<3>& output )
diff --git a/src/algorithm/connection.cpp b/src/algorithm/connection.cpp
index 0d3906f..48ab83a 100644
--- a/src/algorithm/connection.cpp
+++ b/src/algorithm/connection.cpp
@@ -28,9 +28,13 @@
#include <SFCGAL/PolyhedralSurface.h>
#include <SFCGAL/TriangulatedSurface.h>
+#include <limits>
+
namespace SFCGAL {
namespace algorithm {
+const size_t SurfaceGraph::INVALID_INDEX = std::numeric_limits< size_t >::max();
+
void SurfaceGraph::addRing( const LineString& ring, FaceIndex faceIndex )
{
const size_t numSegments = ring.numSegments() ;
diff --git a/src/algorithm/connection.h b/src/algorithm/connection.h
index ed9627c..50bcec5 100644
--- a/src/algorithm/connection.h
+++ b/src/algorithm/connection.h
@@ -44,7 +44,7 @@ public:
typedef size_t VertexIndex;
typedef size_t FaceIndex;
typedef std::map< Coordinate, VertexIndex > CoordinateMap ;
- static const size_t INVALID_INDEX = size_t( -1 ) ; // would use std::numeric_limits< size_t >::max() if it were constant, or SIZE_MAX if it were easier to find.
+ static const size_t INVALID_INDEX;
// an edge is inserted with vtx ordered by the first polygon we treat,
// we search the edge with reverse ordered vtx indexes.
// as a result, an inconsistent orientation between polygons can be spotted by
diff --git a/src/algorithm/distance.cpp b/src/algorithm/distance.cpp
index 2dc5c7e..a633a1b 100644
--- a/src/algorithm/distance.cpp
+++ b/src/algorithm/distance.cpp
@@ -496,7 +496,7 @@ double distanceGeometryCollectionToGeometry( const Geometry& gA, const Geometry&
// point of BS(gAi) there is no need to compute the distance(gAj, gB)
// since it will be greater than distance(gAi, gB)
//
- // The aim is not to find the minimal bounding sphere, but a good enought sphere than
+ // The aim is not to find the minimal bounding sphere, but a good enough sphere than
// encloses all points
std::set<size_t> noTest;
diff --git a/src/algorithm/distance3d.cpp b/src/algorithm/distance3d.cpp
index 15e4d0d..f2bc665 100644
--- a/src/algorithm/distance3d.cpp
+++ b/src/algorithm/distance3d.cpp
@@ -588,7 +588,7 @@ double distanceGeometryCollectionToGeometry3D( const Geometry& gA, const Geometr
// point of BS(gAi) there is no need to compute the distance(gAj, gB)
// since it will be greater than distance(gAi, gB)
//
- // The aim is not to find the minimal bounding sphere, but a good enought sphere than
+ // The aim is not to find the minimal bounding sphere, but a good enough sphere than
// encloses all points
std::set<size_t> noTest;
@@ -682,6 +682,9 @@ squared_distance_t squaredDistancePointTriangle3D(
const Triangle_3& abc
)
{
+#if CGAL_VERSION_NR >= 1041001000 // >= 4.10
+ return CGAL::squared_distance(p, abc);
+#else
Point_3 a = abc.vertex( 0 );
Point_3 b = abc.vertex( 1 );
Point_3 c = abc.vertex( 2 );
@@ -706,6 +709,7 @@ squared_distance_t squaredDistancePointTriangle3D(
}
return dMin ;
+#endif
}
///
@@ -759,7 +763,7 @@ squared_distance_t squaredDistanceSegmentTriangle3D(
/*
* If [sAsB] intersects the triangle (tA,tB,tC), distance is 0.0
*/
- if ( ! CGAL::intersection( sAB, tABC ).empty() ) {
+ if ( boost::none != CGAL::intersection( sAB, tABC ) ) {
return 0.0 ;
}
@@ -817,7 +821,7 @@ squared_distance_t squaredDistanceTriangleTriangle3D(
const Triangle_3& triangleB
)
{
- if ( ! CGAL::intersection( triangleA, triangleB ).empty() ) {
+ if ( boost::none != CGAL::intersection( triangleA, triangleB ) ) {
return squared_distance_t( 0 );
}
diff --git a/src/algorithm/isValid.cpp b/src/algorithm/isValid.cpp
index 8f35546..92a79db 100644
--- a/src/algorithm/isValid.cpp
+++ b/src/algorithm/isValid.cpp
@@ -183,7 +183,7 @@ const Validity isValid( const Polygon& p, const double& toleranceAbs )
for ( size_t r=0; r != numRings; ++r ) {
if ( p.ringN( r ).numPoints() < 4 ) {
- return Validity::invalid( ( boost::format( "not enought points in ring %d" ) % r ).str() );
+ return Validity::invalid( ( boost::format( "not enough points in ring %d" ) % r ).str() );
}
// const Validity v = isValid( p.ringN(r) );
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-grass/sfcgal.git
More information about the Pkg-grass-devel
mailing list