Merge pull request #115 from aothms/tridify_ifcgeom_dll

Dllimport/export for IfcGeom. Closes #77
This commit is contained in:
Thomas Krijnen
2016-08-08 13:40:09 +02:00
committed by GitHub
36 changed files with 2652 additions and 2604 deletions
+21 -32
View File
@@ -63,7 +63,7 @@ MESSAGE(STATUS "LIBDIR: ${LIBDIR}")
set(IFCOPENSHELL_LIBARY_DIR "") # for *nix rpaths
if (BUILD_SHARED_LIBS)
add_definitions(-DBUILD_SHARED_LIBS)
add_definitions(-DIFC_SHARED_BUILD)
if (MSVC)
message(WARNING "Building DLLs against the static VC run-time. This is not recommended if the DLLs are to be redistributed.")
# C4521: 'identifier' : class 'type' needs to have dll-interface to be used by clients of class 'type2'
@@ -245,6 +245,21 @@ IF(COLLADA_SUPPORT)
ENDIF()
ENDIF()
# Make sure cross-referenced symbols between static OCC libraries get
# resolved. Also add thread and rt libraries.
get_filename_component(libTKernelExt ${libTKernel} EXT)
if("${libTKernelExt}" STREQUAL ".a")
find_package(Threads)
# OPENCASCADE_LIBRARIES repeated three times below in order to fix cyclic dependencies - use --start-group ... --end-group instead?
set(OPENCASCADE_LIBRARIES ${OPENCASCADE_LIBRARIES} ${OPENCASCADE_LIBRARIES} ${OPENCASCADE_LIBRARIES} ${CMAKE_THREAD_LIBS_INIT})
if (NOT APPLE AND NOT WIN32)
set(OPENCASCADE_LIBRARIES ${OPENCASCADE_LIBRARIES} "rt")
endif()
if (NOT WIN32)
set(OPENCASCADE_LIBRARIES ${OPENCASCADE_LIBRARIES} "dl")
endif()
endif()
IF(NOT CMAKE_BUILD_TYPE)
SET(CMAKE_BUILD_TYPE "Release")
ENDIF()
@@ -410,11 +425,7 @@ if(NOT WIN32)
LINK_DIRECTORIES(${LINK_DIRECTORIES} /usr/lib /usr/lib64 /usr/local/lib /usr/local/lib64)
endif()
if(BUILD_SHARED_LIBS)
SET(IFCOPENSHELL_LIBRARIES IfcGeom)
else()
SET(IFCOPENSHELL_LIBRARIES IfcParse IfcGeom)
endif()
set(IFCOPENSHELL_LIBRARIES IfcParse IfcGeom)
# IfcParse
file(GLOB IFCPARSE_H_FILES ../src/ifcparse/*.h)
@@ -431,7 +442,7 @@ endforeach()
set(IFCPARSE_FILES ${IFCPARSE_CPP_FILES} ${IFCPARSE_H_FILES})
add_library(IfcParse ${IFCPARSE_FILES})
set_target_properties(IfcParse PROPERTIES COMPILE_FLAGS -DIfcParse_EXPORTS)
set_target_properties(IfcParse PROPERTIES COMPILE_FLAGS -DIFC_PARSE_EXPORTS)
IF(UNICODE_SUPPORT)
TARGET_LINK_LIBRARIES(IfcParse ${ICU_LIBRARIES} ${Boost_LIBRARIES})
@@ -442,17 +453,10 @@ file(GLOB IFCGEOM_H_FILES ../src/ifcgeom/*.h)
file(GLOB IFCGEOM_CPP_FILES ../src/ifcgeom/*.cpp)
set(IFCGEOM_FILES ${IFCGEOM_CPP_FILES} ${IFCGEOM_H_FILES})
IF(BUILD_SHARED_LIBS)
message(WARNING "Building IfcGeom as shared library currently not supported depending on platform and compiler options")
ENDIF()
add_library(IfcGeom ${IFCGEOM_FILES})
set_target_properties(IfcGeom PROPERTIES COMPILE_FLAGS -DIFC_GEOM_EXPORTS)
if(WIN32)
add_library(IfcGeom STATIC ${IFCGEOM_FILES})
else()
add_library(IfcGeom ${IFCGEOM_FILES})
endif()
TARGET_LINK_LIBRARIES(IfcGeom IfcParse)
TARGET_LINK_LIBRARIES(IfcGeom IfcParse ${OPENCASCADE_LIBRARIES})
# IfcConvert
file(GLOB IFCCONVERT_CPP_FILES ../src/ifcconvert/*.cpp)
@@ -463,21 +467,6 @@ if (IFCCONVERT_DOUBLE_PRECISION)
set_target_properties(IfcConvert PROPERTIES COMPILE_FLAGS -DIFCCONVERT_DOUBLE_PRECISION)
endif()
# Make sure cross-referenced symbols between static OCC libraries get
# resolved. Also add thread and rt libraries.
get_filename_component(libTKernelExt ${libTKernel} EXT)
if("${libTKernelExt}" STREQUAL ".a")
find_package(Threads)
# OPENCASCADE_LIBRARIES repeated three times below in order to fix cyclic dependencies - use --start-group ... --end-group instead?
set(OPENCASCADE_LIBRARIES ${OPENCASCADE_LIBRARIES} ${OPENCASCADE_LIBRARIES} ${OPENCASCADE_LIBRARIES} ${CMAKE_THREAD_LIBS_INIT})
if (NOT APPLE AND NOT WIN32)
set(OPENCASCADE_LIBRARIES ${OPENCASCADE_LIBRARIES} "rt")
endif()
if (NOT WIN32)
set(OPENCASCADE_LIBRARIES ${OPENCASCADE_LIBRARIES} "dl")
endif()
endif()
TARGET_LINK_LIBRARIES(IfcConvert ${IFCOPENSHELL_LIBRARIES} ${OPENCASCADE_LIBRARIES} ${Boost_LIBRARIES} ${OPENCOLLADA_LIBRARIES} ${ICU_LIBRARIES})
if (NOT WIN32)
SET_INSTALL_RPATHS(IfcConvert "${IFCOPENSHELL_LIBARY_DIR};${OCC_LIBRARY_DIR};${Boost_LIBRARY_DIRS};${OPENCOLLADA_LIBRARY_DIR};${ICU_LIBRARY_DIR}")
+22 -22
View File
@@ -26,7 +26,7 @@ header = """
#include <boost/optional.hpp>
#include "../ifcparse/IfcParse_Export.h"
#include "../ifcparse/ifc_parse_api.h"
#include "../ifcparse/IfcUtil.h"
#include "../ifcparse/IfcException.h"
@@ -55,7 +55,7 @@ enum_header = """
#ifndef %(schema_name_upper)sENUM_H
#define %(schema_name_upper)sENUM_H
#include "../ifcparse/IfcParse_Export.h"
#include "../ifcparse/ifc_parse_api.h"
#include <boost/optional.hpp>
@@ -67,10 +67,10 @@ namespace Type {
typedef enum {
%(types)s, UNDEFINED
} Enum;
IfcParse_EXPORT boost::optional<Enum> Parent(Enum v);
IfcParse_EXPORT Enum FromString(const std::string& s);
IfcParse_EXPORT std::string ToString(Enum v);
IfcParse_EXPORT bool IsSimple(Enum v);
IFC_PARSE_API boost::optional<Enum> Parent(Enum v);
IFC_PARSE_API Enum FromString(const std::string& s);
IFC_PARSE_API std::string ToString(Enum v);
IFC_PARSE_API bool IsSimple(Enum v);
}
}
@@ -84,24 +84,24 @@ lb_header = """
#define IfcSchema %(schema_name)s
#include "../ifcparse/IfcParse_Export.h"
#include "../ifcparse/ifc_parse_api.h"
#include "../ifcparse/IfcUtil.h"
#include "../ifcparse/IfcEntityDescriptor.h"
#include "../ifcparse/IfcWritableEntity.h"
namespace %(schema_name)s {
namespace Type {
IfcParse_EXPORT int GetAttributeCount(Enum t);
IfcParse_EXPORT int GetAttributeIndex(Enum t, const std::string& a);
IfcParse_EXPORT IfcUtil::ArgumentType GetAttributeType(Enum t, unsigned char a);
IfcParse_EXPORT Enum GetAttributeEntity(Enum t, unsigned char a);
IfcParse_EXPORT const std::string& GetAttributeName(Enum t, unsigned char a);
IfcParse_EXPORT bool GetAttributeOptional(Enum t, unsigned char a);
IfcParse_EXPORT bool GetAttributeDerived(Enum t, unsigned char a);
IfcParse_EXPORT std::pair<const char*, int> GetEnumerationIndex(Enum t, const std::string& a);
IfcParse_EXPORT std::pair<Enum, unsigned> GetInverseAttribute(Enum t, const std::string& a);
IfcParse_EXPORT std::set<std::string> GetInverseAttributeNames(Enum t);
IfcParse_EXPORT void PopulateDerivedFields(IfcWrite::IfcWritableEntity* e);
IFC_PARSE_API int GetAttributeCount(Enum t);
IFC_PARSE_API int GetAttributeIndex(Enum t, const std::string& a);
IFC_PARSE_API IfcUtil::ArgumentType GetAttributeType(Enum t, unsigned char a);
IFC_PARSE_API Enum GetAttributeEntity(Enum t, unsigned char a);
IFC_PARSE_API const std::string& GetAttributeName(Enum t, unsigned char a);
IFC_PARSE_API bool GetAttributeOptional(Enum t, unsigned char a);
IFC_PARSE_API bool GetAttributeDerived(Enum t, unsigned char a);
IFC_PARSE_API std::pair<const char*, int> GetEnumerationIndex(Enum t, const std::string& a);
IFC_PARSE_API std::pair<Enum, unsigned> GetInverseAttribute(Enum t, const std::string& a);
IFC_PARSE_API std::set<std::string> GetInverseAttributeNames(Enum t);
IFC_PARSE_API void PopulateDerivedFields(IfcWrite::IfcWritableEntity* e);
}}
#endif
@@ -347,7 +347,7 @@ derived_field_statement = ' {std::set<int> idxs; %(statements)sderived_map[Ty
derived_field_statement_attrs = 'idxs.insert(%d); '
simpletype = """%(documentation)s
class IfcParse_EXPORT %(name)s : public %(superclass)s {
class IFC_PARSE_API %(name)s : public %(superclass)s {
public:
virtual IfcUtil::ArgumentType getArgumentType(unsigned int i) const;
virtual Argument* getArgument(unsigned int i) const;
@@ -380,13 +380,13 @@ typedef IfcUtil::IfcBaseClass %(name)s;
enumeration = """namespace %(name)s {
%(documentation)s
typedef enum {%(values)s} %(name)s;
IfcParse_EXPORT const char* ToString(%(name)s v);
IfcParse_EXPORT %(name)s FromString(const std::string& s);
IFC_PARSE_API const char* ToString(%(name)s v);
IFC_PARSE_API %(name)s FromString(const std::string& s);
}
"""
entity = """%(documentation)s
class IfcParse_EXPORT %(name)s %(superclass)s{
class IFC_PARSE_API %(name)s %(superclass)s{
public:
%(attributes)s virtual unsigned int getArgumentCount() const { return %(argument_count)d; }
virtual IfcUtil::ArgumentType getArgumentType(unsigned int i) const {%(argument_type_function_body)s}
+9 -6
View File
@@ -51,6 +51,7 @@ inline static bool ALMOST_THE_SAME(const T& a, const T& b, double tolerance=ALMO
#include "../ifcgeom/IfcGeomRepresentation.h"
#include "../ifcgeom/IfcRepresentationShapeItem.h"
#include "../ifcgeom/IfcGeomShapeType.h"
#include "ifc_geom_api.h"
// Define this in case you want to conserve memory usage at all cost. This has been
// benchmarked extensively: https://github.com/IfcOpenShell/IfcOpenShell/pull/47
@@ -71,13 +72,13 @@ if ( it != cache.T.end() ) { e = it->second; return true; }
namespace IfcGeom {
class Cache {
class IFC_GEOM_API Cache {
public:
#include "IfcRegisterCreateCache.h"
std::map<int, TopoDS_Shape> Shape;
};
class Kernel {
class IFC_GEOM_API Kernel {
private:
double deflection_tolerance;
@@ -230,10 +231,12 @@ public:
IfcSchema::IfcObjectDefinition* get_decomposing_entity(IfcSchema::IfcProduct*);
template <typename P>
IfcGeom::BRepElement<P>* create_brep_for_representation_and_product(const IteratorSettings&, IfcSchema::IfcRepresentation*, IfcSchema::IfcProduct*);
IfcGeom::BRepElement<P>* create_brep_for_representation_and_product(
const IteratorSettings&, IfcSchema::IfcRepresentation*, IfcSchema::IfcProduct*);
template <typename P>
IfcGeom::BRepElement<P>* create_brep_for_processed_representation(const IteratorSettings&, IfcSchema::IfcRepresentation*, IfcSchema::IfcProduct*, IfcGeom::BRepElement<P>*);
IfcGeom::BRepElement<P>* create_brep_for_processed_representation(
const IteratorSettings&, IfcSchema::IfcRepresentation*, IfcSchema::IfcProduct*, IfcGeom::BRepElement<P>*);
const SurfaceStyle* get_style(const IfcSchema::IfcRepresentationItem*);
const SurfaceStyle* get_style(const IfcSchema::IfcMaterial*);
@@ -300,8 +303,8 @@ public:
};
IfcSchema::IfcProductDefinitionShape* tesselate(const TopoDS_Shape& shape, double deflection);
IfcSchema::IfcProductDefinitionShape* serialise(const TopoDS_Shape& shape, bool advanced);
IFC_GEOM_API IfcSchema::IfcProductDefinitionShape* tesselate(const TopoDS_Shape& shape, double deflection);
IFC_GEOM_API IfcSchema::IfcProductDefinitionShape* serialise(const TopoDS_Shape& shape, bool advanced);
}
#endif
+1
View File
@@ -27,6 +27,7 @@
#include "../ifcgeom/IfcGeomRepresentation.h"
#include "../ifcgeom/IfcGeomIteratorSettings.h"
#include "ifc_geom_api.h"
namespace IfcGeom {
+15 -8
View File
@@ -1004,8 +1004,9 @@ IfcSchema::IfcRelVoidsElement::list::ptr IfcGeom::Kernel::find_openings(IfcSchem
}
template <typename P>
IfcGeom::BRepElement<P>* IfcGeom::Kernel::create_brep_for_representation_and_product(const IteratorSettings& settings, IfcSchema::IfcRepresentation* representation, IfcSchema::IfcProduct* product) {
IfcGeom::BRepElement<P>* IfcGeom::Kernel::create_brep_for_representation_and_product(
const IteratorSettings& settings, IfcSchema::IfcRepresentation* representation, IfcSchema::IfcProduct* product)
{
IfcGeom::Representation::BRep* shape;
IfcGeom::IfcRepresentationShapeItems shapes, shapes2;
@@ -1116,8 +1117,10 @@ IfcGeom::BRepElement<P>* IfcGeom::Kernel::create_brep_for_representation_and_pro
}
template <typename P>
IfcGeom::BRepElement<P>* IfcGeom::Kernel::create_brep_for_processed_representation(const IteratorSettings& /*settings*/, IfcSchema::IfcRepresentation* representation, IfcSchema::IfcProduct* product, IfcGeom::BRepElement<P>* brep) {
IfcGeom::BRepElement<P>* IfcGeom::Kernel::create_brep_for_processed_representation(
const IteratorSettings& /*settings*/, IfcSchema::IfcRepresentation* representation, IfcSchema::IfcProduct* product,
IfcGeom::BRepElement<P>* brep)
{
int parent_id = -1;
try {
IfcSchema::IfcObjectDefinition* parent_object = get_decomposing_entity(product);
@@ -1210,11 +1213,15 @@ IfcSchema::IfcObjectDefinition* IfcGeom::Kernel::get_decomposing_entity(IfcSchem
return parent;
}
template IfcGeom::BRepElement<float>* IfcGeom::Kernel::create_brep_for_representation_and_product<float>(const IteratorSettings& settings, IfcSchema::IfcRepresentation* representation, IfcSchema::IfcProduct* product);
template IfcGeom::BRepElement<double>* IfcGeom::Kernel::create_brep_for_representation_and_product<double>(const IteratorSettings& settings, IfcSchema::IfcRepresentation* representation, IfcSchema::IfcProduct* product);
template IFC_GEOM_API IfcGeom::BRepElement<float>* IfcGeom::Kernel::create_brep_for_representation_and_product<float>(
const IteratorSettings& settings, IfcSchema::IfcRepresentation* representation, IfcSchema::IfcProduct* product);
template IFC_GEOM_API IfcGeom::BRepElement<double>* IfcGeom::Kernel::create_brep_for_representation_and_product<double>(
const IteratorSettings& settings, IfcSchema::IfcRepresentation* representation, IfcSchema::IfcProduct* product);
template IfcGeom::BRepElement<float>* IfcGeom::Kernel::create_brep_for_processed_representation<float>(const IteratorSettings& settings, IfcSchema::IfcRepresentation* representation, IfcSchema::IfcProduct* product, IfcGeom::BRepElement<float>* brep);
template IfcGeom::BRepElement<double>* IfcGeom::Kernel::create_brep_for_processed_representation<double>(const IteratorSettings& settings, IfcSchema::IfcRepresentation* representation, IfcSchema::IfcProduct* product, IfcGeom::BRepElement<double>* brep);
template IFC_GEOM_API IfcGeom::BRepElement<float>* IfcGeom::Kernel::create_brep_for_processed_representation<float>(
const IteratorSettings& settings, IfcSchema::IfcRepresentation* representation, IfcSchema::IfcProduct* product, IfcGeom::BRepElement<float>* brep);
template IFC_GEOM_API IfcGeom::BRepElement<double>* IfcGeom::Kernel::create_brep_for_processed_representation<double>(
const IteratorSettings& settings, IfcSchema::IfcRepresentation* representation, IfcSchema::IfcProduct* product, IfcGeom::BRepElement<double>* brep);
std::pair<std::string, double> IfcGeom::Kernel::initializeUnits(IfcSchema::IfcUnitAssignment* unit_assignment) {
// Set default units, set length to meters, angles to undefined
+8
View File
@@ -82,6 +82,14 @@
#include "../ifcgeom/IfcGeomIteratorSettings.h"
#include "../ifcgeom/IfcRepresentationShapeItem.h"
// The infamous min & max Win32 #defines can leak here from OCE depending on the build configuration
#ifdef min
#undef min
#endif
#ifdef max
#undef max
#endif
namespace IfcGeom {
template <typename P>
+4 -3
View File
@@ -20,12 +20,13 @@
#ifndef IFCGEOMITERATORSETTINGS_H
#define IFCGEOMITERATORSETTINGS_H
#include "ifc_geom_api.h"
#include "../ifcparse/IfcException.h"
#include "../ifcparse/IfcUtil.h"
namespace IfcGeom
{
class IteratorSettings
class IFC_GEOM_API IteratorSettings
{
public:
/// Enumeration of setting identifiers. These settings define the
@@ -87,7 +88,7 @@ namespace IfcGeom
/// Generates UVs by using simple box projection. Requires normals.
/// Applicable only for DAE output currently.
GENERATE_UVS = 1 << 16,
/// Specifies whether to slide representations according to associated IfcLayerSets.
/// Specifies whether to slice representations according to associated IfcLayerSets.
APPLY_LAYERSETS = 1 << 17,
/// Number of different setting flags.
NUM_SETTINGS = 17
@@ -142,7 +143,7 @@ namespace IfcGeom
double deflection_tolerance_;
};
class ElementSettings : public IteratorSettings
class IFC_GEOM_API ElementSettings : public IteratorSettings
{
public:
ElementSettings(const IteratorSettings& settings,
+1 -1
View File
@@ -26,7 +26,7 @@
namespace IfcGeom {
class Material {
class IFC_GEOM_API Material {
private:
const IfcGeom::SurfaceStyle* style;
public:
+3 -2
View File
@@ -20,6 +20,7 @@
#ifndef IFCGEOMRENDERSTYLES_H
#define IFCGEOMRENDERSTYLES_H
#include "ifc_geom_api.h"
#ifdef USE_IFC4
#include "../ifcparse/Ifc4.h"
#else
@@ -27,7 +28,7 @@
#endif
namespace IfcGeom {
class SurfaceStyle {
class IFC_GEOM_API SurfaceStyle {
public:
class ColorComponent {
private:
@@ -92,7 +93,7 @@ namespace IfcGeom {
boost::optional<double>& Specularity() { return specularity; }
};
const SurfaceStyle* get_default_style(const std::string& ifc_type);
IFC_GEOM_API const SurfaceStyle* get_default_style(const std::string& ifc_type);
}
#endif
+3 -3
View File
@@ -41,7 +41,7 @@ namespace IfcGeom {
namespace Representation {
class Representation {
class IFC_GEOM_API Representation {
Representation(const Representation&); //N/A
Representation& operator =(const Representation&); //N/A
protected:
@@ -54,7 +54,7 @@ namespace IfcGeom {
virtual ~Representation() {}
};
class BRep : public Representation {
class IFC_GEOM_API BRep : public Representation {
private:
unsigned int id;
const IfcGeom::IfcRepresentationShapeItems _shapes;
@@ -73,7 +73,7 @@ namespace IfcGeom {
const unsigned int& getId() const { return id; }
};
class Serialization : public Representation {
class IFC_GEOM_API Serialization : public Representation {
private:
int _id;
std::string _brep_data;
+1 -1
View File
@@ -26,7 +26,7 @@
#include "../ifcgeom/IfcGeomRenderStyles.h"
namespace IfcGeom {
class IfcRepresentationShapeItem {
class IFC_GEOM_API IfcRepresentationShapeItem {
private:
gp_GTrsf placement;
TopoDS_Shape shape;
@@ -17,21 +17,21 @@
* *
********************************************************************************/
#ifndef IfcParse_EXPORT_H
#define IfcParse_EXPORT_H
#ifndef IFC_GEOM_API_H
#define IFC_GEOM_API_H
#ifdef BUILD_SHARED_LIBS
#ifdef _MSC_VER
#ifdef IfcParse_EXPORTS
#define IfcParse_EXPORT __declspec(dllexport)
#ifdef IFC_SHARED_BUILD
#ifdef _WIN32
#ifdef IFC_GEOM_EXPORTS
#define IFC_GEOM_API __declspec(dllexport)
#else
#define IfcParse_EXPORT __declspec(dllimport)
#define IFC_GEOM_API __declspec(dllimport)
#endif
#else // simply assume GCC-like
#define IfcParse_EXPORT __attribute__((visibility("default")))
#else // simply assume *nix + GCC-like compiler
#define IFC_GEOM_API __attribute__((visibility("default")))
#endif
#else
#define IfcParse_EXPORT
#define IFC_GEOM_API
#endif
#endif
+12 -12
View File
@@ -31,24 +31,24 @@
#define IfcSchema Ifc2x3
#include "../ifcparse/IfcParse_Export.h"
#include "../ifcparse/ifc_parse_api.h"
#include "../ifcparse/IfcUtil.h"
#include "../ifcparse/IfcEntityDescriptor.h"
#include "../ifcparse/IfcWritableEntity.h"
namespace Ifc2x3 {
namespace Type {
IfcParse_EXPORT int GetAttributeCount(Enum t);
IfcParse_EXPORT int GetAttributeIndex(Enum t, const std::string& a);
IfcParse_EXPORT IfcUtil::ArgumentType GetAttributeType(Enum t, unsigned char a);
IfcParse_EXPORT Enum GetAttributeEntity(Enum t, unsigned char a);
IfcParse_EXPORT const std::string& GetAttributeName(Enum t, unsigned char a);
IfcParse_EXPORT bool GetAttributeOptional(Enum t, unsigned char a);
IfcParse_EXPORT bool GetAttributeDerived(Enum t, unsigned char a);
IfcParse_EXPORT std::pair<const char*, int> GetEnumerationIndex(Enum t, const std::string& a);
IfcParse_EXPORT std::pair<Enum, unsigned> GetInverseAttribute(Enum t, const std::string& a);
IfcParse_EXPORT std::set<std::string> GetInverseAttributeNames(Enum t);
IfcParse_EXPORT void PopulateDerivedFields(IfcWrite::IfcWritableEntity* e);
IFC_PARSE_API int GetAttributeCount(Enum t);
IFC_PARSE_API int GetAttributeIndex(Enum t, const std::string& a);
IFC_PARSE_API IfcUtil::ArgumentType GetAttributeType(Enum t, unsigned char a);
IFC_PARSE_API Enum GetAttributeEntity(Enum t, unsigned char a);
IFC_PARSE_API const std::string& GetAttributeName(Enum t, unsigned char a);
IFC_PARSE_API bool GetAttributeOptional(Enum t, unsigned char a);
IFC_PARSE_API bool GetAttributeDerived(Enum t, unsigned char a);
IFC_PARSE_API std::pair<const char*, int> GetEnumerationIndex(Enum t, const std::string& a);
IFC_PARSE_API std::pair<Enum, unsigned> GetInverseAttribute(Enum t, const std::string& a);
IFC_PARSE_API std::set<std::string> GetInverseAttributeNames(Enum t);
IFC_PARSE_API void PopulateDerivedFields(IfcWrite::IfcWritableEntity* e);
}}
#endif
+1099 -1099
View File
File diff suppressed because it is too large Load Diff
File diff suppressed because one or more lines are too long
+12 -12
View File
@@ -31,24 +31,24 @@
#define IfcSchema Ifc4
#include "../ifcparse/IfcParse_Export.h"
#include "../ifcparse/ifc_parse_api.h"
#include "../ifcparse/IfcUtil.h"
#include "../ifcparse/IfcEntityDescriptor.h"
#include "../ifcparse/IfcWritableEntity.h"
namespace Ifc4 {
namespace Type {
IfcParse_EXPORT int GetAttributeCount(Enum t);
IfcParse_EXPORT int GetAttributeIndex(Enum t, const std::string& a);
IfcParse_EXPORT IfcUtil::ArgumentType GetAttributeType(Enum t, unsigned char a);
IfcParse_EXPORT Enum GetAttributeEntity(Enum t, unsigned char a);
IfcParse_EXPORT const std::string& GetAttributeName(Enum t, unsigned char a);
IfcParse_EXPORT bool GetAttributeOptional(Enum t, unsigned char a);
IfcParse_EXPORT bool GetAttributeDerived(Enum t, unsigned char a);
IfcParse_EXPORT std::pair<const char*, int> GetEnumerationIndex(Enum t, const std::string& a);
IfcParse_EXPORT std::pair<Enum, unsigned> GetInverseAttribute(Enum t, const std::string& a);
IfcParse_EXPORT std::set<std::string> GetInverseAttributeNames(Enum t);
IfcParse_EXPORT void PopulateDerivedFields(IfcWrite::IfcWritableEntity* e);
IFC_PARSE_API int GetAttributeCount(Enum t);
IFC_PARSE_API int GetAttributeIndex(Enum t, const std::string& a);
IFC_PARSE_API IfcUtil::ArgumentType GetAttributeType(Enum t, unsigned char a);
IFC_PARSE_API Enum GetAttributeEntity(Enum t, unsigned char a);
IFC_PARSE_API const std::string& GetAttributeName(Enum t, unsigned char a);
IFC_PARSE_API bool GetAttributeOptional(Enum t, unsigned char a);
IFC_PARSE_API bool GetAttributeDerived(Enum t, unsigned char a);
IFC_PARSE_API std::pair<const char*, int> GetEnumerationIndex(Enum t, const std::string& a);
IFC_PARSE_API std::pair<Enum, unsigned> GetInverseAttribute(Enum t, const std::string& a);
IFC_PARSE_API std::set<std::string> GetInverseAttributeNames(Enum t);
IFC_PARSE_API void PopulateDerivedFields(IfcWrite::IfcWritableEntity* e);
}}
#endif
+1312 -1312
View File
File diff suppressed because it is too large Load Diff
File diff suppressed because one or more lines are too long
+2 -2
View File
@@ -40,7 +40,7 @@ typedef unsigned int UChar32;
namespace IfcParse {
class IfcParse_EXPORT IfcCharacterDecoder {
class IFC_PARSE_API IfcCharacterDecoder {
private:
IfcParse::IfcSpfStream* file;
#ifdef HAVE_ICU
@@ -75,7 +75,7 @@ namespace IfcParse {
namespace IfcWrite {
class IfcParse_EXPORT IfcCharacterEncoder {
class IFC_PARSE_API IfcCharacterEncoder {
private:
std::string str;
#ifdef HAVE_ICU
+2 -2
View File
@@ -39,7 +39,7 @@
namespace IfcUtil {
class IfcParse_EXPORT IfcEnumerationDescriptor {
class IFC_PARSE_API IfcEnumerationDescriptor {
private:
IfcSchema::Type::Enum type;
std::vector<std::string> values;
@@ -62,7 +62,7 @@ namespace IfcUtil {
}
};
class IfcParse_EXPORT IfcEntityDescriptor {
class IFC_PARSE_API IfcEntityDescriptor {
public:
class IfcArgumentDescriptor
{
+4 -4
View File
@@ -20,7 +20,7 @@
#ifndef IFCEXCEPTION_H
#define IFCEXCEPTION_H
#include "IfcParse_Export.h"
#include "ifc_parse_api.h"
#include <boost/lexical_cast.hpp>
@@ -35,7 +35,7 @@
#endif
namespace IfcParse {
class IfcParse_EXPORT IfcException : public std::exception {
class IFC_PARSE_API IfcException : public std::exception {
private:
std::string message;
public:
@@ -47,14 +47,14 @@ namespace IfcParse {
}
};
class IfcParse_EXPORT IfcAttributeOutOfRangeException : public IfcException {
class IFC_PARSE_API IfcAttributeOutOfRangeException : public IfcException {
public:
IfcAttributeOutOfRangeException(const std::string& e)
: IfcException(e) {}
~IfcAttributeOutOfRangeException () throw () {}
};
class IfcParse_EXPORT IfcInvalidTokenException : public IfcException {
class IFC_PARSE_API IfcInvalidTokenException : public IfcException {
public:
IfcInvalidTokenException(
int token_start,
+2 -2
View File
@@ -23,7 +23,7 @@
#include <map>
#include <set>
#include "../ifcparse/IfcParse_Export.h"
#include "ifc_parse_api.h"
#include "../ifcparse/IfcParse.h"
#include "../ifcparse/IfcSpfHeader.h"
@@ -32,7 +32,7 @@ namespace IfcParse {
/// This class provides several static convenience functions and variables
/// and provide access to the entities in an IFC file
class IfcParse_EXPORT IfcFile {
class IFC_PARSE_API IfcFile {
public:
typedef std::map<IfcSchema::Type::Enum, IfcEntityList::ptr> entities_by_type_t;
typedef std::map<unsigned int, IfcUtil::IfcBaseClass*> entity_by_id_t;
+2 -2
View File
@@ -23,12 +23,12 @@
#include <string>
#include <boost/uuid/uuid.hpp>
#include "../ifcparse/IfcParse_Export.h"
#include "ifc_parse_api.h"
namespace IfcParse {
/// A helper class for the creation of IFC GlobalIds.
class IfcParse_EXPORT IfcGlobalId {
class IFC_PARSE_API IfcGlobalId {
private:
std::string string_data, formatted_string;
boost::uuids::uuid uuid_data;
+2 -2
View File
@@ -30,7 +30,7 @@
#include <map>
#include "../ifcparse/IfcParse_Export.h"
#include "ifc_parse_api.h"
#ifdef USE_IFC4
#include "../ifcparse/Ifc4.h"
@@ -42,7 +42,7 @@
#include "../ifcparse/IfcWrite.h"
#include "../ifcparse/IfcGlobalId.h"
class IfcParse_EXPORT IfcHierarchyHelper : public IfcParse::IfcFile {
class IFC_PARSE_API IfcHierarchyHelper : public IfcParse::IfcFile {
public:
template <class T>
T* addTriplet(double x, double y, double z) {
+2 -2
View File
@@ -22,7 +22,7 @@
#include <string>
#include "../ifcparse/IfcParse_Export.h"
#include "ifc_parse_api.h"
#include "../ifcparse/IfcUtil.h"
#include "../ifcparse/IfcWrite.h"
@@ -34,7 +34,7 @@ namespace IfcParse {
// that in the IfcFile class the distinction what entity type to be created is
// no longer necessary and weird diagonal casts when creating geometry from
// IfcLateBoundEntities are eliminated.
class IfcParse_EXPORT IfcLateBoundEntity : public IfcUtil::IfcBaseEntity {
class IFC_PARSE_API IfcLateBoundEntity : public IfcUtil::IfcBaseEntity {
private:
IfcWrite::IfcWritableEntity* writable_entity();
void invalid_argument(unsigned int i, const std::string& t);
+2 -2
View File
@@ -34,9 +34,9 @@
#include <boost/optional.hpp>
#include "IfcParse_Export.h"
#include "ifc_parse_api.h"
class IfcParse_EXPORT Logger {
class IFC_PARSE_API Logger {
public:
typedef enum { LOG_NOTICE, LOG_WARNING, LOG_ERROR } Severity;
private:
+9 -9
View File
@@ -40,7 +40,7 @@
#include <boost/shared_ptr.hpp>
#include <boost/dynamic_bitset.hpp>
#include "../ifcparse/IfcParse_Export.h"
#include "ifc_parse_api.h"
#include "../ifcparse/IfcCharacterDecoder.h"
#include "../ifcparse/IfcUtil.h"
@@ -91,7 +91,7 @@ namespace IfcParse {
/// Provides functions to convert Tokens to binary data
/// Tokens are merely offsets to where they can be read in the file
class IfcParse_EXPORT TokenFunc {
class IFC_PARSE_API TokenFunc {
private:
static bool startsWith(const Token& t, char c);
public:
@@ -144,7 +144,7 @@ namespace IfcParse {
Token NoneTokenPtr();
/// A stream of tokens to be read from a IfcSpfStream.
class IfcParse_EXPORT IfcSpfLexer {
class IFC_PARSE_API IfcSpfLexer {
private:
IfcCharacterDecoder* decoder;
//storage for temporary string without allocation
@@ -164,7 +164,7 @@ namespace IfcParse {
/// Argument of type list, e.g.
/// #1=IfcDirection((1.,0.,0.));
/// ==========
class IfcParse_EXPORT ArgumentList: public Argument {
class IFC_PARSE_API ArgumentList: public Argument {
private:
std::vector<Argument*> list;
void push(Argument* l);
@@ -197,7 +197,7 @@ namespace IfcParse {
/// Argument being null, e.g. '$'
/// == ===
class IfcParse_EXPORT NullArgument : public Argument {
class IFC_PARSE_API NullArgument : public Argument {
public:
NullArgument() {}
IfcUtil::ArgumentType type() const { return IfcUtil::Argument_NULL; }
@@ -210,7 +210,7 @@ namespace IfcParse {
/// Argument of type scalar or string, e.g.
/// #1=IfcVector(#2,1.0);
/// == ===
class IfcParse_EXPORT TokenArgument : public Argument {
class IFC_PARSE_API TokenArgument : public Argument {
private:
public:
@@ -236,7 +236,7 @@ namespace IfcParse {
/// Argument of an IFC simple type
/// #1=IfcTrimmedCurve(#2,(IFCPARAMETERVALUE(0.)),(IFCPARAMETERVALUE(1.)),.T.,.PARAMETER.);
/// ===================== =====================
class IfcParse_EXPORT EntityArgument : public Argument {
class IFC_PARSE_API EntityArgument : public Argument {
private:
IfcUtil::IfcBaseClass* entity;
public:
@@ -257,7 +257,7 @@ namespace IfcParse {
/// Entity defined in an IFC file, e.g.
/// #1=IfcDirection((1.,0.,0.));
/// ============================
class IfcParse_EXPORT Entity : public IfcAbstractEntity {
class IFC_PARSE_API Entity : public IfcAbstractEntity {
private:
mutable ArgumentList* args;
mutable IfcSchema::Type::Enum _type;
@@ -283,6 +283,6 @@ namespace IfcParse {
}
IfcParse_EXPORT std::ostream& operator<< (std::ostream& os, const IfcParse::IfcFile& f);
IFC_PARSE_API std::ostream& operator<< (std::ostream& os, const IfcParse::IfcFile& f);
#endif
+3 -3
View File
@@ -21,11 +21,11 @@
#define IFCSIPREFIX
#include "../ifcparse/IfcParse.h"
#include "IfcParse_Export.h"
#include "ifc_parse_api.h"
namespace IfcParse {
IfcParse_EXPORT double IfcSIPrefixToValue(IfcSchema::IfcSIPrefix::IfcSIPrefix);
IfcParse_EXPORT double get_SI_equivalent(IfcSchema::IfcNamedUnit*);
IFC_PARSE_API double IfcSIPrefixToValue(IfcSchema::IfcSIPrefix::IfcSIPrefix);
IFC_PARSE_API double get_SI_equivalent(IfcSchema::IfcNamedUnit*);
}
#endif
+6 -6
View File
@@ -20,14 +20,14 @@
#ifndef IFCSPFHEADER_H
#define IFCSPFHEADER_H
#include "../ifcparse/IfcParse_Export.h"
#include "ifc_parse_api.h"
#include "../ifcparse/IfcSpfStream.h"
#include "../ifcparse/IfcWrite.h"
namespace IfcParse {
class IfcParse_EXPORT HeaderEntity : public IfcAbstractEntity {
class IFC_PARSE_API HeaderEntity : public IfcAbstractEntity {
private:
ArgumentList* _list;
const char * const _datatype;
@@ -105,7 +105,7 @@ public:
}
};
class IfcParse_EXPORT FileDescription : public HeaderEntity {
class IFC_PARSE_API FileDescription : public HeaderEntity {
public:
explicit FileDescription(IfcSpfLexer* = 0);
@@ -116,7 +116,7 @@ public:
void implementation_level(const std::string& value) { setArgument(1, value); }
};
class IfcParse_EXPORT FileName : public HeaderEntity {
class IFC_PARSE_API FileName : public HeaderEntity {
public:
explicit FileName(IfcSpfLexer* = 0);
@@ -137,7 +137,7 @@ public:
void authorization(const std::string& value) { setArgument(6, value); }
};
class IfcParse_EXPORT FileSchema : public HeaderEntity {
class IFC_PARSE_API FileSchema : public HeaderEntity {
public:
explicit FileSchema(IfcSpfLexer* = 0);
@@ -146,7 +146,7 @@ public:
void schema_identifiers(const std::vector<std::string>& value) { setArgument(0, value); }
};
class IfcParse_EXPORT IfcSpfHeader {
class IFC_PARSE_API IfcSpfHeader {
private:
IfcSpfLexer* _lexer;
FileDescription* _file_description;
+2 -2
View File
@@ -30,7 +30,7 @@
#include <fstream>
#include <string>
#include "../ifcparse/IfcParse_Export.h"
#include "ifc_parse_api.h"
// As of IfcOpenShell version 0.3.0 the paging functionality, which
// loads a file on disk into multiple chunks, has been disabled.
@@ -48,7 +48,7 @@ namespace IfcParse {
/// which only one is simultaneously kept in memory, for files
/// that define their entities not in a sequential nature, this is
/// detrimental for the performance of the parser.
class IfcParse_EXPORT IfcSpfStream {
class IFC_PARSE_API IfcSpfStream {
private:
FILE* stream;
char* buffer;
+27 -27
View File
@@ -26,7 +26,7 @@
#include <sstream>
#include <algorithm>
#include "../ifcparse/IfcParse_Export.h"
#include "ifc_parse_api.h"
#ifdef USE_IFC4
#include "../ifcparse/Ifc4enum.h"
@@ -74,9 +74,9 @@ namespace IfcUtil {
Argument_UNKNOWN
};
IfcParse_EXPORT const char* ArgumentTypeToString(ArgumentType argument_type);
IFC_PARSE_API const char* ArgumentTypeToString(ArgumentType argument_type);
class IfcParse_EXPORT IfcBaseClass {
class IFC_PARSE_API IfcBaseClass {
public:
virtual ~IfcBaseClass() {}
IfcAbstractEntity* entity;
@@ -104,11 +104,11 @@ namespace IfcUtil {
}
};
class IfcParse_EXPORT IfcBaseEntity : public IfcBaseClass {
class IFC_PARSE_API IfcBaseEntity : public IfcBaseClass {
};
// TODO: Investigate whether these should be template classes instead
class IfcParse_EXPORT IfcBaseType : public IfcBaseEntity {
class IFC_PARSE_API IfcBaseType : public IfcBaseEntity {
public:
unsigned int getArgumentCount() const;
Argument* getArgument(unsigned int i) const;
@@ -116,17 +116,17 @@ namespace IfcUtil {
IfcSchema::Type::Enum getArgumentEntity(unsigned int /*i*/) const { return IfcSchema::Type::UNDEFINED; }
};
IfcParse_EXPORT bool valid_binary_string(const std::string& s);
IFC_PARSE_API bool valid_binary_string(const std::string& s);
/// Replaces spaces and potentially other problem causing characters with underscores.
IfcParse_EXPORT void sanitate_material_name(std::string &str);
IfcParse_EXPORT void escape_xml(std::string &str);
IfcParse_EXPORT void unescape_xml(std::string &str);
IFC_PARSE_API void sanitate_material_name(std::string &str);
IFC_PARSE_API void escape_xml(std::string &str);
IFC_PARSE_API void unescape_xml(std::string &str);
}
template <class T>
class IfcTemplatedEntityList;
class IfcParse_EXPORT IfcEntityList {
class IFC_PARSE_API IfcEntityList {
std::vector<IfcUtil::IfcBaseClass*> ls;
public:
typedef boost::shared_ptr<IfcEntityList> ptr;
@@ -184,7 +184,7 @@ public:
template <class T>
class IfcTemplatedEntityListList;
class IfcParse_EXPORT IfcEntityListList {
class IFC_PARSE_API IfcEntityListList {
std::vector< std::vector<IfcUtil::IfcBaseClass*> > ls;
public:
typedef boost::shared_ptr< IfcEntityListList > ptr;
@@ -282,24 +282,24 @@ namespace IfcParse {
class IfcFile;
}
class IfcParse_EXPORT Argument {
class IFC_PARSE_API Argument {
public:
virtual operator int() const;
virtual operator bool() const;
virtual operator double() const;
virtual operator std::string() const;
virtual operator boost::dynamic_bitset<>() const;
virtual operator IfcUtil::IfcBaseClass*() const;
virtual operator int() const;
virtual operator bool() const;
virtual operator double() const;
virtual operator std::string() const;
virtual operator boost::dynamic_bitset<>() const;
virtual operator IfcUtil::IfcBaseClass*() const;
virtual operator std::vector<int>() const;
virtual operator std::vector<double>() const;
virtual operator std::vector<std::string>() const;
virtual operator std::vector<boost::dynamic_bitset<> >() const;
virtual operator IfcEntityList::ptr() const;
virtual operator std::vector<int>() const;
virtual operator std::vector<double>() const;
virtual operator std::vector<std::string>() const;
virtual operator std::vector<boost::dynamic_bitset<> >() const;
virtual operator IfcEntityList::ptr() const;
virtual operator std::vector< std::vector<int> >() const;
virtual operator std::vector< std::vector<double> >() const;
virtual operator IfcEntityListList::ptr() const;
virtual operator std::vector< std::vector<int> >() const;
virtual operator std::vector< std::vector<double> >() const;
virtual operator IfcEntityListList::ptr() const;
virtual bool isNull() const = 0;
virtual unsigned int size() const = 0;
@@ -311,7 +311,7 @@ public:
virtual ~Argument() {};
};
class IfcParse_EXPORT IfcAbstractEntity {
class IFC_PARSE_API IfcAbstractEntity {
public:
IfcParse::IfcFile* file;
virtual IfcEntityList::ptr getInverse(IfcSchema::Type::Enum type, int attribute_index) = 0;
+2 -2
View File
@@ -35,12 +35,12 @@
#include <boost/dynamic_bitset.hpp>
#include "../ifcparse/IfcParse_Export.h"
#include "ifc_parse_api.h"
#include "IfcUtil.h"
namespace IfcWrite {
class IfcParse_EXPORT IfcWritableEntity : public IfcAbstractEntity {
class IFC_PARSE_API IfcWritableEntity : public IfcAbstractEntity {
private:
std::map<int,bool> writemask;
std::map<int,Argument*> args;
+3 -3
View File
@@ -32,7 +32,7 @@
#include <boost/optional.hpp>
#include <boost/dynamic_bitset.hpp>
#include "../ifcparse/IfcParse_Export.h"
#include "ifc_parse_api.h"
#include "../ifcparse/IfcUtil.h"
#include "../ifcparse/IfcParse.h"
@@ -44,7 +44,7 @@ namespace IfcWrite {
/// IfcParse namespace is that this class has a Boost.Variant member
/// for storing its value, whereas the IfcParse classes only contain
/// lazy references to byte offsets in the IFC-SPF file.
class IfcParse_EXPORT IfcWriteArgument : public Argument {
class IFC_PARSE_API IfcWriteArgument : public Argument {
public:
class EnumerationReference {
public:
@@ -146,7 +146,7 @@ namespace IfcWrite {
// Accumulates all schema instances created from constructors
// This way they can be added in a single batch to the IfcFile
class IfcParse_EXPORT EntityBuffer {
class IFC_PARSE_API EntityBuffer {
private:
IfcEntityList::ptr buffer;
static EntityBuffer* i;
+37
View File
@@ -0,0 +1,37 @@
/********************************************************************************
* *
* 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/>. *
* *
********************************************************************************/
#ifndef IFC_PARSE_API_H
#define IFC_PARSE_API_H
#ifdef IFC_SHARED_BUILD
#ifdef _WIN32
#ifdef IFC_PARSE_EXPORTS
#define IFC_PARSE_API __declspec(dllexport)
#else
#define IFC_PARSE_API __declspec(dllimport)
#endif
#else // simply assume *nix + GCC-like compiler
#define IFC_PARSE_API __attribute__((visibility("default")))
#endif
#else
#define IFC_PARSE_API
#endif
#endif
+1
View File
@@ -36,6 +36,7 @@
$result = PyBool_FromLong(static_cast<long>(*$1));
}
%include "../ifcgeom/ifc_geom_api.h"
%include "../ifcgeom/IfcGeomIteratorSettings.h"
%include "../ifcgeom/IfcGeomElement.h"
%include "../ifcgeom/IfcGeomMaterial.h"
+1 -1
View File
@@ -203,7 +203,7 @@ namespace IfcUtil {
%}
};
%include "../ifcparse/IfcParse_Export.h"
%include "../ifcparse/ifc_parse_api.h"
%include "../ifcparse/IfcSpfHeader.h"
%include "../ifcparse/IfcFile.h"
%include "../ifcparse/IfcLateBoundEntity.h"