MCPcopy Create free account
hub / github.com/TheForceEngine/TheForceEngine / FixOrientations

Method FixOrientations

TheForceEngine/TFE_Polygon/clipper.cpp:3861–3884  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3859//------------------------------------------------------------------------------
3860
3861void ClipperOffset::FixOrientations()
3862{
3863 //fixup orientations of all closed paths if the orientation of the
3864 //closed path with the lowermost vertex is wrong ...
3865 if (m_lowest.X >= 0 &&
3866 !Orientation(m_polyNodes.Childs[(int)m_lowest.X]->Contour))
3867 {
3868 for (int i = 0; i < m_polyNodes.ChildCount(); ++i)
3869 {
3870 PolyNode& node = *m_polyNodes.Childs[i];
3871 if (node.m_endtype == etClosedPolygon ||
3872 (node.m_endtype == etClosedLine && Orientation(node.Contour)))
3873 ReversePath(node.Contour);
3874 }
3875 } else
3876 {
3877 for (int i = 0; i < m_polyNodes.ChildCount(); ++i)
3878 {
3879 PolyNode& node = *m_polyNodes.Childs[i];
3880 if (node.m_endtype == etClosedLine && !Orientation(node.Contour))
3881 ReversePath(node.Contour);
3882 }
3883 }
3884}
3885//------------------------------------------------------------------------------
3886
3887void ClipperOffset::Execute(Paths& solution, double delta)

Callers

nothing calls this directly

Calls 3

OrientationFunction · 0.85
ReversePathFunction · 0.85
ChildCountMethod · 0.80

Tested by

no test coverage detected