using System.Collections.Generic;
using System.Drawing;
using Deltares.Geometry;
using Deltares.Geometry.Forms;
using Deltares.Mathematics;
using Deltares.Standard;
using Deltares.Standard.Forms;
namespace Deltares.Dam.Forms
{
public class RedesignedSurfaceLineDrawingObject : DrawingObject
{
private GeometryPointString redesignedSurfaceLine = null;
private Color color = Color.Lime;
///
/// Initializes a new instance of the class.
///
public RedesignedSurfaceLineDrawingObject()
{
this.Layer = -50;
}
///
/// Gets or sets the color.
///
///
/// The color.
///
public Color Color
{
get { return color; }
set { color = value; }
}
///
/// Sets the data object.
///
/// The data object.
public override void SetDataObject(object dataObject)
{
this.redesignedSurfaceLine = (GeometryPointString)dataObject;
}
///
/// Gets the data object.
///
///
public override object GetDataObject()
{
return redesignedSurfaceLine;
}
///
/// override The Draw3D() Method
///
///
public override void Draw3D(GraphicsInfo info)
{
if (redesignedSurfaceLine != null)
{
DrawingSupport.SetIEPDraw3D(info.Graphics);
DrawingSupport.ColorMaterial3D(Color.CornflowerBlue);
DrawingSupport.Brush3D(Color.Black);
IList pointList = redesignedSurfaceLine.Points;
DrawingSupport.Pen3D(System.Drawing.Drawing2D.DashStyle.Dot, 3, color);
//ValidatePoint(pointList);
for (int curveIndex = 0; curveIndex < pointList.Count - 1; curveIndex++)
{
var calculatedPoint = new Point3D();
var calculatedPoint1 = new Point3D();
this.GetScaled3DPoint(info.Projection, pointList[curveIndex].GetPoint3D(), ref calculatedPoint);
this.GetScaled3DPoint(info.Projection, pointList[curveIndex + 1].GetPoint3D(), ref calculatedPoint1);
DrawingSupport.Line3D(calculatedPoint.X, calculatedPoint.Y, calculatedPoint.Z, calculatedPoint1.X, calculatedPoint1.Y, calculatedPoint1.Z);
}
}
}
}
}