Commit 95e60c11 authored by Pierre Kraemer's avatar Pierre Kraemer

Merge branch 'develop' into 'master'

Develop

corrections dans les collector : parametres template inutiles et types Vertex/Edge/Face au lieu de Dart

See merge request !30
parents 5fc601bd eff3eec9
cmake_minimum_required(VERSION 2.8)
project(CGoGN)
#cmake_policy(SET CMP0042 NEW) # rpath new policy
#SET ( CMAKE_VERBOSE_MAKEFILE 1 )
......@@ -9,7 +10,30 @@ SET ( CGoGN_ROOT_DIR ${CMAKE_SOURCE_DIR} )
SET ( CMAKE_MODULE_PATH ${CGoGN_ROOT_DIR}/cmake_modules/ )
# ====== Check GCC VERSION FOR C++11 ======
if(CMAKE_COMPILER_IS_GNUCXX)
execute_process(COMMAND ${CMAKE_CXX_COMPILER} -dumpversion OUTPUT_VARIABLE GCC_VERSION)
if (GCC_VERSION VERSION_LESS 4.8)
message(FATAL_ERROR "Full support of C++11 needed. Therefore a gcc/g++ compiler with a version at least 4.8 is needed.")
endif()
endif()
# ====== Check CLANG VERSION FOR C++11 ======
if (APPLE)
execute_process(COMMAND ${CMAKE_CXX_COMPILER} -dumpversion OUTPUT_VARIABLE CLANG_VERSION)
if (CLANG_VERSION VERSION_LESS 3.1)
message(FATAL_ERROR "Full support of C++11 needed. Therefore a clang compiler with a version at least 3.1 is needed !!")
endif()
endif()
# ====== Check MSVC VERSION FOR C++11 ======
if(WIN32)
if(MSVC_VERSION LESS 1800)
message(FATAL_ERROR "Full support of C++11 needed. Therefore a microsoft compiler with a version at least 12 is needed.")
endif()
endif()
# ======== Check Build Type =============
IF (NOT (${CMAKE_BUILD_TYPE} MATCHES "Debug|Release"))
IF (${CMAKE_CURRENT_BINARY_DIR} MATCHES "(.*)Debug|(.*)debug|(.*)DEBUG")
SET(CMAKE_BUILD_TYPE "Debug")
......@@ -18,8 +42,16 @@ IF (NOT (${CMAKE_BUILD_TYPE} MATCHES "Debug|Release"))
ENDIF()
ENDIF()
# for shared or not shared
SET ( BUILD_SHARED_LIBS OFF CACHE BOOL "if used all library are build as shared type (.so/.dylib/.dll)" )
# for shared or not shared (default except on windows)
if(WIN32)
SET ( BUILD_SHARED_LIBS OFF CACHE BOOL "if used all library are build as shared type (.so/.dylib/.dll)" )
else()
SET ( BUILD_SHARED_LIBS ON CACHE BOOL "if used all library are build as shared type (.so/.dylib/.dll)" )
endif()
#IF(EXISTS "${CGoGN_ROOT_DIR}/ThirdParty/include/Assimp")
IF(EXISTS "${CGoGN_ROOT_DIR}/lib/${CMAKE_BUILD_TYPE}/*assimp*")
......@@ -44,9 +76,10 @@ SET ( COMPILE_BENCHES ON CACHE BOOL "compile benches" )
SET ( COMPILE_SANDBOX ON CACHE BOOL "compile all in sandbox" )
#create one big lib
#create one big lib
SET ( ONELIB OFF CACHE BOOL "build CGoGN in one lib" )
SET ( WITH_GLEWMX OFF CACHE BOOL "use multi-contex GLEW" )
SET( USE_OGL_CORE_PROFILE OFF CACHE BOOL "use OpenGL 3.3 core profile (do not work on mac)" )
......@@ -58,8 +91,6 @@ ENDIF(WIN32)
find_package(OpenGL REQUIRED)
find_package(Boost COMPONENTS regex REQUIRED)
find_package(ZLIB REQUIRED)
#find_package(LibXml2 REQUIRED)
find_package(TinyXml2 REQUIRED)
find_package(GLEW REQUIRED)
# MESSAGE HERE FOR MORE EASY USER READING
......@@ -99,7 +130,6 @@ SET (CGoGN_EXT_INCLUDES
${OPENGL_INCLUDE_DIR}
${GLEW_INCLUDE_DIRS}
${ZLIB_INCLUDE_DIRS}
${TINYXML2_INCLUDE_DIR}
${Boost_INCLUDE_DIRS}
)
......@@ -109,8 +139,8 @@ SET (CGoGN_EXT_LIBS
${OPENGL_LIBRARY}
${GLEW_LIBRARIES}
${ZLIB_LIBRARIES}
${TINYXML2_LIBRARY}
${Boost_REGEX_LIBRARY}
tinyxml2
)
IF(WIN32)
......@@ -173,11 +203,8 @@ ELSE()
SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Woverride-init -fPIC")
# remove the 60000+ "no unused local typedefs" warnings with GCC4.8+
if(CMAKE_COMPILER_IS_GNUCXX)
execute_process(COMMAND ${CMAKE_C_COMPILER} -dumpversion OUTPUT_VARIABLE GCC_VERSION)
if (GCC_VERSION VERSION_GREATER 4.8 OR GCC_VERSION VERSION_EQUAL 4.8)
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-unused-local-typedefs")
SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-unused-local-typedefs")
endif(GCC_VERSION VERSION_GREATER 4.8 OR GCC_VERSION VERSION_EQUAL 4.8)
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-unused-local-typedefs")
SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-unused-local-typedefs")
endif()
ENDIF()
......
......@@ -23,7 +23,6 @@ SET( USE_OGL_CORE_PROFILE OFF CACHE BOOL "use OpenGL 3.3 core profile (do not wo
find_package(OpenGL REQUIRED)
find_package(Boost COMPONENTS regex system REQUIRED)
find_package(ZLIB REQUIRED)
find_package(LibXml2 REQUIRED)
find_package(GLEW REQUIRED)
find_package(Qt4 REQUIRED)
find_package(QGLViewer REQUIRED)
......@@ -73,7 +72,6 @@ SET (EXT_INCLUDES
${OPENGL_INCLUDE_DIR}
${GLEW_INCLUDE_DIRS}
${ZLIB_INCLUDE_DIRS}
${LIBXML2_INCLUDE_DIR}
${Boost_INCLUDE_DIRS}
${QT_INCLUDE_DIR}
${QGLVIEWER_INCLUDE_DIR}
......@@ -86,17 +84,17 @@ SET (EXT_INCLUDES
SET (EXT_LIBS
PythonQt
nl
${QGLVIEWER_LIBRARIES}
${OPENGL_LIBRARY}
${GLEW_LIBRARIES}
${ZLIB_LIBRARIES}
${LIBXML2_LIBRARIES}
${Boost_SYSTEM_LIBRARY}
${Boost_REGEX_LIBRARY}
${QT_LIBRARIES}
${QGLVIEWER_LIBRARIES}
${PYTHON_LIBRARIES}
${SUITESPARSE_LIBRARIES}
# ${SUPERLU_LIBRARIES}
tinyxml2
)
......
cmake_minimum_required(VERSION 2.8)
project(CGoGN_ThirdParty)
#cmake_policy(SET CMP0042 NEW) # rpath new policy
SET(CGoGN_ROOT_DIR ${CMAKE_SOURCE_DIR}/..)
IF(WIN32)
ENDIF(WIN32)
IF (${CMAKE_CURRENT_BINARY_DIR} MATCHES "(.*)Debug")
set(CMAKE_BUILD_TYPE "Debug" CACHE STRING "Debug/Release" FORCE)
......@@ -20,21 +18,14 @@ IF(WIN32)
INCLUDE_DIRECTORIES(${CGoGN_ROOT_DIR}/windows_dependencies/include/suitesparse)
SET(LIBRARY_OUTPUT_PATH ${CGoGN_ROOT_DIR}/lib)
set(CMAKE_CONFIGURATION_TYPES Release Debug)
# SET(CMAKE_CONFIGURATION_TYPES ${CMAKE_BUILD_TYPE})
# SET(CMAKE_CONFIGURATION_TYPES "${CMAKE_CONFIGURATION_TYPES}" CACHE STRING "" FORCE)
# MARK_AS_ADVANCED(CMAKE_CONFIGURATION_TYPES)
SET (BUILD_SHARED_LIBS OFF CACHE BOOL "if used all library are build as shared type (.so/.dylib/.dll)")
ELSE()
SET(LIBRARY_OUTPUT_PATH ${CGoGN_ROOT_DIR}/lib/${CMAKE_BUILD_TYPE})
SET (BUILD_SHARED_LIBS ON CACHE BOOL "if used all library are build as shared type (.so/.dylib/.dll)")
ENDIF()
IF(WIN32)
ENDIF(WIN32)
# for shared or not shared
SET (BUILD_SHARED_LIBS OFF CACHE BOOL
"if used all library are build as shared type (.so/.dylib/.dll)")
SET (WITH_ASSIMP OFF CACHE BOOL "build with Assimp")
SET (WITH_ZINRI ON CACHE BOOL "build with Zinri libs")
......@@ -67,5 +58,6 @@ IF (WITH_ASSIMP)
INSTALL (DIRECTORY Assimp/include/ DESTINATION ${CGoGN_ROOT_DIR}/ThirdParty/include/Assimp)
ENDIF (WITH_ASSIMP)
add_subdirectory(TinyXml2 TinyXml2/build)
INSTALL (DIRECTORY TinyXml2/ DESTINATION ${CGoGN_ROOT_DIR}/ThirdParty/include/TinyXml2 FILES_MATCHING PATTERN "*.h")
......@@ -25,6 +25,9 @@ IF(USE_SUPERLU)
ENDIF(USE_SUPERLU)
IF(USE_CHOLMOD)
IF (APPLE)
FIND_LIBRARY(CHOL_DEPS Accelerate)
ENDIF (APPLE)
ADD_DEFINITIONS(-DNL_USE_CHOLMOD)
INCLUDE_DIRECTORIES(${SUITESPARSE_INCLUDE_DIRS})
ENDIF(USE_CHOLMOD)
......@@ -41,8 +44,14 @@ IF(USE_CNC)
CUDA_ADD_CUBLAS_TO_TARGET(nl)
ELSE(USE_CNC)
IF(WIN32)
ADD_LIBRARY(nl ${SOURCES} ${HeaderFiles})
ADD_LIBRARY(nl ${SOURCES} ${HeaderFiles})
ELSE(WIN32)
ADD_LIBRARY(nl ${SOURCES} )
ADD_LIBRARY(nl ${SOURCES} )
IF(USE_CHOLMOD)
TARGET_LINK_LIBRARIES(nl ${SUITESPARSE_LIBRARIES} ${CHOL_DEPS})
ENDIF(USE_CHOLMOD)
IF(USE_SUPERLU)
TARGET_LINK_LIBRARIES(nl ${SUPERLU_LIBRARIES})
ENDIF(USE_SUPERLU)
ENDIF(WIN32)
ENDIF(USE_CNC)
cmake_minimum_required(VERSION 2.6 FATAL_ERROR)
#cmake_policy(VERSION 2.6)
project(tinyxml2)
include_directories("${CMAKE_CURRENT_SOURCE_DIR}/.")
if(MSVC)
add_definitions(-D_CRT_SECURE_NO_WARNINGS)
endif(MSVC)
option(BUILD_SHARED_LIBS "build shared or static libraries" ON)
add_library(tinyxml2 tinyxml2.cpp tinyxml2.h)
set_target_properties(tinyxml2 PROPERTIES COMPILE_DEFINITIONS "TINYXML2_EXPORT")
#install(TARGETS tinyxml2
# RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
# LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
# ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR})
#install(FILES tinyxml2.h DESTINATION ${CMAKE_INSTALL_INCLUDEDIR})
#foreach(p LIB INCLUDE)
# set(var CMAKE_INSTALL_${p}DIR)
# if(NOT IS_ABSOLUTE "${${var}}")
# set(${var} "${CMAKE_INSTALL_PREFIX}/${${var}}")
# endif()
#endforeach()
#configure_file(tinyxml2.pc.in tinyxml2.pc @ONLY)
#install(FILES ${CMAKE_CURRENT_BINARY_DIR}/tinyxml2.pc DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig)
#add_test(xmltest ${SAMPLE_NAME} COMMAND $<TARGET_FILE:${SAMPLE_NAME}>)
This is a "partial" copy of original TinyXML-2 library.
http://www.grinninglizard.com/tinyxml2/
Packaged version is not usable on all Linux distribution
Git version is not locally installabe on mac.
CMakeLists.txt has been modified for easy local installation.
Only needed files for building the library have been kept.
This diff is collapsed.
This diff is collapsed.
......@@ -21,7 +21,7 @@ VoronoiDiagram<PFP>::VoronoiDiagram (MAP& m, const EdgeAttribute<REAL, MAP>& p,
regions (r),
vmReached(m)
{
vertexInfo = map.template addAttribute<VertexInfo, VERTEX>("vertexInfo");
vertexInfo = map.template addAttribute<VertexInfo, VERTEX, typename PFP::MAP>("vertexInfo");
}
template <typename PFP>
......@@ -442,7 +442,7 @@ void CentroidalVoronoiDiagram<PFP>::cumulateEnergyAndGradientFromSeed(unsigned i
// compute the gradient
// TODO : check if the computation of grad and proj is still valid for other edgeCost than geodesic distances
VEC3 grad (0.0);
const VertexAttribute<VEC3, MAP>& pos = this->map.template getAttribute<VEC3, VERTEX>("position");
const VertexAttribute<VEC3, MAP>& pos = this->map.template getAttribute<VEC3, VERTEX, typename PFP::MAP>("position");
for (unsigned int j = 0; j < v.size(); ++j)
{
......@@ -460,7 +460,7 @@ Dart CentroidalVoronoiDiagram<PFP>::selectBestNeighborFromSeed(unsigned int numS
{
Dart e = this->seeds[numSeed];
Dart newSeed = e;
const VertexAttribute<VEC3, MAP>& pos = this->map.template getAttribute<VEC3,VERTEX>("position");
const VertexAttribute<VEC3, MAP>& pos = this->map.template getAttribute<VEC3,VERTEX,typename PFP::MAP>("position");
// TODO : check if the computation of grad and proj is still valid for other edgeCost than geodesic distances
float maxProj = 0.0;
......
......@@ -488,7 +488,7 @@ public:
edge_cost(c),
maxDist(d)
{
vertexInfo = m.template addAttribute<VertexInfo, VERTEX>("vertexInfo");
vertexInfo = m.template addAttribute<VertexInfo, VERTEX, typename PFP::MAP>("vertexInfo");
}
~Collector_Dijkstra_Vertices()
{
......
......@@ -942,10 +942,9 @@ void Collector_Triangles<PFP>::collectAll(Dart d)
}
}
}
CellMarkerStore<MAP, VERTEX> vm(this->map); // mark inside-vertices and border-vertices
CellMarkerStore<MAP, EDGE> em(this->map); // mark inside-edges and border-edges
std::vector<Dart>::iterator f_it;
std::vector<Face>::iterator f_it;
for (f_it = this->insideFaces.begin(); f_it != this->insideFaces.end(); f_it++)
{ // collect insideVertices, insideEdges, and border
Traversor2FE<MAP> te (this->map, *f_it) ;
......@@ -1010,9 +1009,8 @@ void Collector_Triangles<PFP>::collectBorder(Dart d)
}
}
}
CellMarkerStore<MAP, EDGE> em(this->map); // mark inside-edges and border-edges
std::vector<Dart>::iterator f_it;
std::vector<Face>::iterator f_it;
for (f_it = this->insideFaces.begin(); f_it != this->insideFaces.end(); f_it++)
{ // collect border (edges)
Traversor2FE<MAP> te (this->map, *f_it) ;
......@@ -1089,7 +1087,7 @@ void Collector_Dijkstra_Vertices<PFP>::collectAll(Dart dinit)
CellMarkerStore<MAP, EDGE> em (this->map);
CellMarkerStore<MAP, FACE> fm (this->map);
for (std::vector<Dart>::iterator e_it = this->insideVertices.begin(); e_it != this->insideVertices.end() ; e_it++)
for (std::vector<Vertex>::iterator e_it = this->insideVertices.begin(); e_it != this->insideVertices.end() ; e_it++)
{
// collect insideEdges
Traversor2VE<MAP> te (this->map, *e_it);
......@@ -1169,9 +1167,8 @@ void Collector_Dijkstra_Vertices<PFP>::collectBorder(Dart dinit)
vmReached.unmark(front.begin()->second);
front.erase(front.begin());
}
CellMarkerStore<MAP, FACE> fm (this->map);
for (std::vector<Dart>::iterator e_it = this->insideVertices.begin(); e_it != this->insideVertices.end() ; e_it++)
for (std::vector<Vertex>::iterator e_it = this->insideVertices.begin(); e_it != this->insideVertices.end() ; e_it++)
{
// collect border
Traversor2VF<MAP> tf (this->map, *e_it);
......
......@@ -27,7 +27,7 @@
#include <string>
#include "Utils/cgognStream.h"
#include <tinyxml2.h>
#include "TinyXml2/tinyxml2.h"
namespace CGoGN
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment