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

Method SetZ

CPP/Clipper2Lib/src/clipper.engine.cpp:805–828  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

803
804#ifdef USINGZ
805 void ClipperBase::SetZ(const Active& e1, const Active& e2, Point64& ip)
806 {
807 if (!zCallback_) return;
808 // prioritize subject over clip vertices by passing
809 // subject vertices before clip vertices in the callback
810 if (GetPolyType(e1) == PathType::Subject)
811 {
812 if (ip == e1.bot) ip.z = e1.bot.z;
813 else if (ip == e1.top) ip.z = e1.top.z;
814 else if (ip == e2.bot) ip.z = e2.bot.z;
815 else if (ip == e2.top) ip.z = e2.top.z;
816 else ip.z = DefaultZ;
817 zCallback_(e1.bot, e1.top, e2.bot, e2.top, ip);
818 }
819 else
820 {
821 if (ip == e2.bot) ip.z = e2.bot.z;
822 else if (ip == e2.top) ip.z = e2.top.z;
823 else if (ip == e1.bot) ip.z = e1.bot.z;
824 else if (ip == e1.top) ip.z = e1.top.z;
825 else ip.z = DefaultZ;
826 zCallback_(e2.bot, e2.top, e1.bot, e1.top, ip);
827 }
828 }
829#endif
830
831 void ClipperBase::AddPath(const Path64& path, PathType polytype, bool is_open)

Callers

nothing calls this directly

Calls 1

GetPolyTypeFunction · 0.85

Tested by

no test coverage detected