tree and document plug-ins

This commit is contained in:
Thomas Krijnen
2026-04-17 11:24:09 +02:00
parent 3824e7b449
commit d2cc66fdf0
60 changed files with 2207 additions and 766 deletions
+10 -3
View File
@@ -1,14 +1,21 @@
find_package(Eigen3 REQUIRED)
set(mapping_plugin_runtime_dir "${CMAKE_BINARY_DIR}/ifcgeom/$<CONFIG>")
foreach(schema ${SCHEMA_VERSIONS})
file(GLOB IFCGEOM_I_FILES *.i)
file(GLOB IFCGEOM_H_FILES *.h)
file(GLOB IFCGEOM_CPP_FILES *.cpp)
set(IFCGEOM_FILES ${IFCGEOM_CPP_FILES} ${IFCGEOM_H_FILES} ${IFCGEOM_I_FILES})
add_library(geometry_mapping_ifc${schema} OBJECT ${IFCGEOM_FILES})
set_target_properties(geometry_mapping_ifc${schema} PROPERTIES COMPILE_FLAGS "-DIFC_GEOM_EXPORTS -DIfcSchema=Ifc${schema}")
target_link_libraries(geometry_mapping_ifc${schema} IfcParse Eigen3::Eigen)
add_library(geometry_mapping_ifc${schema} SHARED ${IFCGEOM_FILES})
set_target_properties(geometry_mapping_ifc${schema} PROPERTIES
COMPILE_FLAGS "-DIfcSchema=Ifc${schema}"
OUTPUT_NAME "geometry.mapping.ifc${schema}"
RUNTIME_OUTPUT_DIRECTORY "${mapping_plugin_runtime_dir}"
LIBRARY_OUTPUT_DIRECTORY "${mapping_plugin_runtime_dir}"
)
target_link_libraries(geometry_mapping_ifc${schema} PRIVATE plugin IfcGeom IfcParse Eigen3::Eigen ${OpenCASCADE_LIBRARIES})
list(APPEND mapping_libraries geometry_mapping_ifc${schema})
+58
View File
@@ -0,0 +1,58 @@
/********************************************************************************
* *
* This file is part of IfcOpenShell. *
* *
* IfcOpenShell is free software: you can redistribute it and/or modify *
* it under the terms of the Lesser GNU General Public License as published by *
* the Free Software Foundation, either version 3.0 of the License, or *
* (at your option) any later version. *
* *
* IfcOpenShell is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* Lesser GNU General Public License for more details. *
* *
* You should have received a copy of the Lesser GNU General Public License *
* along with this program. If not, see <http://www.gnu.org/licenses/>. *
* *
********************************************************************************/
#include "../mapping_plugin.h"
#include "mapping.h"
#include <boost/dll/alias.hpp>
namespace ifcopenshell {
namespace geometry {
namespace impl {
namespace mapping_plugin {
namespace {
struct POSTFIX_SCHEMA(factory_t) {
abstract_mapping* operator()(ifcopenshell::file* file, Settings& settings) const {
return new POSTFIX_SCHEMA(mapping)(file, settings);
}
};
}
plugin::abi_info plugin_abi() {
return plugin::host_abi();
}
plugin::metadata plugin_metadata() {
return mapping_plugin_metadata(STRINGIFY(IfcSchema));
}
void register_plugin(mapping_registry& registry, const plugin::module& module) {
POSTFIX_SCHEMA(factory_t) factory;
registry.bind(STRINGIFY(IfcSchema), factory, module);
}
}
}
}
}
BOOST_DLL_ALIAS(ifcopenshell::geometry::impl::mapping_plugin::plugin_abi, ifcopenshell_plugin_abi_v1)
BOOST_DLL_ALIAS(ifcopenshell::geometry::impl::mapping_plugin::plugin_metadata, ifcopenshell_plugin_metadata_v1)
BOOST_DLL_ALIAS(ifcopenshell::geometry::impl::mapping_plugin::register_plugin, ifcopenshell_register_mapping_plugin_v1)