16 template <
typename Real>
46 template <
typename Real>
53 result.intersect =
false;
58 auto ccResult = ccQuery(circle0, circle1);
59 if (!ccResult.intersect)
62 result.configuration = NO_INTERSECTION;
66 if (ccResult.numIntersections == std::numeric_limits<int>::max())
71 if (arc1.Contains(arc0.end[0]))
73 result.intersect =
true;
74 if (arc1.Contains(arc0.end[1]))
76 if (arc0.Contains(arc1.end[0]) && arc0.Contains(arc1.end[1]))
79 if (arc0.end[0] != arc1.end[1])
81 if (arc1.end[0] != arc0.end[1])
85 result.configuration = COCIRCULAR_TWO_ARCS;
86 result.arc[0] =
Arc2<Real>(arc0.center, arc0.radius, arc0.end[0], arc1.end[1]);
87 result.arc[1] =
Arc2<Real>(arc0.center, arc0.radius, arc1.end[0], arc0.end[1]);
93 result.configuration = COCIRCULAR_ONE_POINT_ONE_ARC;
94 result.point[0] = arc0.end[1];
95 result.arc[0] =
Arc2<Real>(arc0.center, arc0.radius, arc0.end[0], arc1.end[1]);
100 if (arc1.end[0] != arc0.end[1])
104 result.configuration = COCIRCULAR_ONE_POINT_ONE_ARC;
105 result.point[0] = arc0.end[0];
106 result.arc[0] =
Arc2<Real>(arc0.center, arc0.radius, arc1.end[0], arc0.end[1]);
111 result.configuration = COCIRCULAR_TWO_POINTS;
112 result.point[0] = arc0.end[0];
113 result.point[1] = arc0.end[1];
120 result.configuration = COCIRCULAR_ONE_ARC;
121 result.arc[0] = arc0;
126 if (arc0.end[0] != arc1.end[1])
129 result.configuration = COCIRCULAR_ONE_ARC;
130 result.arc[0] =
Arc2<Real>(arc0.center, arc0.radius, arc0.end[0], arc1.end[1]);
135 result.configuration = COCIRCULAR_ONE_POINT;
136 result.point[0] = arc0.end[0];
142 if (arc1.Contains(arc0.end[1]))
144 result.intersect =
true;
145 if (arc0.end[1] != arc1.end[0])
148 result.configuration = COCIRCULAR_ONE_ARC;
149 result.arc[0] =
Arc2<Real>(arc0.center, arc0.radius, arc1.end[0], arc0.end[1]);
154 result.configuration = COCIRCULAR_ONE_POINT;
155 result.point[0] = arc1.end[0];
160 if (arc0.Contains(arc1.end[0]))
163 result.intersect =
true;
164 result.configuration = COCIRCULAR_ONE_ARC;
165 result.arc[0] = arc1;
170 result.configuration = NO_INTERSECTION;
176 int numIntersections = 0;
177 for (
int i = 0; i < ccResult.numIntersections; ++i)
179 if (arc0.Contains(ccResult.point[i]) && arc1.Contains(ccResult.point[i]))
181 result.point[numIntersections++] = ccResult.point[i];
182 result.intersect =
true;
186 if (numIntersections == 2)
188 result.configuration = NONCOCIRCULAR_TWO_POINTS;
190 else if (numIntersections == 1)
192 result.configuration = NONCOCIRCULAR_ONE_POINT;
196 result.configuration = NO_INTERSECTION;
Result operator()(Type0 const &primitive0, Type1 const &primitive1)