RemoveUnderlying property for primitives was added

This commit is contained in:
Evgeny Redikultsev
2023-03-05 19:50:24 +05:00
parent b29d7bfd58
commit edb8afe321
41 changed files with 693 additions and 160 deletions

View File

@@ -30,9 +30,11 @@ namespace StructureHelperLogics.NdmCalculations.Primitives
public double Width { get; set; }
public double Height { get; set; }
public double Angle { get; set; }
public bool ClearUnderlying { get; set; }
public bool Triangulate { get; set; }
public IVisualProperty VisualProperty { get; }
public RectanglePrimitive()
{
Name = "New Rectangle";
@@ -41,6 +43,8 @@ namespace StructureHelperLogics.NdmCalculations.Primitives
VisualProperty = new VisualProperty { Opacity = 0.8d};
UsersPrestrain = new StrainTuple();
AutoPrestrain = new StrainTuple();
ClearUnderlying = false;
Triangulate = true;
}
public RectanglePrimitive(IHeadMaterial material) : this() { HeadMaterial = material; }
@@ -48,6 +52,7 @@ namespace StructureHelperLogics.NdmCalculations.Primitives
public object Clone()
{
var primitive = new RectanglePrimitive();
NdmPrimitivesService.CopyNdmProperties(this, primitive);
NdmPrimitivesService.CopyDivisionProperties(this, primitive);
ShapeService.CopyRectangleProperties(this, primitive);
return primitive;
@@ -66,5 +71,19 @@ namespace StructureHelperLogics.NdmCalculations.Primitives
{
throw new NotImplementedException();
}
public bool IsPointInside(IPoint2D point)
{
var xMax = CenterX + Width / 2;
var xMin = CenterX - Width / 2;
var yMax = CenterY + Height / 2;
var yMin = CenterY - Height / 2;
if (point.X > xMax ||
point.X < xMin ||
point.Y > yMax ||
point.Y < yMin)
{ return false; }
return true;
}
}
}