Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[CGal plugin][CImgPlugin] Image data moved from Image/ to CImgPlugin/ #1104

Merged
merged 4 commits into from
Jul 26, 2019
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
#define CGALPLUGIN_MESHGENERATIONFROMIMAGE_CPP

#include <CGALPlugin/MeshGenerationFromImage.h>
#include <image/ImageTypes.h>
//#include <image/ImageTypes.h>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you can remove the line definitively


namespace cgal
{
Expand Down
28 changes: 17 additions & 11 deletions applications/plugins/CGALPlugin/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -31,16 +31,18 @@ set(README_FILES CGALPlugin.txt)


find_package(SofaFramework REQUIRED)
find_package(image QUIET)
if(image_FOUND)
list(APPEND HEADER_FILES MeshGenerationFromImage.h)
list(APPEND HEADER_FILES MeshGenerationFromImage.inl)
list(APPEND SOURCE_FILES MeshGenerationFromImage.cpp)
find_package(CGAL REQUIRED COMPONENTS ImageIO)
else()
message(STATUS "CGALPlugin: could not find image, won't build MeshGenerationFromImage")
find_package(CGAL REQUIRED)
find_package(CImgPlugin QUIET)
if(CImgPlugin_FOUND)
list(APPEND HEADER_FILES MeshGenerationFromImage.h)
list(APPEND HEADER_FILES MeshGenerationFromImage.inl)
list(APPEND SOURCE_FILES MeshGenerationFromImage.cpp)
find_package(CGAL REQUIRED COMPONENTS ImageIO)
else ()
message (STATUS "CImgPlugin not found, won't build MeshGenerationFromImage")
find_package(CGAL REQUIRED)
endif()


## CGAL dependencies
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}")
find_package(MPFR REQUIRED)
Expand Down Expand Up @@ -93,8 +95,12 @@ set_target_properties(${PROJECT_NAME} PROPERTIES VERSION ${CGALPLUGIN_VERSION})
set_target_properties(${PROJECT_NAME} PROPERTIES COMPILE_FLAGS "-DSOFA_BUILD_CGALPLUGIN")
set_target_properties(${PROJECT_NAME} PROPERTIES PUBLIC_HEADER "${HEADER_FILES}")
target_link_libraries(${PROJECT_NAME} SofaCore SofaSimulationCommon ${Boost_LIBRARIES} ${GMP_LIBRARIES} ${MPFR_LIBRARIES} ${CGAL_LIBRARY})
if(image_FOUND)
target_link_libraries(${PROJECT_NAME} ${CGAL_ImageIO_LIBRARY} image)


if(CImgPlugin_FOUND)
target_link_libraries(${PROJECT_NAME} ${CGAL_ImageIO_LIBRARY} CImgPlugin)
else()
target_link_libraries(${PROJECT_NAME} ${CGAL_ImageIO_LIBRARY})
endif()

if(SOFA_BUILD_TESTS)
Expand Down
4 changes: 3 additions & 1 deletion applications/plugins/CGALPlugin/MeshGenerationFromImage.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,9 @@
#include <sofa/defaulttype/Mat.h>
#include <sofa/defaulttype/Quat.h>
#include <sofa/helper/rmath.h>
#include <image/ImageTypes.h>

//#include <image/ImageTypes.h>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same here. You can remove the line.

#include <CImgPlugin/CImgData.h>

//CGAL
typedef CGAL::Exact_predicates_inexact_constructions_kernel K;
Expand Down
5 changes: 3 additions & 2 deletions applications/plugins/CImgPlugin/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ project(CImgPlugin VERSION 0.1)
set(HEADER_FILES
src/CImgPlugin/ImageCImg.h
src/CImgPlugin/CImgPlugin.h
src/CImgPlugin/SOFACImg.h
src/CImgPlugin/SOFACImg.h
src/CImgPlugin/CImgData.h
)

set(SOURCE_FILES
Expand Down Expand Up @@ -86,7 +87,7 @@ add_library(${PROJECT_NAME} SHARED ${HEADER_FILES} ${SOURCE_FILES})

target_compile_options(${PROJECT_NAME} PUBLIC ${CIMG_CFLAGS})
target_compile_options(${PROJECT_NAME} PRIVATE "-DSOFA_BUILD_CIMGPLUGIN")
target_link_libraries(${PROJECT_NAME} SofaCore ${EXTERNAL_LIBS})
target_link_libraries(${PROJECT_NAME} SofaCore SofaSimulationCommon ${EXTERNAL_LIBS})
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

SofaSimulationCommon is needed?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it is not, forgot how it ended there.
I removed it, along with the commented includes and pushed the updated code to remote.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I didn't change the files/code/algos, I just moved classes around.

target_include_directories(${PROJECT_NAME} PUBLIC "$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/src>")
target_include_directories(${PROJECT_NAME} PUBLIC "$<BUILD_INTERFACE:${CImg_INCLUDE_DIRS}>")
target_include_directories(${PROJECT_NAME} PUBLIC "$<INSTALL_INTERFACE:include>")
Expand Down
Loading