| 137 | ObjectRenderables::~ObjectRenderables() = default; |
| 138 | |
| 139 | void 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 | |
| 171 | void ObjectRenderables::setClipPath(const QPainterPath* path) |
| 172 | { |
nothing calls this directly
no test coverage detected