mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-10 17:58:20 +00:00
Resolving merge conflicts
This commit is contained in:
@@ -40,9 +40,11 @@ class SchemaClass(codegen.Base):
|
||||
return "new aggregation_type(aggregation_type::%(aggr_type)s_type, %(bound1)d, %(bound2)d, %(decl_type)s)" % locals()
|
||||
elif isinstance(type, nodes.BinaryType):
|
||||
return "new simple_type(simple_type::binary_type)"
|
||||
elif isinstance(type, nodes.StringType):
|
||||
return "new simple_type(simple_type::string_type)"
|
||||
elif isinstance(type, str):
|
||||
if mapping.schema.is_type(type) or mapping.schema.is_entity(type):
|
||||
if emitted_names is None or type in emitted_types:
|
||||
if emitted_names is None or type.lower() in emitted_types:
|
||||
return "new named_type(%s_type)" % type
|
||||
else:
|
||||
raise UnmetDependenciesException(type)
|
||||
@@ -63,6 +65,9 @@ class SchemaClass(codegen.Base):
|
||||
try: return et, attrs.index(attribute_name)
|
||||
except: pass
|
||||
|
||||
else:
|
||||
raise Exception("No declared type for <%r>" % type)
|
||||
|
||||
self.schema_name = mapping.schema.name.capitalize()
|
||||
|
||||
statements = ['',
|
||||
@@ -79,25 +84,27 @@ class SchemaClass(codegen.Base):
|
||||
for cpp_type, collection in collections_by_type:
|
||||
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("""
|
||||
#ifdef _MSC_VER
|
||||
#pragma optimize("", off)
|
||||
#endif
|
||||
""")
|
||||
statements.append('schema_definition* populate_schema() {')
|
||||
|
||||
emitted_types = set()
|
||||
while len(emitted_types) < len(mapping.schema.simpletypes):
|
||||
for name, type in mapping.schema.simpletypes.items():
|
||||
if name in emitted_types: continue
|
||||
if name.lower() in emitted_types: continue
|
||||
|
||||
try:
|
||||
declared_type = get_declared_type(type, emitted_types)
|
||||
except UnmetDependenciesException:
|
||||
# print("Unmet", repr(name))
|
||||
continue
|
||||
|
||||
statements.append(' %(name)s_type = new type_declaration(IfcSchema::Type::%(name)s, %(declared_type)s);' % locals())
|
||||
emitted_types.add(name)
|
||||
emitted_types.add(name.lower())
|
||||
|
||||
declared_types.append('%(name)s_type' % locals())
|
||||
|
||||
@@ -113,11 +120,11 @@ class SchemaClass(codegen.Base):
|
||||
emitted_entities = set()
|
||||
while len(emitted_entities) < len(mapping.schema.entities):
|
||||
for name, type in mapping.schema.entities.items():
|
||||
if name in emitted_entities: continue
|
||||
if len(type.supertypes) == 0 or set(type.supertypes) < emitted_entities:
|
||||
if name.lower() in emitted_entities: continue
|
||||
if len(type.supertypes) == 0 or set(map(lambda s: s.lower(), type.supertypes)) < emitted_entities:
|
||||
supertype = '0' if len(type.supertypes) == 0 else '%s_type' % type.supertypes[0]
|
||||
statements.append(' %(name)s_type = new entity(IfcSchema::Type::%(name)s, %(supertype)s);' % locals())
|
||||
emitted_entities.add(name)
|
||||
emitted_entities.add(name.lower())
|
||||
|
||||
declared_types.append('%(name)s_type' % locals())
|
||||
|
||||
@@ -126,14 +133,14 @@ class SchemaClass(codegen.Base):
|
||||
emitted_selects = set()
|
||||
while len(emitted_selects) < len(mapping.schema.selects):
|
||||
for name, type in mapping.schema.selects.items():
|
||||
if name in emitted_selects: continue
|
||||
if set(type.values) < emmited:
|
||||
if name.lower() in emitted_selects: continue
|
||||
if set(map(lambda s: s.lower(),type.values)) < emmited:
|
||||
statements.append(' {')
|
||||
statements.append(' std::vector<const declaration*> items; items.reserve(%d);' % len(type.values))
|
||||
statements.extend(map(lambda v: ' items.push_back(%s_type);' % v, sorted(type.values)))
|
||||
statements.append(' %(name)s_type = new select_type(IfcSchema::Type::%(name)s, items);' % locals())
|
||||
statements.append(' }')
|
||||
emitted_selects.add(name)
|
||||
emitted_selects.add(name.lower())
|
||||
emmited.add(name)
|
||||
|
||||
declared_types.append('%(name)s_type' % locals())
|
||||
@@ -181,9 +188,11 @@ class SchemaClass(codegen.Base):
|
||||
|
||||
statements.extend(('}',''))
|
||||
|
||||
statements.append('#ifdef _MSC_VER' )
|
||||
statements.append('#pragma optimize("", on)')
|
||||
statements.append('#endif' )
|
||||
statements.append("""
|
||||
#ifdef _MSC_VER
|
||||
#pragma optimize("", on)
|
||||
#endif
|
||||
""")
|
||||
|
||||
statements.extend(('const schema_definition& get_schema() {',
|
||||
'',
|
||||
|
||||
@@ -423,7 +423,7 @@ entity_implementation = """// Function implementations for %(name)s
|
||||
%(inverse)s
|
||||
const IfcParse::entity& %(name)s::declaration() const { return *%(name)s_type; }
|
||||
Type::Enum %(name)s::Class() { return Type::%(name)s; }
|
||||
%(name)s::%(name)s(IfcEntityInstanceData* e) : %(superclass)s { if (!e) return; if (!e->is(Type::%(name)s)) throw IfcException("Unable to find find keyword in schema"); data_ = e; }
|
||||
%(name)s::%(name)s(IfcEntityInstanceData* e) : %(superclass)s { if (!e) return; if (e->type() != Type::%(name)s) throw IfcException("Unable to find find keyword in schema"); data_ = e; }
|
||||
%(name)s::%(name)s(%(constructor_arguments)s) : %(superclass)s {data_ = new IfcEntityInstanceData(Class()); %(constructor_implementation)s }
|
||||
"""
|
||||
|
||||
@@ -469,7 +469,7 @@ constructor_stmt_enum = "{IfcWrite::IfcWriteArgument* attr = new IfcWrite::I
|
||||
constructor_stmt_array = "{IfcWrite::IfcWriteArgument* attr = new IfcWrite::IfcWriteArgument();attr->set((%(name)s)->generalize()" +");data_->setArgument(%(index)d,attr);}"
|
||||
constructor_stmt_derived = "{IfcWrite::IfcWriteArgument* attr = new IfcWrite::IfcWriteArgument();attr->set(IfcWrite::IfcWriteArgument::Derived()" +");data_->setArgument(%(index)d,attr);}"
|
||||
|
||||
constructor_stmt_optional = " if (%(name)s) {%(stmt)s } else { IfcWrite::IfcWriteArgument* attr = new IfcWrite::IfcWriteArgument(); attr->set(boost::blank()); entity->setArgument(%(index)d, attr); }"
|
||||
constructor_stmt_optional = " if (%(name)s) {%(stmt)s } else { IfcWrite::IfcWriteArgument* attr = new IfcWrite::IfcWriteArgument(); attr->set(boost::blank()); data_->setArgument(%(index)d, attr); }"
|
||||
|
||||
inverse_implementation = " inverse_map[Type::%(type)s].insert(std::make_pair(\"%(name)s\", std::make_pair(Type::%(related_type)s, %(index)d)));"
|
||||
|
||||
|
||||
@@ -1009,6 +1009,11 @@ enumeration_type* IfcWindowPanelPositionEnum_type = 0;
|
||||
enumeration_type* IfcWindowStyleConstructionEnum_type = 0;
|
||||
enumeration_type* IfcWindowStyleOperationEnum_type = 0;
|
||||
enumeration_type* IfcWorkControlTypeEnum_type = 0;
|
||||
|
||||
#ifdef _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));
|
||||
@@ -1023,7 +1028,7 @@ schema_definition* populate_schema() {
|
||||
IfcCurvatureMeasure_type = new type_declaration(IfcSchema::Type::IfcCurvatureMeasure, new simple_type(simple_type::real_type));
|
||||
IfcDayInMonthNumber_type = new type_declaration(IfcSchema::Type::IfcDayInMonthNumber, new simple_type(simple_type::integer_type));
|
||||
IfcDaylightSavingHour_type = new type_declaration(IfcSchema::Type::IfcDaylightSavingHour, new simple_type(simple_type::integer_type));
|
||||
IfcDescriptiveMeasure_type = new type_declaration(IfcSchema::Type::IfcDescriptiveMeasure, None);
|
||||
IfcDescriptiveMeasure_type = new type_declaration(IfcSchema::Type::IfcDescriptiveMeasure, new simple_type(simple_type::string_type));
|
||||
IfcDimensionCount_type = new type_declaration(IfcSchema::Type::IfcDimensionCount, new simple_type(simple_type::integer_type));
|
||||
IfcDoseEquivalentMeasure_type = new type_declaration(IfcSchema::Type::IfcDoseEquivalentMeasure, new simple_type(simple_type::real_type));
|
||||
IfcDynamicViscosityMeasure_type = new type_declaration(IfcSchema::Type::IfcDynamicViscosityMeasure, new simple_type(simple_type::real_type));
|
||||
@@ -1034,16 +1039,16 @@ schema_definition* populate_schema() {
|
||||
IfcElectricResistanceMeasure_type = new type_declaration(IfcSchema::Type::IfcElectricResistanceMeasure, new simple_type(simple_type::real_type));
|
||||
IfcElectricVoltageMeasure_type = new type_declaration(IfcSchema::Type::IfcElectricVoltageMeasure, new simple_type(simple_type::real_type));
|
||||
IfcEnergyMeasure_type = new type_declaration(IfcSchema::Type::IfcEnergyMeasure, new simple_type(simple_type::real_type));
|
||||
IfcFontStyle_type = new type_declaration(IfcSchema::Type::IfcFontStyle, None);
|
||||
IfcFontVariant_type = new type_declaration(IfcSchema::Type::IfcFontVariant, None);
|
||||
IfcFontWeight_type = new type_declaration(IfcSchema::Type::IfcFontWeight, None);
|
||||
IfcFontStyle_type = new type_declaration(IfcSchema::Type::IfcFontStyle, new simple_type(simple_type::string_type));
|
||||
IfcFontVariant_type = new type_declaration(IfcSchema::Type::IfcFontVariant, new simple_type(simple_type::string_type));
|
||||
IfcFontWeight_type = new type_declaration(IfcSchema::Type::IfcFontWeight, new simple_type(simple_type::string_type));
|
||||
IfcForceMeasure_type = new type_declaration(IfcSchema::Type::IfcForceMeasure, new simple_type(simple_type::real_type));
|
||||
IfcFrequencyMeasure_type = new type_declaration(IfcSchema::Type::IfcFrequencyMeasure, new simple_type(simple_type::real_type));
|
||||
IfcGloballyUniqueId_type = new type_declaration(IfcSchema::Type::IfcGloballyUniqueId, None);
|
||||
IfcGloballyUniqueId_type = new type_declaration(IfcSchema::Type::IfcGloballyUniqueId, new simple_type(simple_type::string_type));
|
||||
IfcHeatFluxDensityMeasure_type = new type_declaration(IfcSchema::Type::IfcHeatFluxDensityMeasure, new simple_type(simple_type::real_type));
|
||||
IfcHeatingValueMeasure_type = new type_declaration(IfcSchema::Type::IfcHeatingValueMeasure, new simple_type(simple_type::real_type));
|
||||
IfcHourInDay_type = new type_declaration(IfcSchema::Type::IfcHourInDay, new simple_type(simple_type::integer_type));
|
||||
IfcIdentifier_type = new type_declaration(IfcSchema::Type::IfcIdentifier, None);
|
||||
IfcIdentifier_type = new type_declaration(IfcSchema::Type::IfcIdentifier, new simple_type(simple_type::string_type));
|
||||
IfcIlluminanceMeasure_type = new type_declaration(IfcSchema::Type::IfcIlluminanceMeasure, new simple_type(simple_type::real_type));
|
||||
IfcInductanceMeasure_type = new type_declaration(IfcSchema::Type::IfcInductanceMeasure, new simple_type(simple_type::real_type));
|
||||
IfcInteger_type = new type_declaration(IfcSchema::Type::IfcInteger, new simple_type(simple_type::integer_type));
|
||||
@@ -1051,7 +1056,7 @@ schema_definition* populate_schema() {
|
||||
IfcIonConcentrationMeasure_type = new type_declaration(IfcSchema::Type::IfcIonConcentrationMeasure, new simple_type(simple_type::real_type));
|
||||
IfcIsothermalMoistureCapacityMeasure_type = new type_declaration(IfcSchema::Type::IfcIsothermalMoistureCapacityMeasure, new simple_type(simple_type::real_type));
|
||||
IfcKinematicViscosityMeasure_type = new type_declaration(IfcSchema::Type::IfcKinematicViscosityMeasure, new simple_type(simple_type::real_type));
|
||||
IfcLabel_type = new type_declaration(IfcSchema::Type::IfcLabel, None);
|
||||
IfcLabel_type = new type_declaration(IfcSchema::Type::IfcLabel, new simple_type(simple_type::string_type));
|
||||
IfcLengthMeasure_type = new type_declaration(IfcSchema::Type::IfcLengthMeasure, new simple_type(simple_type::real_type));
|
||||
IfcLinearForceMeasure_type = new type_declaration(IfcSchema::Type::IfcLinearForceMeasure, new simple_type(simple_type::real_type));
|
||||
IfcLinearMomentMeasure_type = new type_declaration(IfcSchema::Type::IfcLinearMomentMeasure, new simple_type(simple_type::real_type));
|
||||
@@ -1085,7 +1090,7 @@ schema_definition* populate_schema() {
|
||||
IfcPositiveLengthMeasure_type = new type_declaration(IfcSchema::Type::IfcPositiveLengthMeasure, new named_type(IfcLengthMeasure_type));
|
||||
IfcPositivePlaneAngleMeasure_type = new type_declaration(IfcSchema::Type::IfcPositivePlaneAngleMeasure, new named_type(IfcPlaneAngleMeasure_type));
|
||||
IfcPowerMeasure_type = new type_declaration(IfcSchema::Type::IfcPowerMeasure, new simple_type(simple_type::real_type));
|
||||
IfcPresentableText_type = new type_declaration(IfcSchema::Type::IfcPresentableText, None);
|
||||
IfcPresentableText_type = new type_declaration(IfcSchema::Type::IfcPresentableText, new simple_type(simple_type::string_type));
|
||||
IfcPressureMeasure_type = new type_declaration(IfcSchema::Type::IfcPressureMeasure, new simple_type(simple_type::real_type));
|
||||
IfcRadioActivityMeasure_type = new type_declaration(IfcSchema::Type::IfcRadioActivityMeasure, new simple_type(simple_type::real_type));
|
||||
IfcRatioMeasure_type = new type_declaration(IfcSchema::Type::IfcRatioMeasure, new simple_type(simple_type::real_type));
|
||||
@@ -1104,11 +1109,11 @@ schema_definition* populate_schema() {
|
||||
IfcSpecularExponent_type = new type_declaration(IfcSchema::Type::IfcSpecularExponent, new simple_type(simple_type::real_type));
|
||||
IfcSpecularRoughness_type = new type_declaration(IfcSchema::Type::IfcSpecularRoughness, new simple_type(simple_type::real_type));
|
||||
IfcTemperatureGradientMeasure_type = new type_declaration(IfcSchema::Type::IfcTemperatureGradientMeasure, new simple_type(simple_type::real_type));
|
||||
IfcText_type = new type_declaration(IfcSchema::Type::IfcText, None);
|
||||
IfcTextAlignment_type = new type_declaration(IfcSchema::Type::IfcTextAlignment, None);
|
||||
IfcTextDecoration_type = new type_declaration(IfcSchema::Type::IfcTextDecoration, None);
|
||||
IfcTextFontName_type = new type_declaration(IfcSchema::Type::IfcTextFontName, None);
|
||||
IfcTextTransformation_type = new type_declaration(IfcSchema::Type::IfcTextTransformation, None);
|
||||
IfcText_type = new type_declaration(IfcSchema::Type::IfcText, new simple_type(simple_type::string_type));
|
||||
IfcTextAlignment_type = new type_declaration(IfcSchema::Type::IfcTextAlignment, new simple_type(simple_type::string_type));
|
||||
IfcTextDecoration_type = new type_declaration(IfcSchema::Type::IfcTextDecoration, new simple_type(simple_type::string_type));
|
||||
IfcTextFontName_type = new type_declaration(IfcSchema::Type::IfcTextFontName, new simple_type(simple_type::string_type));
|
||||
IfcTextTransformation_type = new type_declaration(IfcSchema::Type::IfcTextTransformation, new simple_type(simple_type::string_type));
|
||||
IfcThermalAdmittanceMeasure_type = new type_declaration(IfcSchema::Type::IfcThermalAdmittanceMeasure, new simple_type(simple_type::real_type));
|
||||
IfcThermalConductivityMeasure_type = new type_declaration(IfcSchema::Type::IfcThermalConductivityMeasure, new simple_type(simple_type::real_type));
|
||||
IfcThermalExpansionCoefficientMeasure_type = new type_declaration(IfcSchema::Type::IfcThermalExpansionCoefficientMeasure, new simple_type(simple_type::real_type));
|
||||
@@ -8867,7 +8872,7 @@ schema_definition* populate_schema() {
|
||||
}
|
||||
{
|
||||
std::vector<const entity::attribute*> attributes; attributes.reserve(2);
|
||||
attributes.push_back(new entity::attribute("Name", None, false));
|
||||
attributes.push_back(new entity::attribute("Name", new simple_type(simple_type::string_type), false));
|
||||
attributes.push_back(new entity::attribute("Rows", new aggregation_type(aggregation_type::list_type, 1, -1, new named_type(IfcTableRow_type)), false));
|
||||
std::vector<bool> derived; derived.reserve(2);
|
||||
derived.push_back(false); derived.push_back(false);
|
||||
@@ -10374,6 +10379,11 @@ schema_definition* populate_schema() {
|
||||
return new schema_definition("IFC2X3", declarations, true);
|
||||
}
|
||||
|
||||
|
||||
#ifdef _MSC_VER
|
||||
#pragma optimize("", on)
|
||||
#endif
|
||||
|
||||
const schema_definition& get_schema() {
|
||||
|
||||
static const schema_definition* s = populate_schema();
|
||||
|
||||
+1134
-1134
File diff suppressed because one or more lines are too long
@@ -1194,6 +1194,11 @@ enumeration_type* IfcWindowTypePartitioningEnum_type = 0;
|
||||
enumeration_type* IfcWorkCalendarTypeEnum_type = 0;
|
||||
enumeration_type* IfcWorkPlanTypeEnum_type = 0;
|
||||
enumeration_type* IfcWorkScheduleTypeEnum_type = 0;
|
||||
|
||||
#ifdef _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));
|
||||
@@ -1210,14 +1215,14 @@ schema_definition* populate_schema() {
|
||||
IfcContextDependentMeasure_type = new type_declaration(IfcSchema::Type::IfcContextDependentMeasure, new simple_type(simple_type::real_type));
|
||||
IfcCountMeasure_type = new type_declaration(IfcSchema::Type::IfcCountMeasure, new simple_type(simple_type::number_type));
|
||||
IfcCurvatureMeasure_type = new type_declaration(IfcSchema::Type::IfcCurvatureMeasure, new simple_type(simple_type::real_type));
|
||||
IfcDate_type = new type_declaration(IfcSchema::Type::IfcDate, None);
|
||||
IfcDateTime_type = new type_declaration(IfcSchema::Type::IfcDateTime, None);
|
||||
IfcDate_type = new type_declaration(IfcSchema::Type::IfcDate, new simple_type(simple_type::string_type));
|
||||
IfcDateTime_type = new type_declaration(IfcSchema::Type::IfcDateTime, new simple_type(simple_type::string_type));
|
||||
IfcDayInMonthNumber_type = new type_declaration(IfcSchema::Type::IfcDayInMonthNumber, new simple_type(simple_type::integer_type));
|
||||
IfcDayInWeekNumber_type = new type_declaration(IfcSchema::Type::IfcDayInWeekNumber, new simple_type(simple_type::integer_type));
|
||||
IfcDescriptiveMeasure_type = new type_declaration(IfcSchema::Type::IfcDescriptiveMeasure, None);
|
||||
IfcDescriptiveMeasure_type = new type_declaration(IfcSchema::Type::IfcDescriptiveMeasure, new simple_type(simple_type::string_type));
|
||||
IfcDimensionCount_type = new type_declaration(IfcSchema::Type::IfcDimensionCount, new simple_type(simple_type::integer_type));
|
||||
IfcDoseEquivalentMeasure_type = new type_declaration(IfcSchema::Type::IfcDoseEquivalentMeasure, new simple_type(simple_type::real_type));
|
||||
IfcDuration_type = new type_declaration(IfcSchema::Type::IfcDuration, None);
|
||||
IfcDuration_type = new type_declaration(IfcSchema::Type::IfcDuration, new simple_type(simple_type::string_type));
|
||||
IfcDynamicViscosityMeasure_type = new type_declaration(IfcSchema::Type::IfcDynamicViscosityMeasure, new simple_type(simple_type::real_type));
|
||||
IfcElectricCapacitanceMeasure_type = new type_declaration(IfcSchema::Type::IfcElectricCapacitanceMeasure, new simple_type(simple_type::real_type));
|
||||
IfcElectricChargeMeasure_type = new type_declaration(IfcSchema::Type::IfcElectricChargeMeasure, new simple_type(simple_type::real_type));
|
||||
@@ -1226,15 +1231,15 @@ schema_definition* populate_schema() {
|
||||
IfcElectricResistanceMeasure_type = new type_declaration(IfcSchema::Type::IfcElectricResistanceMeasure, new simple_type(simple_type::real_type));
|
||||
IfcElectricVoltageMeasure_type = new type_declaration(IfcSchema::Type::IfcElectricVoltageMeasure, new simple_type(simple_type::real_type));
|
||||
IfcEnergyMeasure_type = new type_declaration(IfcSchema::Type::IfcEnergyMeasure, new simple_type(simple_type::real_type));
|
||||
IfcFontStyle_type = new type_declaration(IfcSchema::Type::IfcFontStyle, None);
|
||||
IfcFontVariant_type = new type_declaration(IfcSchema::Type::IfcFontVariant, None);
|
||||
IfcFontWeight_type = new type_declaration(IfcSchema::Type::IfcFontWeight, None);
|
||||
IfcFontStyle_type = new type_declaration(IfcSchema::Type::IfcFontStyle, new simple_type(simple_type::string_type));
|
||||
IfcFontVariant_type = new type_declaration(IfcSchema::Type::IfcFontVariant, new simple_type(simple_type::string_type));
|
||||
IfcFontWeight_type = new type_declaration(IfcSchema::Type::IfcFontWeight, new simple_type(simple_type::string_type));
|
||||
IfcForceMeasure_type = new type_declaration(IfcSchema::Type::IfcForceMeasure, new simple_type(simple_type::real_type));
|
||||
IfcFrequencyMeasure_type = new type_declaration(IfcSchema::Type::IfcFrequencyMeasure, new simple_type(simple_type::real_type));
|
||||
IfcGloballyUniqueId_type = new type_declaration(IfcSchema::Type::IfcGloballyUniqueId, None);
|
||||
IfcGloballyUniqueId_type = new type_declaration(IfcSchema::Type::IfcGloballyUniqueId, new simple_type(simple_type::string_type));
|
||||
IfcHeatFluxDensityMeasure_type = new type_declaration(IfcSchema::Type::IfcHeatFluxDensityMeasure, new simple_type(simple_type::real_type));
|
||||
IfcHeatingValueMeasure_type = new type_declaration(IfcSchema::Type::IfcHeatingValueMeasure, new simple_type(simple_type::real_type));
|
||||
IfcIdentifier_type = new type_declaration(IfcSchema::Type::IfcIdentifier, None);
|
||||
IfcIdentifier_type = new type_declaration(IfcSchema::Type::IfcIdentifier, new simple_type(simple_type::string_type));
|
||||
IfcIlluminanceMeasure_type = new type_declaration(IfcSchema::Type::IfcIlluminanceMeasure, new simple_type(simple_type::real_type));
|
||||
IfcInductanceMeasure_type = new type_declaration(IfcSchema::Type::IfcInductanceMeasure, new simple_type(simple_type::real_type));
|
||||
IfcInteger_type = new type_declaration(IfcSchema::Type::IfcInteger, new simple_type(simple_type::integer_type));
|
||||
@@ -1242,7 +1247,7 @@ schema_definition* populate_schema() {
|
||||
IfcIonConcentrationMeasure_type = new type_declaration(IfcSchema::Type::IfcIonConcentrationMeasure, new simple_type(simple_type::real_type));
|
||||
IfcIsothermalMoistureCapacityMeasure_type = new type_declaration(IfcSchema::Type::IfcIsothermalMoistureCapacityMeasure, new simple_type(simple_type::real_type));
|
||||
IfcKinematicViscosityMeasure_type = new type_declaration(IfcSchema::Type::IfcKinematicViscosityMeasure, new simple_type(simple_type::real_type));
|
||||
IfcLabel_type = new type_declaration(IfcSchema::Type::IfcLabel, None);
|
||||
IfcLabel_type = new type_declaration(IfcSchema::Type::IfcLabel, new simple_type(simple_type::string_type));
|
||||
IfcLanguageId_type = new type_declaration(IfcSchema::Type::IfcLanguageId, new named_type(IfcIdentifier_type));
|
||||
IfcLengthMeasure_type = new type_declaration(IfcSchema::Type::IfcLengthMeasure, new simple_type(simple_type::real_type));
|
||||
IfcLineIndex_type = new type_declaration(IfcSchema::Type::IfcLineIndex, new aggregation_type(aggregation_type::list_type, 2, -1, new named_type(IfcPositiveInteger_type)));
|
||||
@@ -1279,7 +1284,7 @@ schema_definition* populate_schema() {
|
||||
IfcPositiveLengthMeasure_type = new type_declaration(IfcSchema::Type::IfcPositiveLengthMeasure, new named_type(IfcLengthMeasure_type));
|
||||
IfcPositivePlaneAngleMeasure_type = new type_declaration(IfcSchema::Type::IfcPositivePlaneAngleMeasure, new named_type(IfcPlaneAngleMeasure_type));
|
||||
IfcPowerMeasure_type = new type_declaration(IfcSchema::Type::IfcPowerMeasure, new simple_type(simple_type::real_type));
|
||||
IfcPresentableText_type = new type_declaration(IfcSchema::Type::IfcPresentableText, None);
|
||||
IfcPresentableText_type = new type_declaration(IfcSchema::Type::IfcPresentableText, new simple_type(simple_type::string_type));
|
||||
IfcPressureMeasure_type = new type_declaration(IfcSchema::Type::IfcPressureMeasure, new simple_type(simple_type::real_type));
|
||||
IfcPropertySetDefinitionSet_type = new type_declaration(IfcSchema::Type::IfcPropertySetDefinitionSet, new aggregation_type(aggregation_type::set_type, 1, -1, new named_type(IfcPropertySetDefinition_type)));
|
||||
IfcRadioActivityMeasure_type = new type_declaration(IfcSchema::Type::IfcRadioActivityMeasure, new simple_type(simple_type::real_type));
|
||||
@@ -1302,22 +1307,22 @@ schema_definition* populate_schema() {
|
||||
IfcStrippedOptional_type = new type_declaration(IfcSchema::Type::IfcStrippedOptional, new simple_type(simple_type::boolean_type));
|
||||
IfcTemperatureGradientMeasure_type = new type_declaration(IfcSchema::Type::IfcTemperatureGradientMeasure, new simple_type(simple_type::real_type));
|
||||
IfcTemperatureRateOfChangeMeasure_type = new type_declaration(IfcSchema::Type::IfcTemperatureRateOfChangeMeasure, new simple_type(simple_type::real_type));
|
||||
IfcText_type = new type_declaration(IfcSchema::Type::IfcText, None);
|
||||
IfcTextAlignment_type = new type_declaration(IfcSchema::Type::IfcTextAlignment, None);
|
||||
IfcTextDecoration_type = new type_declaration(IfcSchema::Type::IfcTextDecoration, None);
|
||||
IfcTextFontName_type = new type_declaration(IfcSchema::Type::IfcTextFontName, None);
|
||||
IfcTextTransformation_type = new type_declaration(IfcSchema::Type::IfcTextTransformation, None);
|
||||
IfcText_type = new type_declaration(IfcSchema::Type::IfcText, new simple_type(simple_type::string_type));
|
||||
IfcTextAlignment_type = new type_declaration(IfcSchema::Type::IfcTextAlignment, new simple_type(simple_type::string_type));
|
||||
IfcTextDecoration_type = new type_declaration(IfcSchema::Type::IfcTextDecoration, new simple_type(simple_type::string_type));
|
||||
IfcTextFontName_type = new type_declaration(IfcSchema::Type::IfcTextFontName, new simple_type(simple_type::string_type));
|
||||
IfcTextTransformation_type = new type_declaration(IfcSchema::Type::IfcTextTransformation, new simple_type(simple_type::string_type));
|
||||
IfcThermalAdmittanceMeasure_type = new type_declaration(IfcSchema::Type::IfcThermalAdmittanceMeasure, new simple_type(simple_type::real_type));
|
||||
IfcThermalConductivityMeasure_type = new type_declaration(IfcSchema::Type::IfcThermalConductivityMeasure, new simple_type(simple_type::real_type));
|
||||
IfcThermalExpansionCoefficientMeasure_type = new type_declaration(IfcSchema::Type::IfcThermalExpansionCoefficientMeasure, new simple_type(simple_type::real_type));
|
||||
IfcThermalResistanceMeasure_type = new type_declaration(IfcSchema::Type::IfcThermalResistanceMeasure, new simple_type(simple_type::real_type));
|
||||
IfcThermalTransmittanceMeasure_type = new type_declaration(IfcSchema::Type::IfcThermalTransmittanceMeasure, new simple_type(simple_type::real_type));
|
||||
IfcThermodynamicTemperatureMeasure_type = new type_declaration(IfcSchema::Type::IfcThermodynamicTemperatureMeasure, new simple_type(simple_type::real_type));
|
||||
IfcTime_type = new type_declaration(IfcSchema::Type::IfcTime, None);
|
||||
IfcTime_type = new type_declaration(IfcSchema::Type::IfcTime, new simple_type(simple_type::string_type));
|
||||
IfcTimeMeasure_type = new type_declaration(IfcSchema::Type::IfcTimeMeasure, new simple_type(simple_type::real_type));
|
||||
IfcTimeStamp_type = new type_declaration(IfcSchema::Type::IfcTimeStamp, new simple_type(simple_type::integer_type));
|
||||
IfcTorqueMeasure_type = new type_declaration(IfcSchema::Type::IfcTorqueMeasure, new simple_type(simple_type::real_type));
|
||||
IfcURIReference_type = new type_declaration(IfcSchema::Type::IfcURIReference, None);
|
||||
IfcURIReference_type = new type_declaration(IfcSchema::Type::IfcURIReference, new simple_type(simple_type::string_type));
|
||||
IfcVaporPermeabilityMeasure_type = new type_declaration(IfcSchema::Type::IfcVaporPermeabilityMeasure, new simple_type(simple_type::real_type));
|
||||
IfcVolumeMeasure_type = new type_declaration(IfcSchema::Type::IfcVolumeMeasure, new simple_type(simple_type::real_type));
|
||||
IfcVolumetricFlowRateMeasure_type = new type_declaration(IfcSchema::Type::IfcVolumetricFlowRateMeasure, new simple_type(simple_type::real_type));
|
||||
@@ -12310,6 +12315,11 @@ schema_definition* populate_schema() {
|
||||
return new schema_definition("IFC4", declarations, true);
|
||||
}
|
||||
|
||||
|
||||
#ifdef _MSC_VER
|
||||
#pragma optimize("", on)
|
||||
#endif
|
||||
|
||||
const schema_definition& get_schema() {
|
||||
|
||||
static const schema_definition* s = populate_schema();
|
||||
|
||||
+1377
-1377
File diff suppressed because one or more lines are too long
@@ -29,29 +29,24 @@
|
||||
#endif
|
||||
|
||||
#include "../ifcparse/IfcEntityInstanceData.h"
|
||||
#include "../ifcparse/IfcSchema.h"
|
||||
|
||||
class Argument;
|
||||
|
||||
namespace IfcParse { // these have to be declared first in order for the virtual function below to be covariant. separate into different header file
|
||||
class declaration;
|
||||
class entity;
|
||||
class type_declaration;
|
||||
}
|
||||
|
||||
namespace IfcUtil {
|
||||
|
||||
class IFC_PARSE_API IfcBaseClass {
|
||||
protected:
|
||||
IfcAbstractEntity* data_;
|
||||
IfcEntityInstanceData* data_;
|
||||
|
||||
public:
|
||||
IfcBaseClass() : data_(0) {}
|
||||
IfcBaseClass(IfcAbstractEntity* d) : data_(d) {}
|
||||
IfcBaseClass(IfcEntityInstanceData* d) : data_(d) {}
|
||||
virtual ~IfcBaseClass() {}
|
||||
|
||||
const IfcAbstractEntity& data() const { return *data_; }
|
||||
IfcAbstractEntity& data() { return *data_; }
|
||||
void data(IfcAbstractEntity* d);
|
||||
const IfcEntityInstanceData& data() const { return *data_; }
|
||||
IfcEntityInstanceData& data() { return *data_; }
|
||||
void data(IfcEntityInstanceData* d);
|
||||
|
||||
virtual const IfcParse::declaration& declaration() const = 0;
|
||||
|
||||
@@ -73,16 +68,16 @@ namespace IfcUtil {
|
||||
class IFC_PARSE_API IfcBaseEntity : public IfcBaseClass {
|
||||
public:
|
||||
IfcBaseEntity() : IfcBaseClass() {}
|
||||
IfcBaseEntity(IfcAbstractEntity* d) : IfcBaseClass(d) {}
|
||||
IfcBaseEntity(IfcEntityInstanceData* d) : IfcBaseClass(d) {}
|
||||
|
||||
virtual const IfcParse::entity& declaration() const = 0;
|
||||
};
|
||||
|
||||
// TODO: Investigate whether these should be template classes instead
|
||||
class IFC_PARSE_API IfcBaseType : public IfcBaseEntity {
|
||||
class IFC_PARSE_API IfcBaseType : public IfcBaseClass {
|
||||
public:
|
||||
IfcBaseType() : IfcBaseClass() {}
|
||||
IfcBaseType(IfcAbstractEntity* d) : IfcBaseClass(d) {}
|
||||
IfcBaseType(IfcEntityInstanceData* d) : IfcBaseClass(d) {}
|
||||
|
||||
virtual const IfcParse::type_declaration& declaration() const = 0;
|
||||
};
|
||||
|
||||
@@ -45,7 +45,7 @@ public:
|
||||
typename U::list::ptr as() {
|
||||
typename U::list::ptr r(new typename U::list);
|
||||
const bool all = U::Class() == IfcSchema::Type::UNDEFINED;
|
||||
for (it i = begin(); i != end(); ++i) if (all || (*i)->is(U::Class())) r->push((U*)*i);
|
||||
for (it i = begin(); i != end(); ++i) if (all || (*i)->declaration().is(U::Class())) r->push((U*)*i);
|
||||
return r;
|
||||
}
|
||||
void remove(IfcUtil::IfcBaseClass*);
|
||||
|
||||
@@ -64,7 +64,6 @@ public:
|
||||
private:
|
||||
typedef std::map<IfcUtil::IfcBaseClass*, IfcUtil::IfcBaseClass*> entity_entity_map_t;
|
||||
|
||||
bool parsing_complete_;
|
||||
const schema_definition* schema_;
|
||||
|
||||
entity_by_id_t byid;
|
||||
@@ -171,6 +170,7 @@ public:
|
||||
void register_inverse(unsigned, Token);
|
||||
void register_inverse(unsigned, IfcUtil::IfcBaseClass*);
|
||||
void unregister_inverse(unsigned, IfcUtil::IfcBaseClass*);
|
||||
|
||||
const schema_definition* schema() const { return schema_; }
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user