/// <summary> /// Generate a preview or a wire route from a joint to an end point. /// </summary> /// <param name="joint">The joint to start the preview.</param> /// <param name="userHint">The user hint for the direction they want the wire to route.</param> /// <param name="point">The end point of the wire.</param> /// <param name="isBranchingOperation"> Is the start joint a branch of already routed wire</param> /// <param name="retainPreviousRoute"> Indicates if the userHint's direction must be the enddirection.</param> public IList <DiagramPoint> PreviewRouteWireToPoint(WireJoint joint, WireRouteHint userHint, WireRouteDirections endDirections, DiagramPoint point, bool isBranchingOperation, bool retainPreviousRoute) { return(PreviewRouteWireToPoint(joint, userHint, endDirections, point, isBranchingOperation, retainPreviousRoute, false)); }
/// <summary> /// Previews the route wire to point. /// </summary> /// <param name="joint">The joint.</param> /// <param name="userHint">The user hint.</param> /// <param name="endDirections">The end directions.</param> /// <param name="point">The point.</param> /// <param name="isBranchingOperation">if set to <c>true</c> [is branching operation].</param> /// <param name="retainPreviousRoute">if set to <c>true</c> [retain previous route].</param> /// <param name="forceLayout">if set to <c>true</c> [force layout].</param> /// <returns>List of Diagram Points</returns> public IList <DiagramPoint> PreviewRouteWireToPoint(WireJoint joint, WireRouteHint userHint, WireRouteDirections endDirections, DiagramPoint point, bool isBranchingOperation, bool retainPreviousRoute, bool forceLayout) { SMPoint p = point.TransformTo(joint.Wire.Diagram).Point; double dx = p.X - joint.X; double dy = p.Y - joint.Y; // if the points are on top of each other do nothing if (WireJoint.JointEqual((float)dx, 0) && WireJoint.JointEqual((float)dy, 0)) { return(new List <DiagramPoint>()); } return(new List <DiagramPoint>(new[] { point })); }
/// <summary> /// Route the given wire in the current diagram. /// </summary> /// <param name="wire">The wire to be routed.</param> /// <param name="startDiagramPoint">The start Diagram Point, the point where the route starts.</param> /// <param name="endDiagramPoint">The end DiagramPoint, the point where the route ends.</param> /// <param name="startDirections">The hint direction from the start point.</param> /// <param name="endDirections">The hint direction to the end point.</param> /// <param name="startTerminal">The start terminal.</param> /// <param name="endTerminal">The end terminal.</param> /// <param name="purpose">Is the layout being called for cleanup wire operation or for preview operation (the later might give a very quick but rough intermediate results sometimes)</param> /// <param name="userHint">The user hint direction to the end point.</param> /// <param name="endingWireSegment">If the layout is ending on a wire then the segment on which it is ending (for merging operations)</param> /// <param name="isBranchingOperation">If the layout is branching off from an already existing wire</param> /// <returns> /// A list of diagram points that form the route. /// </returns> /// <remarks> /// Provides the routed path using the designated algorithm(if auto-routing is enabled), /// else it returns the Manhattan route"L". /// </remarks> public IList <DiagramPoint> PreviewRouteWire(Wire wire, DiagramPoint startDiagramPoint, DiagramPoint endDiagramPoint, WireRouteDirections startDirections, WireRouteDirections endDirections, Terminal startTerminal, Terminal endTerminal, WireRoutingPurpose purpose, WireRouteDirections userHint, WireSegment endingWireSegment, bool isBranchingOperation) { return(new List <DiagramPoint>()); }