Beispiel #1
0
        /// <summary>The create splitted reinforcement bars.</summary>
        /// <param name="position">The position.</param>
        /// <param name="rebarPoints">The reinforcement bar points.</param>
        /// <param name="splitRebarSet">The split reinforcement bar set.</param>
        /// <param name="finalRebarLength">The final reinforcement bar length.</param>
        /// <returns>The System.Boolean.</returns>
        private bool CreateSplittedRebars(FirstOrLastEnum position, ArrayList rebarPoints, ArrayList splitRebarSet, out double finalRebarLength)
        {
            var result = false;

            finalRebarLength = 0.0;

            var singleRebarCreator = new CreateSingleRebar(this.originalRebar);
            var newRebar           = singleRebarCreator.GetSingleRebar(rebarPoints);

            if (newRebar != null)
            {
                // Rounding the lenth of the rebar
                var reportLength = 0.0;
                newRebar.Insert();
                newRebar.GetReportProperty("LENGTH", ref reportLength);
                newRebar.Delete();

                var rebarLength = Distance.PointToPoint(newRebar.Polygon.Points[1] as Point, newRebar.Polygon.Points[0] as Point);

                if (rebarLength > reportLength)
                {
                    var rebarVector = new Vector((Point)newRebar.Polygon.Points[1] - (Point)newRebar.Polygon.Points[0]);
                    rebarVector.Normalize(rebarLength + AdditionalRebarLength);
                    rebarPoints[1] = (Point)rebarPoints[0] + rebarVector;
                    newRebar       = singleRebarCreator.GetSingleRebar(rebarPoints);
                }

                if (newRebar != null)
                {
                    finalRebarLength = Distance.PointToPoint(
                        newRebar.Polygon.Points[1] as Point, newRebar.Polygon.Points[0] as Point);

                    if (position == FirstOrLastEnum.FirstRebar)
                    {
                        newRebar.EndHook.Shape = RebarHookData.RebarHookShapeEnum.NO_HOOK;
                    }
                    else if (position == FirstOrLastEnum.MiddleRebar)
                    {
                        newRebar.StartHook.Shape = RebarHookData.RebarHookShapeEnum.NO_HOOK;
                        newRebar.EndHook.Shape   = RebarHookData.RebarHookShapeEnum.NO_HOOK;
                    }
                    else if (position == FirstOrLastEnum.LastRebar)
                    {
                        newRebar.StartHook.Shape = RebarHookData.RebarHookShapeEnum.NO_HOOK;
                    }

                    splitRebarSet.Add(newRebar);
                    result = true;
                }
            }

            return(result);
        }
Beispiel #2
0
        /// <summary>The get reinforcement bar maximum length.</summary>
        /// <param name="position">The position.</param>
        /// <param name="maxLength">The max length.</param>
        /// <returns>The System.Boolean.</returns>
        private bool GetRebarMaximumLength(FirstOrLastEnum position, out double maxLength)
        {
            maxLength = this.splitData.MaxLength;

            switch (position)
            {
            case FirstOrLastEnum.Undefined:
                break;

            case FirstOrLastEnum.FirstRebar:

                if (this.splitData.SpliceType == 0)
                {
                    maxLength -= this.splitData.LappingLength / 2.0;
                }

                maxLength -= this.startHookLength;

                break;

            case FirstOrLastEnum.MiddleRebar:

                if (this.splitData.SpliceType == 0)
                {
                    maxLength -= this.splitData.LappingLength;
                }

                break;

            case FirstOrLastEnum.LastRebar:

                if (this.splitData.SpliceType == 0)
                {
                    maxLength -= this.splitData.LappingLength / 2.0;
                }

                maxLength -= this.endHookLength;

                break;

            default:
                break;
            }

            return(true);
        }
        /// <summary>The get reinforcement bar maximum length.</summary>
        /// <param name="position">The position.</param>
        /// <param name="maxLength">The max length.</param>
        /// <returns>The System.Boolean.</returns>
        private bool GetRebarMaximumLength(FirstOrLastEnum position, out double maxLength)
        {
            maxLength = this.splitData.MaxLength;

            switch (position)
            {
            case FirstOrLastEnum.Undefined:
                break;

            case FirstOrLastEnum.FirstRebar:
                if (this.splitData.SpliceType == 0)
                {
                    maxLength -= this.splitData.LappingLength / 2.0;
                }

                if (this.originalRebar.StartHook.Shape != RebarHookData.RebarHookShapeEnum.NO_HOOK &&
                    this.originalRebar.StartHook.Shape != RebarHookData.RebarHookShapeEnum.CUSTOM_HOOK)
                {
                    var startAngle = 0.0;

                    if (this.originalRebar.StartHook.Shape == RebarHookData.RebarHookShapeEnum.HOOK_90_DEGREES)
                    {
                        startAngle = StandardHookAngle90;
                    }
                    else if (this.originalRebar.StartHook.Shape == RebarHookData.RebarHookShapeEnum.HOOK_135_DEGREES)
                    {
                        startAngle = StandardHookAngle135;
                    }
                    else if (this.originalRebar.StartHook.Shape == RebarHookData.RebarHookShapeEnum.HOOK_180_DEGREES)
                    {
                        startAngle = StandardHookAngle180;
                    }

                    maxLength -= StandardHookLength;
                    maxLength -= Math.PI * StandardHookRadius * startAngle / 180.0;
                    maxLength += StandardHookRadius;
                }
                else if (this.originalRebar.StartHook.Shape == RebarHookData.RebarHookShapeEnum.CUSTOM_HOOK)
                {
                    maxLength -= this.originalRebar.StartHook.Length;
                    maxLength -= Math.PI * this.originalRebar.StartHook.Radius * this.originalRebar.StartHook.Angle
                                 / 180.0;
                    maxLength += this.originalRebar.StartHook.Radius;
                }

                break;

            case FirstOrLastEnum.MiddleRebar:
                if (this.splitData.SpliceType == 0)
                {
                    maxLength -= this.splitData.LappingLength;
                }

                break;

            case FirstOrLastEnum.LastRebar:
                if (this.splitData.SpliceType == 0)
                {
                    maxLength -= this.splitData.LappingLength / 2.0;
                }

                if (this.originalRebar.EndHook.Shape != RebarHookData.RebarHookShapeEnum.NO_HOOK &&
                    this.originalRebar.EndHook.Shape != RebarHookData.RebarHookShapeEnum.CUSTOM_HOOK)
                {
                    var endAngle = 0.0;

                    if (this.originalRebar.EndHook.Shape == RebarHookData.RebarHookShapeEnum.HOOK_90_DEGREES)
                    {
                        endAngle = StandardHookAngle90;
                    }
                    else if (this.originalRebar.EndHook.Shape == RebarHookData.RebarHookShapeEnum.HOOK_135_DEGREES)
                    {
                        endAngle = StandardHookAngle135;
                    }
                    else if (this.originalRebar.EndHook.Shape == RebarHookData.RebarHookShapeEnum.HOOK_180_DEGREES)
                    {
                        endAngle = StandardHookAngle180;
                    }

                    maxLength -= StandardHookLength;
                    maxLength -= Math.PI * StandardHookRadius * endAngle / 180.0;
                    maxLength += StandardHookRadius;
                }
                else if (this.originalRebar.EndHook.Shape == RebarHookData.RebarHookShapeEnum.CUSTOM_HOOK)
                {
                    maxLength -= this.originalRebar.EndHook.Length;
                    maxLength -= Math.PI * this.originalRebar.EndHook.Radius * this.originalRebar.EndHook.Angle / 180.0;
                    maxLength += this.originalRebar.EndHook.Radius;
                }

                break;

            default:
                break;
            }

            return(true);
        }