Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Decouple OmniTileset and OmniRasterOverlay #737

Open
lilleyse opened this issue Oct 1, 2024 · 0 comments
Open

Decouple OmniTileset and OmniRasterOverlay #737

lilleyse opened this issue Oct 1, 2024 · 0 comments

Comments

@lilleyse
Copy link
Contributor

lilleyse commented Oct 1, 2024

In supporting custom ellipsoids we introduced some coupling between OmniTileset and OmniRasterOverlay.

const CesiumGeospatial::Ellipsoid* OmniRasterOverlay::getEllipsoid() const {
std::optional<const CesiumGeospatial::Ellipsoid*> maybeEllipsoid;
const auto& tilesets = _pContext->getAssetRegistry().getTilesets();
for (const auto& pTileset : tilesets) {
if (CppUtil::contains(pTileset->getRasterOverlayPaths(), _path)) {
const auto pEllipsoid = pTileset->getEllipsoid();
if (!maybeEllipsoid) {
maybeEllipsoid = pEllipsoid;
} else if (*maybeEllipsoid != pEllipsoid) {
// If not all tilesets that reference this raster overlay use the same ellipsoid then set it to nullptr
return nullptr;
}
}
}
return maybeEllipsoid.value_or(nullptr);
}

If you attach a raster overlay to tilesets with different ellipsoids it will give up and use the default ellipsoid.

I think a better approach would be to create an OmniRasterOverlayInstance object that points to the OmniRasterOverlay and owns the Cesium Native object. That way each instance can receive its own ellipsoid.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant