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

Add support for Building Scene Layer (BSL) OGC I3S standard #11678

Merged
merged 33 commits into from
Feb 28, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
808fcaa
- Added support for conversion from sRGB color space profile to linea…
Tamrat-B Dec 5, 2023
0b9869b
Added Support for BSL structure, BSL statistics, generic feature attr…
Tamrat-B Dec 5, 2023
d612e7b
I3S Building Scene Layer Sandcastle app
Tamrat-B Dec 5, 2023
a4da846
I3S BSL app icon
Tamrat-B Dec 5, 2023
f469a21
Added support for conversion from sRGB color space profile to linear …
Tamrat-B Dec 5, 2023
4f92b4a
added additional payload options
Tamrat-B Dec 5, 2023
a2066b0
- Added support for binary attribute data with values stored in objec…
Tamrat-B Dec 5, 2023
562d6e5
- Added support for 3D objects transparency
Tamrat-B Dec 5, 2023
89f6dbe
- Added support for BSL hierarchy of layers
Tamrat-B Dec 5, 2023
394f823
- Added support for the generic feature attribute driven filter
Tamrat-B Dec 5, 2023
1394e4a
Added support for BSL structure per the OGC I3S standard
Tamrat-B Dec 5, 2023
5a34b60
- Added support for symbolization defined in I3S Layer data
Tamrat-B Dec 5, 2023
1054536
Added support for EXT_mesh_features and EXT_structural_metadata glTF …
Tamrat-B Dec 5, 2023
e1d55f7
Added bsl layer tests
Tamrat-B Dec 5, 2023
04f3c51
Added I3S BSL ViewModel tests
Tamrat-B Dec 5, 2023
3e75b94
Added I3S BSL explorer
Tamrat-B Dec 5, 2023
969ac49
Added I3S Explorer tests
Tamrat-B Dec 5, 2023
b4b23a6
Added I3S BSL Explorer layer widget
Tamrat-B Dec 5, 2023
e03286b
Merge branch 'CesiumGS:main' into feature/i3s_bsl_support
Tamrat-B Jan 11, 2024
21b2f4f
updates based on review feedback
Tamrat-B Jan 11, 2024
efc7db5
Added I3S support PR to additions
Tamrat-B Feb 2, 2024
03a9125
removed non necessary options
Tamrat-B Feb 2, 2024
17784df
check before updating visibility
Tamrat-B Feb 2, 2024
c815c03
additional specs changes
Tamrat-B Feb 2, 2024
4bffc64
Merge branch 'main' into feature/i3s_bsl_support
Tamrat-B Feb 2, 2024
9f02cf3
Merge branch 'CesiumGS:main' into feature/i3s_bsl_support
Tamrat-B Feb 28, 2024
9d6dc59
Removed picking result from console output
Tamrat-B Feb 28, 2024
c7570c3
Remove console out if geoid transform is not needed
Tamrat-B Feb 28, 2024
88eae59
Default to model overview if present
Tamrat-B Feb 28, 2024
1aefdc9
update tests to account for model views
Tamrat-B Feb 28, 2024
cf8d1da
Added I3S Building Scene Layer support to March 1 release
Tamrat-B Feb 28, 2024
96aca3e
Handling edge case use cases where there is no Full Model and/or Over…
Tamrat-B Feb 28, 2024
a3ea292
Rename BSL -> BuildingSceneLayer
ggetz Feb 28, 2024
File filter

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Rename BSL -> BuildingSceneLayer
  • Loading branch information
ggetz committed Feb 28, 2024
commit a3ea2925bf6a52263d4202869408713a1b3dcc0a
2 changes: 1 addition & 1 deletion Apps/Sandcastle/gallery/I3S Building Scene Layer.html
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ <h1>Loading...</h1>
i3sOptions
);

Cesium.I3SBSLExplorer("toolbar", i3sProvider);
Cesium.I3SBuildingSceneLayerExplorer("toolbar", i3sProvider);

// Add the i3s layer provider as a primitive data type
viewer.scene.primitives.add(i3sProvider);
Expand Down
6 changes: 6 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,12 @@

- `Cesium3DTileset.disableCollision` has been deprecated and will be removed in 1.116. Use `Cesium3DTileset.enableCollision` instead.

#### @cesium/engine

##### Additions :tada:

- Added `I3SBuildingSceneLayerExplorer` widget for working with I3S Building Scene Layer data. [#11678](https://github.com/CesiumGS/cesium/pull/11678)

### 1.114 - 2024-02-01

#### @cesium/engine
Expand Down
7 changes: 5 additions & 2 deletions packages/engine/Specs/Scene/I3SDecoderSpec.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,11 @@ describe("Scene/I3SDecoder", function () {
},
];

beforeEach(function () {
// Reset the initialized state
I3SDecoder._promise = undefined;
});

it("constructor", function () {
expect(new I3SDecoder()).toBeDefined();
});
Expand All @@ -59,14 +64,12 @@ describe("Scene/I3SDecoder", function () {
});

it("throws if not initialized", async function () {
I3SDecoder._promise = undefined;
spyOn(TaskProcessor.prototype, "initWebAssemblyModule").and.returnValue(
Promise.resolve(false)
);
await expectAsync(
I3SDecoder.decode("mockUrl", defaultGeometrySchema, geometryDataObb)
).toBeRejectedWithError(RuntimeError);
I3SDecoder._promise = undefined;
});

it("empty geometry with obb", async function () {
Expand Down
2 changes: 1 addition & 1 deletion packages/engine/Specs/Scene/I3SNodeSpec.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import {
Cartographic,
Cesium3DTileRefine,
Cesium3DTileset,
clone,
Math as CesiumMath,
Ellipsoid,
Event,
Expand All @@ -18,7 +19,6 @@ import {
Resource,
WebMercatorProjection,
} from "../../index.js";
import clone from "../../Source/Core/clone.js";

describe("Scene/I3SNode", function () {
// Mock geoid data. 2x2 pixels for the whole world
Expand Down
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
import { Check, defined } from "@cesium/engine";
import knockout from "../ThirdParty/knockout.js";
import I3SBSLExplorerViewModel from "./I3SBSLExplorerViewModel.js";
import I3SBuildingSceneLayerExplorerViewModel from "./I3SBuildingSceneLayerExplorerViewModel.js";

/**
* I3S Building Scene Layer widget
*
* @alias I3SBSLExplorer
* @alias I3SBuildingSceneLayerExplorer
* @constructor
*
* @param {string} containerId The DOM element ID that will contain the widget.
* @param {I3SDataProvider} i3sProvider I3S Data provider instance.
*
* @demo {@link https://sandcastle.cesium.com/index.html?src=I3S%20Building%20Scene%20Layer.html|I3S Building Scene Layer}
*/
function I3SBSLExplorer(containerId, i3sProvider) {
function I3SBuildingSceneLayerExplorer(containerId, i3sProvider) {
const container = document.getElementById(containerId);

//>>includeStart('debug', pragmas.debug);
Expand Down Expand Up @@ -67,7 +67,7 @@ function I3SBSLExplorer(containerId, i3sProvider) {
</div>`;
container.appendChild(htmlWrapper);

const viewModel = new I3SBSLExplorerViewModel(i3sProvider);
const viewModel = new I3SBuildingSceneLayerExplorerViewModel(i3sProvider);

knockout.track(viewModel);
knockout.applyBindings(viewModel, container);
Expand All @@ -77,4 +77,4 @@ function I3SBSLExplorer(containerId, i3sProvider) {
viewModel.currentLayer = viewModel.defaultLayer;
}
}
export default I3SBSLExplorer;
export default I3SBuildingSceneLayerExplorer;
Original file line number Diff line number Diff line change
Expand Up @@ -85,13 +85,13 @@ async function setLevels(i3sProvider, levels) {
}

/**
* The view model for {@link I3SBSLExplorer}.
* @alias I3SBSLExplorerViewModel
* The view model for {@link I3SBuildingSceneLayerExplorer}.
* @alias I3sBslExplorerViewModel
* @constructor
*
* @param {I3SDataProvider} i3sProvider I3S Data provider instance.
*/
function I3SBSLExplorerViewModel(i3sProvider) {
function I3SBuildingSceneLayerExplorerViewModel(i3sProvider) {
const that = this;
this.levels = [];
this.viewModel = {
Expand Down Expand Up @@ -169,4 +169,4 @@ function I3SBSLExplorerViewModel(i3sProvider) {
return this.viewModel;
}

export default I3SBSLExplorerViewModel;
export default I3SBuildingSceneLayerExplorerViewModel;
2 changes: 1 addition & 1 deletion packages/widgets/Source/widgets.css
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,4 @@
@import url(./SelectionIndicator/SelectionIndicator.css);
@import url(./Timeline/Timeline.css);
@import url(./Viewer/Viewer.css);
@import url(./I3SBSLExplorer/I3SBSLExplorer.css);
@import url(./I3SBuildingSceneLayerExplorer/I3SBuildingSceneLayerExplorer.css);
21 changes: 13 additions & 8 deletions packages/widgets/Specs/I3SBSLExplorer/I3SBSLExplorerSpec.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { I3SBSLExplorer } from "../../index.js";
import { I3SBuildingSceneLayerExplorer } from "../../index.js";
import DomEventSimulator from "../../../../Specs/DomEventSimulator.js";

describe("Widgets/I3SBSLExplorer/I3SBSLExplorer", function () {
describe("Widgets/I3SBuildingSceneLayerExplorer/I3SBuildingSceneLayerExplorer", function () {
const i3sProvider = {
sublayers: [
{
Expand Down Expand Up @@ -39,8 +39,10 @@ describe("Widgets/I3SBSLExplorer/I3SBSLExplorer", function () {
container.id = "testContainer";
document.body.appendChild(container);

const widget = new I3SBSLExplorer("testContainer", { sublayers: [] });
expect(widget).toBeInstanceOf(I3SBSLExplorer);
const widget = new I3SBuildingSceneLayerExplorer("testContainer", {
sublayers: [],
});
expect(widget).toBeInstanceOf(I3SBuildingSceneLayerExplorer);

expect(container.childElementCount).toEqual(1);
expect(container.children[0].childElementCount).toEqual(3);
Expand All @@ -60,7 +62,7 @@ describe("Widgets/I3SBSLExplorer/I3SBSLExplorer", function () {

it("throws dev error with no container", function () {
expect(function () {
return new I3SBSLExplorer();
return new I3SBuildingSceneLayerExplorer();
}).toThrowDeveloperError();
});

Expand All @@ -70,7 +72,7 @@ describe("Widgets/I3SBSLExplorer/I3SBSLExplorer", function () {
document.body.appendChild(container);

expect(function () {
return new I3SBSLExplorer("testContainer");
return new I3SBuildingSceneLayerExplorer("testContainer");
}).toThrowDeveloperError();
document.body.removeChild(container);
});
Expand All @@ -81,8 +83,11 @@ describe("Widgets/I3SBSLExplorer/I3SBSLExplorer", function () {
document.body.appendChild(container);

i3sProvider.filterByAttributes = jasmine.createSpy();
const widget = new I3SBSLExplorer("testContainer", i3sProvider);
expect(widget).toBeInstanceOf(I3SBSLExplorer);
const widget = new I3SBuildingSceneLayerExplorer(
"testContainer",
i3sProvider
);
expect(widget).toBeInstanceOf(I3SBuildingSceneLayerExplorer);

const expander = document.querySelector(".expandItem");
const nestedList = expander.parentElement.parentElement.querySelector(
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { I3SBSLExplorerViewModel } from "../../index.js";
import { I3SBuildingSceneLayerExplorerViewModel } from "../../index.js";

import { knockout } from "../../index.js";

describe("Widgets/I3SBSLExplorer/I3SBSLExplorerViewModel", function () {
describe("Widgets/I3SBuildingSceneLayerExplorer/I3SBuildingSceneLayerExplorerViewModel", function () {
const i3sProvider = {
sublayers: [
{
Expand Down Expand Up @@ -49,7 +49,7 @@ describe("Widgets/I3SBSLExplorer/I3SBSLExplorerViewModel", function () {
};

it("can create bsl explorer ViewModel", function () {
const viewModel = new I3SBSLExplorerViewModel(i3sProvider);
const viewModel = new I3SBuildingSceneLayerExplorerViewModel(i3sProvider);
expect(viewModel.levels).toEqual(["All", 0, 1]);
expect(viewModel.selectedLevel).toEqual("All");

Expand Down Expand Up @@ -89,7 +89,9 @@ describe("Widgets/I3SBSLExplorer/I3SBSLExplorerViewModel", function () {
});

it("can create bsl explorer ViewModel if no Overview", function () {
const viewModel = new I3SBSLExplorerViewModel(i3sProviderWithoutOverview);
const viewModel = new I3SBuildingSceneLayerExplorerViewModel(
i3sProviderWithoutOverview
);
expect(viewModel.sublayers.length).toEqual(1);
expect(viewModel.sublayers[0].name).toEqual("Full Model");
expect(viewModel.sublayers[0].modelName).toEqual("FullModel");
Expand Down Expand Up @@ -123,7 +125,7 @@ describe("Widgets/I3SBSLExplorer/I3SBSLExplorerViewModel", function () {

it("can handle filtering by level", function () {
i3sProvider.filterByAttributes = jasmine.createSpy();
const viewModel = new I3SBSLExplorerViewModel(i3sProvider);
const viewModel = new I3SBuildingSceneLayerExplorerViewModel(i3sProvider);
knockout.track(viewModel);

viewModel.currentLevel = 1;
Expand All @@ -144,7 +146,7 @@ describe("Widgets/I3SBSLExplorer/I3SBSLExplorerViewModel", function () {
document.body.appendChild(bslWrapper);

i3sProvider.filterByAttributes = jasmine.createSpy();
const viewModel = new I3SBSLExplorerViewModel(i3sProvider);
const viewModel = new I3SBuildingSceneLayerExplorerViewModel(i3sProvider);
knockout.track(viewModel);

viewModel.currentLayer = {
Expand Down Expand Up @@ -183,7 +185,9 @@ describe("Widgets/I3SBSLExplorer/I3SBSLExplorerViewModel", function () {
document.body.appendChild(bslWrapper);

i3sProviderWithoutOverview.filterByAttributes = jasmine.createSpy();
const viewModel = new I3SBSLExplorerViewModel(i3sProviderWithoutOverview);
const viewModel = new I3SBuildingSceneLayerExplorerViewModel(
i3sProviderWithoutOverview
);
knockout.track(viewModel);

viewModel.currentLayer = {
Expand Down
Loading