(*
Copyright by:
buildingSMART International Limited, 1996-2019

Any technical documentation made available by buildingSMART International Limited
is the copyrighted work of buildingSMART International Limited and is owned by the 
buildingSMART International Limited. It may be photocopied, used in software development, 
or translated into another computer language without prior written consent from 
buildingSMART International Limited provided that full attribution is given. 
Prior written consent is required if changes are made to the technical specification.

This material is delivered to you as is and buildingSMART International Limited makes 
no warranty of any kind with regard to it, including, but not limited to, the implied 
warranties as to its accuracy or fitness for a particular purpose. Any use of the 
technical documentation or the information contained therein is at the risk of the user. 
Documentation may include technical or other inaccuracies or typographical errors. 
buildingSMART International Limited shall not be liable for errors contained therein or 
for incidental consequential damages in connection with the furnishing, performance or use 
of the material. The information contained in this document is subject to change without notice.

Issue date:
Friday, July 26, 2019

*)

SCHEMA IFCPROFILERESOURCE;

REFERENCE FROM IFCMEASURERESOURCE
(
  IfcLengthMeasure,
  IfcLabel,
  IfcPositiveLengthMeasure,
  IfcPlaneAngleMeasure,
  IfcNonNegativeLengthMeasure,
  IfcAreaMeasure,
  IfcCountMeasure
);

REFERENCE FROM IFCGEOMETRYRESOURCE
(
  IfcAxis2Placement2D,
  IfcCurve,
  IfcCartesianTransformationOperator2D,
  IfcBoundedCurve
);

REFERENCE FROM IFCEXTERNALREFERENCERESOURCE
(
  IfcExternalReferenceRelationship
);

REFERENCE FROM IFCPROPERTYRESOURCE
(
  IfcPreDefinedProperties,
  IfcExtendedProperties
);

TYPE IfcProfileTypeEnum = ENUMERATION OF
	(CURVE
	,AREA);
END_TYPE;

TYPE IfcReinforcingBarRoleEnum = ENUMERATION OF
	(MAIN
	,SHEAR
	,LIGATURE
	,STUD
	,PUNCHING
	,EDGE
	,RING
	,ANCHORING
	,USERDEFINED
	,NOTDEFINED);
END_TYPE;

TYPE IfcReinforcingBarSurfaceEnum = ENUMERATION OF
	(PLAIN
	,TEXTURED);
END_TYPE;

TYPE IfcSectionTypeEnum = ENUMERATION OF
	(UNIFORM
	,TAPERED);
END_TYPE;

ENTITY IfcArbitraryClosedProfileDef
 SUPERTYPE OF (ONEOF
    (IfcArbitraryProfileDefWithVoids))
 SUBTYPE OF (IfcProfileDef);
	OuterCurve : IfcCurve;
 WHERE
	WR1 : OuterCurve.Dim = 2;
	WR2 : NOT('IFCGEOMETRYRESOURCE.IFCLINE' IN TYPEOF(OuterCurve));
	WR3 : NOT('IFCGEOMETRYRESOURCE.IFCOFFSETCURVE2D' IN TYPEOF(OuterCurve));
END_ENTITY;

ENTITY IfcArbitraryOpenProfileDef
 SUPERTYPE OF (ONEOF
    (IfcCenterLineProfileDef))
 SUBTYPE OF (IfcProfileDef);
	Curve : IfcBoundedCurve;
 WHERE
	WR11 : ('IFCPROFILERESOURCE.IFCCENTERLINEPROFILEDEF' IN TYPEOF(SELF)) OR 
 (SELF\IfcProfileDef.ProfileType = IfcProfileTypeEnum.CURVE);
	WR12 : Curve.Dim = 2;
END_ENTITY;

ENTITY IfcArbitraryProfileDefWithVoids
 SUBTYPE OF (IfcArbitraryClosedProfileDef);
	InnerCurves : SET [1:?] OF IfcCurve;
 WHERE
	WR1 : SELF\IfcProfileDef.ProfileType = AREA;
	WR2 : SIZEOF(QUERY(temp <* InnerCurves | temp.Dim <> 2)) = 0;
	WR3 : SIZEOF(QUERY(temp <* InnerCurves | 'IFCGEOMETRYRESOURCE.IFCLINE' IN TYPEOF(temp))) = 0;
END_ENTITY;

ENTITY IfcAsymmetricIShapeProfileDef
 SUBTYPE OF (IfcParameterizedProfileDef);
	BottomFlangeWidth : IfcPositiveLengthMeasure;
	OverallDepth : IfcPositiveLengthMeasure;
	WebThickness : IfcPositiveLengthMeasure;
	BottomFlangeThickness : IfcPositiveLengthMeasure;
	BottomFlangeFilletRadius : OPTIONAL IfcNonNegativeLengthMeasure;
	TopFlangeWidth : IfcPositiveLengthMeasure;
	TopFlangeThickness : OPTIONAL IfcPositiveLengthMeasure;
	TopFlangeFilletRadius : OPTIONAL IfcNonNegativeLengthMeasure;
	BottomFlangeEdgeRadius : OPTIONAL IfcNonNegativeLengthMeasure;
	BottomFlangeSlope : OPTIONAL IfcPlaneAngleMeasure;
	TopFlangeEdgeRadius : OPTIONAL IfcNonNegativeLengthMeasure;
	TopFlangeSlope : OPTIONAL IfcPlaneAngleMeasure;
 WHERE
	ValidFlangeThickness : NOT(EXISTS(TopFlangeThickness)) OR ((BottomFlangeThickness + TopFlangeThickness) < OverallDepth);
	ValidWebThickness : (WebThickness < BottomFlangeWidth) AND (WebThickness < TopFlangeWidth);
	ValidBottomFilletRadius : (NOT(EXISTS(BottomFlangeFilletRadius))) OR 
(BottomFlangeFilletRadius <= (BottomFlangeWidth - WebThickness)/2.);
	ValidTopFilletRadius : (NOT(EXISTS(TopFlangeFilletRadius))) OR 
(TopFlangeFilletRadius <= (TopFlangeWidth - WebThickness)/2.);
END_ENTITY;

ENTITY IfcCShapeProfileDef
 SUBTYPE OF (IfcParameterizedProfileDef);
	Depth : IfcPositiveLengthMeasure;
	Width : IfcPositiveLengthMeasure;
	WallThickness : IfcPositiveLengthMeasure;
	Girth : IfcPositiveLengthMeasure;
	InternalFilletRadius : OPTIONAL IfcNonNegativeLengthMeasure;
 WHERE
	ValidGirth : Girth < (Depth / 2.);
	ValidInternalFilletRadius : NOT(EXISTS(InternalFilletRadius)) OR
((InternalFilletRadius <= Width/2. - WallThickness) AND (InternalFilletRadius <= Depth/2. - WallThickness));
	ValidWallThickness : (WallThickness < Width/2.) AND (WallThickness < Depth/2.);
END_ENTITY;

ENTITY IfcCenterLineProfileDef
 SUBTYPE OF (IfcArbitraryOpenProfileDef);
	Thickness : IfcPositiveLengthMeasure;
END_ENTITY;

ENTITY IfcCircleHollowProfileDef
 SUBTYPE OF (IfcCircleProfileDef);
	WallThickness : IfcPositiveLengthMeasure;
 WHERE
	WR1 : WallThickness < SELF\IfcCircleProfileDef.Radius;
END_ENTITY;

ENTITY IfcCircleProfileDef
 SUPERTYPE OF (ONEOF
    (IfcCircleHollowProfileDef))
 SUBTYPE OF (IfcParameterizedProfileDef);
	Radius : IfcPositiveLengthMeasure;
END_ENTITY;

ENTITY IfcCompositeProfileDef
 SUBTYPE OF (IfcProfileDef);
	Profiles : SET [2:?] OF IfcProfileDef;
	Label : OPTIONAL IfcLabel;
 WHERE
	InvariantProfileType : SIZEOF(QUERY(temp <* Profiles | temp.ProfileType <> Profiles[1].ProfileType)) = 0;
	NoRecursion : SIZEOF(QUERY(temp <* Profiles | 'IFCPROFILERESOURCE.IFCCOMPOSITEPROFILEDEF' IN TYPEOF(temp))) = 0;
END_ENTITY;

ENTITY IfcDerivedProfileDef
 SUPERTYPE OF (ONEOF
    (IfcMirroredProfileDef))
 SUBTYPE OF (IfcProfileDef);
	ParentProfile : IfcProfileDef;
	Operator : IfcCartesianTransformationOperator2D;
	Label : OPTIONAL IfcLabel;
 WHERE
	InvariantProfileType : SELF\IfcProfileDef.ProfileType = ParentProfile.ProfileType;
END_ENTITY;

ENTITY IfcEllipseProfileDef
 SUBTYPE OF (IfcParameterizedProfileDef);
	SemiAxis1 : IfcPositiveLengthMeasure;
	SemiAxis2 : IfcPositiveLengthMeasure;
END_ENTITY;

ENTITY IfcIShapeProfileDef
 SUBTYPE OF (IfcParameterizedProfileDef);
	OverallWidth : IfcPositiveLengthMeasure;
	OverallDepth : IfcPositiveLengthMeasure;
	WebThickness : IfcPositiveLengthMeasure;
	FlangeThickness : IfcPositiveLengthMeasure;
	FilletRadius : OPTIONAL IfcNonNegativeLengthMeasure;
	FlangeEdgeRadius : OPTIONAL IfcNonNegativeLengthMeasure;
	FlangeSlope : OPTIONAL IfcPlaneAngleMeasure;
 WHERE
	ValidFlangeThickness : (2. * FlangeThickness) < OverallDepth;
	ValidWebThickness : WebThickness < OverallWidth;
	ValidFilletRadius : NOT(EXISTS(FilletRadius)) OR
((FilletRadius <= (OverallWidth - WebThickness)/2.) AND 
 (FilletRadius <= (OverallDepth - (2. * FlangeThickness))/2.));
END_ENTITY;

ENTITY IfcLShapeProfileDef
 SUBTYPE OF (IfcParameterizedProfileDef);
	Depth : IfcPositiveLengthMeasure;
	Width : OPTIONAL IfcPositiveLengthMeasure;
	Thickness : IfcPositiveLengthMeasure;
	FilletRadius : OPTIONAL IfcNonNegativeLengthMeasure;
	EdgeRadius : OPTIONAL IfcNonNegativeLengthMeasure;
	LegSlope : OPTIONAL IfcPlaneAngleMeasure;
 WHERE
	ValidThickness : (Thickness < Depth) AND (NOT(EXISTS(Width)) OR (Thickness < Width));
END_ENTITY;

ENTITY IfcMirroredProfileDef
 SUBTYPE OF (IfcDerivedProfileDef);
 DERIVE
	SELF\IfcDerivedProfileDef.Operator : IfcCartesianTransformationOperator2D := 
IfcRepresentationItem() || IfcGeometricRepresentationItem() ||
IfcCartesianTransformationOperator(
    -- Axis1
    IfcRepresentationItem() || IfcGeometricRepresentationItem() ||
    IfcDirection([-1., 0.]),
    -- Axis2
    IfcRepresentationItem() || IfcGeometricRepresentationItem() ||
    IfcDirection([ 0., 1.]),
    -- LocalOrigin
    IfcRepresentationItem() || IfcGeometricRepresentationItem() ||
    IfcPoint() || IfcCartesianPoint([0., 0.]),
    -- Scale
    1.) ||
IfcCartesianTransformationOperator2D();
END_ENTITY;

ENTITY IfcParameterizedProfileDef
 ABSTRACT SUPERTYPE OF (ONEOF
    (IfcAsymmetricIShapeProfileDef
    ,IfcCShapeProfileDef
    ,IfcCircleProfileDef
    ,IfcEllipseProfileDef
    ,IfcIShapeProfileDef
    ,IfcLShapeProfileDef
    ,IfcRectangleProfileDef
    ,IfcTShapeProfileDef
    ,IfcTrapeziumProfileDef
    ,IfcUShapeProfileDef
    ,IfcZShapeProfileDef))
 SUBTYPE OF (IfcProfileDef);
	Position : OPTIONAL IfcAxis2Placement2D;
END_ENTITY;

ENTITY IfcProfileDef
 SUPERTYPE OF (ONEOF
    (IfcArbitraryClosedProfileDef
    ,IfcArbitraryOpenProfileDef
    ,IfcCompositeProfileDef
    ,IfcDerivedProfileDef
    ,IfcParameterizedProfileDef));
	ProfileType : IfcProfileTypeEnum;
	ProfileName : OPTIONAL IfcLabel;
 INVERSE
	HasExternalReference : SET [0:?] OF IfcExternalReferenceRelationship FOR RelatedResourceObjects;
	HasProperties : SET [0:?] OF IfcProfileProperties FOR ProfileDefinition;
END_ENTITY;

ENTITY IfcProfileProperties
 SUBTYPE OF (IfcExtendedProperties);
	ProfileDefinition : IfcProfileDef;
END_ENTITY;

ENTITY IfcRectangleHollowProfileDef
 SUBTYPE OF (IfcRectangleProfileDef);
	WallThickness : IfcPositiveLengthMeasure;
	InnerFilletRadius : OPTIONAL IfcNonNegativeLengthMeasure;
	OuterFilletRadius : OPTIONAL IfcNonNegativeLengthMeasure;
 WHERE
	ValidWallThickness : (WallThickness < (SELF\IfcRectangleProfileDef.XDim/2.)) AND 
(WallThickness < (SELF\IfcRectangleProfileDef.YDim/2.));
	ValidInnerRadius : NOT(EXISTS(InnerFilletRadius)) OR 
((InnerFilletRadius <= (SELF\IfcRectangleProfileDef.XDim/2. - WallThickness)) AND 
 (InnerFilletRadius <= (SELF\IfcRectangleProfileDef.YDim/2. - WallThickness)))
;
	ValidOuterRadius : NOT(EXISTS(OuterFilletRadius)) OR 
((OuterFilletRadius <= (SELF\IfcRectangleProfileDef.XDim/2.)) AND 
 (OuterFilletRadius <= (SELF\IfcRectangleProfileDef.YDim/2.)));
END_ENTITY;

ENTITY IfcRectangleProfileDef
 SUPERTYPE OF (ONEOF
    (IfcRectangleHollowProfileDef
    ,IfcRoundedRectangleProfileDef))
 SUBTYPE OF (IfcParameterizedProfileDef);
	XDim : IfcPositiveLengthMeasure;
	YDim : IfcPositiveLengthMeasure;
END_ENTITY;

ENTITY IfcReinforcementBarProperties
 SUBTYPE OF (IfcPreDefinedProperties);
	TotalCrossSectionArea : IfcAreaMeasure;
	SteelGrade : IfcLabel;
	BarSurface : OPTIONAL IfcReinforcingBarSurfaceEnum;
	EffectiveDepth : OPTIONAL IfcLengthMeasure;
	NominalBarDiameter : OPTIONAL IfcPositiveLengthMeasure;
	BarCount : OPTIONAL IfcCountMeasure;
END_ENTITY;

ENTITY IfcRoundedRectangleProfileDef
 SUBTYPE OF (IfcRectangleProfileDef);
	RoundingRadius : IfcPositiveLengthMeasure;
 WHERE
	ValidRadius : ((RoundingRadius <= (SELF\IfcRectangleProfileDef.XDim/2.)) AND 
 (RoundingRadius <= (SELF\IfcRectangleProfileDef.YDim/2.)));
END_ENTITY;

ENTITY IfcSectionProperties
 SUBTYPE OF (IfcPreDefinedProperties);
	SectionType : IfcSectionTypeEnum;
	StartProfile : IfcProfileDef;
	EndProfile : OPTIONAL IfcProfileDef;
END_ENTITY;

ENTITY IfcSectionReinforcementProperties
 SUBTYPE OF (IfcPreDefinedProperties);
	LongitudinalStartPosition : IfcLengthMeasure;
	LongitudinalEndPosition : IfcLengthMeasure;
	TransversePosition : OPTIONAL IfcLengthMeasure;
	ReinforcementRole : IfcReinforcingBarRoleEnum;
	SectionDefinition : IfcSectionProperties;
	CrossSectionReinforcementDefinitions : SET [1:?] OF IfcReinforcementBarProperties;
END_ENTITY;

ENTITY IfcTShapeProfileDef
 SUBTYPE OF (IfcParameterizedProfileDef);
	Depth : IfcPositiveLengthMeasure;
	FlangeWidth : IfcPositiveLengthMeasure;
	WebThickness : IfcPositiveLengthMeasure;
	FlangeThickness : IfcPositiveLengthMeasure;
	FilletRadius : OPTIONAL IfcNonNegativeLengthMeasure;
	FlangeEdgeRadius : OPTIONAL IfcNonNegativeLengthMeasure;
	WebEdgeRadius : OPTIONAL IfcNonNegativeLengthMeasure;
	WebSlope : OPTIONAL IfcPlaneAngleMeasure;
	FlangeSlope : OPTIONAL IfcPlaneAngleMeasure;
 WHERE
	ValidFlangeThickness : FlangeThickness < Depth;
	ValidWebThickness : WebThickness < FlangeWidth;
END_ENTITY;

ENTITY IfcTrapeziumProfileDef
 SUBTYPE OF (IfcParameterizedProfileDef);
	BottomXDim : IfcPositiveLengthMeasure;
	TopXDim : IfcPositiveLengthMeasure;
	YDim : IfcPositiveLengthMeasure;
	TopXOffset : IfcLengthMeasure;
END_ENTITY;

ENTITY IfcUShapeProfileDef
 SUBTYPE OF (IfcParameterizedProfileDef);
	Depth : IfcPositiveLengthMeasure;
	FlangeWidth : IfcPositiveLengthMeasure;
	WebThickness : IfcPositiveLengthMeasure;
	FlangeThickness : IfcPositiveLengthMeasure;
	FilletRadius : OPTIONAL IfcNonNegativeLengthMeasure;
	EdgeRadius : OPTIONAL IfcNonNegativeLengthMeasure;
	FlangeSlope : OPTIONAL IfcPlaneAngleMeasure;
 WHERE
	ValidFlangeThickness : FlangeThickness < (Depth / 2.);
	ValidWebThickness : WebThickness < FlangeWidth;
END_ENTITY;

ENTITY IfcZShapeProfileDef
 SUBTYPE OF (IfcParameterizedProfileDef);
	Depth : IfcPositiveLengthMeasure;
	FlangeWidth : IfcPositiveLengthMeasure;
	WebThickness : IfcPositiveLengthMeasure;
	FlangeThickness : IfcPositiveLengthMeasure;
	FilletRadius : OPTIONAL IfcNonNegativeLengthMeasure;
	EdgeRadius : OPTIONAL IfcNonNegativeLengthMeasure;
 WHERE
	ValidFlangeThickness : FlangeThickness < (Depth / 2.);
END_ENTITY;

END_SCHEMA;
