/// <summary> /// Creates a point on a linear figure (ILinearFigure) /// </summary> /// <param name="drawing">Drawing to add the figure to</param> /// <param name="figure">A linear figure such as a line or a circle</param> /// <param name="parameter">A double parameter that defines the /// position of the point on the figure /// [0, 2 * PI) for circles, [0, 1] for segments, etc. </param> /// <returns>The newly created point on the figure</returns> public static PointOnFigure CreatePointOnFigure(Drawing drawing, IFigure figure, double parameter) { var result = new PointOnFigure() { Drawing = drawing, Dependencies = new [] { figure }, }; result.Parameter = parameter; return(result); }
/// <summary> /// Creates a point on a linear figure (ILinearFigure) /// </summary> /// <param name="drawing">Drawing to add the figure to</param> /// <param name="iFigure">A linear figure such as a line or a circle</param> /// <param name="point">Hint point coordinates - this point will be /// projected on to the figure if it's not already on it</param> /// <returns>The newly created point on the figure</returns> public static PointOnFigure CreatePointOnFigure(Drawing drawing, IFigure iFigure, Point point) { var result = new PointOnFigure() { Drawing = drawing, Dependencies = new [] { iFigure }, }; result.Parameter = result.LinearFigure.GetNearestParameterFromPoint(point); return(result); }
List <IFigure> GetFiguresToRecalculate(PointOnFigure pointOnFigure, IPoint dependentPoint) { return(DependencyAlgorithms.FindImpactedDependencyChain(pointOnFigure, dependentPoint)); }