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