MCPcopy Create free account
hub / github.com/KratosMultiphysics/Kratos / BuildPathD

Function BuildPathD

external_libraries/clipper/src/clipper.engine.cpp:2967–3011  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2965 }
2966
2967 bool BuildPathD(OutPt* op, bool reverse, bool isOpen, PathD& path, double inv_scale)
2968 {
2969 if (!op || op->next == op || (!isOpen && op->next == op->prev))
2970 return false;
2971
2972 path.resize(0);
2973 Point64 lastPt;
2974 OutPt* op2;
2975 if (reverse)
2976 {
2977 lastPt = op->pt;
2978 op2 = op->prev;
2979 }
2980 else
2981 {
2982 op = op->next;
2983 lastPt = op->pt;
2984 op2 = op->next;
2985 }
2986#ifdef USINGZ
2987 path.push_back(PointD(lastPt.x * inv_scale, lastPt.y * inv_scale, lastPt.z));
2988#else
2989 path.push_back(PointD(lastPt.x * inv_scale, lastPt.y * inv_scale));
2990#endif
2991
2992 while (op2 != op)
2993 {
2994 if (op2->pt != lastPt)
2995 {
2996 lastPt = op2->pt;
2997#ifdef USINGZ
2998 path.push_back(PointD(lastPt.x * inv_scale, lastPt.y * inv_scale, lastPt.z));
2999#else
3000 path.push_back(PointD(lastPt.x * inv_scale, lastPt.y * inv_scale));
3001#endif
3002
3003 }
3004 if (reverse)
3005 op2 = op2->prev;
3006 else
3007 op2 = op2->next;
3008 }
3009 if (path.size() == 3 && IsVerySmallTriangle(*op2)) return false;
3010 return true;
3011 }
3012
3013 void ClipperD::BuildPathsD(PathsD& solutionClosed, PathsD* solutionOpen)
3014 {

Callers 2

BuildPathsDMethod · 0.85
BuildTreeDMethod · 0.85

Calls 4

IsVerySmallTriangleFunction · 0.85
resizeMethod · 0.45
push_backMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected