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

Method drawObjectIDs

src/tools/fill_tool.cpp:319–348  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

317}
318
319void FillTool::drawObjectIDs(Map* map, QPainter* painter, const RenderConfig &config)
320{
321 Q_STATIC_ASSERT(MapColor::Reserved == -1);
322 Q_ASSERT(!map->isAreaHatchingEnabled());
323
324 auto part = map->getCurrentPart();
325 auto num_objects = qMin(part->getNumObjects(), int(RGB_MASK));
326 auto num_colors = map->getNumColors();
327 for (auto c = num_colors-1; c >= MapColor::Reserved; --c)
328 {
329 auto map_color = map->getColor(c);
330 for (int o = 0; o < num_objects; ++o)
331 {
332 auto object = part->getObject(o);
333 if (object->getType() != Object::Path)
334 continue;
335 if (auto symbol = object->getSymbol())
336 {
337 if (symbol->isHidden())
338 continue;
339 if (symbol->getType() == Symbol::Area
340 && static_cast<const AreaSymbol*>(symbol)->getColor() != map_color)
341 continue;
342 }
343
344 object->update();
345 object->renderables().draw(c, QRgb(o) | ~RGB_MASK, painter, config);
346 }
347 }
348}
349
350int FillTool::traceBoundary(const QImage& image, const QPoint& free_pixel, const QPoint& boundary_pixel, std::vector<QPoint>& out_boundary)
351{

Callers

nothing calls this directly

Calls 12

QRgbFunction · 0.85
getCurrentPartMethod · 0.80
getNumColorsMethod · 0.80
getObjectMethod · 0.80
isHiddenMethod · 0.80
isAreaHatchingEnabledMethod · 0.45
getNumObjectsMethod · 0.45
getColorMethod · 0.45
getTypeMethod · 0.45
getSymbolMethod · 0.45
updateMethod · 0.45
drawMethod · 0.45

Tested by

no test coverage detected