MCPcopy Create free account
hub / github.com/CesiumGS/cesium-native / drawPolygon

Method drawPolygon

CesiumVectorData/src/VectorRasterizer.cpp:106–140  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

104}
105
106void 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
142void VectorRasterizer::drawPolygon(
143 const std::vector<std::vector<glm::dvec3>>& polygon,

Callers 3

operator()Method · 0.80

Calls 9

radiansToPointFunction · 0.85
seedForObjectFunction · 0.85
setStrokeWidthFunction · 0.85
degreesToRadiansFunction · 0.85
toRgba32Method · 0.80
getColorMethod · 0.80
sizeMethod · 0.45
getVerticesMethod · 0.45
dataMethod · 0.45

Tested by

no test coverage detected