mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-14 03:14:23 +00:00
- Handle explicit attributes re-declared as derived in a subtype
- Update IfcOpenHouse to import correctly in Autodesk Autocad Architecture 2013
This commit is contained in:
@@ -7539,7 +7539,7 @@ bool IfcGeometricRepresentationSubContext::is(Type::Enum v) const { return v ==
|
||||
Type::Enum IfcGeometricRepresentationSubContext::type() const { return Type::IfcGeometricRepresentationSubContext; }
|
||||
Type::Enum IfcGeometricRepresentationSubContext::Class() { return Type::IfcGeometricRepresentationSubContext; }
|
||||
IfcGeometricRepresentationSubContext::IfcGeometricRepresentationSubContext(IfcAbstractEntityPtr e) { if (!is(Type::IfcGeometricRepresentationSubContext)) throw IfcException("Unable to find find keyword in schema"); entity = e; }
|
||||
IfcGeometricRepresentationSubContext::IfcGeometricRepresentationSubContext(optional< IfcLabel > v1_ContextIdentifier, optional< IfcLabel > v2_ContextType, IfcDimensionCount v3_CoordinateSpaceDimension, optional< double > v4_Precision, IfcAxis2Placement v5_WorldCoordinateSystem, IfcDirection* v6_TrueNorth, IfcGeometricRepresentationContext* v7_ParentContext, optional< IfcPositiveRatioMeasure > v8_TargetScale, IfcGeometricProjectionEnum::IfcGeometricProjectionEnum v9_TargetView, optional< IfcLabel > v10_UserDefinedTargetView) { IfcWritableEntity* e = new IfcWritableEntity(Class()); if (v1_ContextIdentifier) { e->setArgument(0,(*v1_ContextIdentifier)); } else { e->setArgument(0); } ; if (v2_ContextType) { e->setArgument(1,(*v2_ContextType)); } else { e->setArgument(1); } ; e->setArgument(2,(v3_CoordinateSpaceDimension)); if (v4_Precision) { e->setArgument(3,(*v4_Precision)); } else { e->setArgument(3); } ; e->setArgument(4,(v5_WorldCoordinateSystem)); e->setArgument(5,(v6_TrueNorth)); e->setArgument(6,(v7_ParentContext)); if (v8_TargetScale) { e->setArgument(7,(*v8_TargetScale)); } else { e->setArgument(7); } ; e->setArgument(8,v9_TargetView,IfcGeometricProjectionEnum::ToString(v9_TargetView)); if (v10_UserDefinedTargetView) { e->setArgument(9,(*v10_UserDefinedTargetView)); } else { e->setArgument(9); } ; entity = e; EntityBuffer::Add(this); }
|
||||
IfcGeometricRepresentationSubContext::IfcGeometricRepresentationSubContext(optional< IfcLabel > v1_ContextIdentifier, optional< IfcLabel > v2_ContextType, IfcGeometricRepresentationContext* v7_ParentContext, optional< IfcPositiveRatioMeasure > v8_TargetScale, IfcGeometricProjectionEnum::IfcGeometricProjectionEnum v9_TargetView, optional< IfcLabel > v10_UserDefinedTargetView) { IfcWritableEntity* e = new IfcWritableEntity(Class()); if (v1_ContextIdentifier) { e->setArgument(0,(*v1_ContextIdentifier)); } else { e->setArgument(0); } ; if (v2_ContextType) { e->setArgument(1,(*v2_ContextType)); } else { e->setArgument(1); } ; e->setArgumentDerived(2); e->setArgumentDerived(2); e->setArgumentDerived(2); e->setArgumentDerived(2); e->setArgument(6,(v7_ParentContext)); if (v8_TargetScale) { e->setArgument(7,(*v8_TargetScale)); } else { e->setArgument(7); } ; e->setArgument(8,v9_TargetView,IfcGeometricProjectionEnum::ToString(v9_TargetView)); if (v10_UserDefinedTargetView) { e->setArgument(9,(*v10_UserDefinedTargetView)); } else { e->setArgument(9); } ; entity = e; EntityBuffer::Add(this); }
|
||||
// Function implementations for IfcGeometricSet
|
||||
SHARED_PTR< IfcTemplatedEntityList< IfcAbstractSelect > > IfcGeometricSet::Elements() { RETURN_AS_LIST(IfcAbstractSelect,0) }
|
||||
void IfcGeometricSet::setElements(SHARED_PTR< IfcTemplatedEntityList< IfcAbstractSelect > > v) { if ( ! entity->isWritable() ) { entity = new IfcWritableEntity(entity); } ((IfcWritableEntity*)entity)->setArgument(0,v->generalize()); }
|
||||
@@ -8405,7 +8405,7 @@ bool IfcOrientedEdge::is(Type::Enum v) const { return v == Type::IfcOrientedEdge
|
||||
Type::Enum IfcOrientedEdge::type() const { return Type::IfcOrientedEdge; }
|
||||
Type::Enum IfcOrientedEdge::Class() { return Type::IfcOrientedEdge; }
|
||||
IfcOrientedEdge::IfcOrientedEdge(IfcAbstractEntityPtr e) { if (!is(Type::IfcOrientedEdge)) throw IfcException("Unable to find find keyword in schema"); entity = e; }
|
||||
IfcOrientedEdge::IfcOrientedEdge(IfcVertex* v1_EdgeStart, IfcVertex* v2_EdgeEnd, IfcEdge* v3_EdgeElement, bool v4_Orientation) { IfcWritableEntity* e = new IfcWritableEntity(Class()); e->setArgument(0,(v1_EdgeStart)); e->setArgument(1,(v2_EdgeEnd)); e->setArgument(2,(v3_EdgeElement)); e->setArgument(3,(v4_Orientation)); entity = e; EntityBuffer::Add(this); }
|
||||
IfcOrientedEdge::IfcOrientedEdge(IfcEdge* v3_EdgeElement, bool v4_Orientation) { IfcWritableEntity* e = new IfcWritableEntity(Class()); e->setArgumentDerived(0); e->setArgumentDerived(0); e->setArgument(2,(v3_EdgeElement)); e->setArgument(3,(v4_Orientation)); entity = e; EntityBuffer::Add(this); }
|
||||
// Function implementations for IfcOutletType
|
||||
IfcOutletTypeEnum::IfcOutletTypeEnum IfcOutletType::PredefinedType() { return IfcOutletTypeEnum::FromString(*entity->getArgument(9)); }
|
||||
void IfcOutletType::setPredefinedType(IfcOutletTypeEnum::IfcOutletTypeEnum v) { if ( ! entity->isWritable() ) { entity = new IfcWritableEntity(entity); } ((IfcWritableEntity*)entity)->setArgument(9,v,IfcOutletTypeEnum::ToString(v)); }
|
||||
@@ -10110,7 +10110,7 @@ bool IfcSIUnit::is(Type::Enum v) const { return v == Type::IfcSIUnit || IfcNamed
|
||||
Type::Enum IfcSIUnit::type() const { return Type::IfcSIUnit; }
|
||||
Type::Enum IfcSIUnit::Class() { return Type::IfcSIUnit; }
|
||||
IfcSIUnit::IfcSIUnit(IfcAbstractEntityPtr e) { if (!is(Type::IfcSIUnit)) throw IfcException("Unable to find find keyword in schema"); entity = e; }
|
||||
IfcSIUnit::IfcSIUnit(IfcDimensionalExponents* v1_Dimensions, IfcUnitEnum::IfcUnitEnum v2_UnitType, optional< IfcSIPrefix::IfcSIPrefix > v3_Prefix, IfcSIUnitName::IfcSIUnitName v4_Name) { IfcWritableEntity* e = new IfcWritableEntity(Class()); e->setArgument(0,(v1_Dimensions)); e->setArgument(1,v2_UnitType,IfcUnitEnum::ToString(v2_UnitType)); if (v3_Prefix) { e->setArgument(2,*v3_Prefix,IfcSIPrefix::ToString(*v3_Prefix)); } else { e->setArgument(2); } ; e->setArgument(3,v4_Name,IfcSIUnitName::ToString(v4_Name)); entity = e; EntityBuffer::Add(this); }
|
||||
IfcSIUnit::IfcSIUnit(IfcUnitEnum::IfcUnitEnum v2_UnitType, optional< IfcSIPrefix::IfcSIPrefix > v3_Prefix, IfcSIUnitName::IfcSIUnitName v4_Name) { IfcWritableEntity* e = new IfcWritableEntity(Class()); e->setArgumentDerived(0); e->setArgument(1,v2_UnitType,IfcUnitEnum::ToString(v2_UnitType)); if (v3_Prefix) { e->setArgument(2,*v3_Prefix,IfcSIPrefix::ToString(*v3_Prefix)); } else { e->setArgument(2); } ; e->setArgument(3,v4_Name,IfcSIUnitName::ToString(v4_Name)); entity = e; EntityBuffer::Add(this); }
|
||||
// Function implementations for IfcSanitaryTerminalType
|
||||
IfcSanitaryTerminalTypeEnum::IfcSanitaryTerminalTypeEnum IfcSanitaryTerminalType::PredefinedType() { return IfcSanitaryTerminalTypeEnum::FromString(*entity->getArgument(9)); }
|
||||
void IfcSanitaryTerminalType::setPredefinedType(IfcSanitaryTerminalTypeEnum::IfcSanitaryTerminalTypeEnum v) { if ( ! entity->isWritable() ) { entity = new IfcWritableEntity(entity); } ((IfcWritableEntity*)entity)->setArgument(9,v,IfcSanitaryTerminalTypeEnum::ToString(v)); }
|
||||
|
||||
@@ -9733,7 +9733,7 @@ public:
|
||||
Type::Enum type() const;
|
||||
static Type::Enum Class();
|
||||
IfcSIUnit (IfcAbstractEntityPtr e = IfcAbstractEntityPtr());
|
||||
IfcSIUnit (IfcDimensionalExponents* v1_Dimensions, IfcUnitEnum::IfcUnitEnum v2_UnitType, optional< IfcSIPrefix::IfcSIPrefix > v3_Prefix, IfcSIUnitName::IfcSIUnitName v4_Name);
|
||||
IfcSIUnit (IfcUnitEnum::IfcUnitEnum v2_UnitType, optional< IfcSIPrefix::IfcSIPrefix > v3_Prefix, IfcSIUnitName::IfcSIUnitName v4_Name);
|
||||
typedef IfcSIUnit* ptr;
|
||||
typedef SHARED_PTR< IfcTemplatedEntityList< IfcSIUnit > > list;
|
||||
typedef IfcTemplatedEntityList< IfcSIUnit >::it it;
|
||||
@@ -13205,7 +13205,7 @@ public:
|
||||
Type::Enum type() const;
|
||||
static Type::Enum Class();
|
||||
IfcGeometricRepresentationSubContext (IfcAbstractEntityPtr e = IfcAbstractEntityPtr());
|
||||
IfcGeometricRepresentationSubContext (optional< IfcLabel > v1_ContextIdentifier, optional< IfcLabel > v2_ContextType, IfcDimensionCount v3_CoordinateSpaceDimension, optional< double > v4_Precision, IfcAxis2Placement v5_WorldCoordinateSystem, IfcDirection* v6_TrueNorth, IfcGeometricRepresentationContext* v7_ParentContext, optional< IfcPositiveRatioMeasure > v8_TargetScale, IfcGeometricProjectionEnum::IfcGeometricProjectionEnum v9_TargetView, optional< IfcLabel > v10_UserDefinedTargetView);
|
||||
IfcGeometricRepresentationSubContext (optional< IfcLabel > v1_ContextIdentifier, optional< IfcLabel > v2_ContextType, IfcGeometricRepresentationContext* v7_ParentContext, optional< IfcPositiveRatioMeasure > v8_TargetScale, IfcGeometricProjectionEnum::IfcGeometricProjectionEnum v9_TargetView, optional< IfcLabel > v10_UserDefinedTargetView);
|
||||
typedef IfcGeometricRepresentationSubContext* ptr;
|
||||
typedef SHARED_PTR< IfcTemplatedEntityList< IfcGeometricRepresentationSubContext > > list;
|
||||
typedef IfcTemplatedEntityList< IfcGeometricRepresentationSubContext >::it it;
|
||||
@@ -14111,7 +14111,7 @@ public:
|
||||
Type::Enum type() const;
|
||||
static Type::Enum Class();
|
||||
IfcOrientedEdge (IfcAbstractEntityPtr e = IfcAbstractEntityPtr());
|
||||
IfcOrientedEdge (IfcVertex* v1_EdgeStart, IfcVertex* v2_EdgeEnd, IfcEdge* v3_EdgeElement, bool v4_Orientation);
|
||||
IfcOrientedEdge (IfcEdge* v3_EdgeElement, bool v4_Orientation);
|
||||
typedef IfcOrientedEdge* ptr;
|
||||
typedef SHARED_PTR< IfcTemplatedEntityList< IfcOrientedEdge > > list;
|
||||
typedef IfcTemplatedEntityList< IfcOrientedEdge >::it it;
|
||||
|
||||
@@ -98,9 +98,9 @@ Ifc2x3::IfcProject* IfcHierarchyHelper::addProject(Ifc2x3::IfcOwnerHistory* owne
|
||||
|
||||
IfcEntities units (new IfcEntityList());
|
||||
Ifc2x3::IfcDimensionalExponents* dimexp = new Ifc2x3::IfcDimensionalExponents(0, 0, 0, 0, 0, 0, 0);
|
||||
Ifc2x3::IfcSIUnit* unit1 = new Ifc2x3::IfcSIUnit(dimexp, Ifc2x3::IfcUnitEnum::IfcUnit_LENGTHUNIT,
|
||||
Ifc2x3::IfcSIUnit* unit1 = new Ifc2x3::IfcSIUnit(Ifc2x3::IfcUnitEnum::IfcUnit_LENGTHUNIT,
|
||||
Ifc2x3::IfcSIPrefix::IfcSIPrefix_MILLI, Ifc2x3::IfcSIUnitName::IfcSIUnitName_METRE);
|
||||
Ifc2x3::IfcSIUnit* unit2a = new Ifc2x3::IfcSIUnit(dimexp, Ifc2x3::IfcUnitEnum::IfcUnit_PLANEANGLEUNIT,
|
||||
Ifc2x3::IfcSIUnit* unit2a = new Ifc2x3::IfcSIUnit(Ifc2x3::IfcUnitEnum::IfcUnit_PLANEANGLEUNIT,
|
||||
boost::none, Ifc2x3::IfcSIUnitName::IfcSIUnitName_RADIAN);
|
||||
Ifc2x3::IfcMeasureWithUnit* unit2b = new Ifc2x3::IfcMeasureWithUnit(
|
||||
new IfcWrite::IfcSelectHelper(0.017453293, Ifc2x3::Type::IfcPlaneAngleMeasure), unit2a);
|
||||
|
||||
@@ -59,6 +59,7 @@ namespace IfcWrite {
|
||||
unsigned int id();
|
||||
bool isWritable();
|
||||
void setArgument(int i);
|
||||
void setArgumentDerived(int i);
|
||||
void setArgument(int i,bool v);
|
||||
void setArgument(int i,int v);
|
||||
void setArgument(int i,int v, const char* c);
|
||||
|
||||
@@ -105,6 +105,11 @@ void IfcWritableEntity::setArgument(int i) {
|
||||
args[i] = new IfcWriteNullArgument(this);
|
||||
arg_writable(i,true);
|
||||
}
|
||||
void IfcWritableEntity::setArgumentDerived(int i) {
|
||||
if ( arg_writable(i) ) delete args[i];
|
||||
args[i] = new IfcWriteDerivedArgument(this);
|
||||
arg_writable(i,true);
|
||||
}
|
||||
void IfcWritableEntity::setArgument(int i,int v) {
|
||||
if ( arg_writable(i) ) delete args[i];
|
||||
args[i] = new IfcWriteIntegralArgument(this,v);
|
||||
@@ -172,6 +177,20 @@ ArgumentPtr IfcWriteNullArgument::operator [] (unsigned int i) const { throw Ifc
|
||||
std::string IfcWriteNullArgument::toString(bool upper) const { return "$"; }
|
||||
unsigned int IfcWriteNullArgument::Size() const { throw IfcParse::IfcException("Invalid cast"); }
|
||||
|
||||
IfcWriteDerivedArgument::operator int() const { throw IfcParse::IfcException("Invalid cast"); }
|
||||
IfcWriteDerivedArgument::operator bool() const { throw IfcParse::IfcException("Invalid cast"); }
|
||||
IfcWriteDerivedArgument::operator double() const { throw IfcParse::IfcException("Invalid cast"); }
|
||||
IfcWriteDerivedArgument::operator std::string() const { throw IfcParse::IfcException("Invalid cast"); }
|
||||
IfcWriteDerivedArgument::operator std::vector<double>() const { throw IfcParse::IfcException("Invalid cast"); }
|
||||
IfcWriteDerivedArgument::operator std::vector<int>() const { throw IfcParse::IfcException("Invalid cast"); }
|
||||
IfcWriteDerivedArgument::operator std::vector<std::string>() const { throw IfcParse::IfcException("Invalid cast"); }
|
||||
IfcWriteDerivedArgument::operator IfcUtil::IfcSchemaEntity() const { throw IfcParse::IfcException("Invalid cast"); }
|
||||
IfcWriteDerivedArgument::operator IfcEntities() const { throw IfcParse::IfcException("Invalid cast"); }
|
||||
bool IfcWriteDerivedArgument::isNull() const { throw IfcParse::IfcException("Invalid cast"); }
|
||||
ArgumentPtr IfcWriteDerivedArgument::operator [] (unsigned int i) const { throw IfcParse::IfcException("Invalid cast"); }
|
||||
std::string IfcWriteDerivedArgument::toString(bool upper) const { return "*"; }
|
||||
unsigned int IfcWriteDerivedArgument::Size() const { throw IfcParse::IfcException("Invalid cast"); }
|
||||
|
||||
IfcWriteEntityListArgument::IfcWriteEntityListArgument(IfcAbstractEntity* e, const IfcEntities& v) : IfcWriteArgument(e) { value = v; }
|
||||
IfcWriteEntityListArgument::operator int() const { throw IfcParse::IfcException("Invalid cast"); }
|
||||
IfcWriteEntityListArgument::operator bool() const { throw IfcParse::IfcException("Invalid cast"); }
|
||||
|
||||
@@ -58,6 +58,25 @@ namespace IfcWrite {
|
||||
std::string toString(bool upper=false) const;
|
||||
unsigned int Size() const;
|
||||
};
|
||||
|
||||
/// A derived argument. It will always serialize to *
|
||||
class IfcWriteDerivedArgument : public IfcWriteArgument {
|
||||
public:
|
||||
IfcWriteDerivedArgument(IfcAbstractEntity* e) : IfcWriteArgument(e) {};
|
||||
operator int() const;
|
||||
operator bool() const;
|
||||
operator double() const;
|
||||
operator std::string() const;
|
||||
operator std::vector<double>() const;
|
||||
operator std::vector<int>() const;
|
||||
operator std::vector<std::string>() const;
|
||||
operator IfcUtil::IfcSchemaEntity() const;
|
||||
operator IfcEntities() const;
|
||||
bool isNull() const;
|
||||
ArgumentPtr operator [] (unsigned int i) const;
|
||||
std::string toString(bool upper=false) const;
|
||||
unsigned int Size() const;
|
||||
};
|
||||
|
||||
/// An entity list argument. It will serialize to (#1,#2,#3)
|
||||
/// with possibly a datatype identifier for SELECT types, e.g:
|
||||
|
||||
Reference in New Issue
Block a user