public List <RebarPoint> GetFilteredBars(double CutoffCoordinate, BarCoordinateFilter CoordinateFilter, BarCoordinateLimitFilterType LimitFilterType) { List <RebarPoint> barPoints = new List <RebarPoint>(); foreach (var bar in longitBars) { if (CoordinateFilter == BarCoordinateFilter.X && LimitFilterType == BarCoordinateLimitFilterType.Maximum) { if (bar.Coordinate.X <= CutoffCoordinate) { barPoints.Add(bar); } } if (CoordinateFilter == BarCoordinateFilter.Y && LimitFilterType == BarCoordinateLimitFilterType.Maximum) { if (bar.Coordinate.Y <= CutoffCoordinate) { barPoints.Add(bar); } } if (CoordinateFilter == BarCoordinateFilter.X && LimitFilterType == BarCoordinateLimitFilterType.Minimum) { if (bar.Coordinate.X >= CutoffCoordinate) { barPoints.Add(bar); } } if (CoordinateFilter == BarCoordinateFilter.Y && LimitFilterType == BarCoordinateLimitFilterType.Minimum) { if (bar.Coordinate.Y >= CutoffCoordinate) { barPoints.Add(bar); } } } return(barPoints); }
protected RebarPoint FindRebarWithExtremeCoordinate(BarCoordinateFilter CoordinateFilter, BarCoordinateLimitFilterType LimitFilter, double CutoffCoordinate) { RebarPoint returnBar = null; RebarPoint maxXRebar = null; RebarPoint maxYRebar = null; RebarPoint minXRebar = null; RebarPoint minYRebar = null; double MaxY = double.NegativeInfinity; double MaxX = double.NegativeInfinity; double MinY = double.PositiveInfinity; double MinX = double.PositiveInfinity; if (longitBars.Count == 0) { throw new NoRebarException(); } foreach (var bar in longitBars) { if (bar.Coordinate.X > MaxX) { if (bar.Coordinate.X < CutoffCoordinate) { maxXRebar = bar; MaxX = bar.Coordinate.X; } } if (bar.Coordinate.Y > MaxY) { if (bar.Coordinate.Y < CutoffCoordinate) { maxYRebar = bar; MaxY = bar.Coordinate.Y; } } if (bar.Coordinate.X < MinX) { if (bar.Coordinate.X > CutoffCoordinate) { minXRebar = bar; MinX = bar.Coordinate.X; } } if (bar.Coordinate.Y < MinY) { if (bar.Coordinate.Y > CutoffCoordinate) { minYRebar = bar; MinY = bar.Coordinate.Y; } } } if (CoordinateFilter == BarCoordinateFilter.X && LimitFilter == BarCoordinateLimitFilterType.Maximum) { returnBar = maxXRebar; } if (CoordinateFilter == BarCoordinateFilter.X && LimitFilter == BarCoordinateLimitFilterType.Minimum) { returnBar = minXRebar; } if (CoordinateFilter == BarCoordinateFilter.Y && LimitFilter == BarCoordinateLimitFilterType.Maximum) { returnBar = maxYRebar; } if (CoordinateFilter == BarCoordinateFilter.Y && LimitFilter == BarCoordinateLimitFilterType.Minimum) { returnBar = minYRebar; } return(returnBar); }
public List<RebarPoint> GetFilteredBars(double CutoffCoordinate, BarCoordinateFilter CoordinateFilter, BarCoordinateLimitFilterType LimitFilterType) { List<RebarPoint> barPoints = new List<RebarPoint>(); foreach (var bar in longitBars) { if (CoordinateFilter == BarCoordinateFilter.X && LimitFilterType == BarCoordinateLimitFilterType.Maximum) { if (bar.Coordinate.X <= CutoffCoordinate) { barPoints.Add(bar); } } if (CoordinateFilter == BarCoordinateFilter.Y && LimitFilterType == BarCoordinateLimitFilterType.Maximum) { if (bar.Coordinate.Y <= CutoffCoordinate) { barPoints.Add(bar); } } if (CoordinateFilter == BarCoordinateFilter.X && LimitFilterType == BarCoordinateLimitFilterType.Minimum) { if (bar.Coordinate.X >= CutoffCoordinate) { barPoints.Add(bar); } } if (CoordinateFilter == BarCoordinateFilter.Y && LimitFilterType == BarCoordinateLimitFilterType.Minimum) { if (bar.Coordinate.Y >= CutoffCoordinate) { barPoints.Add(bar); } } } return barPoints; }
protected ForceMomentContribution GetApproximateRebarResultant(BarCoordinateFilter CoordinateFilter, BarCoordinateLimitFilterType LimitFilterType, double CutoffCoordinate) { ForceMomentContribution resultant = new ForceMomentContribution(); double barLimitForce = 0; double barLimitForceMoment = 0; List<RebarPoint> filteredBars = GetFilteredBars(CutoffCoordinate, CoordinateFilter, LimitFilterType); foreach (var bar in filteredBars) { if (CoordinateFilter == BarCoordinateFilter.X) // && LimitFilterType == BarCoordinateLimitFilterType.Maximum) { barLimitForce = bar.Rebar.GetDesignForce(); barLimitForceMoment = barLimitForce * bar.Coordinate.X; } else { barLimitForce = bar.Rebar.GetDesignForce(); barLimitForceMoment = barLimitForce * bar.Coordinate.Y; } } ForceMomentContribution barResultant = new ForceMomentContribution() { Force = barLimitForce, Moment = barLimitForceMoment }; resultant += barResultant; return resultant; }
protected ForceMomentContribution GetRebarResultant(BarCoordinateFilter CoordinateFilter, BarCoordinateLimitFilterType LimitFilter, double CutoffCoordinate) { ForceMomentContribution resultant = new ForceMomentContribution(); foreach (var bar in longitBars) { double barLimitForce = 0; double barLimitForceMoment = 0; if (CoordinateFilter == BarCoordinateFilter.X && LimitFilter == BarCoordinateLimitFilterType.Maximum) { if (bar.Coordinate.X <= CutoffCoordinate) { barLimitForce = bar.Rebar.GetDesignForce(); barLimitForceMoment = barLimitForce * bar.Coordinate.X; } } if (CoordinateFilter == BarCoordinateFilter.Y && LimitFilter == BarCoordinateLimitFilterType.Maximum) { if (bar.Coordinate.Y <= CutoffCoordinate) { barLimitForce = bar.Rebar.GetDesignForce(); barLimitForceMoment = barLimitForce * bar.Coordinate.Y; } } if (CoordinateFilter == BarCoordinateFilter.X && LimitFilter == BarCoordinateLimitFilterType.Minimum) { if (bar.Coordinate.X >= CutoffCoordinate) { barLimitForce = bar.Rebar.GetDesignForce(); barLimitForceMoment = barLimitForce * bar.Coordinate.X; } } if (CoordinateFilter == BarCoordinateFilter.Y && LimitFilter == BarCoordinateLimitFilterType.Minimum) { if (bar.Coordinate.Y >= CutoffCoordinate) { barLimitForce = bar.Rebar.GetDesignForce(); barLimitForceMoment = barLimitForce * bar.Coordinate.Y; } } ForceMomentContribution barResultant = new ForceMomentContribution(){ Force = barLimitForce, Moment=barLimitForceMoment}; resultant += barResultant; } return resultant; }
protected RebarPoint FindRebarWithExtremeCoordinate(BarCoordinateFilter CoordinateFilter, BarCoordinateLimitFilterType LimitFilter, double CutoffCoordinate) { RebarPoint returnBar = null; RebarPoint maxXRebar = null; RebarPoint maxYRebar = null; RebarPoint minXRebar = null; RebarPoint minYRebar = null; double MaxY = double.NegativeInfinity; double MaxX = double.NegativeInfinity; double MinY = double.PositiveInfinity; double MinX = double.PositiveInfinity; if (longitBars.Count == 0) { throw new NoRebarException(); } foreach (var bar in longitBars) { if (bar.Coordinate.X > MaxX) { if (bar.Coordinate.X<CutoffCoordinate) { maxXRebar = bar; MaxX = bar.Coordinate.X; } } if (bar.Coordinate.Y > MaxY) { if (bar.Coordinate.Y < CutoffCoordinate) { maxYRebar = bar; MaxY = bar.Coordinate.Y; } } if (bar.Coordinate.X < MinX) { if (bar.Coordinate.X > CutoffCoordinate) { minXRebar = bar; MinX = bar.Coordinate.X; } } if (bar.Coordinate.Y < MinY) { if (bar.Coordinate.Y > CutoffCoordinate) { minYRebar = bar; MinY = bar.Coordinate.Y; } } } if (CoordinateFilter == BarCoordinateFilter.X && LimitFilter == BarCoordinateLimitFilterType.Maximum) { returnBar = maxXRebar; } if (CoordinateFilter == BarCoordinateFilter.X && LimitFilter == BarCoordinateLimitFilterType.Minimum) { returnBar = minXRebar; } if (CoordinateFilter == BarCoordinateFilter.Y && LimitFilter == BarCoordinateLimitFilterType.Maximum) { returnBar = maxYRebar; } if (CoordinateFilter == BarCoordinateFilter.Y && LimitFilter == BarCoordinateLimitFilterType.Minimum) { returnBar = minYRebar; } return returnBar; }