Skip to content

Commit

Permalink
Merge pull request #377 from LIHPC-Computational-Geometry/medialaxis_…
Browse files Browse the repository at this point in the history
…milp_components

added medialaxis and milp components
  • Loading branch information
nicolaslg authored Apr 3, 2024
2 parents 665fc85 + ffc34b5 commit 596c54d
Show file tree
Hide file tree
Showing 18 changed files with 374 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/continuous-macos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,9 @@ jobs:
-DENABLE_GEOD_HONEY_COMB:BOOL=ON
-DENABLE_HYBRIDMESHADAPT:BOOL=ON
-DENABLE_KMDS:BOOL=OFF
-DENABLE_MEDIALAXIS:BOOL=OFF
-DENABLE_MEDUSA:BOOL=OFF
-DENABLE_MILP:BOOL=OFF
-DENABLE_MORPHMESH:BOOL=ON
-DENABLE_PADDINGs:BOOL=ON
-DENABLE_POLYBLOCK:BOOL=ON
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/continuous-ubuntu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,9 @@ jobs:
-DENABLE_GEOD_HONEY_COMB:BOOL=ON
-DENABLE_HYBRIDMESHADAPT:BOOL=ON
-DENABLE_KMDS:BOOL=ON
-DENABLE_MEDIALAXIS:BOOL=OFF
-DENABLE_MEDUSA:BOOL=OFF
-DENABLE_MILP:BOOL=OFF
-DENABLE_MORPHMESH:BOOL=ON
-DENABLE_PADDINGs:BOOL=ON
-DENABLE_POLYBLOCK:BOOL=ON
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/continuous-windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,9 @@ jobs:
-DENABLE_GEOD_HONEY_COMB:BOOL=OFF
-DENABLE_HYBRIDMESHADAPT:BOOL=OFF
-DENABLE_KMDS:BOOL=OFF
-DENABLE_MEDIALAXIS:BOOL=OFF
-DENABLE_MEDUSA:BOOL=OFF
-DENABLE_MILP:BOOL=OFF
-DENABLE_MORPHMESH:BOOL=OFF
-DENABLE_PADDINGs:BOOL=OFF
-DENABLE_POLYBLOCK:BOOL=OFF
Expand Down
18 changes: 18 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -235,6 +235,15 @@ GMDS_ADD_COMPONENT(
OFF # must be covered
)

GMDS_ADD_COMPONENT(
MEDIALAXIS
medialaxis
GMDSMedialaxis
"Medial-axis component"
OFF
OFF # must be covered
)

GMDS_ADD_COMPONENT(
MEDUSA
medusa
Expand All @@ -244,6 +253,15 @@ GMDS_ADD_COMPONENT(
OFF # must be covered
)

GMDS_ADD_COMPONENT(
MILP
milp
GMDSmilp
"Mixed-Integer Linear Programming component"
OFF
OFF # must be covered
)

GMDS_ADD_COMPONENT(
MORPHMESH
morphMesh
Expand Down
60 changes: 60 additions & 0 deletions medialaxis/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
#==============================================================================
# LIBRARY DEFINITION (SOURCE FILES)
#==============================================================================
# Explicitly used the name given in this preamble
set(GMDS_LIB ${LIB_GMDS_MEDIALAXIS})
set(GMDS_LIB_PREFIX gmds/medialaxis)

set(GMDS_INC
${CMAKE_BINARY_DIR}/exports/${GMDS_LIB}_export.h
inc/gmds/medialaxis/Medialaxis.h
)
set(GMDS_SRC
src/Medialaxis.cpp
)
#==============================================================================
add_library(${GMDS_LIB} ${GMDS_INC} ${GMDS_SRC})
#==============================================================================
include(GenerateExportHeader)
generate_export_header(${GMDS_LIB}
EXPORT_FILE_NAME ${CMAKE_BINARY_DIR}/exports/${GMDS_LIB}_export.h
EXPORT_MACRO_NAME ${GMDS_LIB}_API)
#==============================================================================
# TARGET DEFINITION
#==============================================================================
include(GNUInstallDirs)
#LIBRARY TO INSTALL
target_link_libraries(${GMDS_LIB} PUBLIC
${LIB_GMDS_CAD}
${LIB_GMDS_IG})

#==============================================================================
# NOTHING TO UPDATE BELOW
#==============================================================================

target_compile_features(${GMDS_LIB} PUBLIC cxx_std_14)

# INCLUDE TO INSTALL
target_include_directories(${GMDS_LIB} PUBLIC
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/inc>
$<INSTALL_INTERFACE:${CMAKE_INSTALL_PREFIX}/include>
)
set_target_properties(${GMDS_LIB} PROPERTIES PUBLIC_HEADER "${GMDS_INC}")

install(TARGETS ${GMDS_LIB}
EXPORT GMDS_SUITE
PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/${GMDS_LIB_PREFIX}
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/gmds
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/gmds)

#==============================================================================
if(WITH_TEST)
add_subdirectory(tst)
endif(WITH_TEST)
#==============================================================================
# EXECUTABLE
#==============================================================================
add_executable(medialaxis_exec src/main.cpp)
target_link_libraries(medialaxis_exec PRIVATE ${GMDS_LIB})
target_compile_features(medialaxis_exec PUBLIC cxx_std_14)
install(TARGETS medialaxis_exec)
44 changes: 44 additions & 0 deletions medialaxis/inc/gmds/medialaxis/Medialaxis.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
#ifndef GMDS_MEDIALAXIS_MEDIALAXIS_H
#define GMDS_MEDIALAXIS_MEDIALAXIS_H
/*----------------------------------------------------------------------------*/
#include "LIB_GMDS_MEDIALAXIS_export.h"
#include <gmds/ig/Mesh.h>
/*----------------------------------------------------------------------------*/
namespace gmds{
/*----------------------------------------------------------------------------*/
namespace medialaxis{
/*----------------------------------------------------------------------------*/
/** \class dummy
* \brief dummy class.
*/
class LIB_GMDS_MEDIALAXIS_API Medialaxis{

public:
/*-------------------------------------------------------------------------*/
/** @enum Status code for executing algorithms
*/
typedef enum {
FAIL,
SUCCESS
} STATUS;
/*-------------------------------------------------------------------------*/
/** @brief Constructor.
* @param
*/
explicit Medialaxis();
/*-------------------------------------------------------------------------*/
/** @brief Default destructor.
* @param
*/
virtual ~Medialaxis() =default;
/*-------------------------------------------------------------------------*/
/** \brief
*/
Medialaxis::STATUS execute();
};
/*----------------------------------------------------------------------------*/
} // end namespace medialaxis
/*----------------------------------------------------------------------------*/
} // end namespace gmds
/*----------------------------------------------------------------------------*/
#endif // GMDS_MEDIALAXIS_MEDIALAXIS_H
19 changes: 19 additions & 0 deletions medialaxis/src/Medialaxis.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
/*----------------------------------------------------------------------------*/
#include "gmds/medialaxis/Medialaxis.h"
/*----------------------------------------------------------------------------*/
namespace gmds {
/*----------------------------------------------------------------------------*/
namespace medialaxis {
/*----------------------------------------------------------------------------*/
Medialaxis::Medialaxis() {}
/*----------------------------------------------------------------------------*/
Medialaxis::STATUS
Medialaxis::execute()
{
return Medialaxis::SUCCESS;
}
/*----------------------------------------------------------------------------*/
} // end namespace medialaxis
/*----------------------------------------------------------------------------*/
} // end namespace gmds
/*----------------------------------------------------------------------------*/
10 changes: 10 additions & 0 deletions medialaxis/src/main.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#include <iostream>
#include "gmds/medialaxis/Medialaxis.h"

int main() {
std::cout<<"hello world"<<std::endl;

gmds::medialaxis::Medialaxis qf;
gmds::medialaxis::Medialaxis::STATUS st = qf.execute();

}
12 changes: 12 additions & 0 deletions medialaxis/tst/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
add_executable(GMDS_MEDIALAXIS_TEST
DummyTestSuite.h
main_test.cpp
)
#==============================================================================
target_link_libraries(GMDS_MEDIALAXIS_TEST PUBLIC
${GMDS_LIB}
GTest::gtest)
#==============================================================================
gtest_discover_tests(GMDS_MEDIALAXIS_TEST
WORKING_DIRECTORY ${CMAKE_BINARY_DIR})
#==============================================================================
17 changes: 17 additions & 0 deletions medialaxis/tst/DummyTestSuite.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#include <gtest/gtest.h>
#include <gmds/medialaxis/Medialaxis.h>
#include <gmds/ig/Mesh.h>
#include <gmds/io/IGMeshIOService.h>
#include <gmds/io/VTKWriter.h>
#include <gmds/io/VTKReader.h>
#include <iostream>
#include <unit_test_config.h>
/*----------------------------------------------------------------------------*/
using namespace gmds;
/*----------------------------------------------------------------------------*/

TEST(DummyTestClass, aaa)
{
gmds::medialaxis::Medialaxis md;
ASSERT_EQ(0,0);
}
13 changes: 13 additions & 0 deletions medialaxis/tst/main_test.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
/*----------------------------------------------------------------------------*/
#include <gtest/gtest.h>
/*----------------------------------------------------------------------------*/
// Files containing the different test suites to launch

#include "DummyTestSuite.h"
/*----------------------------------------------------------------------------*/
int main(int argc, char ** argv) {
::testing::InitGoogleTest(&argc, argv);
return RUN_ALL_TESTS();
}
/*----------------------------------------------------------------------------*/

60 changes: 60 additions & 0 deletions milp/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
#==============================================================================
# LIBRARY DEFINITION (SOURCE FILES)
#==============================================================================
# Explicitly used the name given in this preamble
set(GMDS_LIB ${LIB_GMDS_MILP})
set(GMDS_LIB_PREFIX gmds/milp)

set(GMDS_INC
${CMAKE_BINARY_DIR}/exports/${GMDS_LIB}_export.h
inc/gmds/milp/milp.h
)
set(GMDS_SRC
src/milp.cpp
)
#==============================================================================
add_library(${GMDS_LIB} ${GMDS_INC} ${GMDS_SRC})
#==============================================================================
include(GenerateExportHeader)
generate_export_header(${GMDS_LIB}
EXPORT_FILE_NAME ${CMAKE_BINARY_DIR}/exports/${GMDS_LIB}_export.h
EXPORT_MACRO_NAME ${GMDS_LIB}_API)
#==============================================================================
# TARGET DEFINITION
#==============================================================================
include(GNUInstallDirs)
#LIBRARY TO INSTALL
target_link_libraries(${GMDS_LIB} PUBLIC
${LIB_GMDS_CAD}
${LIB_GMDS_IG})

#==============================================================================
# NOTHING TO UPDATE BELOW
#==============================================================================

target_compile_features(${GMDS_LIB} PUBLIC cxx_std_14)

# INCLUDE TO INSTALL
target_include_directories(${GMDS_LIB} PUBLIC
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/inc>
$<INSTALL_INTERFACE:${CMAKE_INSTALL_PREFIX}/include>
)
set_target_properties(${GMDS_LIB} PROPERTIES PUBLIC_HEADER "${GMDS_INC}")

install(TARGETS ${GMDS_LIB}
EXPORT GMDS_SUITE
PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/${GMDS_LIB_PREFIX}
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/gmds
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/gmds)

#==============================================================================
if(WITH_TEST)
add_subdirectory(tst)
endif(WITH_TEST)
#==============================================================================
# EXECUTABLE
#==============================================================================
add_executable(milp_exec src/main.cpp)
target_link_libraries(milp_exec PRIVATE ${GMDS_LIB})
target_compile_features(milp_exec PUBLIC cxx_std_14)
install(TARGETS milp_exec)
44 changes: 44 additions & 0 deletions milp/inc/gmds/milp/milp.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
#ifndef GMDS_MILP_MILP_H
#define GMDS_MILP_MILP_H
/*----------------------------------------------------------------------------*/
#include "LIB_GMDS_MILP_export.h"
#include <gmds/ig/Mesh.h>
/*----------------------------------------------------------------------------*/
namespace gmds{
/*----------------------------------------------------------------------------*/
namespace milp{
/*----------------------------------------------------------------------------*/
/** \class dummy
* \brief dummy class.
*/
class LIB_GMDS_MILP_API milp{

public:
/*-------------------------------------------------------------------------*/
/** @enum Status code for executing algorithms
*/
typedef enum {
FAIL,
SUCCESS
} STATUS;
/*-------------------------------------------------------------------------*/
/** @brief Constructor.
* @param
*/
explicit milp();
/*-------------------------------------------------------------------------*/
/** @brief Default destructor.
* @param
*/
virtual ~milp() =default;
/*-------------------------------------------------------------------------*/
/** \brief
*/
milp::STATUS execute();
};
/*----------------------------------------------------------------------------*/
} // end namespace milp
/*----------------------------------------------------------------------------*/
} // end namespace gmds
/*----------------------------------------------------------------------------*/
#endif // GMDS_MILP_MILP_H
10 changes: 10 additions & 0 deletions milp/src/main.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#include <iostream>
#include "gmds/milp/milp.h"

int main() {
std::cout<<"hello world"<<std::endl;

gmds::milp::milp qf;
gmds::milp::milp::STATUS st = qf.execute();

}
19 changes: 19 additions & 0 deletions milp/src/milp.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
/*----------------------------------------------------------------------------*/
#include "gmds/milp/milp.h"
/*----------------------------------------------------------------------------*/
namespace gmds {
/*----------------------------------------------------------------------------*/
namespace milp {
/*----------------------------------------------------------------------------*/
milp::milp() {}
/*----------------------------------------------------------------------------*/
milp::STATUS
milp::execute()
{
return milp::SUCCESS;
}
/*----------------------------------------------------------------------------*/
} // end namespace milp
/*----------------------------------------------------------------------------*/
} // end namespace gmds
/*----------------------------------------------------------------------------*/
Loading

0 comments on commit 596c54d

Please sign in to comment.