Exemplo n.º 1
0
        public override StepPatternEvaluationResult Evaluate(Point?lastStepEndPoint, List <Line> lines, StepContext context)
        {
            if (lines.Count == 0)
            {
                return(new StepPatternEvaluationResult(false, null));
            }

            var line = lines.First();

            var dx = line.P2.X - line.P1.X;
            var dy = line.P2.Y - line.P1.Y;

            var acceptedSlopeDiff = Math.Abs(dx * Settings.AcceptedSlopeRatio);

            if (dx < Settings.UnitValue && Math.Abs(dy) < acceptedSlopeDiff && PopLine(lines, context))
            {
                return(new StepPatternEvaluationResult(true, line.P2));
            }

            return(new StepPatternEvaluationResult(false, null));
        }
Exemplo n.º 2
0
        public override StepPatternEvaluationResult Evaluate(Point?lastStepEndPoint, List <Line> lines, StepContext context)
        {
            if (lines.Count == 0)
            {
                return(new StepPatternEvaluationResult(false, null));
            }

            var line = lines.First();

            var dx = line.P2.X - line.P1.X;
            var dy = line.P2.Y - line.P1.Y;

            if (dx < -Settings.UnitValue &&
                dy < -Settings.UnitValue &&
                PopLine(lines, context))
            {
                return(new StepPatternEvaluationResult(true, line.P2));
            }

            return(new StepPatternEvaluationResult(false, line.P2));
        }