[sfcgal] 02/11: Imported Upstream version 1.3.1
Bas Couwenberg
sebastic at debian.org
Mon May 29 11:27:46 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 44b43f3ca8be806fcd8be282093f3c61f4570d3d
Author: Bas Couwenberg <sebastic at xs4all.nl>
Date: Mon May 29 10:33:56 2017 +0200
Imported Upstream version 1.3.1
---
CMakeLists.txt | 15 +++++-
NEWS | 4 ++
doc/Doxyfile.in | 2 +-
example/CMakeLists.txt | 1 -
example/SFCGAL-asc2osg/CMakeLists.txt | 14 ------
example/SFCGAL-asc2osg/main.cpp | 85 --------------------------------
example/SFCGAL-building/CMakeLists.txt | 18 +++----
example/SFCGAL-export-osg/CMakeLists.txt | 7 +--
src/CMakeLists.txt | 50 ++++++++++++++++---
src/capi/sfcgal_c.cpp | 2 +-
10 files changed, 73 insertions(+), 125 deletions(-)
diff --git a/CMakeLists.txt b/CMakeLists.txt
index bbf7f24..4f1f201 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -18,12 +18,14 @@ option( SFCGAL_BUILD_EXAMPLES "build examples" OFF )
option( SFCGAL_BUILD_TESTS "build unit, garden and regress tests" OFF )
option( SFCGAL_BUILD_BENCH "Build benchmarks" OFF )
+option( SFCGAL_WITH_OSG "Compile with OpenSceneGraph support" OFF )
+
#-- include finders and co
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 0 )
+set( SFCGAL_VERSION_PATCH 1 )
set( SFCGAL_VERSION "${SFCGAL_VERSION_MAJOR}.${SFCGAL_VERSION_MINOR}.${SFCGAL_VERSION_PATCH}" )
@@ -106,6 +108,17 @@ if( NOT ${GMP_FOUND} OR NOT ${MPFR_FOUND} )
endif()
+#-- OpenScenegraph -----------------------------------------
+if ( SFCGAL_WITH_OSG )
+ find_package( OpenSceneGraph COMPONENTS osgDB osgUtil )
+ if( ${OPENSCENEGRAPH_FOUND} )
+ message( STATUS "OPENSCENEGRAPH_INCLUDE_DIRS = ${OPENSCENEGRAPH_INCLUDE_DIRS}" )
+ message( STATUS "OPENSCENEGRAPH_LIBRARIES = ${OPENSCENEGRAPH_LIBRARIES}" )
+
+ include_directories( SYSTEM ${OPENSCENEGRAPH_INCLUDE_DIRS} )
+ endif()
+endif()
+
#-- find CGAL ---------------------------------------------
option( CGAL_USE_AUTOLINK "disable CGAL autolink" OFF )
if( ${CGAL_USE_AUTOLINK} )
diff --git a/NEWS b/NEWS
index 34dcdab..973fd40 100644
--- a/NEWS
+++ b/NEWS
@@ -1,3 +1,7 @@
+1.3.1 (2017-05-29):
+ * Add a SFCGAL-osg library for OSG specific functions
+ * Fix C API geometry_is_planar
+ * Fix Doxygen script
1.3.0 (2016-02-29):
* Add a validity flag to geometries
* Add an option to straight skeleton to return the distance to borders
diff --git a/doc/Doxyfile.in b/doc/Doxyfile.in
index 79fd4c6..9da5cf3 100644
--- a/doc/Doxyfile.in
+++ b/doc/Doxyfile.in
@@ -657,7 +657,7 @@ WARN_LOGFILE =
# directories like "/usr/src/myproject". Separate the files or directories
# with spaces.
-INPUT = ../include \
+INPUT = ../include ../src \
.
# This tag can be used to specify the character encoding of the source files
diff --git a/example/CMakeLists.txt b/example/CMakeLists.txt
index 55b9fd4..6c99d15 100644
--- a/example/CMakeLists.txt
+++ b/example/CMakeLists.txt
@@ -7,7 +7,6 @@ add_subdirectory( SFCGAL-offset )
if ( SFCGAL_WITH_OSG )
add_subdirectory( SFCGAL-export-osg )
- add_subdirectory( SFCGAL-asc2osg )
add_subdirectory( SFCGAL-building )
endif()
diff --git a/example/SFCGAL-asc2osg/CMakeLists.txt b/example/SFCGAL-asc2osg/CMakeLists.txt
deleted file mode 100644
index 94afac2..0000000
--- a/example/SFCGAL-asc2osg/CMakeLists.txt
+++ /dev/null
@@ -1,14 +0,0 @@
-GET_FILENAME_COMPONENT( EXAMPLE_NAME ${CMAKE_CURRENT_SOURCE_DIR} NAME )
-add_executable( example-${EXAMPLE_NAME}
- main.cpp
-)
-target_link_libraries( example-${EXAMPLE_NAME}
- SFCGAL
- ${CGAL_LIBRARIES}
- ${MPFR_LIBRARIES}
- ${GMP_LIBRARIES}
- ${OPENSCENEGRAPH_LIBRARIES}
- ${Boost_LIBRARIES}
-)
-set_target_properties( example-${EXAMPLE_NAME} PROPERTIES DEBUG_POSTFIX "d" )
-install( TARGETS example-${EXAMPLE_NAME} DESTINATION bin )
\ No newline at end of file
diff --git a/example/SFCGAL-asc2osg/main.cpp b/example/SFCGAL-asc2osg/main.cpp
deleted file mode 100644
index b0bb8f0..0000000
--- a/example/SFCGAL-asc2osg/main.cpp
+++ /dev/null
@@ -1,85 +0,0 @@
-/**
- * SFCGAL
- *
- * Copyright (C) 2012-2013 Oslandia <infos at oslandia.com>
- * Copyright (C) 2012-2013 IGN (http://www.ign.fr)
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Library General Public License for more details.
-
- * You should have received a copy of the GNU Library General Public
- * License along with this library; if not, see <http://www.gnu.org/licenses/>.
- */
-#include <iostream>
-#include <fstream>
-
-#include <boost/filesystem.hpp>
-
-#include <SFCGAL/Exception.h>
-#include <SFCGAL/Grid.h>
-#include <SFCGAL/io/asc.h>
-#include <SFCGAL/io/osg.h>
-
-using namespace SFCGAL ;
-
-int main( int argc, char* argv[] ){
- if ( argc < 3 ){
- std::cout << "asc2wkt <input-file> <output-file> [-no-zero]" << std::endl ;
- return 1 ;
- }
-
- std::string inputFile( argv[1] );
- std::string outputFile( argv[2] );
-
- std::ifstream ifs( argv[1] );
- if ( ! ifs.good() ){
- std::cerr << "can't open input file ('" << argv[1] << "')" << std::endl;
- return 1 ;
- }
-
- bool filterZeros = false ;
- for ( int i = 1; i < argc; i++ ){
- if ( std::string("-no-zero") == argv[i] ){
- filterZeros = true ;
- }
- }
-
-
- try {
- std::cout << "-- loading grid" << std::endl ;
- std::auto_ptr< Grid > grid( io::readASC( ifs ) );
-
- if ( filterZeros ){
- std::cout << "-- filtering zeros" << std::endl ;
- for ( size_t i = 0; i < grid->nrows(); i++ ){
- for ( size_t j = 0; j < grid->ncols(); j++ ){
- if ( abs(grid->z(i,j)) == 0.0 ){
- grid->z(i,j) = NaN() ;
- }
- }
- }
- }
-
- std::cout << "-- triangulate grid" << std::endl ;
- std::auto_ptr< TriangulatedSurface > triangulatedSurface( grid->toTrianguledSurface() );
- std::cout << "-- save with osg" << std::endl ;
- io::osgWriteFile( *triangulatedSurface, outputFile );
-
- } catch ( Exception & e ){
- std::cerr << e.diagnostic() << std::endl ;
- return 1 ;
- } catch ( std::exception& e ){
- std::cerr << e.what() << std::endl ;
- return 1 ;
- }
-
-
- return 0 ;
-}
diff --git a/example/SFCGAL-building/CMakeLists.txt b/example/SFCGAL-building/CMakeLists.txt
index 1e225f3..cb5ea72 100644
--- a/example/SFCGAL-building/CMakeLists.txt
+++ b/example/SFCGAL-building/CMakeLists.txt
@@ -3,16 +3,12 @@ add_executable( example-${EXAMPLE_NAME}
main.cpp
)
target_link_libraries( example-${EXAMPLE_NAME}
- SFCGAL
- ${CGAL_LIBRARIES}
- ${MPFR_LIBRARIES}
- ${GMP_LIBRARIES}
- ${Boost_LIBRARIES}
+ SFCGAL
+ SFCGAL-osg
+ ${CGAL_LIBRARIES}
+ ${MPFR_LIBRARIES}
+ ${GMP_LIBRARIES}
+ ${Boost_LIBRARIES}
)
-if(SFCGAL_WITH_OSG)
- target_link_libraries( example-${EXAMPLE_NAME}
- ${OPENSCENEGRAPH_LIBRARIES}
- )
-endif()
set_target_properties( example-${EXAMPLE_NAME} PROPERTIES DEBUG_POSTFIX "d" )
-install( TARGETS example-${EXAMPLE_NAME} DESTINATION bin )
\ No newline at end of file
+install( TARGETS example-${EXAMPLE_NAME} DESTINATION bin )
diff --git a/example/SFCGAL-export-osg/CMakeLists.txt b/example/SFCGAL-export-osg/CMakeLists.txt
index 94afac2..8d69bac 100644
--- a/example/SFCGAL-export-osg/CMakeLists.txt
+++ b/example/SFCGAL-export-osg/CMakeLists.txt
@@ -2,8 +2,9 @@ GET_FILENAME_COMPONENT( EXAMPLE_NAME ${CMAKE_CURRENT_SOURCE_DIR} NAME )
add_executable( example-${EXAMPLE_NAME}
main.cpp
)
-target_link_libraries( example-${EXAMPLE_NAME}
- SFCGAL
+target_link_libraries( example-${EXAMPLE_NAME}
+ SFCGAL
+ SFCGAL-osg
${CGAL_LIBRARIES}
${MPFR_LIBRARIES}
${GMP_LIBRARIES}
@@ -11,4 +12,4 @@ target_link_libraries( example-${EXAMPLE_NAME}
${Boost_LIBRARIES}
)
set_target_properties( example-${EXAMPLE_NAME} PROPERTIES DEBUG_POSTFIX "d" )
-install( TARGETS example-${EXAMPLE_NAME} DESTINATION bin )
\ No newline at end of file
+install( TARGETS example-${EXAMPLE_NAME} DESTINATION bin )
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index f0af617..2147240 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -8,11 +8,15 @@ foreach (header ${SFCGAL_HEADERS_COPIED})
COMMAND ${CMAKE_COMMAND} -E copy_if_different ${CMAKE_SOURCE_DIR}/src/${header} ${CMAKE_BINARY_DIR}/include/SFCGAL/${header} DEPENDS ${CMAKE_SOURCE_DIR}/src/${header})
endforeach()
-if ( NOT SFCGAL_WITH_OSG )
- message( STATUS "removing ${CMAKE_SOURCE_DIR}/src/io/osg.h and ${CMAKE_SOURCE_DIR}/src/SFCGAL/io/osg.cpp from the library")
- list(REMOVE_ITEM SFCGAL_HEADERS "${CMAKE_SOURCE_DIR}/src/io/osg.h")
- list(REMOVE_ITEM SFCGAL_SOURCES "${CMAKE_SOURCE_DIR}/src/io/osg.cpp")
-endif()
+set( SFCGAL_OSG_HEADERS
+ ${CMAKE_SOURCE_DIR}/src/io/osg.h
+ ${CMAKE_SOURCE_DIR}/src/detail/io/OsgFactory.h )
+set( SFCGAL_OSG_SOURCES
+ ${CMAKE_SOURCE_DIR}/src/io/osg.cpp
+ ${CMAKE_SOURCE_DIR}/src/detail/io/OsgFactory.cpp )
+message( STATUS "removing OSG dependencies from the library")
+list(REMOVE_ITEM SFCGAL_HEADERS ${SFCGAL_OSG_HEADERS})
+list(REMOVE_ITEM SFCGAL_SOURCES ${SFCGAL_OSG_SOURCES})
if( SFCGAL_USE_STATIC_LIBS )
add_definitions( "-fPIC" )
@@ -46,9 +50,6 @@ if( ${SFCGAL_WITH_GMP} )
target_link_libraries( SFCGAL ${GMP_LIBRARIES} )
endif( ${SFCGAL_WITH_GMP} )
-if( ${SFCGAL_WITH_OSG} )
- target_link_libraries( SFCGAL ${OPENSCENEGRAPH_LIBRARIES} )
-endif()
target_link_libraries( SFCGAL ${Boost_LIBRARIES} )
if ( ${Use_precompiled_headers} )
@@ -76,3 +77,36 @@ install(
BUNDLE DESTINATION ${CMAKE_INSTALL_LIBDIR}
)
+# SFCGAL-osg
+if ( SFCGAL_WITH_OSG )
+ if( SFCGAL_USE_STATIC_LIBS )
+ add_definitions( "-fPIC" )
+ add_library(
+ SFCGAL-osg
+ ${SFCGAL_OSG_HEADERS}
+ ${SFCGAL_OSG_SOURCES}
+ )
+
+ else()
+ add_definitions( "-DSFCGAL_BUILD_SHARED" )
+ add_library(
+ SFCGAL-osg SHARED
+ ${SFCGAL_OSG_HEADERS}
+ ${SFCGAL_OSG_SOURCES}
+ )
+ endif()
+ target_link_libraries( SFCGAL-osg
+ SFCGAL
+ ${OPENSCENEGRAPH_LIBRARIES}
+ )
+ set_target_properties( SFCGAL-osg PROPERTIES VERSION ${SFCGAL_VERSION}
+ SOVERSION ${SFCGAL_VERSION_MAJOR} )
+ install(
+ TARGETS
+ SFCGAL-osg
+ RUNTIME DESTINATION bin
+ LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
+ ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
+ BUNDLE DESTINATION ${CMAKE_INSTALL_LIBDIR}
+ )
+endif()
diff --git a/src/capi/sfcgal_c.cpp b/src/capi/sfcgal_c.cpp
index e466b4c..c24f05f 100644
--- a/src/capi/sfcgal_c.cpp
+++ b/src/capi/sfcgal_c.cpp
@@ -813,7 +813,7 @@ extern "C" int sfcgal_geometry_is_planar( const sfcgal_geometry_t* ga )
bool r;
try {
- r = SFCGAL::algorithm::hasPlane3D< SFCGAL::Kernel >( g->as< const SFCGAL::Polygon >() );
+ r = SFCGAL::algorithm::isPlane3D< SFCGAL::Kernel >( g->as<const SFCGAL::Polygon >(), 1e-9 );
}
catch ( std::exception& e ) {
SFCGAL_WARNING( "During is_planar(A) :" );
--
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