/// <summary> /// Validate a call to the pipeline interface (a state transition) /// </summary> /// <param name="transition">The transition</param> /// <param name="validator">The validator instance</param> internal override void ValidateTransition(PipelineCall transition, NestedValidator validator) { switch (transition) { case PipelineCall.LineTo: if (validator.pointCount != 0) { ThrowExpected(PipelineCall.EndFigure, transition); } return; case PipelineCall.EndFigure: if (validator.pointCount == 0) { ThrowExpected(PipelineCall.BeginFigure, transition); } validator.Jump(PointEnd); return; default: ThrowExpected(PipelineCall.EndFigure, transition); return; } }
/// <summary> /// Validate a call to the pipeline interface (a state transition) /// </summary> /// <param name="transition">The transition</param> /// <param name="validator">The validator instance</param> internal override void ValidateTransition(PipelineCall transition, NestedValidator validator) { switch (transition) { case PipelineCall.BeginFigure: validator.Jump(PointBuilding); return; case PipelineCall.End: validator.Return(); return; default: ThrowExpected(PipelineCall.BeginFigure, PipelineCall.End, transition); return; } }
/// <summary> /// Validate a call to the pipeline interface (a state transition) /// </summary> /// <param name="transition">The transition</param> /// <param name="validator">The validator instance</param> internal override void ValidateTransition(PipelineCall transition, NestedValidator validator) { switch (transition) { case PipelineCall.LineTo: return; case PipelineCall.EndFigure: validator.ringCount += 1; if (validator.processingGeography) { ValidateGeographyPolygon( validator.pointCount, validator.initialFirstCoordinate, validator.initialSecondCoordinate, validator.mostRecentFirstCoordinate, validator.mostRecentSecondCoordinate); } else { ValidateGeometryPolygon( validator.pointCount, validator.initialFirstCoordinate, validator.initialSecondCoordinate, validator.mostRecentFirstCoordinate, validator.mostRecentSecondCoordinate); } validator.Jump(PolygonStart); return; default: ThrowExpected(PipelineCall.LineTo, PipelineCall.EndFigure, transition); return; } }
/// <summary> /// Validate a call to the pipeline interface (a state transition) /// </summary> /// <param name="transition">The transition</param> /// <param name="validator">The validator instance</param> internal override void ValidateTransition( PipelineCall transition, NestedValidator validator) { switch (transition) { case PipelineCall.BeginPoint: validator.Jump(PointStart); return; case PipelineCall.BeginLineString: validator.Jump(LineStringStart); return; case PipelineCall.BeginPolygon: validator.Jump(PolygonStart); return; case PipelineCall.BeginMultiPoint: validator.Jump(MultiPoint); return; case PipelineCall.BeginMultiLineString: validator.Jump(MultiLineString); return; case PipelineCall.BeginMultiPolygon: validator.Jump(MultiPolygon); return; case PipelineCall.BeginCollection: validator.Jump(Collection); return; case PipelineCall.BeginFullGlobe: if (validator.depth != 1) { throw new FormatException(Strings.Validator_FullGlobeInCollection); } validator.Jump(FullGlobe); return; #if CURVE_SUPPORT case Transition.BeginCircularString: Jump(CircularString); return; case Transition.BeginCompoundCurve: Jump(CompoundCurve); return; case Transition.BeginCurvePolygon: Jump(CurvePolygon); return; #endif default: ThrowExpected(PipelineCall.Begin, transition); return; } }
/// <summary> /// Validate a call to the pipeline interface (a state transition) /// </summary> /// <param name="transition">The transition</param> /// <param name="validator">The validator instance</param> internal override void ValidateTransition(PipelineCall transition, NestedValidator validator) { switch (transition) { case PipelineCall.LineTo: return; case PipelineCall.EndFigure: if (validator.pointCount < 2) { throw new FormatException(Strings.Validator_LineStringNeedsTwoPoints); } validator.Jump(LineStringEnd); return; default: ThrowExpected(PipelineCall.LineTo, PipelineCall.EndFigure, transition); return; } }