mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-28 15:53:00 +00:00
Fix compilation on msvc
This commit is contained in:
@@ -24,8 +24,6 @@
|
||||
* *
|
||||
********************************************************************************/
|
||||
|
||||
#ifndef USE_IFC4
|
||||
|
||||
#include "../ifcparse/Ifc2x3.h"
|
||||
#include "../ifcparse/IfcSchema.h"
|
||||
#include "../ifcparse/IfcException.h"
|
||||
@@ -13158,4 +13156,3 @@ const IfcParse::entity& Ifc2x3::IfcZone::Class() { return *IFC2X3_IfcZone_type;
|
||||
Ifc2x3::IfcZone::IfcZone(IfcEntityInstanceData* e) : IfcGroup((IfcEntityInstanceData*)0) { if (!e) return; if (e->type() != IFC2X3_IfcZone_type) throw IfcException("Unable to find find keyword in schema"); data_ = e; }
|
||||
Ifc2x3::IfcZone::IfcZone(std::string v1_GlobalId, ::Ifc2x3::IfcOwnerHistory* v2_OwnerHistory, boost::optional< std::string > v3_Name, boost::optional< std::string > v4_Description, boost::optional< std::string > v5_ObjectType) : IfcGroup((IfcEntityInstanceData*)0) {data_ = new IfcEntityInstanceData(IFC2X3_IfcZone_type); {IfcWrite::IfcWriteArgument* attr = new IfcWrite::IfcWriteArgument();attr->set((v1_GlobalId));data_->setArgument(0,attr);}{IfcWrite::IfcWriteArgument* attr = new IfcWrite::IfcWriteArgument();attr->set((v2_OwnerHistory));data_->setArgument(1,attr);} if (v3_Name) {{IfcWrite::IfcWriteArgument* attr = new IfcWrite::IfcWriteArgument();attr->set((*v3_Name));data_->setArgument(2,attr);} } else { IfcWrite::IfcWriteArgument* attr = new IfcWrite::IfcWriteArgument(); attr->set(boost::blank()); data_->setArgument(2, attr); } if (v4_Description) {{IfcWrite::IfcWriteArgument* attr = new IfcWrite::IfcWriteArgument();attr->set((*v4_Description));data_->setArgument(3,attr);} } else { IfcWrite::IfcWriteArgument* attr = new IfcWrite::IfcWriteArgument(); attr->set(boost::blank()); data_->setArgument(3, attr); } if (v5_ObjectType) {{IfcWrite::IfcWriteArgument* attr = new IfcWrite::IfcWriteArgument();attr->set((*v5_ObjectType));data_->setArgument(4,attr);} } else { IfcWrite::IfcWriteArgument* attr = new IfcWrite::IfcWriteArgument(); attr->set(boost::blank()); data_->setArgument(4, attr); } }
|
||||
|
||||
#endif
|
||||
|
||||
@@ -24,8 +24,6 @@
|
||||
* *
|
||||
********************************************************************************/
|
||||
|
||||
#ifdef USE_IFC4
|
||||
|
||||
#include "../ifcparse/Ifc4.h"
|
||||
#include "../ifcparse/IfcSchema.h"
|
||||
#include "../ifcparse/IfcException.h"
|
||||
@@ -5253,8 +5251,8 @@ Ifc4::IfcPressureMeasure::operator double() const { return *data_->getArgument(0
|
||||
const IfcParse::type_declaration& Ifc4::IfcPropertySetDefinitionSet::Class() { return *IFC4_IfcPropertySetDefinitionSet_type; }
|
||||
const IfcParse::type_declaration& Ifc4::IfcPropertySetDefinitionSet::declaration() const { return *IFC4_IfcPropertySetDefinitionSet_type; }
|
||||
Ifc4::IfcPropertySetDefinitionSet::IfcPropertySetDefinitionSet(IfcEntityInstanceData* e) { data_ = e; }
|
||||
Ifc4::IfcPropertySetDefinitionSet::IfcPropertySetDefinitionSet(IfcTemplatedEntityList< IfcPropertySetDefinition >::ptr v) { data_ = new IfcEntityInstanceData(IFC4_IfcPropertySetDefinitionSet_type); {IfcWrite::IfcWriteArgument* attr = new IfcWrite::IfcWriteArgument(); attr->set(v->generalize()); data_->setArgument(0, attr);} }
|
||||
Ifc4::IfcPropertySetDefinitionSet::operator IfcTemplatedEntityList< IfcPropertySetDefinition >::ptr() const { IfcEntityList::ptr es = *data_->getArgument(0); return es->as<::Ifc4::IfcPropertySetDefinition>(); }
|
||||
Ifc4::IfcPropertySetDefinitionSet::IfcPropertySetDefinitionSet(IfcTemplatedEntityList< ::Ifc4::IfcPropertySetDefinition >::ptr v) { data_ = new IfcEntityInstanceData(IFC4_IfcPropertySetDefinitionSet_type); {IfcWrite::IfcWriteArgument* attr = new IfcWrite::IfcWriteArgument(); attr->set(v->generalize()); data_->setArgument(0, attr);} }
|
||||
Ifc4::IfcPropertySetDefinitionSet::operator IfcTemplatedEntityList< ::Ifc4::IfcPropertySetDefinition >::ptr() const { IfcEntityList::ptr es = *data_->getArgument(0); return es->as<::Ifc4::IfcPropertySetDefinition>(); }
|
||||
|
||||
// Function implementations for IfcRadioActivityMeasure
|
||||
const IfcParse::type_declaration& Ifc4::IfcRadioActivityMeasure::Class() { return *IFC4_IfcRadioActivityMeasure_type; }
|
||||
@@ -15616,4 +15614,3 @@ const IfcParse::entity& Ifc4::IfcZone::Class() { return *IFC4_IfcZone_type; }
|
||||
Ifc4::IfcZone::IfcZone(IfcEntityInstanceData* e) : IfcSystem((IfcEntityInstanceData*)0) { if (!e) return; if (e->type() != IFC4_IfcZone_type) throw IfcException("Unable to find find keyword in schema"); data_ = e; }
|
||||
Ifc4::IfcZone::IfcZone(std::string v1_GlobalId, ::Ifc4::IfcOwnerHistory* v2_OwnerHistory, boost::optional< std::string > v3_Name, boost::optional< std::string > v4_Description, boost::optional< std::string > v5_ObjectType, boost::optional< std::string > v6_LongName) : IfcSystem((IfcEntityInstanceData*)0) {data_ = new IfcEntityInstanceData(IFC4_IfcZone_type); {IfcWrite::IfcWriteArgument* attr = new IfcWrite::IfcWriteArgument();attr->set((v1_GlobalId));data_->setArgument(0,attr);}{IfcWrite::IfcWriteArgument* attr = new IfcWrite::IfcWriteArgument();attr->set((v2_OwnerHistory));data_->setArgument(1,attr);} if (v3_Name) {{IfcWrite::IfcWriteArgument* attr = new IfcWrite::IfcWriteArgument();attr->set((*v3_Name));data_->setArgument(2,attr);} } else { IfcWrite::IfcWriteArgument* attr = new IfcWrite::IfcWriteArgument(); attr->set(boost::blank()); data_->setArgument(2, attr); } if (v4_Description) {{IfcWrite::IfcWriteArgument* attr = new IfcWrite::IfcWriteArgument();attr->set((*v4_Description));data_->setArgument(3,attr);} } else { IfcWrite::IfcWriteArgument* attr = new IfcWrite::IfcWriteArgument(); attr->set(boost::blank()); data_->setArgument(3, attr); } if (v5_ObjectType) {{IfcWrite::IfcWriteArgument* attr = new IfcWrite::IfcWriteArgument();attr->set((*v5_ObjectType));data_->setArgument(4,attr);} } else { IfcWrite::IfcWriteArgument* attr = new IfcWrite::IfcWriteArgument(); attr->set(boost::blank()); data_->setArgument(4, attr); } if (v6_LongName) {{IfcWrite::IfcWriteArgument* attr = new IfcWrite::IfcWriteArgument();attr->set((*v6_LongName));data_->setArgument(5,attr);} } else { IfcWrite::IfcWriteArgument* attr = new IfcWrite::IfcWriteArgument(); attr->set(boost::blank()); data_->setArgument(5, attr); } }
|
||||
|
||||
#endif
|
||||
|
||||
+2
-2
@@ -7140,8 +7140,8 @@ public:
|
||||
virtual const IfcParse::type_declaration& declaration() const;
|
||||
static const IfcParse::type_declaration& Class();
|
||||
explicit IfcPropertySetDefinitionSet (IfcEntityInstanceData* e);
|
||||
IfcPropertySetDefinitionSet (IfcTemplatedEntityList< IfcPropertySetDefinition >::ptr v);
|
||||
operator IfcTemplatedEntityList< IfcPropertySetDefinition >::ptr() const;
|
||||
IfcPropertySetDefinitionSet (IfcTemplatedEntityList< ::Ifc4::IfcPropertySetDefinition >::ptr v);
|
||||
operator IfcTemplatedEntityList< ::Ifc4::IfcPropertySetDefinition >::ptr() const;
|
||||
};
|
||||
/// IfcRadioActivityMeasure is a measure of activity of radionuclide.
|
||||
/// Usually measured in Becquerel (Bq, 1/s).
|
||||
|
||||
@@ -133,7 +133,7 @@ public:
|
||||
const std::vector<IfcUtil::IfcBaseClass*>& from = *outer;
|
||||
typename std::vector<U*> to;
|
||||
for (inner_it inner = from.begin(); inner != from.end(); ++inner) {
|
||||
if (all || (*inner)->is(U::Class())) to.push_back((U*)*inner);
|
||||
if (all || (*inner)->declaration().is(U::Class())) to.push_back((U*)*inner);
|
||||
}
|
||||
r->push(to);
|
||||
}
|
||||
|
||||
@@ -16,8 +16,12 @@
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>. *
|
||||
* *
|
||||
********************************************************************************/
|
||||
|
||||
#include "IfcSIPrefix.h"
|
||||
|
||||
#include "../ifcparse/Ifc2x3.h"
|
||||
#include "../ifcparse/Ifc4.h"
|
||||
|
||||
double IfcParse::IfcSIPrefixToValue(const std::string& v) {
|
||||
if ( v == "EXA" ) return 1.e18;
|
||||
else if ( v == "PETA" ) return 1.e15;
|
||||
@@ -41,23 +45,23 @@ double IfcParse::IfcSIPrefixToValue(const std::string& v) {
|
||||
template <typename Schema>
|
||||
double IfcParse::get_SI_equivalent(typename Schema::IfcNamedUnit* named_unit) {
|
||||
double scale = 1.;
|
||||
IfcSchema::IfcSIUnit* si_unit = 0;
|
||||
typename Schema::IfcSIUnit* si_unit = 0;
|
||||
|
||||
if (named_unit->declaration().is(IfcSchema::Type::IfcConversionBasedUnit)) {
|
||||
IfcSchema::IfcConversionBasedUnit* conv_unit = named_unit->as<IfcSchema::IfcConversionBasedUnit>();
|
||||
IfcSchema::IfcMeasureWithUnit* factor = conv_unit->ConversionFactor();
|
||||
IfcSchema::IfcUnit* component = factor->UnitComponent();
|
||||
if (component->declaration().is(IfcSchema::Type::IfcSIUnit)) {
|
||||
si_unit = component->as<IfcSchema::IfcSIUnit>();
|
||||
IfcSchema::IfcValue* v = factor->ValueComponent();
|
||||
if (named_unit->declaration().is(Schema::IfcConversionBasedUnit::Class())) {
|
||||
typename Schema::IfcConversionBasedUnit* conv_unit = named_unit->as<typename Schema::IfcConversionBasedUnit>();
|
||||
typename Schema::IfcMeasureWithUnit* factor = conv_unit->ConversionFactor();
|
||||
typename Schema::IfcUnit* component = factor->UnitComponent();
|
||||
if (component->declaration().is(Schema::IfcSIUnit::Class())) {
|
||||
si_unit = component->as<typename Schema::IfcSIUnit>();
|
||||
typename Schema::IfcValue* v = factor->ValueComponent();
|
||||
scale = *v->data().getArgument(0);
|
||||
}
|
||||
} else if (named_unit->declaration().is(IfcSchema::Type::IfcSIUnit)) {
|
||||
si_unit = named_unit->as<IfcSchema::IfcSIUnit>();
|
||||
} else if (named_unit->declaration().is(Schema::IfcSIUnit::Class())) {
|
||||
si_unit = named_unit->as<typename Schema::IfcSIUnit>();
|
||||
}
|
||||
if (si_unit) {
|
||||
if (si_unit->hasPrefix()) {
|
||||
scale *= IfcSIPrefixToValue(si_unit->Prefix());
|
||||
scale *= IfcSIPrefixToValue(Schema::IfcSIPrefix::ToString(si_unit->Prefix()));
|
||||
}
|
||||
} else {
|
||||
scale = 0.;
|
||||
@@ -65,3 +69,6 @@ double IfcParse::get_SI_equivalent(typename Schema::IfcNamedUnit* named_unit) {
|
||||
|
||||
return scale;
|
||||
}
|
||||
|
||||
template double IfcParse::get_SI_equivalent<Ifc2x3>(typename Ifc2x3::IfcNamedUnit* named_unit);
|
||||
template double IfcParse::get_SI_equivalent<Ifc4>(typename Ifc4::IfcNamedUnit* named_unit);
|
||||
|
||||
@@ -60,7 +60,7 @@ IfcParse::schema_definition::~schema_definition() {
|
||||
}
|
||||
}
|
||||
|
||||
const IfcParse::schema_definition* schema_by_name(const std::string& name) {
|
||||
const IfcParse::schema_definition* IfcParse::schema_by_name(const std::string& name) {
|
||||
std::map<std::string, const IfcParse::schema_definition*>::const_iterator it = schemas.find(name);
|
||||
if (it == schemas.end()) {
|
||||
throw IfcParse::IfcException("No schema named " + name);
|
||||
|
||||
@@ -165,7 +165,7 @@ void IfcUtil::unescape_xml(std::string &str)
|
||||
boost::replace_all(str, ">", ">");
|
||||
}
|
||||
|
||||
Argument* IfcUtil::IfcBaseEntity::getArgumentByName(const std::string& name) const {
|
||||
Argument* IfcUtil::IfcBaseEntity::get(const std::string& name) const {
|
||||
return data().getArgument(declaration().attribute_index(name));
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user