mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-26 02:07:36 +00:00
Sprinkle with template and typename keywords
This commit is contained in:
@@ -40,7 +40,7 @@ struct %(schema_name)s {
|
|||||||
|
|
||||||
static const IfcParse::schema_definition& get_schema();
|
static const IfcParse::schema_definition& get_schema();
|
||||||
|
|
||||||
static const char* const Identifier = "%(schema_name_upper)s";
|
static const char* const Identifier;
|
||||||
|
|
||||||
// Forward definitions
|
// Forward definitions
|
||||||
%(forward_definitions)s
|
%(forward_definitions)s
|
||||||
@@ -75,6 +75,8 @@ implementation= """
|
|||||||
|
|
||||||
#include <map>
|
#include <map>
|
||||||
|
|
||||||
|
const char* const %(schema_name)s::Identifier = "%(schema_name_upper)s";
|
||||||
|
|
||||||
using namespace IfcParse;
|
using namespace IfcParse;
|
||||||
using namespace IfcWrite;
|
using namespace IfcWrite;
|
||||||
|
|
||||||
|
|||||||
@@ -31,6 +31,8 @@
|
|||||||
|
|
||||||
#include <map>
|
#include <map>
|
||||||
|
|
||||||
|
const char* const Ifc2x3::Identifier = "IFC2X3";
|
||||||
|
|
||||||
using namespace IfcParse;
|
using namespace IfcParse;
|
||||||
using namespace IfcWrite;
|
using namespace IfcWrite;
|
||||||
|
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
@@ -31,6 +31,8 @@
|
|||||||
|
|
||||||
#include <map>
|
#include <map>
|
||||||
|
|
||||||
|
const char* const Ifc4::Identifier = "IFC4";
|
||||||
|
|
||||||
using namespace IfcParse;
|
using namespace IfcParse;
|
||||||
using namespace IfcWrite;
|
using namespace IfcWrite;
|
||||||
|
|
||||||
|
|||||||
+1
-1
File diff suppressed because one or more lines are too long
@@ -187,12 +187,12 @@ class IFC_PARSE_API IfcFileWithSchema : public IfcFile {
|
|||||||
public:
|
public:
|
||||||
std::pair<typename Schema::IfcNamedUnit*, double> getUnit(typename Schema::IfcUnitEnum::Value unit_type) {
|
std::pair<typename Schema::IfcNamedUnit*, double> getUnit(typename Schema::IfcUnitEnum::Value unit_type) {
|
||||||
std::pair<IfcUtil::IfcBaseClass*, double> unit_info = IfcFile::getUnit(Schema::IfcUnitEnum::ToString(unit_type));
|
std::pair<IfcUtil::IfcBaseClass*, double> unit_info = IfcFile::getUnit(Schema::IfcUnitEnum::ToString(unit_type));
|
||||||
return std::make_pair(unit_info.first->as<typename Schema::IfcNamedUnit>(), unit_info.second);
|
return std::make_pair(unit_info.first->template as<typename Schema::IfcNamedUnit>(), unit_info.second);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Returns the entity with the specified GlobalId
|
/// Returns the entity with the specified GlobalId
|
||||||
virtual typename Schema::IfcRoot::list::ptr instance_by_guid(const std::string& guid) {
|
virtual typename Schema::IfcRoot* instance_by_guid(const std::string& guid) {
|
||||||
return IfcFile::instance_by_guid(guid)->as<typename Schema::IfcRoot>();
|
return IfcFile::instance_by_guid(guid)->template as<typename Schema::IfcRoot>();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -48,16 +48,16 @@ double IfcParse::get_SI_equivalent(typename Schema::IfcNamedUnit* named_unit) {
|
|||||||
typename Schema::IfcSIUnit* si_unit = 0;
|
typename Schema::IfcSIUnit* si_unit = 0;
|
||||||
|
|
||||||
if (named_unit->declaration().is(Schema::IfcConversionBasedUnit::Class())) {
|
if (named_unit->declaration().is(Schema::IfcConversionBasedUnit::Class())) {
|
||||||
typename Schema::IfcConversionBasedUnit* conv_unit = named_unit->as<typename Schema::IfcConversionBasedUnit>();
|
typename Schema::IfcConversionBasedUnit* conv_unit = named_unit->template as<typename Schema::IfcConversionBasedUnit>();
|
||||||
typename Schema::IfcMeasureWithUnit* factor = conv_unit->ConversionFactor();
|
typename Schema::IfcMeasureWithUnit* factor = conv_unit->ConversionFactor();
|
||||||
typename Schema::IfcUnit* component = factor->UnitComponent();
|
typename Schema::IfcUnit* component = factor->UnitComponent();
|
||||||
if (component->declaration().is(Schema::IfcSIUnit::Class())) {
|
if (component->declaration().is(Schema::IfcSIUnit::Class())) {
|
||||||
si_unit = component->as<typename Schema::IfcSIUnit>();
|
si_unit = component->template as<typename Schema::IfcSIUnit>();
|
||||||
typename Schema::IfcValue* v = factor->ValueComponent();
|
typename Schema::IfcValue* v = factor->ValueComponent();
|
||||||
scale = *v->data().getArgument(0);
|
scale = *v->data().getArgument(0);
|
||||||
}
|
}
|
||||||
} else if (named_unit->declaration().is(Schema::IfcSIUnit::Class())) {
|
} else if (named_unit->declaration().is(Schema::IfcSIUnit::Class())) {
|
||||||
si_unit = named_unit->as<typename Schema::IfcSIUnit>();
|
si_unit = named_unit->template as<typename Schema::IfcSIUnit>();
|
||||||
}
|
}
|
||||||
if (si_unit) {
|
if (si_unit) {
|
||||||
if (si_unit->hasPrefix()) {
|
if (si_unit->hasPrefix()) {
|
||||||
|
|||||||
@@ -135,6 +135,8 @@ namespace IfcParse {
|
|||||||
, schema_(0)
|
, schema_(0)
|
||||||
{}
|
{}
|
||||||
|
|
||||||
|
virtual ~declaration() {}
|
||||||
|
|
||||||
const std::string& name() const { return name_; }
|
const std::string& name() const { return name_; }
|
||||||
const std::string& name_lc() const { return name_lower_; }
|
const std::string& name_lc() const { return name_lower_; }
|
||||||
|
|
||||||
@@ -232,7 +234,7 @@ namespace IfcParse {
|
|||||||
{}
|
{}
|
||||||
|
|
||||||
const std::string& name() const { return name_; }
|
const std::string& name() const { return name_; }
|
||||||
aggregate_type type_of_aggregation() const { type_of_aggregation_; }
|
aggregate_type type_of_aggregation() const { return type_of_aggregation_; }
|
||||||
int bound1() const { return bound1_; }
|
int bound1() const { return bound1_; }
|
||||||
int bound2() const { return bound2_; }
|
int bound2() const { return bound2_; }
|
||||||
const entity* entity_reference() const { return entity_reference_; }
|
const entity* entity_reference() const { return entity_reference_; }
|
||||||
@@ -358,7 +360,7 @@ namespace IfcParse {
|
|||||||
index = std::distance(current->attributes().begin(), it);
|
index = std::distance(current->attributes().begin(), it);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} while ((current = current->supertype_));
|
} while ((current = current->supertype_) != 0);
|
||||||
return index;
|
return index;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -376,7 +378,7 @@ namespace IfcParse {
|
|||||||
index = std::distance(current->attributes().begin(), it);
|
index = std::distance(current->attributes().begin(), it);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} while ((current = current->supertype_));
|
} while ((current = current->supertype_) != 0);
|
||||||
return index;
|
return index;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user