MCPcopy Create free account
hub / github.com/OpenOrienteering/mapper / normalize

Method normalize

src/core/objects/object.cpp:985–1017  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

983
984
985void PathObject::normalize()
986{
987 for (MapCoordVector::size_type i = 0; i < coords.size(); ++i)
988 {
989 if (coords[i].isCurveStart())
990 {
991 if (i+3 >= getCoordinateCount())
992 {
993 coords[i].setCurveStart(false);
994 continue;
995 }
996
997 if (coords[i + 1].isClosePoint() || coords[i + 1].isHolePoint() ||
998 coords[i + 2].isClosePoint() || coords[i + 2].isHolePoint())
999 {
1000 coords[i].setCurveStart(false);
1001 continue;
1002 }
1003
1004 coords[i + 1].setCurveStart(false);
1005 coords[i + 1].setDashPoint(false);
1006 coords[i + 2].setCurveStart(false);
1007 coords[i + 2].setDashPoint(false);
1008 i += 2;
1009 }
1010
1011 if (i > 0 && coords[i].isHolePoint())
1012 {
1013 if (coords[i-1].isHolePoint())
1014 deleteCoordinate(i, false);
1015 }
1016 }
1017}
1018
1019bool PathObject::intersectsBox(const QRectF& box) const
1020{

Callers 11

moveMethod · 0.45
convertRangeToCurvesMethod · 0.45
isPointOnPathMethod · 0.45
executeForLineMethod · 0.45
LineRenderableMethod · 0.45
extentIncludeCapMethod · 0.45
shiftCoordinatesMethod · 0.45
createPointedLineCapMethod · 0.45

Calls 6

isCurveStartMethod · 0.80
setCurveStartMethod · 0.80
isClosePointMethod · 0.80
isHolePointMethod · 0.80
setDashPointMethod · 0.80
sizeMethod · 0.45

Tested by

no test coverage detected