Surrounding property was added
This commit is contained in:
@@ -13,14 +13,14 @@ namespace StructureHelperLogics.Models.CrossSections
|
||||
{
|
||||
public class CrossSectionRepository : ICrossSectionRepository
|
||||
{
|
||||
public List<IForceCombinationList> ForceCombinationLists { get; private set; }
|
||||
public List<IForceAction> ForceActions { get; private set; }
|
||||
public List<IHeadMaterial> HeadMaterials { get; private set; }
|
||||
public List<INdmPrimitive> Primitives { get; }
|
||||
public List<INdmCalculator> CalculatorsList { get; private set; }
|
||||
|
||||
public CrossSectionRepository()
|
||||
{
|
||||
ForceCombinationLists = new List<IForceCombinationList>();
|
||||
ForceActions = new List<IForceAction>();
|
||||
HeadMaterials = new List<IHeadMaterial>();
|
||||
Primitives = new List<INdmPrimitive>();
|
||||
CalculatorsList = new List<INdmCalculator>();
|
||||
|
||||
@@ -14,7 +14,7 @@ namespace StructureHelperLogics.Models.CrossSections
|
||||
{
|
||||
public interface ICrossSectionRepository : IHasHeadMaterials, IHasPrimitives
|
||||
{
|
||||
List<IForceCombinationList> ForceCombinationLists { get; }
|
||||
List<IForceAction> ForceActions { get; }
|
||||
List<INdmCalculator> CalculatorsList { get; }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -13,7 +13,7 @@ namespace StructureHelperLogics.Models.Templates.CrossSections.RCs
|
||||
public class CircleGeometryLogic : IRCGeometryLogic
|
||||
{
|
||||
ICircleTemplate template;
|
||||
|
||||
CirclePrimitive concreteBlock;
|
||||
|
||||
public IEnumerable<IHeadMaterial> HeadMaterials { get; set; }
|
||||
|
||||
@@ -35,8 +35,8 @@ namespace StructureHelperLogics.Models.Templates.CrossSections.RCs
|
||||
var diameter = template.Shape.Diameter;
|
||||
var concreteMaterial = HeadMaterials.ToList()[0];
|
||||
var primitives = new List<INdmPrimitive>();
|
||||
var rectangle = new CirclePrimitive() { Diameter = diameter, Name = "Concrete block", HeadMaterial = concreteMaterial };
|
||||
primitives.Add(rectangle);
|
||||
concreteBlock = new CirclePrimitive() { Diameter = diameter, Name = "Concrete block", HeadMaterial = concreteMaterial };
|
||||
primitives.Add(concreteBlock);
|
||||
return primitives;
|
||||
}
|
||||
|
||||
@@ -52,7 +52,13 @@ namespace StructureHelperLogics.Models.Templates.CrossSections.RCs
|
||||
var angle = i * dAngle;
|
||||
var x = radius * Math.Sin(angle);
|
||||
var y = radius * Math.Cos(angle);
|
||||
var point = new PointPrimitive() { CenterX = x, CenterY = y, Area = barArea, Name = "Left bottom point", HeadMaterial = reinforcementMaterial };
|
||||
var point = new ReinforcementPrimitive()
|
||||
{ CenterX = x,
|
||||
CenterY = y,
|
||||
Area = barArea,
|
||||
Name = "Left bottom point",
|
||||
HeadMaterial = reinforcementMaterial,
|
||||
SurroundingPrimitive=concreteBlock };
|
||||
primitives.Add(point);
|
||||
}
|
||||
return primitives;
|
||||
|
||||
@@ -17,6 +17,7 @@ namespace StructureHelperLogics.Models.Templates.CrossSections.RCs
|
||||
IRectangleBeamTemplate template;
|
||||
IHeadMaterial concrete => HeadMaterials.ToList()[0];
|
||||
IHeadMaterial reinforcement => HeadMaterials.ToList()[1];
|
||||
RectanglePrimitive concreteBlock;
|
||||
|
||||
RectangleShape rect => template.Shape as RectangleShape;
|
||||
double width => rect.Width;
|
||||
@@ -47,8 +48,8 @@ namespace StructureHelperLogics.Models.Templates.CrossSections.RCs
|
||||
private IEnumerable<INdmPrimitive> GetConcretePrimitives()
|
||||
{
|
||||
var primitives = new List<INdmPrimitive>();
|
||||
var rectangle = new RectanglePrimitive(concrete) { Width = width, Height = height, Name = "Concrete block" };
|
||||
primitives.Add(rectangle);
|
||||
concreteBlock = new RectanglePrimitive(concrete) { Width = width, Height = height, Name = "Concrete block" };
|
||||
primitives.Add(concreteBlock);
|
||||
return primitives;
|
||||
}
|
||||
|
||||
@@ -58,13 +59,13 @@ namespace StructureHelperLogics.Models.Templates.CrossSections.RCs
|
||||
double[] ys = new double[] { -height / 2 + gap, height / 2 - gap };
|
||||
|
||||
List<INdmPrimitive> primitives = new List<INdmPrimitive>();
|
||||
var point = new PointPrimitive(reinforcement) { CenterX = xs[0], CenterY = ys[0], Area = area1, Name = "Left bottom point" };
|
||||
var point = new ReinforcementPrimitive() { CenterX = xs[0], CenterY = ys[0], Area = area1, Name = "Left bottom point", HeadMaterial = reinforcement, SurroundingPrimitive=concreteBlock };
|
||||
primitives.Add(point);
|
||||
point = new PointPrimitive(reinforcement) { CenterX = xs[1], CenterY = ys[0], Area = area1, Name = "Right bottom point" };
|
||||
point = new ReinforcementPrimitive() { CenterX = xs[1], CenterY = ys[0], Area = area1, Name = "Right bottom point", HeadMaterial = reinforcement, SurroundingPrimitive = concreteBlock };
|
||||
primitives.Add(point);
|
||||
point = new PointPrimitive(reinforcement) { CenterX = xs[0], CenterY = ys[1], Area = area2, Name = "Left top point" };
|
||||
point = new ReinforcementPrimitive() { CenterX = xs[0], CenterY = ys[1], Area = area2, Name = "Left top point", HeadMaterial = reinforcement, SurroundingPrimitive = concreteBlock };
|
||||
primitives.Add(point);
|
||||
point = new PointPrimitive(reinforcement) { CenterX = xs[1], CenterY = ys[1], Area = area2, Name = "Right top point" };
|
||||
point = new ReinforcementPrimitive() { CenterX = xs[1], CenterY = ys[1], Area = area2, Name = "Right top point", HeadMaterial = reinforcement, SurroundingPrimitive = concreteBlock };
|
||||
primitives.Add(point);
|
||||
return primitives;
|
||||
}
|
||||
@@ -82,9 +83,9 @@ namespace StructureHelperLogics.Models.Templates.CrossSections.RCs
|
||||
double dist = (xs[1] - xs[0]) / count;
|
||||
for (int i = 1; i < count; i++)
|
||||
{
|
||||
point = new PointPrimitive(reinforcement) { CenterX = xs[0] + dist * i, CenterY = ys[0], Area = area1, Name = $"Bottom point {i}" };
|
||||
point = new ReinforcementPrimitive() { CenterX = xs[0] + dist * i, CenterY = ys[0], Area = area1, Name = $"Bottom point {i}", HeadMaterial = reinforcement, SurroundingPrimitive = concreteBlock };
|
||||
primitives.Add(point);
|
||||
point = new PointPrimitive(reinforcement) { CenterX = xs[0] + dist * i, CenterY = ys[1], Area = area2, Name = $"Top point {i}" };
|
||||
point = new ReinforcementPrimitive() { CenterX = xs[0] + dist * i, CenterY = ys[1], Area = area2, Name = $"Top point {i}", HeadMaterial = reinforcement, SurroundingPrimitive = concreteBlock };
|
||||
primitives.Add(point);
|
||||
}
|
||||
}
|
||||
@@ -94,9 +95,9 @@ namespace StructureHelperLogics.Models.Templates.CrossSections.RCs
|
||||
double dist = (ys[1] - ys[0]) / count;
|
||||
for (int i = 1; i < count; i++)
|
||||
{
|
||||
point = new PointPrimitive(reinforcement) { CenterX = xs[0], CenterY = ys[0] + dist * i, Area = area1, Name = $"Left point {i}" };
|
||||
point = new ReinforcementPrimitive() { CenterX = xs[0], CenterY = ys[0] + dist * i, Area = area1, Name = $"Left point {i}", HeadMaterial = reinforcement, SurroundingPrimitive = concreteBlock };
|
||||
primitives.Add(point);
|
||||
point = new PointPrimitive(reinforcement) { CenterX = xs[1], CenterY = ys[0] + dist * i, Area = area1, Name = $"Right point {i}" };
|
||||
point = new ReinforcementPrimitive() { CenterX = xs[1], CenterY = ys[0] + dist * i, Area = area1, Name = $"Right point {i}", HeadMaterial = reinforcement, SurroundingPrimitive = concreteBlock };
|
||||
primitives.Add(point);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -37,10 +37,14 @@ namespace StructureHelperLogics.Models.Templates.CrossSections.RCs
|
||||
var materials = materialLogic.GetHeadMaterials();
|
||||
geometryLogic.HeadMaterials = materials;
|
||||
primitives = geometryLogic.GetNdmPrimitives();
|
||||
foreach (var primitive in primitives)
|
||||
{
|
||||
primitive.CrossSection = section;
|
||||
}
|
||||
repository.HeadMaterials.AddRange(materials);
|
||||
repository.Primitives.AddRange(primitives);
|
||||
combinations = forceLogic.GetCombinationList();
|
||||
repository.ForceCombinationLists.AddRange(combinations);
|
||||
repository.ForceActions.AddRange(combinations);
|
||||
calculators = calculatorLogic.GetNdmCalculators();
|
||||
AddAllForcesToCalculators();
|
||||
AddAllPrimitivesToCalculator();
|
||||
@@ -55,7 +59,7 @@ namespace StructureHelperLogics.Models.Templates.CrossSections.RCs
|
||||
if (calculator is IHasForceCombinations)
|
||||
{
|
||||
var forceCalculator = calculator as IHasForceCombinations;
|
||||
forceCalculator.ForceCombinationLists.AddRange(combinations);
|
||||
forceCalculator.ForceActions.AddRange(combinations);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user