Skip to content

Commit 70c812b

Browse files
committed
Still trying to fix CI errors
1 parent 63d4b8f commit 70c812b

2 files changed

Lines changed: 100 additions & 91 deletions

File tree

CesiumVectorData/src/VectorRasterizer.cpp

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -408,20 +408,26 @@ void VectorRasterizer::drawPoints(
408408
points[i].latitude,
409409
this->_bounds,
410410
this->_context);
411-
if (styles[i]->point.fill.has_value()) {
411+
// clang-tidy does not understand that we *are* in fact checking these
412+
// optionals
413+
if (styles[i]->point.fill) {
414+
// NOLINTBEGIN(bugprone-unchecked-optional-access)
412415
this->_context.fillCircle(
413416
BLCircle(point.x, point.y, styles[i]->point.radius),
414417
BLRgba32(styles[i]
415418
->point.fill->getColor(seedForObject(points[i], 17))
416419
.toRgba32()));
420+
// NOLINTEND(bugprone-unchecked-optional-access)
417421
}
418422

419-
if (styles[i]->point.outline.has_value()) {
423+
if (styles[i]->point.outline) {
424+
// NOLINTBEGIN(bugprone-unchecked-optional-access)
420425
this->_context.strokeCircle(
421426
BLCircle(point.x, point.y, styles[i]->point.radius),
422427
BLRgba32(styles[i]
423428
->point.outline->getColor(seedForObject(points[i], 31))
424429
.toRgba32()));
430+
// NOLINTEND(bugprone-unchecked-optional-access)
425431
}
426432
}
427433
}

CesiumVectorOverlays/src/VectorTilesRasterOverlay.cpp

Lines changed: 92 additions & 89 deletions
Original file line numberDiff line numberDiff line change
@@ -342,95 +342,98 @@ CesiumAsync::Future<CesiumUtility::Result<VectorRenderContent*>> vectorizeModel(
342342
{pContent, errors});
343343
}
344344

345-
return asyncSystem
346-
.all(
347-
pStylingProvider
348-
->onStylePoints(
349-
asyncSystem,
350-
model,
351-
pointFeatureIds,
352-
pContent->points)
353-
.thenInWorkerThread(
354-
[pContent](std::vector<std::optional<
355-
CesiumVectorData::VectorStyle>>&& result) {
356-
if (result.size() == 0 ||
357-
result.size() != pContent->points.size()) {
358-
pContent->pointStyles.resize(
359-
pContent->points.size(),
360-
&pContent->defaultStyle);
361-
return false;
362-
}
363-
364-
for (const auto& style : result) {
365-
if (style.has_value()) {
366-
pContent->pointStyles.emplace_back(
367-
&*pContent->uniqueStyles.insert(*style).first);
368-
} else {
369-
pContent->pointStyles.emplace_back(
370-
&pContent->defaultStyle);
371-
}
372-
}
373-
374-
return true;
375-
}),
376-
pStylingProvider
377-
->onStylePolylines(
378-
asyncSystem,
379-
model,
380-
polylineFeatureIds,
381-
pContent->polylines)
382-
.thenInWorkerThread(
383-
[pContent](std::vector<std::optional<
384-
CesiumVectorData::VectorStyle>>&& result) {
385-
if (result.size() == 0 ||
386-
result.size() != pContent->polylines.size()) {
387-
pContent->polylineStyles.resize(
388-
pContent->polylines.size(),
389-
&pContent->defaultStyle);
390-
return false;
391-
}
392-
for (const auto& style : result) {
393-
if (style.has_value()) {
394-
pContent->polylineStyles.emplace_back(
395-
&*pContent->uniqueStyles.insert(*style).first);
396-
} else {
397-
pContent->polylineStyles.emplace_back(
398-
&pContent->defaultStyle);
399-
}
400-
}
401-
return true;
402-
}),
403-
pStylingProvider
404-
->onStylePolygons(
405-
asyncSystem,
406-
model,
407-
polygonFeatureIds,
408-
pContent->polygons)
409-
.thenInWorkerThread(
410-
[pContent](std::vector<std::optional<
411-
CesiumVectorData::VectorStyle>>&& result) {
412-
if (result.size() == 0 ||
413-
result.size() != pContent->polygons.size()) {
414-
pContent->polygonStyles.resize(
415-
pContent->polygons.size(),
416-
&pContent->defaultStyle);
417-
return false;
418-
}
419-
for (const auto& style : result) {
420-
if (style.has_value()) {
421-
pContent->polygonStyles.emplace_back(
422-
&*pContent->uniqueStyles.insert(*style).first);
423-
} else {
424-
pContent->polygonStyles.emplace_back(
425-
&pContent->defaultStyle);
426-
}
427-
}
428-
return true;
429-
}))
430-
.thenInWorkerThread([pContent, errors = std::move(errors)](
431-
std::tuple<bool, bool, bool>&& /*results*/) {
432-
return Result<VectorRenderContent*>({pContent, errors});
433-
});
345+
return std::
346+
move(asyncSystem.all(
347+
pStylingProvider
348+
->onStylePoints(
349+
asyncSystem,
350+
model,
351+
pointFeatureIds,
352+
pContent->points)
353+
.thenInWorkerThread(
354+
[pContent](
355+
std::vector<std::optional<
356+
CesiumVectorData::VectorStyle>>&& result) {
357+
if (result.size() == 0 ||
358+
result.size() != pContent->points.size()) {
359+
pContent->pointStyles.resize(
360+
pContent->points.size(),
361+
&pContent->defaultStyle);
362+
return false;
363+
}
364+
365+
for (const auto& style : result) {
366+
if (style.has_value()) {
367+
pContent->pointStyles.emplace_back(
368+
&*pContent->uniqueStyles.insert(*style).first);
369+
} else {
370+
pContent->pointStyles.emplace_back(
371+
&pContent->defaultStyle);
372+
}
373+
}
374+
375+
return true;
376+
}),
377+
pStylingProvider
378+
->onStylePolylines(
379+
asyncSystem,
380+
model,
381+
polylineFeatureIds,
382+
pContent->polylines)
383+
.thenInWorkerThread(
384+
[pContent](
385+
std::vector<std::optional<
386+
CesiumVectorData::VectorStyle>>&& result) {
387+
if (result.size() == 0 ||
388+
result.size() != pContent->polylines.size()) {
389+
pContent->polylineStyles.resize(
390+
pContent->polylines.size(),
391+
&pContent->defaultStyle);
392+
return false;
393+
}
394+
for (const auto& style : result) {
395+
if (style.has_value()) {
396+
pContent->polylineStyles.emplace_back(
397+
&*pContent->uniqueStyles.insert(*style).first);
398+
} else {
399+
pContent->polylineStyles.emplace_back(
400+
&pContent->defaultStyle);
401+
}
402+
}
403+
return true;
404+
}),
405+
pStylingProvider
406+
->onStylePolygons(
407+
asyncSystem,
408+
model,
409+
polygonFeatureIds,
410+
pContent->polygons)
411+
.thenInWorkerThread(
412+
[pContent](
413+
std::vector<std::optional<
414+
CesiumVectorData::VectorStyle>>&& result) {
415+
if (result.size() == 0 ||
416+
result.size() != pContent->polygons.size()) {
417+
pContent->polygonStyles.resize(
418+
pContent->polygons.size(),
419+
&pContent->defaultStyle);
420+
return false;
421+
}
422+
for (const auto& style : result) {
423+
if (style.has_value()) {
424+
pContent->polygonStyles.emplace_back(
425+
&*pContent->uniqueStyles.insert(*style).first);
426+
} else {
427+
pContent->polygonStyles.emplace_back(
428+
&pContent->defaultStyle);
429+
}
430+
}
431+
return true;
432+
})))
433+
.thenInWorkerThread([pContent, errors = std::move(errors)](
434+
std::tuple<bool, bool, bool>&& /*results*/) {
435+
return Result<VectorRenderContent*>({pContent, errors});
436+
});
434437
}
435438

436439
struct LoadRequest {

0 commit comments

Comments
 (0)