/// <summary>
        /// Tests the express where-clause specified in param 'clause'
        /// </summary>
        /// <param name="clause">The express clause to test</param>
        /// <returns>true if the clause is satisfied.</returns>
        public bool ValidateClause(IfcCompoundPlaneAngleMeasureClause clause)
        {
            var retVal = false;

            try
            {
                switch (clause)
                {
                case IfcCompoundPlaneAngleMeasureClause.WR1:
                    retVal = ((-360 <= this.ItemAt(0)) && (this.ItemAt(0) < 360));
                    break;

                case IfcCompoundPlaneAngleMeasureClause.WR2:
                    retVal = ((-60 <= this.ItemAt(1)) && (this.ItemAt(1) < 60));
                    break;

                case IfcCompoundPlaneAngleMeasureClause.WR3:
                    retVal = ((-60 <= this.ItemAt(2)) && (this.ItemAt(2) < 60));
                    break;

                case IfcCompoundPlaneAngleMeasureClause.WR4:
                    retVal = ((this.ItemAt(0) >= 0) && (this.ItemAt(1) >= 0) && (this.ItemAt(2) >= 0)) || ((this.ItemAt(0) <= 0) && (this.ItemAt(1) <= 0) && (this.ItemAt(2) <= 0));
                    break;
                }
            } catch (Exception ex) {
                var log = Validation.ValidationLogging.CreateLogger <Xbim.Ifc2x3.MeasureResource.IfcCompoundPlaneAngleMeasure>();
                log?.LogError(string.Format("Exception thrown evaluating where-clause 'IfcCompoundPlaneAngleMeasure.{0}'.", clause), ex);
            }
            return(retVal);
        }
Beispiel #2
0
        /// <summary>
        /// Tests the express where-clause specified in param 'clause'
        /// </summary>
        /// <param name="clause">The express clause to test</param>
        /// <returns>true if the clause is satisfied.</returns>
        public bool ValidateClause(IfcCompoundPlaneAngleMeasureClause clause)
        {
            var retVal = false;

            try
            {
                switch (clause)
                {
                case IfcCompoundPlaneAngleMeasureClause.MinutesInRange:
                    retVal = Functions.ABS(this.ItemAt(1)) < 60;
                    break;

                case IfcCompoundPlaneAngleMeasureClause.SecondsInRange:
                    retVal = Functions.ABS(this.ItemAt(2)) < 60;
                    break;

                case IfcCompoundPlaneAngleMeasureClause.MicrosecondsInRange:
                    retVal = (Functions.SIZEOF(this) == 3) || (Functions.ABS(this.ItemAt(3)) < 1000000);
                    break;

                case IfcCompoundPlaneAngleMeasureClause.ConsistentSign:
                    retVal = ((this.ItemAt(0) >= 0) && (this.ItemAt(1) >= 0) && (this.ItemAt(2) >= 0) && ((Functions.SIZEOF(this) == 3) || (this.ItemAt(3) >= 0))) || ((this.ItemAt(0) <= 0) && (this.ItemAt(1) <= 0) && (this.ItemAt(2) <= 0) && ((Functions.SIZEOF(this) == 3) || (this.ItemAt(3) <= 0)));
                    break;
                }
            } catch (Exception ex) {
                var log = Validation.ValidationLogging.CreateLogger <Xbim.Ifc4.MeasureResource.IfcCompoundPlaneAngleMeasure>();
                log?.LogError(string.Format("Exception thrown evaluating where-clause 'IfcCompoundPlaneAngleMeasure.{0}'.", clause), ex);
            }
            return(retVal);
        }