From 98008d48c9452951419b061337320224e6e19761 Mon Sep 17 00:00:00 2001 From: Relintai Date: Wed, 20 Apr 2022 02:50:16 +0200 Subject: [PATCH] Proper structural setup for the new module. --- modules/wfc/.gitignore | 21 ------ modules/wfc/CMakeLists.txt | 47 ------------- modules/wfc/LICENSE | 68 +------------------ modules/wfc/SCsub | 8 +++ .../wfc/{src/include/utils => }/array2D.hpp | 0 .../wfc/{src/include/utils => }/array3D.hpp | 0 modules/wfc/config.py | 19 ++++++ modules/wfc/{src/include => }/direction.hpp | 0 .../wfc/{src/include => }/overlapping_wfc.hpp | 0 modules/wfc/{src/lib => }/propagator.cpp | 0 modules/wfc/{src/include => }/propagator.hpp | 0 modules/wfc/register_types.cpp | 8 +++ modules/wfc/register_types.h | 3 + modules/wfc/{src/include => }/tiling_wfc.hpp | 0 modules/wfc/{src/lib => }/wave.cpp | 0 modules/wfc/{src/include => }/wave.hpp | 0 modules/wfc/{src/lib => }/wfc.cpp | 0 modules/wfc/{src/include => }/wfc.hpp | 0 18 files changed, 39 insertions(+), 135 deletions(-) delete mode 100644 modules/wfc/.gitignore delete mode 100644 modules/wfc/CMakeLists.txt create mode 100644 modules/wfc/SCsub rename modules/wfc/{src/include/utils => }/array2D.hpp (100%) rename modules/wfc/{src/include/utils => }/array3D.hpp (100%) create mode 100644 modules/wfc/config.py rename modules/wfc/{src/include => }/direction.hpp (100%) rename modules/wfc/{src/include => }/overlapping_wfc.hpp (100%) rename modules/wfc/{src/lib => }/propagator.cpp (100%) rename modules/wfc/{src/include => }/propagator.hpp (100%) create mode 100644 modules/wfc/register_types.cpp create mode 100644 modules/wfc/register_types.h rename modules/wfc/{src/include => }/tiling_wfc.hpp (100%) rename modules/wfc/{src/lib => }/wave.cpp (100%) rename modules/wfc/{src/include => }/wave.hpp (100%) rename modules/wfc/{src/lib => }/wfc.cpp (100%) rename modules/wfc/{src/include => }/wfc.hpp (100%) diff --git a/modules/wfc/.gitignore b/modules/wfc/.gitignore deleted file mode 100644 index 714df4186..000000000 --- a/modules/wfc/.gitignore +++ /dev/null @@ -1,21 +0,0 @@ -# The executable -wfc -example/wfc_demo - -# The results of the algorithm -example/results/* - -# The library files -lib/* - -# CMake files -**/CMakeLists.txt.user -**/CMakeCache.txt -**/CMakeFiles -**/CMakeScripts -**/Testing -**/Makefile -**/install_manifest.txt -**/compile_commands.json -**/*.cmake -**/_deps \ No newline at end of file diff --git a/modules/wfc/CMakeLists.txt b/modules/wfc/CMakeLists.txt deleted file mode 100644 index 133db27d2..000000000 --- a/modules/wfc/CMakeLists.txt +++ /dev/null @@ -1,47 +0,0 @@ -cmake_minimum_required(VERSION 3.9) -project(fastwfc VERSION 1.0.0 LANGUAGES CXX) - -set(CMAKE_CXX_STANDARD 17) -set(DEFAULT_BUILD_TYPE "Release") - -if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES) - message(STATUS "Setting build type to '${DEFAULT_BUILD_TYPE}' as none was specified.") - set(CMAKE_BUILD_TYPE "${DEFAULT_BUILD_TYPE}" CACHE STRING "Choose the type of build." FORCE) -endif() - -include(GNUInstallDirs) - -set(SOURCE_FILES src/lib/wave.cpp src/lib/propagator.cpp src/lib/wfc.cpp) - -add_library(${PROJECT_NAME}_static STATIC ${SOURCE_FILES}) -add_library(${PROJECT_NAME} SHARED ${SOURCE_FILES}) - -set(LIBRARY_OUTPUT_PATH lib CACHE PATH "Build directory" FORCE) - -target_include_directories(${PROJECT_NAME}_static PUBLIC - $) - -target_include_directories(${PROJECT_NAME} PUBLIC - $) - -set_target_properties(${PROJECT_NAME} PROPERTIES - VERSION ${PROJECT_VERSION} - SOVERSION 1) - -install(TARGETS ${PROJECT_NAME} EXPORT FastWFCConfig - ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} - LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} - RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) - -install(TARGETS ${PROJECT_NAME}_static EXPORT FastWFCStaticConfig - ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} - LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} - RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) - -install(DIRECTORY src/include/ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/${PROJECT_NAME}) - -install(EXPORT FastWFCConfig DESTINATION share/fastwfc/cmake) -install(EXPORT FastWFCStaticConfig DESTINATION share/fastwfc/cmake) - -export(TARGETS ${PROJECT_NAME} FILE FastWFCConfig.cmake) -export(TARGETS ${PROJECT_NAME}_static FILE FastWFCStaticConfig.cmake) diff --git a/modules/wfc/LICENSE b/modules/wfc/LICENSE index fa5cc6674..9f4a03556 100644 --- a/modules/wfc/LICENSE +++ b/modules/wfc/LICENSE @@ -1,9 +1,6 @@ -================================================================================ - -All files directly under src/ are under the following license: - MIT License +Copyright (c) 2022 Péter Magyar Copyright (c) 2018-2019 Mathieu Fehr and Nathanaël Courant Permission is hereby granted, free of charge, to any person obtaining a copy @@ -23,66 +20,3 @@ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -================================================================================ - -The file `src/lib/rapidxml.hpp` is under the following licenses: - -Use of this software is granted under one of the following two licenses, -to be chosen freely by the user. - -1. Boost Software License - Version 1.0 - August 17th, 2003 --------------------------------------------------------------------------------- - -Copyright (c) 2006, 2007 Marcin Kalicinski - -Permission is hereby granted, free of charge, to any person or organization -obtaining a copy of the software and accompanying documentation covered by -this license (the "Software") to use, reproduce, display, distribute, -execute, and transmit the Software, and to prepare derivative works of the -Software, and to permit third-parties to whom the Software is furnished to -do so, all subject to the following: - -The copyright notices in the Software and this entire statement, including -the above license grant, this restriction and the following disclaimer, -must be included in all copies of the Software, in whole or in part, and -all derivative works of the Software, unless such copies or derivative -works are solely in the form of machine-executable object code generated by -a source language processor. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT -SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE -FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE, -ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -DEALINGS IN THE SOFTWARE. - -2. The MIT License --------------------------------------------------------------------------------- - -Copyright (c) 2006, 2007 Marcin Kalicinski - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies -of the Software, and to permit persons to whom the Software is furnished to do so, -subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL -THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS -IN THE SOFTWARE. - -================================================================================ - -The files `src/lib/stb_image_write.h` and `src/lib/stb_image.h` are dual-licensed -under the public domain and MIT license. See the end of the corresponding files -for details. diff --git a/modules/wfc/SCsub b/modules/wfc/SCsub new file mode 100644 index 000000000..ea2afa7d9 --- /dev/null +++ b/modules/wfc/SCsub @@ -0,0 +1,8 @@ +#!/usr/bin/env python + +Import("env") +Import("env_modules") + +env_network_synchronizer = env_modules.Clone() + +env_network_synchronizer.add_source_files(env.modules_sources, "register_types.cpp") diff --git a/modules/wfc/src/include/utils/array2D.hpp b/modules/wfc/array2D.hpp similarity index 100% rename from modules/wfc/src/include/utils/array2D.hpp rename to modules/wfc/array2D.hpp diff --git a/modules/wfc/src/include/utils/array3D.hpp b/modules/wfc/array3D.hpp similarity index 100% rename from modules/wfc/src/include/utils/array3D.hpp rename to modules/wfc/array3D.hpp diff --git a/modules/wfc/config.py b/modules/wfc/config.py new file mode 100644 index 000000000..7cbbc80da --- /dev/null +++ b/modules/wfc/config.py @@ -0,0 +1,19 @@ +def can_build(env, platform): + return True + + +def configure(env): + pass + + +def get_doc_classes(): + return [ + ] + + +def get_doc_path(): + return "doc_classes" + + +def is_enabled(): + return True diff --git a/modules/wfc/src/include/direction.hpp b/modules/wfc/direction.hpp similarity index 100% rename from modules/wfc/src/include/direction.hpp rename to modules/wfc/direction.hpp diff --git a/modules/wfc/src/include/overlapping_wfc.hpp b/modules/wfc/overlapping_wfc.hpp similarity index 100% rename from modules/wfc/src/include/overlapping_wfc.hpp rename to modules/wfc/overlapping_wfc.hpp diff --git a/modules/wfc/src/lib/propagator.cpp b/modules/wfc/propagator.cpp similarity index 100% rename from modules/wfc/src/lib/propagator.cpp rename to modules/wfc/propagator.cpp diff --git a/modules/wfc/src/include/propagator.hpp b/modules/wfc/propagator.hpp similarity index 100% rename from modules/wfc/src/include/propagator.hpp rename to modules/wfc/propagator.hpp diff --git a/modules/wfc/register_types.cpp b/modules/wfc/register_types.cpp new file mode 100644 index 000000000..e84abb5ab --- /dev/null +++ b/modules/wfc/register_types.cpp @@ -0,0 +1,8 @@ + +#include "register_types.h" + +void register_wfc_types() { +} + +void unregister_wfc_types() { +} diff --git a/modules/wfc/register_types.h b/modules/wfc/register_types.h new file mode 100644 index 000000000..4ef314102 --- /dev/null +++ b/modules/wfc/register_types.h @@ -0,0 +1,3 @@ + +void register_wfc_types(); +void unregister_wfc_types(); diff --git a/modules/wfc/src/include/tiling_wfc.hpp b/modules/wfc/tiling_wfc.hpp similarity index 100% rename from modules/wfc/src/include/tiling_wfc.hpp rename to modules/wfc/tiling_wfc.hpp diff --git a/modules/wfc/src/lib/wave.cpp b/modules/wfc/wave.cpp similarity index 100% rename from modules/wfc/src/lib/wave.cpp rename to modules/wfc/wave.cpp diff --git a/modules/wfc/src/include/wave.hpp b/modules/wfc/wave.hpp similarity index 100% rename from modules/wfc/src/include/wave.hpp rename to modules/wfc/wave.hpp diff --git a/modules/wfc/src/lib/wfc.cpp b/modules/wfc/wfc.cpp similarity index 100% rename from modules/wfc/src/lib/wfc.cpp rename to modules/wfc/wfc.cpp diff --git a/modules/wfc/src/include/wfc.hpp b/modules/wfc/wfc.hpp similarity index 100% rename from modules/wfc/src/include/wfc.hpp rename to modules/wfc/wfc.hpp