MCPcopy Create free account
hub / github.com/AngusJohnson/Clipper2 / TestingZ_Int64

Function TestingZ_Int64

CPP/Examples/UsingZ/UsingZ.cpp:41–71  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

39}
40
41void TestingZ_Int64()
42{
43
44 Paths64 subject, solution;
45 MyClass mc;
46 Clipper64 c64;
47
48 subject.push_back(MakePath({ 100, 50, 10, 79, 65, 2, 65, 98, 10, 21 }));
49 c64.AddSubject(subject);
50 c64.SetZCallback(
51 std::bind(&MyClass::myZCB, mc, std::placeholders::_1,
52 std::placeholders::_2, std::placeholders::_3,
53 std::placeholders::_4, std::placeholders::_5));
54 c64.Execute(ClipType::Union, FillRule::NonZero, solution);
55
56 SvgWriter svg;
57 SvgAddSolution(svg, solution, FillRule::NonZero, false);
58 if (solution.size() > 0) {
59 // draw circles around intersection points - flagged by z == 1
60 PathsD ellipses;
61 double r = 3.0;
62 for (const Point64& pt : solution[0])
63 if (pt.z == 1)
64 {
65 ellipses.push_back(Ellipse(RectD(pt.x - r, pt.y - r, pt.x + r, pt.y + r), 11));
66 }
67 SvgAddClip(svg, ellipses, FillRule::NonZero);
68 }
69 SvgSaveToFile(svg, "usingz_int64.svg", 800, 600, 20);
70 System("usingz_int64.svg");
71}
72
73void TestingZ_Double()
74{

Callers

nothing calls this directly

Calls 10

MakePathFunction · 0.85
SvgAddSolutionFunction · 0.85
EllipseFunction · 0.85
RectDClass · 0.85
SvgAddClipFunction · 0.85
SvgSaveToFileFunction · 0.85
SystemFunction · 0.70
AddSubjectMethod · 0.45
SetZCallbackMethod · 0.45
ExecuteMethod · 0.45

Tested by

no test coverage detected