Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/main' into Testing
Browse files Browse the repository at this point in the history
  • Loading branch information
QuimMoya committed Feb 14, 2025
2 parents 0a1ef6d + cc9ecfb commit e046c91
Show file tree
Hide file tree
Showing 51 changed files with 502 additions and 401 deletions.
415 changes: 261 additions & 154 deletions package-lock.json

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@
],
"devDependencies": {
"@types/jest": "^27.5.2",
"@types/three": "^0.170.0",
"@types/three": "^0.173.0",
"adm-zip": "^0.5.10",
"cpy-cli": "^5.0.0",
"esbuild": "^0.24.0",
Expand All @@ -74,7 +74,7 @@
"make-dir-cli": "^4.0.0",
"monaco-editor": "^0.52.0",
"rimraf": "^6.0.0",
"three": "^0.170.0",
"three": "^0.173.0",
"ts-jest": "^27.0.7",
"ts-node": "^10.9.1",
"typedoc": "^0.26.3",
Expand Down
44 changes: 12 additions & 32 deletions src/cpp/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,8 @@ set(CMAKE_CXX_EXTENSIONS OFF)
set_property(GLOBAL PROPERTY USE_FOLDERS ON)

# collect source files
file(GLOB WebIfcParsing parsing/*.cpp)
file(GLOB_RECURSE WebIfcGeometry geometry/*.cpp)
file(GLOB_RECURSE WebIfcGeometryH geometry/*.h)
file(GLOB WebIfcSchema schema/*.cpp)
file(GLOB WebIfcManager modelmanager/*.cpp)
file(GLOB WebIfcAPI web-ifc-wasm.cpp)
file(GLOB WebIfcUtility utility/*.cpp)
file(GLOB WebIfcTestSourceFiles test/*.cpp)
file(GLOB WebIfcTestingMain web-ifc-test.cpp)
file(GLOB_RECURSE web-ifc-source web-ifc/*.cpp)
file(GLOB_RECURSE web-ifc-wasm wasm/*.cpp)

# download the external projects and save their paths
Message("Downloading FastFloat")
Expand All @@ -38,8 +31,6 @@ FetchContent_MakeAvailable(fastfloat)
FetchContent_GetProperties(fastfloat)

Message("Downloading TinyNURBS")

# FetchContent_Declare(tinynurbs GIT_REPOSITORY "https://github.com/pradeep-pyro/tinynurbs" GIT_TAG "2fc6562d71665312c6298f7c340bace1bcf1b7a1" SOURCE_SUBDIR "../")
FetchContent_Declare(tinynurbs GIT_REPOSITORY "https://github.com/QuimMoya/tinynurbs" GIT_TAG "47115cd9b6e922b27bbc4ab01fdeac2e9ea597a4" SOURCE_SUBDIR "../")
FetchContent_MakeAvailable(tinynurbs)
FetchContent_GetProperties(tinynurbs)
Expand All @@ -61,28 +52,14 @@ FetchContent_GetProperties(earcut)

Message("Downloading CDT")
FetchContent_Declare(cdt GIT_REPOSITORY "https://github.com/artem-ogre/CDT" GIT_TAG "4d0c9026b8ec846fe544897e7111f8f9080d5f8a" SOURCE_SUBDIR "../")

# FetchContent_Declare(cdt GIT_REPOSITORY "https://github.com/artem-ogre/CDT" GIT_TAG "9d99b32ae56b26cd2781678dc4405c98b8679a9f" SOURCE_SUBDIR "../")
FetchContent_MakeAvailable(cdt)
FetchContent_GetProperties(cdt)

Message("Downloading spdlog")
FetchContent_Declare(spdlog GIT_REPOSITORY "https://github.com/gabime/spdlog" GIT_TAG "7e635fca68d014934b4af8a1cf874f63989352b7" SOURCE_SUBDIR "../")
FetchContent_Declare(spdlog GIT_REPOSITORY "https://github.com/gabime/spdlog" GIT_TAG "f355b3d58f7067eee1706ff3c801c2361011f3d5" SOURCE_SUBDIR "../")
FetchContent_MakeAvailable(spdlog)
FetchContent_GetProperties(spdlog)

#Message("Downloading FUZZY")
# using a custom version of fuzzy-bools to silence some debug printf from the library that pollutes the output of the executables
# FetchContent_Declare(fuzzy GIT_REPOSITORY "https://github.com/CBenghi/fuzzy-bools" GIT_TAG "07faaad8cae623dd634b1c09b4b37b44bf645781" SOURCE_SUBDIR "../")
# FetchContent_Declare(fuzzy GIT_REPOSITORY "https://github.com/tomvandig/fuzzy-bools" GIT_TAG "a52c0f0c0667b7c875ae44e91e63a33c1813be64" SOURCE_SUBDIR "../")
# @pobr1 Improvement
# FetchContent_Declare(fuzzy GIT_REPOSITORY "https://github.com/QuimMoya/fuzzy-bools" GIT_TAG "2cf2885065dcf5359dc42b9934cd7d0acb62f431" SOURCE_SUBDIR "../")
# FetchContent_MakeAvailable(fuzzy)
# FetchContent_GetProperties(fuzzy)
# file(RENAME ${fuzzy_SOURCE_DIR}/src ${fuzzy_SOURCE_DIR}/fuzzy RESULT result) # specifying 'result' continues even if rename was already performed
# file(GLOB FuzzyHeaders ${fuzzy_SOURCE_DIR}/fuzzy/*.h)
message(${WebIfcGeometryH})

Message("Downloads Finished")

function(PARAM_SETTER THE_EXECUTABLE)
Expand All @@ -92,7 +69,6 @@ function(PARAM_SETTER THE_EXECUTABLE)
target_include_directories(${THE_EXECUTABLE} PUBLIC ${glm_SOURCE_DIR}/)
target_include_directories(${THE_EXECUTABLE} PUBLIC ${glm_SOURCE_DIR}/glm)
target_include_directories(${THE_EXECUTABLE} PUBLIC ${earcut_SOURCE_DIR}/include)
target_include_directories(${THE_EXECUTABLE} PUBLIC ${fuzzy_SOURCE_DIR}/)
target_include_directories(${THE_EXECUTABLE} PUBLIC ${spdlog_SOURCE_DIR}/include)

if(NOT MSVC)
Expand All @@ -116,32 +92,36 @@ endfunction()

if(EMSCRIPTEN)
# build parameters for web-ifc
add_executable(web-ifc ${WebIfcManager} ${WebIfcSchema} ${WebIfcParsing} ${WebIfcAPI} ${WebIfcUtility} ${WebIfcGeometry})
add_executable(web-ifc ${web-ifc-source} ${web-ifc-wasm})
param_setter(web-ifc)
set_target_properties(web-ifc PROPERTIES LINK_FLAGS "${DEBUG_FLAG} --bind -flto --define-macro=REAL_T_IS_DOUBLE -s ALLOW_MEMORY_GROWTH=1 -s MAXIMUM_MEMORY=4GB -sSTACK_SIZE=5MB -s EXPORT_NAME=WebIFCWasm -s MODULARIZE=1 -s ENVIRONMENT=web")

add_executable(web-ifc-node ${WebIfcManager} ${WebIfcSchema} ${WebIfcParsing} ${WebIfcAPI} ${WebIfcUtility} ${WebIfcGeometry})
add_executable(web-ifc-node ${web-ifc-source} ${web-ifc-wasm})
param_setter(web-ifc-node)
set_target_properties(web-ifc-node PROPERTIES LINK_FLAGS "${DEBUG_FLAG} --bind -flto --define-macro=REAL_T_IS_DOUBLE -s ALLOW_MEMORY_GROWTH=1 -s MAXIMUM_MEMORY=4GB -sSTACK_SIZE=5MB -s EXPORT_NAME=WebIFCWasm -s MODULARIZE=1 ")

# multi-treaded versions
add_executable(web-ifc-mt ${WebIfcManager} ${WebIfcSchema} ${WebIfcParsing} ${WebIfcAPI} ${WebIfcUtility} ${WebIfcGeometry})
add_executable(web-ifc-mt ${web-ifc-source} ${web-ifc-wasm})
param_setter(web-ifc-mt)
target_compile_options(web-ifc-mt PUBLIC "-pthread")
set_target_properties(web-ifc-mt PROPERTIES LINK_FLAGS "${DEBUG_FLAG} -pthread -s PTHREAD_POOL_SIZE=navigator.hardwareConcurrency --bind -flto --define-macro=REAL_T_IS_DOUBLE -sSTACK_SIZE=5MB -s ALLOW_MEMORY_GROWTH=1 -s MAXIMUM_MEMORY=4GB -s EXPORT_NAME=WebIFCWasm -s MODULARIZE=1 -s ENVIRONMENT=web,worker")
endif()

if(NOT EMSCRIPTEN)
# build web-ifc as a static library
add_library(web-ifc-library STATIC ${web-ifc-source})
param_setter(web-ifc-library)

# build parameters for web-ifc-test
add_executable(web-ifc-test ${WebIfcManager} ${WebIfcSchema} ${WebIfcParsing} ${WebIfcUtility} ${WebIfcGeometry} ${WebIfcTestSourceFiles})
add_executable(web-ifc-test ${web-ifc-source} "./test/encoding_test.cpp" "./test/main.cpp" "./test/io_helpers.cpp")
param_setter(web-ifc-test)
target_include_directories(web-ifc-test PUBLIC ${tinycpptest_SOURCE_DIR}/Sources)

add_test(web-ifc-test web-ifc-test)
set_tests_properties(web-ifc-test PROPERTIES LABELS "web-ifc")

# build parameters for web-ifc in testing environment
add_executable(web-ifc ${WebIfcManager} ${WebIfcSchema} ${WebIfcParsing} ${WebIfcUtility} ${WebIfcGeometry} ${WebIfcTestingMain} "./test/io_helpers.cpp")
add_executable(web-ifc ${web-ifc-source} "./test/web-ifc-test.cpp" "./test/io_helpers.cpp")
param_setter(web-ifc)
target_include_directories(web-ifc PUBLIC ${tinycpptest_SOURCE_DIR}/Sources)

Expand Down
6 changes: 3 additions & 3 deletions src/cpp/test/io_helpers.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@

#include "io_helpers.h"
#include <fstream>
#include "../geometry/operations/boolean-utils/fuzzy-bools.h"
#include "../geometry/representation/IfcGeometry.h"
#include "../geometry/representation/geometry.h"
#include "../web-ifc/geometry/operations/boolean-utils/fuzzy-bools.h"
#include "../web-ifc/geometry/representation/IfcGeometry.h"
#include "../web-ifc/geometry/representation/geometry.h"

namespace webifc::io
{
Expand Down
8 changes: 4 additions & 4 deletions src/cpp/test/io_helpers.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@
#include <sstream>
#include <cstdint>
#include <glm/glm.hpp>
#include "../geometry/representation/geometry.h"
#include "../geometry/representation/IfcGeometry.h"
#include "../geometry/IfcGeometryProcessor.h"
#include "../geometry/operations/geometryutils.h"
#include "../web-ifc/geometry/representation/geometry.h"
#include "../web-ifc/geometry/representation/IfcGeometry.h"
#include "../web-ifc/geometry/IfcGeometryProcessor.h"
#include "../web-ifc/geometry/operations/geometryutils.h"

namespace webifc::io
{
Expand Down
10 changes: 5 additions & 5 deletions src/cpp/web-ifc-test.cpp → src/cpp/test/web-ifc-test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@
#include <fstream>
#include <cstdint>
#include <filesystem>
#include "test/io_helpers.h"
#include "io_helpers.h"

#include "parsing/IfcLoader.h"
#include "schema/IfcSchemaManager.h"
#include "geometry/IfcGeometryProcessor.h"
#include "schema/ifc-schema.h"
#include "../web-ifc/parsing/IfcLoader.h"
#include "../web-ifc/schema/IfcSchemaManager.h"
#include "../web-ifc/geometry/IfcGeometryProcessor.h"
#include "../web-ifc/schema/ifc-schema.h"

using namespace webifc::io;

Expand Down
4 changes: 2 additions & 2 deletions src/cpp/web-ifc-wasm.cpp → src/cpp/wasm/web-ifc-wasm.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
#include <memory>
#include <emscripten/bind.h>
#include <spdlog/spdlog.h>
#include "modelmanager/ModelManager.h"
#include "version.h"
#include "../web-ifc/modelmanager/ModelManager.h"
#include "../version.h"

namespace webifc::parsing {
void p21encode(std::string_view input, std::ostringstream &output);
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
#include "../schema/IfcSchemaManager.h"
#include "../geometry/IfcGeometryProcessor.h"
#include "../parsing/IfcLoader.h"
#include "../version.h"
#include "../../version.h"

webifc::manager::ModelManager::ModelManager(bool _mt_enabled) {
mt_enabled = _mt_enabled;
Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
#include <fast_float/fast_float.h>
#include <spdlog/spdlog.h>
#include "IfcLoader.h"
#include "../version.h"
#include "../../version.h"
#include "../schema/IfcSchemaManager.h"

namespace webifc::parsing {
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion tests/regression/results.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"tests/ifcfiles/public/AC20-FZK-Haus.ifc":"10d153b8a811be6938884afa7564aef21a862989f18bca3ea0edf478b3acc6c8","tests/ifcfiles/public/C20-Institute-Var-2.ifc":"691b89f04e20da3698e8b99a237d2fa4fd3f8cb46547566e1dee2627e1d5c1b7","tests/ifcfiles/public/FM_ARC_DigitalHub.ifc":"4d22dbbdc8450fb71128a4409af6f58ab3a1b2c6294cd3909e7d5bb174ec2a5f","tests/ifcfiles/public/ISSUE_005_haus.ifc":"10d153b8a811be6938884afa7564aef21a862989f18bca3ea0edf478b3acc6c8","tests/ifcfiles/public/ISSUE_021_Mini Project.ifc":"664050e7ea13d259076dbb19dc3ed61c0e755141ea0d9be8e5933a29b7b46845","tests/ifcfiles/public/ISSUE_034_HouseZ.ifc":"601033a8a4f7efad18362b105ffbf70da85886536282e493c2bd86973d69b674","tests/ifcfiles/public/ISSUE_044_test_IFCCOMPOSITEPROFILEDEF.ifc":"d438e1f2df58ee34eb9a411cf472ca06f454b7f4db3165b73a5aa56e0eb7abe8","tests/ifcfiles/public/ISSUE_053_20181220Holter_Tower_10.ifczip":"56032afee815bddad18cbd039aef99557c93c1a2c13c6bf7129d75a9dd475cbe","tests/ifcfiles/public/ISSUE_068_ARK_NUS_skolebygg.ifc":"86f994da7ddaad3214f2102d148d3316eb64a784a4d1408c5284790dfdfef21b","tests/ifcfiles/public/ISSUE_102_M3D-CON-CD.ifc":"397b1d6fc416a661e313aa4616dfee5146d243385e116954e891fa885dfa27b2","tests/ifcfiles/public/ISSUE_102_M3D-CON.ifc":"d0b9abc1e7e0a2a2d992dd02053f86a39106c8bde557e29ebb8695f86847b23e","tests/ifcfiles/public/ISSUE_126_model.ifc":"2e1d125b00cea201428215a20fafaecd0e2727d9dc250e6177e1492c4d584abf","tests/ifcfiles/public/ISSUE_129_N1540_17_EXE_MOD_448200_02_09_11SMC_IGC_V17.ifc":"2147a4eac7b6f4bc1ca912daa13e9058f5bb6049dded5e1c1bce0f24a393af0e","tests/ifcfiles/public/ISSUE_159_kleine_Wohnung_R22.ifc":"f6d432c9bfc30f49fb7d11bbdba6fd01e06b9893932be6e07dfd5392f9fc318b","tests/ifcfiles/public/ISSUE_171_IfcSurfaceCurveSweptAreaSolid.ifc":"7eba51243653b014f59b2bf0f9f7dc5a0f7050b231614e8bbb9852ce2bf9a4c7","tests/ifcfiles/public/IfcOpenHouse_IFC4.ifc":"38b6a5c4907a8b93ef5a5ad99b1c31149380e266cd00b6401edd11f2ec9aeef2","tests/ifcfiles/public/KIT-Simple-Road-Test-Web-IFC4x3_RC2.ifc":"c43b6e1b005d640f9535aa7b415f5c565b89fe7fe31ec44eb0b899d815ab06c1","tests/ifcfiles/public/Office_A_20110811.ifc":"d53e5bd7e766843e80649208435f2e4a37b39c1010cdb13a459c8896563e6b2c","tests/ifcfiles/public/S_Office_Integrated Design Archi.ifc":"770d7a4cfc273c1c70f74e0691d00c4eb974c8ea568351ca86a3194b0b211055","tests/ifcfiles/public/Sample_entities.ifc":"15a455f4b849c546855a30e2b82cf88e677ad4a21ba05f0727fdc6f78ce24fcd","tests/ifcfiles/public/advanced_model.ifc":"cc2f867ef94b3774893aeadf5b6a5c648f5b83038bf6ec39ee17f5065766739e","tests/ifcfiles/public/dental_clinic.ifc":"b2046343793d5d2e0ca1ec246b4634114d829154dc2d49bf9007c57f6f436d45","tests/ifcfiles/public/duplex.ifc":"902e1de09228e42097051e87ad79384b9fe03a160981c86a30d5a327a57f6a9c","tests/ifcfiles/public/example.ifc":"23d4d722c3283f60d795291d18cf36667d77459be27f45215be88ba1c54f5565","tests/ifcfiles/public/ifcbridge-model01.ifc":"5c7adbba41eda38cd14b9ba5386728c9e4874bfb434f25b8bf5876d3554ee918","tests/ifcfiles/public/schependomlaan.ifc":"c863a8f9db66ec30ce6f24d6f136e981973ad79cf60064758dd01cefac0c419c","tests/ifcfiles/public/tested_sample_project.ifc":"bb2e3681d317836401b62a845cefb524e465ba02a89fe8139dfd47ec6325e96f"}
{"tests/ifcfiles/public/AC20-FZK-Haus.ifc":"19ee5b853d0cf32018f54c1f778514a8834b6cb01261dc9825cb4a48f67a5fae","tests/ifcfiles/public/C20-Institute-Var-2.ifc":"ac98b82c88cc8e27dbafece628e5e278b3fdfdfc1e460f679d563ca13c6df5c9","tests/ifcfiles/public/FM_ARC_DigitalHub.ifc":"607320d14e4eaf3fc40a83a6148348f645a78c3bf8da19bddcfcf2f35c909147","tests/ifcfiles/public/ISSUE_005_haus.ifc":"19ee5b853d0cf32018f54c1f778514a8834b6cb01261dc9825cb4a48f67a5fae","tests/ifcfiles/public/ISSUE_021_Mini Project.ifc":"ec105fd04e6f7cc87f5aff2346c3e9d3e94f2a35b28cad59f7d8051d9567a03d","tests/ifcfiles/public/ISSUE_034_HouseZ.ifc":"b599ca9f82ad21d05f9c9b8921d14ca5e9635ca8937fca6eba40272cd7f2e1c4","tests/ifcfiles/public/ISSUE_044_test_IFCCOMPOSITEPROFILEDEF.ifc":"ce7582a288480a545b2dcda2e6d8570b669827b0c221cfbc31185d5553563b7a","tests/ifcfiles/public/ISSUE_053_20181220Holter_Tower_10.ifczip":"6b8dc638fd01a04fc0816f9e2c935fab766c04d385475d42262e8b70d962724d","tests/ifcfiles/public/ISSUE_068_ARK_NUS_skolebygg.ifc":"453492a320187a30fc03aefa036502a364c97af62eee921f69cebfd631e67c03","tests/ifcfiles/public/ISSUE_102_M3D-CON-CD.ifc":"aae6cae8ccd12efb9a90da6678423601f73ae0b4b878d63f9b85d8619f450ca6","tests/ifcfiles/public/ISSUE_102_M3D-CON.ifc":"fb22b6e733f1c5ad9719d86e81c2f45c79a954d56c0d779a56ef03bd14161c10","tests/ifcfiles/public/ISSUE_126_model.ifc":"bfad187b873a34ec386b8c4a47a02233839373a8bb9d7ef1c7a3972fae0f56a7","tests/ifcfiles/public/ISSUE_129_N1540_17_EXE_MOD_448200_02_09_11SMC_IGC_V17.ifc":"3ef60977b10937a410cc3074c7cc87b99de9ddf761867624bc78a47210104f51","tests/ifcfiles/public/ISSUE_159_kleine_Wohnung_R22.ifc":"820adfaa6ecb5883dd889b6f920724b77666bd4ddd116abcccce4bbc613dce67","tests/ifcfiles/public/ISSUE_171_IfcSurfaceCurveSweptAreaSolid.ifc":"c5bb45f57ca83a19d4a3146c41e4e42b4a08208c400ce490d9bfc23c7ff575e8","tests/ifcfiles/public/IfcOpenHouse_IFC4.ifc":"25c6b335a66e56de318997be5aae3c9f9774517e39a36b520fe69ce637a15fe6","tests/ifcfiles/public/KIT-Simple-Road-Test-Web-IFC4x3_RC2.ifc":"168971a85b62fe14900dc9ac5eab3a7d9268833078a313d1ae98785b69bbe64e","tests/ifcfiles/public/Office_A_20110811.ifc":"28b4a6a8645ab2b23c0f0050c6225c545cdb25c4b9d9968ed4a90d71f0ee281f","tests/ifcfiles/public/S_Office_Integrated Design Archi.ifc":"3ac8c503dec4cf6dd31806a82269c28f34b44b245dba0b66d0b7d9199a66c064","tests/ifcfiles/public/Sample_entities.ifc":"69d08b09e343a03031c8f912fbf0671f5ceabd5bf87a842ba7f39254e746d587","tests/ifcfiles/public/advanced_model.ifc":"a9d75d26b6d911513b3410a1e0332ad2639975e3ba4de2e8d0be6cda0f0518ab","tests/ifcfiles/public/dental_clinic.ifc":"019e6a09d8a215e75608f9cff79ca34bcfb2d930aa610a6ecb3a2403b5394acd","tests/ifcfiles/public/duplex.ifc":"ad9d46748eabacda99f85bcec2ffd6eb168c1602aedb9ff387c3d0230499f472","tests/ifcfiles/public/example.ifc":"52767e9f48a4d42a3ee43f3d84df35f8bcdd8226c1ef4a48f8da86a054217511","tests/ifcfiles/public/ifcbridge-model01.ifc":"1c0d30b936ced88ea0377ec117d3e5376d63dc9634baca281a35b42035860ce7","tests/ifcfiles/public/schependomlaan.ifc":"ffda1eefcab37c83da6685b89c1b30066216cc6ee655a0a93ceb6145550c1ca3","tests/ifcfiles/public/tested_sample_project.ifc":"b670ba3155f8a813037f94bfba59cdd24b8eeb693f21663a68aaff4bb0167094"}
Loading

0 comments on commit e046c91

Please sign in to comment.