Исправил ошибки триангуляции точки
This commit is contained in:
@@ -6,6 +6,6 @@ namespace StructureHelperLogics.Data.Shapes
|
||||
{
|
||||
public interface IPoint : IShape
|
||||
{
|
||||
double Area { get; set; }
|
||||
double Area { get; }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,7 +4,7 @@ using System.Text;
|
||||
|
||||
namespace StructureHelperLogics.NdmCalculations.Triangulations
|
||||
{
|
||||
interface IPointTiangulationLogic : ITriangulationLogic
|
||||
interface IPointTriangulationLogic : ITriangulationLogic
|
||||
{
|
||||
}
|
||||
}
|
||||
@@ -7,11 +7,11 @@ using System.Text;
|
||||
|
||||
namespace StructureHelperLogics.NdmCalculations.Triangulations
|
||||
{
|
||||
public class PointTriangulationLogic : IPointTiangulationLogic
|
||||
public class PointTriangulationLogic : IPointTriangulationLogic
|
||||
{
|
||||
public ITriangulationLogicOptions Options { get; }
|
||||
|
||||
public PointTriangulationLogic(IPointTriangulationLogicOptions options)
|
||||
public PointTriangulationLogic(ITriangulationLogicOptions options)
|
||||
{
|
||||
Options = options;
|
||||
}
|
||||
|
||||
@@ -62,16 +62,22 @@ namespace StructureHelperLogics.NdmCalculations.Triangulations
|
||||
IShape shape = primitive.Shape;
|
||||
if (shape is IRectangle)
|
||||
{
|
||||
IRectangle rectangle = shape as IRectangle;
|
||||
options = new RectangleTriangulationLogicOptions(primitive);
|
||||
IRectangleTriangulationLogic logic = new RectangleTriangulationLogic(options);
|
||||
ITriangulationLogic logic = new RectangleTriangulationLogic(options);
|
||||
ndms.AddRange(logic.GetNdmCollection(material));
|
||||
}
|
||||
else if (shape is IPoint)
|
||||
{
|
||||
IPoint point = shape as IPoint;
|
||||
options = new PointTriangulationLogicOptions(primitive.Center, point.Area);
|
||||
IPointTriangulationLogic logic = new PointTriangulationLogic(options);
|
||||
ndms.AddRange(logic.GetNdmCollection(material));
|
||||
}
|
||||
else { throw new Exception("Primitive type is not valid"); }
|
||||
return ndms;
|
||||
}
|
||||
|
||||
public static IMaterial GetMaterial(IPrimitiveMaterial primitiveMaterial, ITriangulationOptions options)
|
||||
private static IMaterial GetMaterial(IPrimitiveMaterial primitiveMaterial, ITriangulationOptions options)
|
||||
{
|
||||
IMaterial material;
|
||||
if (primitiveMaterial.MaterialType == MaterialTypes.Concrete) { material = GetConcreteMaterial(primitiveMaterial, options); }
|
||||
|
||||
Reference in New Issue
Block a user