Skip to content

Commit

Permalink
Merge pull request #15 from crvs/no_pcl
Browse files Browse the repository at this point in the history
Removed dependency on PCL and CGAL
  • Loading branch information
crvs authored Jun 13, 2018
2 parents d44f793 + dcf3100 commit d4cb2ce
Show file tree
Hide file tree
Showing 15 changed files with 366 additions and 357 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
# ignore all files
*

# tags file
tags

# unignore directories
!*/

Expand Down
9 changes: 9 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
[submodule "KDTree"]
path = KDTree
url = [email protected]:crvs/KDTree.git
[submodule "tinyply"]
path = tinyply
url = https://github.com/ddiakopoulos/tinyply
[submodule "tinyobjloader"]
path = tinyobjloader
url = https://github.com/syoyo/tinyobjloader
48 changes: 25 additions & 23 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,22 +1,18 @@
cmake_minimum_required(VERSION 2.8)
cmake_minimum_required(VERSION 3.0)
project(coefficient-flow CXX)

# requirements:
# * Gudhi under /usr/include/gudhi
# * Eigen3 under /usr/include/eigen3
# * boost under /usr/include/boost
# * CGAL under /usr/include/CGAL
# * libyaml under /usr/local/include/libyaml
# * pcl 1.8 under /usr/include/pcl-1.8
#

# in case Eigen, and/or CGAL, and/or GUDHI are not found by find_package
# in case Eigen, and/or GUDHI are not found by find_package
# try setting the paths to them manually
#
# set(EIGEN3_INCLUDE_DIR "/usr/local/include/eigen3")
# include_directories(${EIGEN3_INCLUDE_DIR})
# set(CGAL_INCLUDE_DIR "/usr/local/include/eigen3")
# include_directories(${CGAL_INCLUDE_DIR})
#

# GUDHI version should be 1.3 or higher, provided they don't break the
Expand All @@ -25,33 +21,32 @@ project(coefficient-flow CXX)
# libyaml-cpp this should actually be found in "/usr/include" so there is no
# real need for the find_package, but it's always nice to make sure
#
# pcl-1.8 version 1.7 doesn't let one read ply files into meshes which is
# rather strange, but it is a thing.
#

find_package(Boost REQUIRED QUIET)
message(STATUS "Boost version: ${BOOST_VERSION}")
message(STATUS "Boost directory: ${BOOST_INCLUDE_DIRS}")
# TODO remove
add_subdirectory(KDTree)


add_subdirectory(tinyply)
include_directories("./tinyply/source/")

add_subdirectory(tinyobjloader)
include_directories("./tinyobjloader")

find_package(Boost REQUIRED)
message(STATUS "Boost version: ${Boost_VERSION}")
message(STATUS "Boost directory: ${Boost_INCLUDE_DIRS}")
message(STATUS "boost libraries: ${Boost_LIBRARIES}")

find_package(Eigen3 3.1.2 REQUIRED QUIET)
message(STATUS "Eigen3 version: ${EIGEN3_VERSION}")
message(STATUS "Eigen3 directory: ${EIGEN3_INCLUDE_DIR}")
include_directories(${EIGEN3_INCLUDE_DIR})

find_package(CGAL REQUIRED QUIET)
message(STATUS "CGAL version: ${CGAL_VERSION}")
message(STATUS "CGAL directory: ${CGAL_INCLUDE_DIRS}")

find_package(yaml-cpp REQUIRED QUIET)
message(STATUS "yaml-cpp version: ${YAML_CPP_VERSION}")
message(STATUS "yaml-cpp directory: ${YAML_CPP_INCLUDE_DIR}")
include_directories(${YAML_CPP_INCLUDE_DIR})

find_package(PCL 1.8 REQUIRED QUIET COMPONENTS io)
message(STATUS "PCL version: ${PCL_VERSION}")
message(STATUS "PCL directory: ${PCL_INCLUDE_DIRS}")
include_directories(${PCL_INCLUDE_DIRS})

find_package(GUDHI 1.3 REQUIRED QUIET)
message(STATUS "Gudhi version: ${GUDHI_VERSION}")
string(REGEX MATCH "^/home/" LOCAL_INSTALLED "${GUDHI_DIR}")
Expand Down Expand Up @@ -79,16 +74,22 @@ set(CMAKE_OBJDUMP "/usr/bin/llvm-objdump")
set(CMAKE_RANLIB "/usr/bin/llvm-ranlib")

set(CMAKE_BUILD_TYPE Release)
# set(CMAKE_BUILD_TYPE Debug)

include_directories(
"./lib" # where all the library files are
"KDTree" # for the KDTree library
)

include_directories("./lib") # where all the library files are

add_library(scomplex SHARED "./lib/scomplex/simplicial_complex.cpp")
add_library(pathsnap SHARED "./lib/scomplex/path_snapper.cpp")
target_link_libraries(pathsnap KDTree)

add_executable(qhull2ply "src/make_mesh.cpp")

add_executable(yamltest "src/testing_facility.cpp")
target_link_libraries(yamltest yaml-cpp scomplex pathsnap ${PCL_LIBRARIES})
target_link_libraries(yamltest yaml-cpp scomplex pathsnap tinyply tinyobjloader)

message(INFO ${CMAKE_CURRENT_SOURCE_DIR})
message(INFO ${CMAKE_CURRENT_BINARY_DIR})
Expand All @@ -98,3 +99,4 @@ add_custom_target(timing_test
COMMAND "cp" "${CMAKE_CURRENT_SOURCE_DIR}/test/dumbexample.yaml" "${CMAKE_CURRENT_BINARY_DIR}"
COMMAND "${CMAKE_CURRENT_BINARY_DIR}/run_dumb_tests.sh" "1"
DEPENDS yamltest qhull2ply "test/run_dumb_tests.sh" "test/dumbexample.yaml")

1 change: 1 addition & 0 deletions KDTree
Submodule KDTree added at a88129
3 changes: 0 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,11 @@ In order to compile this repository you will need the following packages:
- `clang (v == 3.8)`
- `Eigen (v == 3.3.2)`
- `Boost (v >= 1.54.0)`
- `CGAL (v >= 4.9.1)`
- `Gudhi (v >= 1.3.1)`
- `pcl (v >= 1.8.0)`
- `libyaml`

**Note:**
- In case you are using a different version of `clang`, everything should still compile without problems, but you will need to change the appropriate lines in `CMakeLists.txt`.
- pcl needs to be version 1.8 or higher because 1.7 does not support reading ply files into `pcl::PolygonMesh` elements.

## Running

Expand Down
4 changes: 2 additions & 2 deletions lib/scomplex/chain_calc.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,13 +41,13 @@ bounding_chain::bounding_chain(std::shared_ptr<simplicial_complex> sc) {
}

bounding_chain::bounding_chain(simplicial_complex& sc) {
s_comp.reset(new simplicial_complex(sc));
s_comp = std::make_shared<simplicial_complex>(sc);
populate_matrices();
}

bounding_chain::bounding_chain(std::vector<point_t>& points,
std::vector<cell_t>& tris) {
s_comp.reset(new simplicial_complex(points, tris));
s_comp = std::make_shared<simplicial_complex>(points,tris);
populate_matrices();
}

Expand Down
2 changes: 1 addition & 1 deletion lib/scomplex/graph_utils.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ std::vector<vertex_t> shortest_path(graph_t& g, vertex_t s, vertex_t t) {

std::vector<vertex_t> complete_path(graph_t& g,
std::vector<vertex_t> vec) {
std::vector<vertex_t>::iterator s{vec.begin()};
std::vector<vertex_t>::iterator s = vec.begin();
std::vector<vertex_t>::iterator t = std::next(s);

// start calculatinng the full path
Expand Down
98 changes: 0 additions & 98 deletions lib/scomplex/nn_utils.hpp

This file was deleted.

Loading

0 comments on commit d4cb2ce

Please sign in to comment.