Add inclined section visualization
This commit is contained in:
@@ -3,6 +3,7 @@ using StructureHelperCommon.Infrastructures.Interfaces;
|
||||
using StructureHelperCommon.Models;
|
||||
using StructureHelperCommon.Models.Materials;
|
||||
using StructureHelperCommon.Models.Shapes;
|
||||
using StructureHelperCommon.Models.VisualProperties;
|
||||
using StructureHelperLogics.Models.BeamShears;
|
||||
using StructureHelperLogics.Models.Materials;
|
||||
|
||||
@@ -15,6 +16,7 @@ namespace DataAccess.DTOs
|
||||
private IConvertStrategy<ConcreteLibMaterial, ConcreteLibMaterialDTO> concreteConvertStrategy;
|
||||
private IConvertStrategy<ReinforcementLibMaterial, ReinforcementLibMaterialDTO> reinforcementConvertStrategy;
|
||||
private IUpdateStrategy<IHelperMaterial> safetyFactorUpdateStrategy;
|
||||
private IUpdateStrategy<IHasVisualProperty> visualUpdateStrategy;
|
||||
|
||||
|
||||
public BeamShearSectionFromDTOConvertStrategy(Dictionary<(Guid id, Type type), ISaveable> referenceDictionary, IShiftTraceLogger traceLogger) : base(referenceDictionary, traceLogger)
|
||||
@@ -38,6 +40,7 @@ namespace DataAccess.DTOs
|
||||
throw new StructureHelperException(ErrorStrings.ObjectTypeIsUnknownObj(source.ReinforcementMaterial));
|
||||
}
|
||||
NewItem.ReinforcementMaterial = reinforcementConvertStrategy.Convert(reinforcement);
|
||||
visualUpdateStrategy.Update(NewItem, source);
|
||||
return NewItem;
|
||||
}
|
||||
|
||||
@@ -57,6 +60,7 @@ namespace DataAccess.DTOs
|
||||
TraceLogger = TraceLogger
|
||||
};
|
||||
safetyFactorUpdateStrategy = new HelperMaterialDTOSafetyFactorUpdateStrategy(new MaterialSafetyFactorsFromDTOLogic());
|
||||
visualUpdateStrategy = new HasVisualPropertyFromDTOUpdateStrategy(ReferenceDictionary, TraceLogger);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
using StructureHelperCommon.Models;
|
||||
using StructureHelperCommon.Models.Materials;
|
||||
using StructureHelperCommon.Models.Shapes;
|
||||
using StructureHelperCommon.Models.VisualProperties;
|
||||
using StructureHelperLogics.Models.BeamShears;
|
||||
using StructureHelperLogics.Models.Materials;
|
||||
|
||||
@@ -14,6 +15,7 @@ namespace DataAccess.DTOs
|
||||
private IConvertStrategy<ConcreteLibMaterialDTO, IConcreteLibMaterial> concreteConvertStrategy;
|
||||
private ReinforcementLibMaterialToDTOConvertStrategy reinforcementConvertStrategy;
|
||||
private IUpdateStrategy<IHelperMaterial> safetyFactorUpdateStrategy;
|
||||
private IUpdateStrategy<IHasVisualProperty> visualUpdateStrategy;
|
||||
|
||||
public BeamShearSectionToDTOConvertStrategy(Dictionary<(Guid id, Type type), ISaveable> referenceDictionary, IShiftTraceLogger traceLogger)
|
||||
: base(referenceDictionary, traceLogger)
|
||||
@@ -46,6 +48,7 @@ namespace DataAccess.DTOs
|
||||
NewItem.ReinforcementMaterial = reinforcementConvertStrategy.Convert(source.ReinforcementMaterial);
|
||||
safetyFactorUpdateStrategy.Update(NewItem.ReinforcementMaterial, source.ReinforcementMaterial);
|
||||
TraceLogger?.AddMessage($"Beam shear section converting Id = {NewItem.Id} has been finished succesfully", TraceLogStatuses.Debug);
|
||||
visualUpdateStrategy.Update(NewItem, source);
|
||||
}
|
||||
|
||||
private void InitializeStrategies()
|
||||
@@ -62,6 +65,7 @@ namespace DataAccess.DTOs
|
||||
TraceLogger = TraceLogger
|
||||
};
|
||||
safetyFactorUpdateStrategy = new HelperMaterialDTOSafetyFactorUpdateStrategy(new MaterialSafetyFactorToDTOLogic());
|
||||
visualUpdateStrategy = new HasVisualPropertyToDTOUpdateStrategy(ReferenceDictionary, TraceLogger);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -11,6 +11,7 @@ namespace DataAccess.DTOs
|
||||
private IShiftTraceLogger traceLogger;
|
||||
private IConvertStrategy<PrimitiveVisualPropertyDTO, IPrimitiveVisualProperty> convertStrategy;
|
||||
|
||||
|
||||
public HasVisualPropertyToDTOUpdateStrategy(Dictionary<(Guid id, Type type), ISaveable> referenceDictionary, IShiftTraceLogger traceLogger)
|
||||
{
|
||||
this.referenceDictionary = referenceDictionary;
|
||||
|
||||
@@ -1,7 +1,9 @@
|
||||
using Newtonsoft.Json;
|
||||
using StructureHelperCommon.Models.Shapes;
|
||||
using StructureHelperCommon.Models.VisualProperties;
|
||||
using StructureHelperLogics.Models.BeamShears;
|
||||
using StructureHelperLogics.Models.Materials;
|
||||
using System.Windows.Media;
|
||||
|
||||
//Copyright (c) 2025 Redikultsev Evgeny, Ekaterinburg, Russia
|
||||
//All rights reserved.
|
||||
@@ -24,10 +26,15 @@ namespace DataAccess.DTOs
|
||||
public double ReinforcementArea { get; set; }
|
||||
[JsonProperty("ReinforcementMaterial")]
|
||||
public IReinforcementLibMaterial ReinforcementMaterial { get; set; } = new ReinforcementLibMaterial(Guid.NewGuid());
|
||||
public IPrimitiveVisualProperty VisualProperty { get; set; }
|
||||
|
||||
public BeamShearSectionDTO(Guid id)
|
||||
{
|
||||
Id = id;
|
||||
VisualProperty = new PrimitiveVisualPropertyDTO(Guid.NewGuid())
|
||||
{
|
||||
Color = (Color)ColorConverter.ConvertFromString("DarkGray")
|
||||
};
|
||||
}
|
||||
|
||||
public object Clone()
|
||||
|
||||
@@ -36,7 +36,7 @@ namespace DataAccess.DTOs
|
||||
Id = id;
|
||||
VisualProperty = new PrimitiveVisualPropertyDTO(Guid.NewGuid())
|
||||
{
|
||||
Color = (Color)ColorConverter.ConvertFromString("Black")
|
||||
Color = (Color)ColorConverter.ConvertFromString("Brown")
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user