void BoundAxisEdgeByRect(Rectangle rectangle, AxisEdge axisEdge)
 {
     if (axisEdge != null && axisEdge.Direction == NudgingDirection)
     {
         if (NudgingDirection == Directions.North)
         {
             axisEdge.BoundFromLeft(rectangle.Left);
             axisEdge.BoundFromRight(rectangle.Right);
         }
         else
         {
             axisEdge.BoundFromLeft(-rectangle.Top);
             axisEdge.BoundFromRight(-rectangle.Bottom);
         }
     }
 }
 void BoundAxisByPoint(Point point, AxisEdge axisEdge)
 {
     if (axisEdge != null && axisEdge.Direction == NudgingDirection)
     {
         if (NudgingDirection == Directions.North)
         {
             axisEdge.BoundFromLeft(point.X);
             axisEdge.BoundFromRight(point.X);
         }
         else
         {
             axisEdge.BoundFromLeft(-point.Y);
             axisEdge.BoundFromRight(-point.Y);
         }
     }
 }
示例#3
0
        void ConstraintEdgeWithObstaclesAtZFromLeft(AxisEdge edge, Point point)
        {
            //    ShowNudgedSegAndPoint(point, nudgedSegment);
            var node = GetActiveSideFromLeft(point);

            if (node == null)
            {
                return;
            }
            if (NotRestricting(edge, ((RightObstacleSide)node.Item).Polyline))
            {
                return;
            }
            var x = ObstacleSideComparer.IntersectionOfSideAndSweepLine(node.Item);

            edge.BoundFromLeft(x * DirectionPerp);
        }
 void BoundAxisEdgeByRect(Rectangle rectangle, AxisEdge axisEdge) {
     if (axisEdge != null && axisEdge.Direction == NudgingDirection)
         if (NudgingDirection == Directions.North) {
             axisEdge.BoundFromLeft(rectangle.Left);
             axisEdge.BoundFromRight(rectangle.Right);
         } else {
             axisEdge.BoundFromLeft(-rectangle.Top);
             axisEdge.BoundFromRight(-rectangle.Bottom);
         }
 }
 void BoundAxisByPoint(Point point, AxisEdge axisEdge) {
     if (axisEdge != null && axisEdge.Direction == NudgingDirection)
         if (NudgingDirection == Directions.North) {
             axisEdge.BoundFromLeft(point.X);
             axisEdge.BoundFromRight(point.X);
         } else {
             axisEdge.BoundFromLeft(-point.Y);
             axisEdge.BoundFromRight(-point.Y);
         }
 }