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

Method draw

src/core/renderables/renderable.cpp:139–169  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

137ObjectRenderables::~ObjectRenderables() = default;
138
139void ObjectRenderables::draw(int map_color, const QColor& color, QPainter* painter, const RenderConfig& config) const
140{
141 if (!extent.intersects(config.bounding_box))
142 return;
143
144 auto color_renderables = std::find_if(begin(), end(), [map_color](auto item) {
145 return item.first == map_color;
146 });
147 if (color_renderables == end())
148 return;
149
150 const QPainterPath initial_clip = clip_path ? *clip_path : painter->clipPath();
151 const QPainterPath* current_clip = nullptr;
152
153 painter->save();
154 for (const auto& config_renderables : *(color_renderables->second))
155 {
156 const PainterConfig& state = config_renderables.first;
157 if (!state.activate(painter, current_clip, config, color, initial_clip))
158 continue;
159
160 for (const auto* renderable : config_renderables.second)
161 {
162 if (renderable->intersects(config.bounding_box))
163 {
164 renderable->render(*painter, config);
165 }
166 }
167 }
168 painter->restore();
169}
170
171void ObjectRenderables::setClipPath(const QPainterPath* path)
172{

Callers

nothing calls this directly

Calls 14

intersectsMethod · 0.80
activateMethod · 0.80
renderMethod · 0.80
getNumColorsMethod · 0.80
testFlagMethod · 0.80
getSpotColorMethodMethod · 0.80
isHelperSymbolMethod · 0.80
isHiddenMethod · 0.80
getOpacityMethod · 0.80
saveMethod · 0.45
getColorMethod · 0.45
getSymbolMethod · 0.45

Tested by

no test coverage detected