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

Building permits slicing #24

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 14 additions & 5 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
"@microsoft/api-documenter": "7.25.22",
"@microsoft/api-extractor": "7.47.12",
"@trevoreyre/autocomplete-js": "3.0.3",
"@types/earcut": "^2.1.4",
"csstype": "^3.1.3",
"eslint": "9.15.0",
"eslint-config-prettier": "^9.1.0",
Expand All @@ -46,6 +47,7 @@
},
"dependencies": {
"@shoelace-style/shoelace": "2.18.0",
"@types/geojson": "^7946.0.14"
"@types/geojson": "^7946.0.14",
"earcut": "^3.0.1"
}
}
4 changes: 2 additions & 2 deletions src/apps/permits/demoPermitConfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ export const config: IPermitsConfig = {
'@demo': () => import('../../catalogs/demoCatalog.js'),
},
layers: {
// tilesets: ['@cesium/googlePhotorealistic'],
models: ['@demo/sofa', '@demo/thatopensmall'],
// tiles3d: ['@cesium/googlePhotorealistic'],
// models: ['@demo/sofa', '@demo/thatopensmall'],
imageries: ['@geoadmin/pixel-karte-farbe'],
// terrain: '@geoadmin/terrain',
},
Expand Down
14 changes: 13 additions & 1 deletion src/apps/permits/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,10 @@ import type {IPermitsConfig} from './ingv-config-permits.js';
import '../../plugins/cesium/ngv-plugin-cesium-widget';
import '../../plugins/cesium/ngv-plugin-cesium-upload';
import '../../plugins/cesium/ngv-plugin-cesium-model-interact';
import '../../plugins/cesium/ngv-plugin-cesium-slicing';
import type {CesiumWidget, DataSourceCollection} from '@cesium/engine';

import {PrimitiveCollection} from '@cesium/engine';
import {PrimitiveCollection, CustomDataSource} from '@cesium/engine';
import type {ViewerInitializedDetails} from '../../plugins/cesium/ngv-plugin-cesium-widget.js';

@customElement('ngv-app-permits')
Expand All @@ -26,6 +27,7 @@ export class NgvAppPermits extends ABaseApp<IPermitsConfig> {
private uploadedModelsCollection: PrimitiveCollection =
new PrimitiveCollection();
private dataSourceCollection: DataSourceCollection;
private slicingDataSource: CustomDataSource = new CustomDataSource();

private storeOptions = {
localStoreKey: 'permits-localStoreModels',
Expand Down Expand Up @@ -55,6 +57,7 @@ export class NgvAppPermits extends ABaseApp<IPermitsConfig> {
.viewer="${this.viewer}"
.dataSourceCollection="${this.dataSourceCollection}"
.primitiveCollection="${this.collections.models}"
.tiles3dCollection="${this.collections.tiles3d}"
.options="${{listTitle: 'Catalog'}}"
></ngv-plugin-cesium-model-interact>
<div
Expand All @@ -69,9 +72,15 @@ export class NgvAppPermits extends ABaseApp<IPermitsConfig> {
.viewer="${this.viewer}"
.dataSourceCollection="${this.dataSourceCollection}"
.primitiveCollection="${this.uploadedModelsCollection}"
.tiles3dCollection="${this.collections.tiles3d}"
.storeOptions="${this.storeOptions}"
.options="${{listTitle: 'Uploaded models'}}"
></ngv-plugin-cesium-model-interact>
<ngv-plugin-cesium-slicing
.viewer="${this.viewer}"
.tiles3dCollection="${this.collections.tiles3d}"
.slicingDataSource="${this.slicingDataSource}"
></ngv-plugin-cesium-slicing>
`
: ''}
</div>
Expand All @@ -83,6 +92,9 @@ export class NgvAppPermits extends ABaseApp<IPermitsConfig> {
this.viewer.scene.primitives.add(this.uploadedModelsCollection);
this.dataSourceCollection = evt.detail.dataSourceCollection;
this.collections = evt.detail.primitiveCollections;
this.dataSourceCollection
.add(this.slicingDataSource)
.catch((e) => console.error(e));
}}
></ngv-plugin-cesium-widget>
</ngv-structure-app>
Expand Down
4 changes: 4 additions & 0 deletions src/interfaces/cesium/ingv-layers.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import type {
Cesium3DTileset,
ClippingPolygon,
UrlTemplateImageryProvider,
WebMapServiceImageryProvider,
WebMapTileServiceImageryProvider,
Expand Down Expand Up @@ -42,6 +43,9 @@ export interface INGVCesiumModel extends Model {
id: {
dimensions?: Cartesian3;
name: string;
terrainClipping?: boolean;
tilesClipping?: boolean;
clippingPolygon?: ClippingPolygon;
};
}

Expand Down
Loading
Loading