Esempio n. 1
0
        public override void IfcParse(int propIndex, IPropertyValue value)
        {
            switch (propIndex)
            {
            case 0:
            case 1:
                base.IfcParse(propIndex, value);
                break;

            case 2:
                _parentProfile = (IfcProfileDef)value.EntityVal;
                break;

            case 3:
                _operator = (IfcCartesianTransformationOperator2D)value.EntityVal;
                break;

            case 4:
                _label = value.StringVal;
                break;

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

            case 2:
                _parentProfile = (IfcProfileDef)(value.EntityVal);
                return;

            case 3:
                _operator = (IfcCartesianTransformationOperator2D)(value.EntityVal);
                return;

            case 4:
                _label = value.StringVal;
                return;

            default:
                throw new XbimParserException(string.Format("Attribute index {0} is out of range for {1}", propIndex + 1, GetType().Name.ToUpper()));
            }
        }
 /// <summary>
 /// Compares two objects for geometric equality
 /// </summary>
 /// <param name="a"></param>
 /// <param name="b">object to compare with</param>
 /// <returns></returns>
 public static bool GeometricEquals(this IfcProfileDef a, IfcProfileDef b)
 {
     if (a is IfcRectangleProfileDef)
     {
         if (a is IfcRectangleHollowProfileDef)
             return ((IfcRectangleHollowProfileDef)a).GeometricEquals(b);
         else 
             return ((IfcRectangleProfileDef)a).GeometricEquals(b);
     }
     else if (a is IfcArbitraryClosedProfileDef)
         return ((IfcArbitraryClosedProfileDef)a).GeometricEquals(b);
     else if (a is IfcCircleProfileDef)
         return ((IfcCircleProfileDef)a).GeometricEquals(b);
     else if (a is IfcCircleHollowProfileDef)
         return ((IfcCircleHollowProfileDef)a).GeometricEquals(b);
     else if (a is IfcLShapeProfileDef)
         return ((IfcLShapeProfileDef)a).GeometricEquals(b);
     else if (a is IfcIShapeProfileDef)
         return ((IfcIShapeProfileDef)a).GeometricEquals(b);
     else if (a is IfcUShapeProfileDef)
         return ((IfcUShapeProfileDef)a).GeometricEquals(b);
     else if (a is IfcDerivedProfileDef)
         return ((IfcDerivedProfileDef)a).GeometricEquals(b);
     else
     {
         return false; //default to false
     }
 }
 /// <summary>
 /// Compares two objects for geomtric equality
 /// </summary>
 /// <param name="a"></param>
 /// <param name="b">object to compare with</param>
 /// <returns></returns>
 public static bool GeometricEquals(this IfcLShapeProfileDef a, IfcProfileDef b)
 {
     IfcLShapeProfileDef p = b as IfcLShapeProfileDef;
     if (p == null) return false; //different types are not the same
     return a.Depth == p.Depth && 
         a.Thickness == p.Thickness && 
         a.Width == p.Width && 
         a.Position.GeometricEquals(p.Position);
 }
 /// <summary>
 /// Compares two objects for geomtric equality
 /// </summary>
 /// <param name="a"></param>
 /// <param name="b">object to compare with</param>
 /// <returns></returns>
 public static bool GeometricEquals(this IfcRectangleHollowProfileDef a, IfcProfileDef b)
 {
     IfcRectangleHollowProfileDef p = b as IfcRectangleHollowProfileDef;
     if (p == null) return false; //different types are not the same
     return a.XDim == p.XDim && a.YDim == p.YDim &&
         a.WallThickness == p.WallThickness &&
         a.InnerFilletRadius == p.InnerFilletRadius &&
         a.OuterFilletRadius == p.OuterFilletRadius && 
         a.Position.GeometricEquals(p.Position);
 }
 /// <summary>
 /// Compares two objects for geomtric equality
 /// </summary>
 /// <param name="a"></param>
 /// <param name="b">object to compare with</param>
 /// <returns></returns>
 public static bool GeometricEquals(this IfcIShapeProfileDef a, IfcProfileDef b)
 {
     IfcIShapeProfileDef p = b as IfcIShapeProfileDef;
     if (p == null) return false; //different types are not the same
     return a.WebThickness == p.WebThickness &&
         a.FlangeThickness == p.FlangeThickness &&
         a.OverallDepth == p.OverallDepth &&
         a.OverallWidth == p.OverallWidth &&
         a.FilletRadius == p.FilletRadius &&
         a.Position.GeometricEquals(p.Position);
 }
 public override void IfcParse(int propIndex, IPropertyValue value)
 {
     switch (propIndex)
     {
         case 0:
             _sweptArea = (IfcProfileDef) value.EntityVal;
             break;
         case 1:
             _position = (IfcAxis2Placement3D) value.EntityVal;
             break;
         default:
             this.HandleUnexpectedAttribute(propIndex, value); break;
     }
 }
 /// <summary>
 /// Compares two objects for geomtric equality
 /// </summary>
 /// <param name="a"></param>
 /// <param name="b">object to compare with</param>
 /// <returns></returns>
 public static bool GeometricEquals(this IfcUShapeProfileDef a, IfcProfileDef b)
 {
     IfcUShapeProfileDef p = b as Xbim.Ifc2x3.ProfileResource.IfcUShapeProfileDef;
     if (p == null) return false; //different types are not the same
     return a.WebThickness == p.WebThickness &&
         a.FlangeThickness == p.FlangeThickness &&
         a.FlangeWidth == p.FlangeWidth &&
         a.Depth == p.Depth &&
         a.FilletRadius == p.FilletRadius &&
         a.EdgeRadius == p.EdgeRadius &&
         a.FlangeSlope == p.FlangeSlope &&
         a.CentreOfGravityInX == p.CentreOfGravityInX &&
         a.Position.GeometricEquals(p.Position);
 }
Esempio n. 9
0
        public override bool Equals(object obj)
        {
            // Check for null
            if (obj == null)
            {
                return(false);
            }

            // Check for type
            if (this.GetType() != obj.GetType())
            {
                return(false);
            }

            // Cast as IfcRoot
            IfcProfileDef root = (IfcProfileDef)obj;

            return(this == root);
        }
Esempio n. 10
0
        public override string WhereRule()
        {
            IfcProfileDef pDef = _profiles.FirstOrDefault();
            string        err  = "";

            if (pDef != null)
            {
                IfcProfileTypeEnum pType = pDef.ProfileType;
                foreach (IfcProfileDef profile in _profiles)
                {
                    if (pType != profile.ProfileType)
                    {
                        err += "WR1 CompositeProfileDef : Either all profiles are areas or all profiles are curves\n";
                        break;
                    }
                }
            }
            if (_profiles.OfType <IfcCompositeProfileDef>().Count() > 0)
            {
                err +=
                    "WR2 CompositeProfileDef :   A composite profile should not include another composite profile, i.e. no recursive definitions should be allowed.\n";
            }
            return(err);
        }
Esempio n. 11
0
 public virtual void IfcParse(int propIndex, IPropertyValue value)
 {
     switch (propIndex)
     {
         case 0:
             _profileName = value.StringVal;
             break;
         case 1:
             _profileDefinition = (IfcProfileDef) value.EntityVal;
             break;
         default:
             this.HandleUnexpectedAttribute(propIndex, value); break;
     }
 }
Esempio n. 12
0
 public static IfcExtrudedAreaSolid MakeExtrudedAreaSolid(XbimModel m, IfcProfileDef profile, double extrude)
 {
     var extrusion = m.Instances.New<IfcExtrudedAreaSolid>();
     extrusion.Depth = extrude;
     extrusion.ExtrudedDirection = m.Instances.New<IfcDirection>(d => d.SetXYZ(0, 0, 1));
     extrusion.Position = MakeAxis2Placement3D(m);
     extrusion.SweptArea = profile;
     return extrusion;
 }
 /// <summary>
 /// Compares two objects for geomtric equality
 /// </summary>
 /// <param name="a"></param>
 /// <param name="b">object to compare with</param>
 /// <returns></returns>
 public static bool GeometricEquals(this IfcDerivedProfileDef a, IfcProfileDef b)
 {
     IfcDerivedProfileDef p = b as IfcDerivedProfileDef;
     if (p == null) return false; //different types are not the same
     return a.Operator.GeometricEquals(p.Operator) && a.ParentProfile.GeometricEquals(p.ParentProfile);
 }
Esempio n. 14
0
 public static IfcSurfaceOfLinearExtrusion MakeSurfaceOfLinearExtrusion(XbimModel m, IfcProfileDef profile, double depth, XbimVector3D dir)
 {
     var surf = m.Instances.New<IfcSurfaceOfLinearExtrusion>();
     surf.SweptCurve = profile;
     surf.Depth = depth;
     surf.ExtrudedDirection =  m.Instances.New<IfcDirection>(d=>d.SetXYZ(dir.X,dir.Y,dir.Z));
     return surf;
 }
 public IXbimFace CreateFace(IfcProfileDef profileDef)
 {
     return _engine.CreateFace(profileDef);
 }
 /// <summary>
 /// Compares two objects for geomtric equality
 /// </summary>
 /// <param name="a"></param>
 /// <param name="b">object to compare with</param>
 /// <returns></returns>
 public static bool GeometricEquals(this IfcArbitraryClosedProfileDef a, IfcProfileDef b)
 {
     IfcArbitraryClosedProfileDef p = b as IfcArbitraryClosedProfileDef;
     if (p == null) return false; //different types are not the same
     return a.ProfileType==b.ProfileType && a.OuterCurve.GeometricEquals(p.OuterCurve);
 }
Esempio n. 17
0
 public static IfcSurfaceOfRevolution MakeSurfaceOfRevolution(XbimModel m, IfcProfileDef profile)
 {
     var surf = m.Instances.New<IfcSurfaceOfRevolution>();
     surf.SweptCurve = profile;
     surf.AxisPosition = MakeAxis1Placement(m);
     return surf;
 }
Esempio n. 18
0
        public virtual void IfcParse(int propIndex, IPropertyValue value)
        {
            switch (propIndex)
            {
                case 0:
                    _sectionType = (IfcSectionTypeEnum) Enum.Parse(typeof (IfcSectionTypeEnum), value.EnumVal, true);
                    break;
                case 1:
                    _startProfile = (IfcProfileDef) value.EntityVal;
                    break;
                case 2:
                    _endProfile = (IfcProfileDef) value.EntityVal;
                    break;

                default:
                    this.HandleUnexpectedAttribute(propIndex, value); break;
            }
        }
 public override void IfcParse(int propIndex, IPropertyValue value)
 {
     switch (propIndex)
     {
         case 0:
         case 1:
             base.IfcParse(propIndex, value);
             break;
         case 2:
             _parentProfile = (IfcProfileDef) value.EntityVal;
             break;
         case 3:
             _operator = (IfcCartesianTransformationOperator2D) value.EntityVal;
             break;
         case 4:
             _label = value.StringVal;
             break;
         default:
             this.HandleUnexpectedAttribute(propIndex, value); break;
     }
 }
 /// <summary>
 /// Compares two objects for geomtric equality
 /// </summary>
 /// <param name="a"></param>
 /// <param name="b">object to compare with</param>
 /// <returns></returns>
 public static bool GeometricEquals(this IfcCircleProfileDef a, IfcProfileDef b)
 {
     IfcCircleProfileDef p = b as IfcCircleProfileDef;
     if (p == null) return false; //different types are not the same
     return a.Radius == p.Radius && a.Position.GeometricEquals(p.Position);
 }
 public override void IfcParse(int propIndex, IPropertyValue value)
 {
     switch (propIndex)
     {
         case 0:
             _LocationAtRelatingElement = (IfcAxis2Placement)value.EntityVal;
             break;
         case 1:
             _LocationAtRelatedElement = (IfcAxis2Placement)value.EntityVal;
             break;
         case 2:
             _ProfileOfPort = (IfcProfileDef)value.EntityVal;
             break;
         default:
             this.HandleUnexpectedAttribute(propIndex, value); break;
     }
 }
 /// <summary>
 /// Compares two objects for geomtric equality
 /// </summary>
 /// <param name="a"></param>
 /// <param name="b">object to compare with</param>
 /// <returns></returns>
 public static bool GeometricEquals(this IfcRectangleProfileDef a, IfcProfileDef b)
 {
     IfcRectangleProfileDef p = b as IfcRectangleProfileDef;
     if (p == null) return false; //different types are not the same
     return a.XDim == p.XDim && a.YDim == p.YDim && a.Position.GeometricEquals(p.Position);
 }