skia2/experimental/Intersection/QuadraticIntersection_TestData.cpp

101 lines
2.7 KiB
C++
Raw Normal View History

work in progress for shape operations A experimental/Intersection A experimental/Intersection/Intersections.h A experimental/Intersection/DataTypes.cpp A experimental/Intersection/QuadraticReduceOrder.cpp A experimental/Intersection/IntersectionUtilities.cpp A experimental/Intersection/CubicIntersection_Tests.h A experimental/Intersection/LineParameteters_Test.cpp A experimental/Intersection/ReduceOrder.cpp A experimental/Intersection/QuadraticIntersection.cpp A experimental/Intersection/Extrema.h A experimental/Intersection/CubicIntersection_TestData.h A experimental/Intersection/QuadraticParameterization_Test.cpp A experimental/Intersection/TestUtilities.cpp A experimental/Intersection/CubicRoots.cpp A experimental/Intersection/QuadraticParameterization.cpp A experimental/Intersection/QuadraticSubDivide.cpp A experimental/Intersection/LineIntersection_Test.cpp A experimental/Intersection/LineIntersection.cpp A experimental/Intersection/CubicParameterizationCode.cpp A experimental/Intersection/LineParameters.h A experimental/Intersection/CubicIntersection.h A experimental/Intersection/CubeRoot.cpp A experimental/Intersection/SkAntiEdge.h A experimental/Intersection/ConvexHull_Test.cpp A experimental/Intersection/CubicBezierClip_Test.cpp A experimental/Intersection/CubicIntersection_Tests.cpp A experimental/Intersection/CubicBezierClip.cpp A experimental/Intersection/CubicIntersectionT.cpp A experimental/Intersection/Inline_Tests.cpp A experimental/Intersection/ReduceOrder_Test.cpp A experimental/Intersection/QuadraticIntersection_TestData.h A experimental/Intersection/DataTypes.h A experimental/Intersection/Extrema.cpp A experimental/Intersection/EdgeApp.cpp A experimental/Intersection/CubicIntersection_TestData.cpp A experimental/Intersection/IntersectionUtilities.h A experimental/Intersection/CubicReduceOrder.cpp A experimental/Intersection/CubicCoincidence.cpp A experimental/Intersection/CubicIntersection_Test.cpp A experimental/Intersection/CubicIntersection.cpp A experimental/Intersection/QuadraticUtilities.h A experimental/Intersection/SkAntiEdge.cpp A experimental/Intersection/TestUtilities.h A experimental/Intersection/CubicParameterization_Test.cpp A experimental/Intersection/LineIntersection.h A experimental/Intersection/CubicSubDivide.cpp A experimental/Intersection/CubicParameterization.cpp A experimental/Intersection/QuadraticBezierClip_Test.cpp A experimental/Intersection/QuadraticBezierClip.cpp A experimental/Intersection/BezierClip_Test.cpp A experimental/Intersection/ConvexHull.cpp A experimental/Intersection/BezierClip.cpp A experimental/Intersection/QuadraticIntersection_TestData.cpp git-svn-id: http://skia.googlecode.com/svn/trunk@3005 2bbb7eff-a529-9590-31e7-b0007b416f81
2012-01-10 21:46:10 +00:00
/*
* QuadraticIntersection_TestData.cpp
* edge
*
* Created by Cary Clark on 1/10/12.
* Copyright 2012 __MyCompanyName__. All rights reserved.
*
*/
#include "QuadraticIntersection_TestData.h"
const Quadratic quadraticLines[] = {
{{0, 0}, {0, 0}, {1, 0}},
{{0, 0}, {1, 0}, {0, 0}},
{{1, 0}, {0, 0}, {0, 0}},
{{1, 0}, {2, 0}, {3, 0}},
{{0, 0}, {0, 0}, {0, 1}},
{{0, 0}, {0, 1}, {0, 0}},
{{0, 1}, {0, 0}, {0, 0}},
{{0, 1}, {0, 2}, {0, 3}},
{{0, 0}, {0, 0}, {1, 1}},
{{0, 0}, {1, 1}, {0, 0}},
{{1, 1}, {0, 0}, {0, 0}},
{{1, 1}, {2, 2}, {3, 3}},
{{1, 1}, {3, 3}, {3, 3}},
{{1, 1}, {1, 1}, {2, 2}},
{{1, 1}, {2, 2}, {1, 1}},
{{1, 1}, {1, 1}, {3, 3}},
{{1, 1}, {2, 2}, {4, 4}}, // no coincident
{{1, 1}, {3, 3}, {4, 4}},
{{1, 1}, {3, 3}, {2, 2}},
{{1, 1}, {4, 4}, {2, 2}},
{{1, 1}, {4, 4}, {3, 3}},
{{2, 2}, {1, 1}, {3, 3}},
{{2, 2}, {1, 1}, {4, 4}},
{{2, 2}, {3, 3}, {1, 1}},
{{2, 2}, {3, 3}, {4, 4}},
{{2, 2}, {4, 4}, {1, 1}},
{{2, 2}, {4, 4}, {3, 3}},
};
const size_t quadraticLines_count = sizeof(quadraticLines) / sizeof(quadraticLines[0]);
static const double F = PointEpsilon * 3;
static const double H = PointEpsilon * 4;
static const double J = PointEpsilon * 5;
static const double K = PointEpsilon * 8; // INVESTIGATE: why are larger multiples necessary?
const Quadratic quadraticModEpsilonLines[] = {
{{0, F}, {0, 0}, {1, 0}},
{{0, 0}, {1, 0}, {0, F}},
{{1, 0}, {0, F}, {0, 0}},
{{1, H}, {2, 0}, {3, 0}},
{{F, 0}, {0, 0}, {0, 1}},
{{0, 0}, {0, 1}, {F, 0}},
{{0, 1}, {F, 0}, {0, 0}},
{{H, 1}, {0, 2}, {0, 3}},
{{0, F}, {0, 0}, {1, 1}},
{{0, 0}, {1, 1}, {F, 0}},
{{1, 1}, {F, 0}, {0, 0}},
{{1, 1+J}, {2, 2}, {3, 3}},
{{1, 1}, {3, 3}, {3+F, 3}},
{{1, 1}, {1+F, 1}, {2, 2}},
{{1, 1}, {2, 2}, {1, 1+F}},
{{1, 1}, {1, 1+F}, {3, 3}},
{{1+H, 1}, {2, 2}, {4, 4}}, // no coincident
{{1, 1+K}, {3, 3}, {4, 4}},
{{1, 1}, {3+F, 3}, {2, 2}},
{{1, 1}, {4, 4+F}, {2, 2}},
{{1, 1}, {4, 4}, {3+F, 3}},
{{2, 2}, {1, 1}, {3, 3+F}},
{{2+F, 2}, {1, 1}, {4, 4}},
{{2, 2+F}, {3, 3}, {1, 1}},
{{2, 2}, {3+F, 3}, {4, 4}},
{{2, 2}, {4, 4+F}, {1, 1}},
{{2, 2}, {4, 4}, {3+F, 3}},
};
const size_t quadraticModEpsilonLines_count = sizeof(quadraticModEpsilonLines) / sizeof(quadraticModEpsilonLines[0]);
const Quadratic quadraticTests[][2] = {
{ // one intersection
{{0, 0},
{0, 1},
{1, 1}},
{{0, 1},
{0, 0},
{1, 0}}
},
{ // four intersections
{{1, 0},
{2, 6},
{3, 0}},
{{0, 1},
{6, 2},
{0, 3}}
}
};
const size_t quadraticTests_count = sizeof(quadraticTests) / sizeof(quadraticTests[0]);