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

Method convertToCurves

src/core/objects/object.cpp:2103–2130  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2101}
2102
2103bool PathObject::convertToCurves(PathObject** undo_duplicate)
2104{
2105 bool converted_a_range = false;
2106 for (const auto& part : path_parts)
2107 {
2108 for (auto index = part.first_index; index < part.last_index; index += 3)
2109 {
2110 if (!coords[index].isCurveStart())
2111 {
2112 auto end_index = index + 1;
2113 while (end_index < part.last_index && !coords[end_index].isCurveStart())
2114 ++end_index;
2115
2116 if (!converted_a_range)
2117 {
2118 if (undo_duplicate)
2119 *undo_duplicate = duplicate()->asPath();
2120 converted_a_range = true;
2121 }
2122
2123 index = convertRangeToCurves(part, index, end_index);
2124 }
2125 }
2126 }
2127
2128 Q_ASSERT(!converted_a_range || isOutputDirty());
2129 return converted_a_range;
2130}
2131
2132PathPart::size_type PathObject::convertRangeToCurves(const PathPart& part, PathPart::size_type start_index, PathPart::size_type end_index)
2133{

Callers 1

Calls 3

duplicateFunction · 0.85
isCurveStartMethod · 0.80
asPathMethod · 0.80

Tested by

no test coverage detected