| 71 | } |
| 72 | |
| 73 | void TestingZ_Double() |
| 74 | { |
| 75 | PathsD subject, solution; |
| 76 | MyClass mc; |
| 77 | ClipperD c; |
| 78 | |
| 79 | subject.push_back(MakePathD({ 100, 50, 10, 79, 65, 2, 65, 98, 10, 21 })); |
| 80 | c.AddSubject(subject); |
| 81 | c.SetZCallback( |
| 82 | std::bind(&MyClass::myZCBD, mc, std::placeholders::_1, |
| 83 | std::placeholders::_2, std::placeholders::_3, |
| 84 | std::placeholders::_4, std::placeholders::_5)); |
| 85 | c.Execute(ClipType::Union, FillRule::NonZero, solution); |
| 86 | |
| 87 | SvgWriter svg; |
| 88 | SvgAddSubject(svg, subject, FillRule::NonZero); |
| 89 | if (solution.size() > 0) |
| 90 | { |
| 91 | // draw circles around intersection points |
| 92 | PathsD ellipses; |
| 93 | double r = 3.0; |
| 94 | for (const PointD& pt : solution[0]) |
| 95 | if (pt.z == 1) |
| 96 | ellipses.push_back(Ellipse(RectD(pt.x - r, pt.y - r, |
| 97 | pt.x + r, pt.y + r), 11)); |
| 98 | |
| 99 | SvgAddSolution(svg, ellipses, FillRule::NonZero, false); |
| 100 | } |
| 101 | SvgSaveToFile(svg, "usingz_double.svg", 320, 320, 0); |
| 102 | System("usingz_double.svg"); |
| 103 | } |
| 104 | |
| 105 | void System(const std::string &filename) |
| 106 | { |
no test coverage detected