| 104 | } |
| 105 | |
| 106 | void VectorRasterizer::drawPolygon( |
| 107 | const CesiumGeospatial::CartographicPolygon& polygon, |
| 108 | const PolygonStyle& style) { |
| 109 | if (this->_finalized || (!style.fill && !style.outline)) { |
| 110 | return; |
| 111 | } |
| 112 | |
| 113 | std::vector<BLPoint> vertices; |
| 114 | vertices.reserve(polygon.getVertices().size()); |
| 115 | |
| 116 | for (const glm::dvec2& pos : polygon.getVertices()) { |
| 117 | vertices.emplace_back( |
| 118 | radiansToPoint(pos.x, pos.y, this->_bounds, this->_context)); |
| 119 | } |
| 120 | |
| 121 | if (style.fill) { |
| 122 | this->_context.fillPolygon( |
| 123 | vertices.data(), |
| 124 | vertices.size(), |
| 125 | BLRgba32(style.fill->getColor(seedForObject(polygon, 13)).toRgba32())); |
| 126 | } |
| 127 | |
| 128 | if (style.outline) { |
| 129 | setStrokeWidth( |
| 130 | this->_context, |
| 131 | *style.outline, |
| 132 | this->_ellipsoid, |
| 133 | this->_bounds); |
| 134 | this->_context.strokePolygon( |
| 135 | vertices.data(), |
| 136 | vertices.size(), |
| 137 | BLRgba32( |
| 138 | style.outline->getColor(seedForObject(polygon, 31)).toRgba32())); |
| 139 | } |
| 140 | } |
| 141 | |
| 142 | void VectorRasterizer::drawPolygon( |
| 143 | const std::vector<std::vector<glm::dvec3>>& polygon, |
no test coverage detected