예제 #1
0
        public override string WhereRule()
        {
            string err = "";

            if (Dim != 3)
            {
                err += "WR1 Axis2Placement3D: The dimensionality of the placement location shall be 3.";
            }
            if (Axis != null && Axis.Dim != 3)
            {
                err +=
                    "WR2 Axis2Placement3D: The Axis when given should only reference a three-dimensional IfcDirection.";
            }
            if (RefDirection != null && RefDirection.Dim != 3)
            {
                err +=
                    "WR3 Axis2Placement3D: The RefDirection when given should only reference a three-dimensional IfcDirection.";
            }
            if (Axis != null && RefDirection != null && IfcDirection.CrossProduct(Axis, RefDirection).Magnitude <= 0)
            {
                err += "WR4 Axis2Placement3D: The Axis and RefDirection shall not be parallel or anti-parallel. ";
            }
            if (RefDirection != null ^ Axis != null)
            {
                err +=
                    "WR5 Axis2Placement3D: Either both (Axis and RefDirection) are not given and therefore defaulted, or both shall be given.";
            }

            return(err);
        }
예제 #2
0
 public static IfcVector CrossProduct(IfcDirection d1, IfcDirection d2)
 {
     if (d1.Dim == 3 && d2.Dim == 3)
     {
         XbimVector3D v3D = d1.XbimVector3D().CrossProduct(d2.XbimVector3D());
         return(new IfcVector(v3D.X, v3D.Y, v3D.Z, v3D.Length));
     }
     else
     {
         throw new ArgumentException("CrossProduct: Both Vectors must have the same dimensionality");
     }
 }
예제 #3
0
 public override void IfcParse(int propIndex, IPropertyValue value)
 {
     if (propIndex == 0)
     {
         base.IfcParse(propIndex, value);
     }
     else if (propIndex == 1)
     {
         _axis = (IfcDirection)value.EntityVal;
     }
     else
     {
         this.HandleUnexpectedAttribute(propIndex, value);
     }
 }
예제 #4
0
        public override void Parse(int propIndex, IPropertyValue value, int[] nestedIndex)
        {
            switch (propIndex)
            {
            case 0:
                _orientation = (IfcDirection)(value.EntityVal);
                return;

            case 1:
                _magnitude = value.RealVal;
                return;

            default:
                throw new XbimParserException(string.Format("Attribute index {0} is out of range for {1}", propIndex + 1, GetType().Name.ToUpper()));
            }
        }
예제 #5
0
        public override void IfcParse(int propIndex, IPropertyValue value)
        {
            switch (propIndex)
            {
            case 0:
                _orientation = (IfcDirection)value.EntityVal;
                break;

            case 1:
                _magnitude = value.RealVal;
                break;

            default:
                this.HandleUnexpectedAttribute(propIndex, value); break;
            }
        }
예제 #6
0
        public override void IfcParse(int propIndex, IPropertyValue value)
        {
            switch (propIndex)
            {
            case 0:
                base.IfcParse(propIndex, value);
                break;

            case 1:
                _refDirection = (IfcDirection)value.EntityVal;
                break;

            default:
                this.HandleUnexpectedAttribute(propIndex, value); break;
            }
        }
        public override void Parse(int propIndex, IPropertyValue value, int[] nestedIndex)
        {
            switch (propIndex)
            {
            case 0:
            case 1:
            case 2:
            case 3:
                base.Parse(propIndex, value, nestedIndex);
                return;

            case 4:
                _axis3 = (IfcDirection)(value.EntityVal);
                return;

            default:
                throw new XbimParserException(string.Format("Attribute index {0} is out of range for {1}", propIndex + 1, GetType().Name.ToUpper()));
            }
        }
예제 #8
0
        public override void IfcParse(int propIndex, IPropertyValue value)
        {
            switch (propIndex)
            {
            case 0:
            case 1:
                base.IfcParse(propIndex, value);
                break;

            case 2:
                _extrudedDirection = (IfcDirection)value.EntityVal;
                break;

            case 3:
                _depth = value.RealVal;
                break;

            default:
                this.HandleUnexpectedAttribute(propIndex, value); break;
            }
        }
예제 #9
0
        public override void IfcParse(int propIndex, IPropertyValue value)
        {
            switch (propIndex)
            {
            case 0:
                _axis1 = (IfcDirection)value.EntityVal;
                break;

            case 1:
                _axis2 = (IfcDirection)value.EntityVal;
                break;

            case 2:
                _localOrigin = (IfcCartesianPoint)value.EntityVal;
                break;

            case 3:
                _scale = value.RealVal;
                break;

            default:
                this.HandleUnexpectedAttribute(propIndex, value); break;
            }
        }
예제 #10
0
        public override void Parse(int propIndex, IPropertyValue value, int[] nestedIndex)
        {
            switch (propIndex)
            {
            case 0:
                _axis1 = (IfcDirection)(value.EntityVal);
                return;

            case 1:
                _axis2 = (IfcDirection)(value.EntityVal);
                return;

            case 2:
                _localOrigin = (IfcCartesianPoint)(value.EntityVal);
                return;

            case 3:
                _scale = value.RealVal;
                return;

            default:
                throw new XbimParserException(string.Format("Attribute index {0} is out of range for {1}", propIndex + 1, GetType().Name.ToUpper()));
            }
        }
예제 #11
0
        public override void IfcParse(int propIndex, IPropertyValue value)
        {
            switch (propIndex)
            {
            case 0:
                _basisCurve = (IfcCurve)value.EntityVal;
                break;

            case 1:
                _distance = value.RealVal;
                break;

            case 2:
                _selfIntersect = value.BooleanVal;
                break;

            case 3:
                _refDirection = (IfcDirection)value.EntityVal;
                break;

            default:
                this.HandleUnexpectedAttribute(propIndex, value); break;
            }
        }
        public override void Parse(int propIndex, IPropertyValue value, int[] nestedIndex)
        {
            switch (propIndex)
            {
            case 0:
                _basisCurve = (IfcCurve)(value.EntityVal);
                return;

            case 1:
                _distance = value.RealVal;
                return;

            case 2:
                _selfIntersect = value.BooleanVal;
                return;

            case 3:
                _refDirection = (IfcDirection)(value.EntityVal);
                return;

            default:
                throw new XbimParserException(string.Format("Attribute index {0} is out of range for {1}", propIndex + 1, GetType().Name.ToUpper()));
            }
        }
예제 #13
0
 public IfcVector(double x, double y, IfcLengthMeasure magnitude)
 {
     _orientation = new IfcDirection(x, y);
     _magnitude   = magnitude;
 }
예제 #14
0
 public IfcVector(IfcDirection dir, IfcLengthMeasure magnitude)
 {
     _orientation = dir;
     _magnitude   = magnitude;
 }
예제 #15
0
 public IfcDirection(IfcDirection dir)
 {
     _x = dir.X;
     _y = dir.Y;
     _z = dir.Z;
 }