gcc compatibility

This commit is contained in:
Thomas Krijnen
2018-01-17 17:00:27 +01:00
parent cf1de365e7
commit e6499ef3b1
19 changed files with 1145 additions and 911 deletions
+5 -1
View File
@@ -207,7 +207,7 @@ if(HDF5_SUPPORT)
# An additional lib- prefix is added by HDF5 to denote static libraries
SET(HDF5_LIBRARIES libhdf5_cpp libhdf5 libzlib)
ELSE()
SET(HDF5_LIBRARIES hdf5_cpp hdf5 zlib)
SET(HDF5_LIBRARIES hdf5_cpp hdf5 z szip)
ENDIF()
endif()
@@ -450,6 +450,10 @@ ENDIF()
IF(HDF5_SUPPORT)
ADD_SUBDIRECTORY(../src/hdf5_usecases hdf5_usecases)
ENDIF()
if(NOT MSVC)
add_definitions(-std=c++14)
endif()
# CMake installation targets
INSTALL(FILES ${IFCPARSE_H_FILES} DESTINATION include/ifcparse)
+5 -3
View File
@@ -31,6 +31,8 @@ import re
import os
import csv
from builtins import open
try: from html.entities import entitydefs
except: from htmlentitydefs import entitydefs
@@ -45,17 +47,17 @@ regices = list(zip([re.compile(s,re.M) for s in [r'<[\w\n=" \-/\.;_\t:%#,\?\(\)]
definition_files = ['DocEntity.csv', 'DocEnumeration.csv', 'DocDefined.csv', 'DocSelect.csv']
definition_files = map(make_absolute, definition_files)
for fn in definition_files:
with open(fn) as f:
with open(fn, encoding='utf-8', errors='ignore') as f:
for oid, name, desc in csv.reader(f, delimiter=';', quotechar='"'):
name_to_oid[name] = oid
oid_to_name[oid] = name
oid_to_desc[oid] = desc
with open(make_absolute('DocEntityAttributes.csv')) as f:
with open(make_absolute('DocEntityAttributes.csv'), encoding='utf-8', errors='ignore') as f:
for pid, x, oid in csv.reader(f, delimiter=';', quotechar='"'):
oid_to_pid[oid] = pid
with open(make_absolute('DocAttribute.csv')) as f:
with open(make_absolute('DocAttribute.csv'), encoding='utf-8', errors='ignore') as f:
for oid, name, desc in csv.reader(f, delimiter=';', quotechar='"'):
pid = oid_to_pid[oid]
pname = oid_to_name[pid]
+18 -7
View File
@@ -80,10 +80,16 @@ class SchemaClass(codegen.Base):
for name in collection.keys():
statements.append('%(cpp_type)s* %(name)s_type = 0;' % locals())
statements.append('#ifdef _MSC_VER' )
statements.append('#pragma optimize("", off)')
statements.append('#endif' )
statements.append("""
#if defined(__clang__)
#elif defined(__GNUC__) || defined(__GNUG__)
#pragma GCC push_options
#pragma GCC optimize ("O0")
#elif defined(_MSC_VER)
#pragma optimize("", off)
#endif
""")
statements.append('schema_definition* populate_schema() {')
emitted_types = set()
@@ -181,9 +187,14 @@ class SchemaClass(codegen.Base):
statements.extend(('}',''))
statements.append('#ifdef _MSC_VER' )
statements.append('#pragma optimize("", on)')
statements.append('#endif' )
statements.append("""
#if defined(__clang__)
#elif defined(__GNUC__) || defined(__GNUG__)
#pragma GCC pop_options
#elif defined(_MSC_VER)
#pragma optimize("", on)
#endif
""")
statements.extend(('const schema_definition& get_schema() {',
'',
+13 -7
View File
@@ -196,9 +196,12 @@ enumeration_descriptor_map_t enumeration_descriptor_map;
inverse_map_t inverse_map;
derived_map_t derived_map;
#ifdef _MSC_VER
# pragma optimize( "", off )
#if defined(__clang__)
#elif defined(__GNUC__) || defined(__GNUG__)
#pragma GCC push_options
#pragma GCC optimize ("O0")
#elif defined(_MSC_VER)
#pragma optimize("", off)
#endif
void InitDescriptorMap() {
@@ -210,10 +213,6 @@ void InitDescriptorMap() {
%(enumeration_descriptors)s
}
#ifdef _MSC_VER
# pragma optimize( "", on )
#endif
void InitInverseMap() {
%(inverse_implementations)s
}
@@ -222,6 +221,13 @@ void InitDerivedMap() {
%(derived_field_statements)s
}
#if defined(__clang__)
#elif defined(__GNUC__) || defined(__GNUG__)
#pragma GCC pop_options
#elif defined(_MSC_VER)
#pragma optimize("", on)
#endif
int Type::GetAttributeIndex(Enum t, const std::string& a) {
if (entity_descriptor_map.empty()) ::InitDescriptorMap();
std::map<Type::Enum,IfcEntityDescriptor*>::const_iterator i = entity_descriptor_map.find(t);
+2 -1
View File
@@ -22,6 +22,7 @@
#include <string>
#include <vector>
#include <stdexcept>
namespace IfcParse {
@@ -44,7 +45,7 @@ namespace IfcParse {
if (s == "padded") return padded;
if (s == "referenced") return standard_referenced;
if (s == "padded-referenced") return padded_referenced;
throw std::exception("Unrecognized profile");
throw std::runtime_error("Unrecognized profile");
}
private:
+13 -7
View File
@@ -51,9 +51,12 @@ enumeration_descriptor_map_t enumeration_descriptor_map;
inverse_map_t inverse_map;
derived_map_t derived_map;
#ifdef _MSC_VER
# pragma optimize( "", off )
#if defined(__clang__)
#elif defined(__GNUC__) || defined(__GNUG__)
#pragma GCC push_options
#pragma GCC optimize ("O0")
#elif defined(_MSC_VER)
#pragma optimize("", off)
#endif
void InitDescriptorMap() {
@@ -4063,10 +4066,6 @@ void InitDescriptorMap() {
current_enum = enumeration_descriptor_map[Type::IfcWorkControlTypeEnum] = new IfcEnumerationDescriptor(Type::IfcWorkControlTypeEnum, values);
}
#ifdef _MSC_VER
# pragma optimize( "", on )
#endif
void InitInverseMap() {
inverse_map[Type::IfcActor].insert(std::make_pair("IsActingUpon", std::make_pair(Type::IfcRelAssignsToActor, 6)));
inverse_map[Type::IfcAddress].insert(std::make_pair("OfPerson", std::make_pair(Type::IfcPerson, 7)));
@@ -4191,6 +4190,13 @@ void InitDerivedMap() {
{std::set<int> idxs; idxs.insert(0); derived_map[Type::IfcSIUnit] = idxs;}
}
#if defined(__clang__)
#elif defined(__GNUC__) || defined(__GNUG__)
#pragma GCC pop_options
#elif defined(_MSC_VER)
#pragma optimize("", on)
#endif
int Type::GetAttributeIndex(Enum t, const std::string& a) {
if (entity_descriptor_map.empty()) ::InitDescriptorMap();
std::map<Type::Enum,IfcEntityDescriptor*>::const_iterator i = entity_descriptor_map.find(t);
+3
View File
@@ -24,6 +24,8 @@
* *
********************************************************************************/
#ifndef USE_IFC4
#ifndef IFC2X3RT_H
#define IFC2X3RT_H
@@ -49,3 +51,4 @@ namespace Type {
}}
#endif
#endif
+13 -2
View File
@@ -1009,9 +1009,15 @@ enumeration_type* IfcWindowPanelPositionEnum_type = 0;
enumeration_type* IfcWindowStyleConstructionEnum_type = 0;
enumeration_type* IfcWindowStyleOperationEnum_type = 0;
enumeration_type* IfcWorkControlTypeEnum_type = 0;
#ifdef _MSC_VER
#if defined(__clang__)
#elif defined(__GNUC__) || defined(__GNUG__)
#pragma GCC push_options
#pragma GCC optimize ("O0")
#elif defined(_MSC_VER)
#pragma optimize("", off)
#endif
schema_definition* populate_schema() {
IfcAbsorbedDoseMeasure_type = new type_declaration(IfcSchema::Type::IfcAbsorbedDoseMeasure, new simple_type(simple_type::real_type));
IfcAccelerationMeasure_type = new type_declaration(IfcSchema::Type::IfcAccelerationMeasure, new simple_type(simple_type::real_type));
@@ -10744,9 +10750,14 @@ schema_definition* populate_schema() {
return new schema_definition("IFC2X3", declarations, true);
}
#ifdef _MSC_VER
#if defined(__clang__)
#elif defined(__GNUC__) || defined(__GNUG__)
#pragma GCC pop_options
#elif defined(_MSC_VER)
#pragma optimize("", on)
#endif
const schema_definition& get_schema() {
static const schema_definition* s = populate_schema();
+301 -337
View File
File diff suppressed because it is too large Load Diff
+3
View File
@@ -24,6 +24,8 @@
* *
********************************************************************************/
#ifndef USE_IFC4
#ifndef IFC2X3ENUM_H
#define IFC2X3ENUM_H
@@ -44,3 +46,4 @@ namespace Type {
}
#endif
#endif
+47 -12
View File
@@ -51,9 +51,12 @@ enumeration_descriptor_map_t enumeration_descriptor_map;
inverse_map_t inverse_map;
derived_map_t derived_map;
#ifdef _MSC_VER
# pragma optimize( "", off )
#if defined(__clang__)
#elif defined(__GNUC__) || defined(__GNUG__)
#pragma GCC push_options
#pragma GCC optimize ("O0")
#elif defined(_MSC_VER)
#pragma optimize("", off)
#endif
void InitDescriptorMap() {
@@ -1485,6 +1488,10 @@ void InitDescriptorMap() {
current->add("FilletRadius",true,IfcUtil::Argument_DOUBLE,Type::IfcNonNegativeLengthMeasure);
current->add("FlangeEdgeRadius",true,IfcUtil::Argument_DOUBLE,Type::IfcNonNegativeLengthMeasure);
current->add("FlangeSlope",true,IfcUtil::Argument_DOUBLE,Type::IfcPlaneAngleMeasure);
current = entity_descriptor_map[Type::IfcIndexedPolygonalFace] = new IfcEntityDescriptor(Type::IfcIndexedPolygonalFace,entity_descriptor_map.find(Type::IfcTessellatedItem)->second);
current->add("CoordIndex",false,IfcUtil::Argument_AGGREGATE_OF_INT,Type::IfcPositiveInteger);
current = entity_descriptor_map[Type::IfcIndexedPolygonalFaceWithVoids] = new IfcEntityDescriptor(Type::IfcIndexedPolygonalFaceWithVoids,entity_descriptor_map.find(Type::IfcIndexedPolygonalFace)->second);
current->add("InnerCoordIndices",false,IfcUtil::Argument_AGGREGATE_OF_AGGREGATE_OF_INT,Type::IfcPositiveInteger);
current = entity_descriptor_map[Type::IfcLShapeProfileDef] = new IfcEntityDescriptor(Type::IfcLShapeProfileDef,entity_descriptor_map.find(Type::IfcParameterizedProfileDef)->second);
current->add("Depth",false,IfcUtil::Argument_DOUBLE,Type::IfcPositiveLengthMeasure);
current->add("Width",true,IfcUtil::Argument_DOUBLE,Type::IfcPositiveLengthMeasure);
@@ -1767,6 +1774,8 @@ void InitDescriptorMap() {
current->add("LongName",true,IfcUtil::Argument_STRING,Type::IfcLabel);
current = entity_descriptor_map[Type::IfcSphere] = new IfcEntityDescriptor(Type::IfcSphere,entity_descriptor_map.find(Type::IfcCsgPrimitive3D)->second);
current->add("Radius",false,IfcUtil::Argument_DOUBLE,Type::IfcPositiveLengthMeasure);
current = entity_descriptor_map[Type::IfcSphericalSurface] = new IfcEntityDescriptor(Type::IfcSphericalSurface,entity_descriptor_map.find(Type::IfcElementarySurface)->second);
current->add("Radius",false,IfcUtil::Argument_DOUBLE,Type::IfcPositiveLengthMeasure);
current = entity_descriptor_map[Type::IfcStructuralActivity] = new IfcEntityDescriptor(Type::IfcStructuralActivity,entity_descriptor_map.find(Type::IfcProduct)->second);
current->add("AppliedLoad",false,IfcUtil::Argument_ENTITY_INSTANCE,Type::IfcStructuralLoad);
current->add("GlobalOrLocal",false,IfcUtil::Argument_ENUMERATION,Type::IfcGlobalOrLocalEnum);
@@ -1785,6 +1794,10 @@ void InitDescriptorMap() {
current->add("PredefinedType",false,IfcUtil::Argument_ENUMERATION,Type::IfcStructuralSurfaceActivityTypeEnum);
current = entity_descriptor_map[Type::IfcSubContractResourceType] = new IfcEntityDescriptor(Type::IfcSubContractResourceType,entity_descriptor_map.find(Type::IfcConstructionResourceType)->second);
current->add("PredefinedType",false,IfcUtil::Argument_ENUMERATION,Type::IfcSubContractResourceTypeEnum);
current = entity_descriptor_map[Type::IfcSurfaceCurve] = new IfcEntityDescriptor(Type::IfcSurfaceCurve,entity_descriptor_map.find(Type::IfcCurve)->second);
current->add("Curve3D",false,IfcUtil::Argument_ENTITY_INSTANCE,Type::IfcCurve);
current->add("AssociatedGeometry",false,IfcUtil::Argument_AGGREGATE_OF_ENTITY_INSTANCE,Type::IfcPcurve);
current->add("MasterRepresentation",false,IfcUtil::Argument_ENUMERATION,Type::IfcPreferredSurfaceCurveRepresentation);
current = entity_descriptor_map[Type::IfcSurfaceCurveSweptAreaSolid] = new IfcEntityDescriptor(Type::IfcSurfaceCurveSweptAreaSolid,entity_descriptor_map.find(Type::IfcSweptAreaSolid)->second);
current->add("Directrix",false,IfcUtil::Argument_ENTITY_INSTANCE,Type::IfcCurve);
current->add("StartParam",true,IfcUtil::Argument_DOUBLE,Type::IfcParameterValue);
@@ -1809,13 +1822,16 @@ void InitDescriptorMap() {
current->add("WorkMethod",true,IfcUtil::Argument_STRING,Type::IfcLabel);
current = entity_descriptor_map[Type::IfcTessellatedFaceSet] = new IfcEntityDescriptor(Type::IfcTessellatedFaceSet,entity_descriptor_map.find(Type::IfcTessellatedItem)->second);
current->add("Coordinates",false,IfcUtil::Argument_ENTITY_INSTANCE,Type::IfcCartesianPointList3D);
current->add("Normals",true,IfcUtil::Argument_AGGREGATE_OF_AGGREGATE_OF_DOUBLE,Type::IfcParameterValue);
current->add("Closed",true,IfcUtil::Argument_BOOL,Type::IfcBoolean);
current = entity_descriptor_map[Type::IfcToroidalSurface] = new IfcEntityDescriptor(Type::IfcToroidalSurface,entity_descriptor_map.find(Type::IfcElementarySurface)->second);
current->add("MajorRadius",false,IfcUtil::Argument_DOUBLE,Type::IfcPositiveLengthMeasure);
current->add("MinorRadius",false,IfcUtil::Argument_DOUBLE,Type::IfcPositiveLengthMeasure);
current = entity_descriptor_map[Type::IfcTransportElementType] = new IfcEntityDescriptor(Type::IfcTransportElementType,entity_descriptor_map.find(Type::IfcElementType)->second);
current->add("PredefinedType",false,IfcUtil::Argument_ENUMERATION,Type::IfcTransportElementTypeEnum);
current = entity_descriptor_map[Type::IfcTriangulatedFaceSet] = new IfcEntityDescriptor(Type::IfcTriangulatedFaceSet,entity_descriptor_map.find(Type::IfcTessellatedFaceSet)->second);
current->add("Normals",true,IfcUtil::Argument_AGGREGATE_OF_AGGREGATE_OF_DOUBLE,Type::IfcParameterValue);
current->add("Closed",true,IfcUtil::Argument_BOOL,Type::IfcBoolean);
current->add("CoordIndex",false,IfcUtil::Argument_AGGREGATE_OF_AGGREGATE_OF_INT,Type::IfcPositiveInteger);
current->add("NormalIndex",true,IfcUtil::Argument_AGGREGATE_OF_AGGREGATE_OF_INT,Type::IfcPositiveInteger);
current->add("PnIndex",true,IfcUtil::Argument_AGGREGATE_OF_INT,Type::IfcPositiveInteger);
current = entity_descriptor_map[Type::IfcWindowLiningProperties] = new IfcEntityDescriptor(Type::IfcWindowLiningProperties,entity_descriptor_map.find(Type::IfcPreDefinedPropertySet)->second);
current->add("LiningDepth",true,IfcUtil::Argument_DOUBLE,Type::IfcPositiveLengthMeasure);
current->add("LiningThickness",true,IfcUtil::Argument_DOUBLE,Type::IfcNonNegativeLengthMeasure);
@@ -2038,6 +2054,8 @@ void InitDescriptorMap() {
current->add("SelfIntersect",true,IfcUtil::Argument_BOOL,Type::IfcBoolean);
current = entity_descriptor_map[Type::IfcInterceptorType] = new IfcEntityDescriptor(Type::IfcInterceptorType,entity_descriptor_map.find(Type::IfcFlowTreatmentDeviceType)->second);
current->add("PredefinedType",false,IfcUtil::Argument_ENUMERATION,Type::IfcInterceptorTypeEnum);
current = entity_descriptor_map[Type::IfcIntersectionCurve] = new IfcEntityDescriptor(Type::IfcIntersectionCurve,entity_descriptor_map.find(Type::IfcSurfaceCurve)->second);
current = entity_descriptor_map[Type::IfcInventory] = new IfcEntityDescriptor(Type::IfcInventory,entity_descriptor_map.find(Type::IfcGroup)->second);
current->add("PredefinedType",true,IfcUtil::Argument_ENUMERATION,Type::IfcInventoryTypeEnum);
current->add("Jurisdiction",true,IfcUtil::Argument_ENTITY_INSTANCE,Type::IfcActorSelect);
@@ -2096,6 +2114,10 @@ void InitDescriptorMap() {
current->add("PredefinedType",false,IfcUtil::Argument_ENUMERATION,Type::IfcPipeSegmentTypeEnum);
current = entity_descriptor_map[Type::IfcPlateType] = new IfcEntityDescriptor(Type::IfcPlateType,entity_descriptor_map.find(Type::IfcBuildingElementType)->second);
current->add("PredefinedType",false,IfcUtil::Argument_ENUMERATION,Type::IfcPlateTypeEnum);
current = entity_descriptor_map[Type::IfcPolygonalFaceSet] = new IfcEntityDescriptor(Type::IfcPolygonalFaceSet,entity_descriptor_map.find(Type::IfcTessellatedFaceSet)->second);
current->add("Closed",true,IfcUtil::Argument_BOOL,Type::IfcBoolean);
current->add("Faces",false,IfcUtil::Argument_AGGREGATE_OF_ENTITY_INSTANCE,Type::IfcIndexedPolygonalFace);
current->add("PnIndex",true,IfcUtil::Argument_AGGREGATE_OF_INT,Type::IfcPositiveInteger);
current = entity_descriptor_map[Type::IfcPolyline] = new IfcEntityDescriptor(Type::IfcPolyline,entity_descriptor_map.find(Type::IfcBoundedCurve)->second);
current->add("Points",false,IfcUtil::Argument_AGGREGATE_OF_ENTITY_INSTANCE,Type::IfcCartesianPoint);
current = entity_descriptor_map[Type::IfcPort] = new IfcEntityDescriptor(Type::IfcPort,entity_descriptor_map.find(Type::IfcProduct)->second);
@@ -2153,6 +2175,8 @@ void InitDescriptorMap() {
current->add("PredefinedType",false,IfcUtil::Argument_ENUMERATION,Type::IfcRoofTypeEnum);
current = entity_descriptor_map[Type::IfcSanitaryTerminalType] = new IfcEntityDescriptor(Type::IfcSanitaryTerminalType,entity_descriptor_map.find(Type::IfcFlowTerminalType)->second);
current->add("PredefinedType",false,IfcUtil::Argument_ENUMERATION,Type::IfcSanitaryTerminalTypeEnum);
current = entity_descriptor_map[Type::IfcSeamCurve] = new IfcEntityDescriptor(Type::IfcSeamCurve,entity_descriptor_map.find(Type::IfcSurfaceCurve)->second);
current = entity_descriptor_map[Type::IfcShadingDeviceType] = new IfcEntityDescriptor(Type::IfcShadingDeviceType,entity_descriptor_map.find(Type::IfcBuildingElementType)->second);
current->add("PredefinedType",false,IfcUtil::Argument_ENUMERATION,Type::IfcShadingDeviceTypeEnum);
current = entity_descriptor_map[Type::IfcSite] = new IfcEntityDescriptor(Type::IfcSite,entity_descriptor_map.find(Type::IfcSpatialStructureElement)->second);
@@ -2247,7 +2271,7 @@ void InitDescriptorMap() {
current->add("PredefinedType",false,IfcUtil::Argument_ENUMERATION,Type::IfcTendonTypeEnum);
current->add("NominalDiameter",true,IfcUtil::Argument_DOUBLE,Type::IfcPositiveLengthMeasure);
current->add("CrossSectionArea",true,IfcUtil::Argument_DOUBLE,Type::IfcAreaMeasure);
current->add("SheethDiameter",true,IfcUtil::Argument_DOUBLE,Type::IfcPositiveLengthMeasure);
current->add("SheathDiameter",true,IfcUtil::Argument_DOUBLE,Type::IfcPositiveLengthMeasure);
current = entity_descriptor_map[Type::IfcTransformerType] = new IfcEntityDescriptor(Type::IfcTransformerType,entity_descriptor_map.find(Type::IfcEnergyConversionDeviceType)->second);
current->add("PredefinedType",false,IfcUtil::Argument_ENUMERATION,Type::IfcTransformerTypeEnum);
current = entity_descriptor_map[Type::IfcTransportElement] = new IfcEntityDescriptor(Type::IfcTransportElement,entity_descriptor_map.find(Type::IfcElement)->second);
@@ -2906,6 +2930,7 @@ void InitDescriptorMap() {
values.push_back("ELEMENT");
values.push_back("PARTIAL");
values.push_back("PROVISIONFORVOID");
values.push_back("PROVISIONFORSPACE");
values.push_back("USERDEFINED");
values.push_back("NOTDEFINED");
current_enum = enumeration_descriptor_map[Type::IfcBuildingElementProxyTypeEnum] = new IfcEnumerationDescriptor(Type::IfcBuildingElementProxyTypeEnum, values);
@@ -3550,7 +3575,7 @@ void InitDescriptorMap() {
values.push_back("EXTERNAL_WATER");
values.push_back("EXTERNAL_FIRE");
values.push_back("USERDEFINED");
values.push_back("NOTDEFIEND");
values.push_back("NOTDEFINED");
current_enum = enumeration_descriptor_map[Type::IfcExternalSpatialElementTypeEnum] = new IfcEnumerationDescriptor(Type::IfcExternalSpatialElementTypeEnum, values);
values.clear(); values.reserve(128);
values.push_back("CENTRIFUGALFORWARDCURVED");
@@ -3970,6 +3995,11 @@ void InitDescriptorMap() {
values.push_back("NOTDEFINED");
current_enum = enumeration_descriptor_map[Type::IfcPlateTypeEnum] = new IfcEnumerationDescriptor(Type::IfcPlateTypeEnum, values);
values.clear(); values.reserve(128);
values.push_back("CURVE3D");
values.push_back("PCURVE_S1");
values.push_back("PCURVE_S2");
current_enum = enumeration_descriptor_map[Type::IfcPreferredSurfaceCurveRepresentation] = new IfcEnumerationDescriptor(Type::IfcPreferredSurfaceCurveRepresentation, values);
values.clear(); values.reserve(128);
values.push_back("ADVICE_CAUTION");
values.push_back("ADVICE_NOTE");
values.push_back("ADVICE_WARNING");
@@ -4229,6 +4259,7 @@ void InitDescriptorMap() {
values.push_back("TAPERED");
current_enum = enumeration_descriptor_map[Type::IfcSectionTypeEnum] = new IfcEnumerationDescriptor(Type::IfcSectionTypeEnum, values);
values.clear(); values.reserve(128);
values.push_back("COSENSOR");
values.push_back("CO2SENSOR");
values.push_back("CONDUCTANCESENSOR");
values.push_back("CONTACTSENSOR");
@@ -4742,10 +4773,6 @@ void InitDescriptorMap() {
current_enum = enumeration_descriptor_map[Type::IfcWorkScheduleTypeEnum] = new IfcEnumerationDescriptor(Type::IfcWorkScheduleTypeEnum, values);
}
#ifdef _MSC_VER
# pragma optimize( "", on )
#endif
void InitInverseMap() {
inverse_map[Type::IfcActor].insert(std::make_pair("IsActingUpon", std::make_pair(Type::IfcRelAssignsToActor, 6)));
inverse_map[Type::IfcActorRole].insert(std::make_pair("HasExternalReference", std::make_pair(Type::IfcExternalReferenceRelationship, 3)));
@@ -4806,6 +4833,7 @@ void InitInverseMap() {
inverse_map[Type::IfcGridAxis].insert(std::make_pair("PartOfU", std::make_pair(Type::IfcGrid, 7)));
inverse_map[Type::IfcGridAxis].insert(std::make_pair("HasIntersections", std::make_pair(Type::IfcVirtualGridIntersection, 0)));
inverse_map[Type::IfcGroup].insert(std::make_pair("IsGroupedBy", std::make_pair(Type::IfcRelAssignsToGroup, 6)));
inverse_map[Type::IfcIndexedPolygonalFace].insert(std::make_pair("ToFaceSet", std::make_pair(Type::IfcPolygonalFaceSet, 2)));
inverse_map[Type::IfcLibraryInformation].insert(std::make_pair("LibraryInfoForObjects", std::make_pair(Type::IfcRelAssociatesLibrary, 5)));
inverse_map[Type::IfcLibraryInformation].insert(std::make_pair("HasLibraryReferences", std::make_pair(Type::IfcLibraryReference, 5)));
inverse_map[Type::IfcLibraryReference].insert(std::make_pair("LibraryRefForObjects", std::make_pair(Type::IfcRelAssociatesLibrary, 5)));
@@ -4908,6 +4936,13 @@ void InitDerivedMap() {
{std::set<int> idxs; idxs.insert(0); derived_map[Type::IfcSIUnit] = idxs;}
}
#if defined(__clang__)
#elif defined(__GNUC__) || defined(__GNUG__)
#pragma GCC pop_options
#elif defined(_MSC_VER)
#pragma optimize("", on)
#endif
int Type::GetAttributeIndex(Enum t, const std::string& a) {
if (entity_descriptor_map.empty()) ::InitDescriptorMap();
std::map<Type::Enum,IfcEntityDescriptor*>::const_iterator i = entity_descriptor_map.find(t);
+3
View File
@@ -24,6 +24,8 @@
* *
********************************************************************************/
#ifdef USE_IFC4
#ifndef IFC4RT_H
#define IFC4RT_H
@@ -49,3 +51,4 @@ namespace Type {
}}
#endif
#endif
+162 -25
View File
File diff suppressed because one or more lines are too long
+540 -487
View File
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
+9 -8
View File
@@ -284,13 +284,13 @@ public:
else if (attr_->type() == IfcUtil::Argument_UNKNOWN) {
auto aggregation = schema_attr_->type_of_attribute()->as_aggregation_type();
if (aggregation == nullptr) {
throw std::exception("Attribute of unknown type encountered, expected empty aggregate");
throw std::runtime_error("Attribute of unknown type encountered, expected empty aggregate");
}
auto elem_type = aggregation->type_of_element();
if (elem_type->as_named_type()) {
auto entity = elem_type->as_named_type()->declared_type()->as_entity();
if (entity == nullptr) {
throw std::exception("Not implemented");
throw std::runtime_error("Not implemented");
}
std::vector<IfcUtil::IfcBaseClass*> empty;
t(empty);
@@ -300,10 +300,10 @@ public:
std::vector<int> empty;
t(empty);
} else {
throw std::exception("Not implemented");
throw std::runtime_error("Not implemented");
}
} else {
throw std::exception("Not implemented");
throw std::runtime_error("Not implemented");
}
}
}
@@ -336,7 +336,7 @@ public:
std::pair<int, int> operator()(IfcUtil::IfcBaseClass* v) {
if (IfcSchema::Type::IsSimple(v->declaration().type())) {
throw std::exception("Simple type not expected here");
throw std::runtime_error("Simple type not expected here");
}
IfcSchema::Type::Enum t = v->declaration().type();
@@ -1183,7 +1183,7 @@ H5::DataType* type_mapper::operator()(const IfcParse::select_type* pt, const boo
break;
}
default:
throw std::exception("Unexpected attribute types for datatype width reference");
throw std::runtime_error("Unexpected attribute types for datatype width reference");
}
});
std::set_intersection(leafs_schema.begin(), leafs_schema.end(), instantiated.begin(), instantiated.end(), std::inserter(leafs_model, leafs_model.end()));
@@ -1747,7 +1747,7 @@ void IfcParse::IfcHdf5File::write_population(H5::Group& population_group, instan
}
size_t dataset_size = entity_datatype.getSize() * static_cast<size_t>(num_instances);
void* data = allocator.allocate(dataset_size);
uint8_t* data = (uint8_t*) allocator.allocate(dataset_size);
void* ptr = data;
std::cerr << dataset_size << std::endl;
@@ -2033,7 +2033,8 @@ void visit(instance_resolver& resolver, std::ostream& output, void* buffer, H5::
} else if (is_padded != not_padded) {
const size_t offs = ct->getMemberOffset(1);
void* member_ptr = (uint8_t*)buffer + offs;
int N = read<int>(buffer, &ct->getMemberDataType(0));
H5::DataType length_dt = ct->getMemberDataType(0);
int N = read<int>(buffer, &length_dt);
H5::DataType MEMBER(member_type, *ct, 1);
visit(resolver, output, member_ptr, &member_type, name, path, -1, many_trues, N);
+2 -7
View File
@@ -86,12 +86,12 @@ namespace IfcParse {
vector_vector_iterator<T>& operator++() {
if (!b_) {
throw std::exception;
throw std::runtime_error("");
}
++(*b_);
if ((*b_) == a_->end()) {
do {
++a;
++a_;
} while (a_ != container_.end() && a_->size() == 0);
if (a_ != container_.end()) {
b_ = a_->begin();
@@ -244,11 +244,6 @@ namespace IfcParse {
std::pair<size_t, size_t> make_instance_reference(const IfcUtil::IfcBaseClass* instance) const;
// void write_select(void*& ptr, IfcUtil::IfcBaseClass* instance, const H5::CompType* datatype) const;
template <typename T>
const H5::DataType* get_datatype() const {
return default_types.find(IfcUtil::cpp_to_schema_type<T>::schema_type)->second;
}
H5::DataSet create_dataset(H5::Group* population_group, const std::string& path, H5::DataType datatype, int rank, hsize_t* dimensions);
void write_header(H5::Group& group, const IfcSpfHeader& header);
+1 -1
View File
@@ -87,7 +87,7 @@ namespace IfcParse {
const IfcAbstractEntity& data() const { return *data_; }
IfcAbstractEntity& data() { return *data_; }
const IfcParse::declaration& IfcParse::IfcLateBoundEntity::declaration() const;
const IfcParse::declaration& declaration() const;
};
}
+1 -5
View File
@@ -327,11 +327,7 @@ namespace IfcParse {
if (current_inst_name_ != 0) {
try {
inst_data = new Entity(current_inst_name_, file_);
if (file_->create_latebound_entities()) {
entity_instance = new IfcLateBoundEntity(inst_data);
} else {
entity_instance = IfcSchema::SchemaEntity(inst_data);
}
entity_instance = IfcSchema::SchemaEntity(inst_data);
} catch (const IfcException& ex) {
current_inst_name_ = 0;
Logger::Message(Logger::LOG_ERROR, ex.what());