コード例 #1
0
        /// <summary>
        /// Get guid from objects (only bars and slabs supported) in list.
        /// </summary>
        /// <param name="objs">Bars and/or Slabs</param>
        internal static CoverReferenceList FromObjectList(List <object> objs)
        {
            if (objs == null)
            {
                return(null);
            }

            if (objs.Count == 0)
            {
                return(null);
            }

            CoverReferenceList refList = new CoverReferenceList();

            foreach (object elem in objs)
            {
                if (elem.GetType() == typeof(Bars.Bar))
                {
                    refList.RefGuid.Add(new GuidListType(((Bars.Bar)elem).BarPart.Guid));
                }
                else if (elem.GetType() == typeof(Shells.Slab))
                {
                    refList.RefGuid.Add(new GuidListType(((Shells.Slab)elem).SlabPart.Guid));
                }
                else
                {
                    throw new System.ArgumentException("Type of supporting structure is not supported. Can be bar or slab.");
                }
            }
            return(refList);
        }
コード例 #2
0
ファイル: Cover.cs プロジェクト: strusoft/femdesign-api
 /// <summary>
 /// Construct a cover
 /// </summary>
 /// <param name="region">Region of cover.</param>
 /// <param name="supportingStructures">Guidlist of supporting structure.</param>
 /// <param name="loadBearingDirection">Vector, if null a TwoWay cover is defined.</param>
 public Cover(Geometry.Region region, CoverReferenceList supportingStructures, Geometry.FdVector3d loadBearingDirection, string identifier)
 {
     this.EntityCreated();
     this.Identifier           = identifier;
     this.Region               = region;
     this.SupportingStructures = supportingStructures;
     this.LoadBearingDirection = loadBearingDirection;
 }
コード例 #3
0
ファイル: Cover.cs プロジェクト: strusoft/femdesign-api
        /// Create TwoWayCover.
        public static Cover TwoWayCover(Geometry.Region region, List <object> supportingStructures, string identifier)
        {
            // get supportingStructures.guid
            CoverReferenceList _supportingStructures = CoverReferenceList.FromObjectList(supportingStructures);

            // create cover
            Cover _cover = new Cover(region, _supportingStructures, null, identifier);

            return(_cover);
        }
コード例 #4
0
ファイル: Cover.cs プロジェクト: strusoft/femdesign-api
        /// Create OneWayCover.
        public static Cover OneWayCover(Geometry.Region region, List <object> supportingStructures, Geometry.FdVector3d loadBearingDirection, string identifier)
        {
            // get supportingStructures.guid
            CoverReferenceList _supportingStructures = CoverReferenceList.FromObjectList(supportingStructures);

            // create cover
            Cover _cover = new Cover(region, _supportingStructures, loadBearingDirection, identifier);

            return(_cover);
        }