@giro3d/piero 1.0.0-beta.0 → 1.0.0-beta.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (59) hide show
  1. package/dist/Components.cjs.js +5 -1
  2. package/dist/Components.cjs.js.map +1 -1
  3. package/dist/Components.es.js +6286 -432
  4. package/dist/Components.es.js.map +1 -1
  5. package/dist/assets/piero.css +2 -2
  6. package/dist/index.cjs.js +11 -3
  7. package/dist/index.cjs.js.map +1 -1
  8. package/dist/index.es.js +8206 -4441
  9. package/dist/index.es.js.map +1 -1
  10. package/dist/modules.cjs.js +2 -1
  11. package/dist/modules.cjs.js.map +1 -1
  12. package/dist/modules.es.js +1051 -414
  13. package/dist/modules.es.js.map +1 -1
  14. package/dist/src/api/AnalysisApi.d.ts +15 -0
  15. package/dist/src/api/DatasetApi.d.ts +28 -0
  16. package/dist/src/api/NotificationApi.d.ts +10 -0
  17. package/dist/src/api/ViewApi.d.ts +4 -0
  18. package/dist/src/api/index.d.ts +2 -2
  19. package/dist/src/components/panels/AnalysisPanel.vue.d.ts +1 -1
  20. package/dist/src/components/panels/DatasetOrGroupItem.vue.d.ts +0 -2
  21. package/dist/src/components/panels/analysis/ToolWrapper.vue.d.ts +1 -6
  22. package/dist/src/context.d.ts +7 -0
  23. package/dist/src/index.d.ts +2 -1
  24. package/dist/src/module.d.ts +4 -0
  25. package/dist/src/modules/ClippingBoxAnalysis.d.ts +18 -0
  26. package/dist/src/modules/CrossSectionAnalysis.d.ts +11 -0
  27. package/dist/src/modules/DownloadDataset.d.ts +12 -0
  28. package/dist/src/modules/FloodingPlaneAnalysis.d.ts +11 -0
  29. package/dist/src/modules/IFCLoader.d.ts +1 -0
  30. package/dist/src/modules/PLYLoader.d.ts +1 -0
  31. package/dist/src/modules/PotreeLoader.d.ts +1 -0
  32. package/dist/src/modules/Tour.d.ts +1 -0
  33. package/dist/src/{services/analysis → modules/clippingBoxAnalysis}/ClippingBoxManager.d.ts +9 -3
  34. package/dist/src/modules/clippingBoxAnalysis/store.d.ts +2268 -0
  35. package/dist/src/modules/crossSectionAnalysis/CrossSectionManager.d.ts +8 -0
  36. package/dist/src/modules/crossSectionAnalysis/store.d.ts +522 -0
  37. package/dist/src/modules/floodingPlaneAnalysis/FloodingPlaneManager.d.ts +9 -0
  38. package/dist/src/{types/FloodingPlane.d.ts → modules/floodingPlaneAnalysis/FloodingPlaneObject.d.ts} +2 -2
  39. package/dist/src/modules/floodingPlaneAnalysis/store.d.ts +16 -0
  40. package/dist/src/modules/index.d.ts +5 -1
  41. package/dist/src/services/Giro3DManager.d.ts +0 -2
  42. package/dist/src/services/Picker.d.ts +1 -1
  43. package/dist/src/stores/analysis.d.ts +19 -1569
  44. package/dist/src/stores/datasets.d.ts +23 -1
  45. package/dist/src/stores/modules.d.ts +5 -1
  46. package/dist/src/stores/modules.test.d.ts +1 -0
  47. package/dist/src/stores/notifications.d.ts +1 -0
  48. package/package.json +1 -5
  49. package/dist/src/components/charts/BarChart.vue.d.ts +0 -4
  50. package/dist/src/components/charts/DoughnutChart.vue.d.ts +0 -4
  51. package/dist/src/components/panels/LoadingIndicator.vue.d.ts +0 -6
  52. package/dist/src/components/panels/analysis/FloodingPlane.vue.d.ts +0 -2
  53. package/dist/src/services/AnalysisManager.d.ts +0 -10
  54. package/dist/src/services/analysis/CrossSectionManager.d.ts +0 -9
  55. package/dist/src/services/analysis/FloodingPlaneManager.d.ts +0 -11
  56. package/dist/src/stores/statistics.d.ts +0 -8
  57. /package/dist/src/{components/panels/analysis → modules/clippingBoxAnalysis}/ClippingBox.vue.d.ts +0 -0
  58. /package/dist/src/{components/panels/analysis → modules/crossSectionAnalysis}/CrossSection.vue.d.ts +0 -0
  59. /package/dist/src/{components/panels/analysis/Statistics.vue.d.ts → modules/floodingPlaneAnalysis/FloodingPlane.vue.d.ts} +0 -0
@@ -1,8 +1,35 @@
1
1
  import { Component } from 'vue';
2
2
  import { HighlightFn } from '../services/Highlighter';
3
3
  import { AttributeExtractorFn } from '../services/Picker';
4
+ import { DatasetOrGroup } from '../types/Dataset';
4
5
  import { EntityBuilder } from '../giro3d/EntityBuilder';
5
6
  import { LoadDatasetFromFile } from '../loaders/loader';
7
+ export type DatasetActionRegistrationParams = {
8
+ /**
9
+ * The action to execute on the dataset.
10
+ */
11
+ action: (dataset: DatasetOrGroup) => void;
12
+ /**
13
+ * The icon to display for the action.
14
+ */
15
+ icon: string;
16
+ /**
17
+ * If true, the action becomes available only when the dataset is pre-loaded.
18
+ */
19
+ mustBePreloaded?: boolean;
20
+ /**
21
+ * If true, the action becomes available only when the dataset is visible.
22
+ */
23
+ mustBeVisible?: boolean;
24
+ /**
25
+ * A predicate to filter on which datasets this action applies. By default it applies to all datasets.
26
+ */
27
+ predicate?: (dataset: DatasetOrGroup) => boolean;
28
+ /**
29
+ * The title of the button.
30
+ */
31
+ title: string;
32
+ };
6
33
  /**
7
34
  * Parameters to register a new Dataset type.
8
35
  */
@@ -49,6 +76,7 @@ export type DatasetRegistrationParams = {
49
76
  * APIs to manipulate datasets.
50
77
  */
51
78
  export default interface DatasetApi {
79
+ registerDatasetAction(params: DatasetActionRegistrationParams): void;
52
80
  /**
53
81
  * Register a new dataset type.
54
82
  */
@@ -0,0 +1,10 @@
1
+ import { NotificationStore } from '../stores/notifications';
2
+ import { default as Notification } from '../types/Notification';
3
+ export declare class NotificationApiImpl implements NotificationApi {
4
+ private readonly store;
5
+ constructor(store: NotificationStore);
6
+ pushNotification(notification: Notification): void;
7
+ }
8
+ export default interface NotificationApi {
9
+ pushNotification(notification: Notification): void;
10
+ }
@@ -1,4 +1,8 @@
1
+ import { default as Instance } from '@giro3d/giro3d/core/Instance';
2
+ import { Box3 } from '../../../../node_modules/three';
1
3
  import { default as CameraController } from '../services/CameraController';
2
4
  export default interface ViewApi {
5
+ getBoundingBox(): Box3;
3
6
  getCameraController(): CameraController;
7
+ getInstance(): Instance;
4
8
  }
@@ -1,4 +1,4 @@
1
1
  import { default as BookmarkApi } from './BookmarkApi';
2
- import { default as DatasetApi } from './DatasetApi';
2
+ import { default as DatasetApi, DatasetActionRegistrationParams, DatasetRegistrationParams } from './DatasetApi';
3
3
  import { default as ViewApi } from './ViewApi';
4
- export { BookmarkApi, DatasetApi, ViewApi };
4
+ export { BookmarkApi, DatasetActionRegistrationParams, DatasetApi, DatasetRegistrationParams, ViewApi, };
@@ -1,2 +1,2 @@
1
- declare const _default: import('vue').DefineComponent<{}, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, HTMLDivElement>;
1
+ declare const _default: import('vue').DefineComponent<{}, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
2
2
  export default _default;
@@ -5,13 +5,11 @@ type __VLS_Props = {
5
5
  declare const _default: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
6
6
  zoom: (...args: any[]) => void;
7
7
  "update:visible": (...args: any[]) => void;
8
- clipTo: (...args: any[]) => void;
9
8
  "update:toggle-grid": (...args: any[]) => void;
10
9
  "update:toggle-mask": (...args: any[]) => void;
11
10
  }, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{
12
11
  onZoom?: ((...args: any[]) => any) | undefined;
13
12
  "onUpdate:visible"?: ((...args: any[]) => any) | undefined;
14
- onClipTo?: ((...args: any[]) => any) | undefined;
15
13
  "onUpdate:toggle-grid"?: ((...args: any[]) => any) | undefined;
16
14
  "onUpdate:toggle-mask"?: ((...args: any[]) => any) | undefined;
17
15
  }>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, HTMLLIElement>;
@@ -1,6 +1,5 @@
1
1
  type __VLS_Props = {
2
2
  collapsible: boolean;
3
- expanded: boolean;
4
3
  icon?: string;
5
4
  id: string;
6
5
  title: string;
@@ -14,11 +13,7 @@ declare function __VLS_template(): {
14
13
  rootEl: HTMLDivElement;
15
14
  };
16
15
  type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
17
- declare const __VLS_component: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
18
- "update:expanded": (...args: any[]) => void;
19
- }, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{
20
- "onUpdate:expanded"?: ((...args: any[]) => any) | undefined;
21
- }>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, HTMLDivElement>;
16
+ declare const __VLS_component: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, HTMLDivElement>;
22
17
  declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
23
18
  export default _default;
24
19
  type __VLS_WithTemplateSlots<T, S> = T & {
@@ -1,6 +1,8 @@
1
1
  import { EventDispatcher } from '../../../node_modules/three';
2
+ import { default as AnalysisApi } from './api/AnalysisApi';
2
3
  import { default as BookmarkApi } from './api/BookmarkApi';
3
4
  import { default as DatasetApi } from './api/DatasetApi';
5
+ import { default as NotificationApi } from './api/NotificationApi';
4
6
  import { default as ViewApi } from './api/ViewApi';
5
7
  import { PieroEvents } from './events';
6
8
  import { Configuration } from './types/Configuration';
@@ -8,6 +10,7 @@ import { Configuration } from './types/Configuration';
8
10
  * Piero context.
9
11
  */
10
12
  export interface PieroContext {
13
+ analysis: AnalysisApi;
11
14
  /**
12
15
  * The base URL of the application.
13
16
  */
@@ -28,6 +31,10 @@ export interface PieroContext {
28
31
  * The global event dispatcher.
29
32
  */
30
33
  events: EventDispatcher<PieroEvents>;
34
+ /**
35
+ * Notification related functions.
36
+ */
37
+ notifications: NotificationApi;
31
38
  /**
32
39
  * 3D View related functions.
33
40
  */
@@ -14,4 +14,5 @@ import { fillObject3DUserData, UserData } from './loaders/userData';
14
14
  import { default as Bookmark } from './types/Bookmark';
15
15
  import { default as Fetcher } from './utils/Fetcher';
16
16
  import { default as Projections } from './utils/Projections';
17
- export { Attribute, AttributeExtractorFn, AttributesGroups, Bookmark, BookmarkApi, BookmarkEvents, Configuration, createPieroApp, DatasetApi, EntityBuilder, Fetcher, fillObject3DUserData, LoadDatasetFromFile, Module, PieroContext, PieroEmptyEvent, PieroEvents, PieroGlobalEvents, Projections, UserData, ViewApi, };
17
+ import { default as Notification } from './types/Notification';
18
+ export { Attribute, AttributeExtractorFn, AttributesGroups, Bookmark, BookmarkApi, BookmarkEvents, Configuration, createPieroApp, DatasetApi, EntityBuilder, Fetcher, fillObject3DUserData, LoadDatasetFromFile, Module, Notification, PieroContext, PieroEmptyEvent, PieroEvents, PieroGlobalEvents, Projections, UserData, ViewApi, };
@@ -1,5 +1,9 @@
1
1
  import { PieroContext } from './context';
2
2
  export interface Module {
3
+ /**
4
+ * The unique ID of the module.
5
+ */
6
+ id: string;
3
7
  /**
4
8
  * The readable name of the module.
5
9
  */
@@ -0,0 +1,18 @@
1
+ import { Box3 } from '../../../../node_modules/three';
2
+ import { PieroContext } from '../context';
3
+ import { Module } from '../module';
4
+ export declare const moduleId = "builtin-clipping-box-analysis";
5
+ /**
6
+ * An analysis module that clips objects from a box.
7
+ */
8
+ export default class ClippingBoxAnalysis implements Module {
9
+ readonly id = "builtin-clipping-box-analysis";
10
+ readonly name = "Clipping box";
11
+ private _manager;
12
+ private _store;
13
+ getClippingBox(): Box3;
14
+ initialize(context: PieroContext): void;
15
+ isClippingBoxEnabled(): boolean;
16
+ isClippingBoxInverted(): boolean;
17
+ setClippingBox(box: Box3): void;
18
+ }
@@ -0,0 +1,11 @@
1
+ import { PieroContext } from '../context';
2
+ import { Module } from '../module';
3
+ /**
4
+ * An analysis module that displays a cross section.
5
+ */
6
+ export default class CrossSectionAnalysis implements Module {
7
+ readonly id = "builtin-cross-section-analysis";
8
+ readonly name = "Cross section";
9
+ private _manager;
10
+ initialize(context: PieroContext): void;
11
+ }
@@ -0,0 +1,12 @@
1
+ import { PieroContext } from '../context';
2
+ import { Module } from '../module';
3
+ /**
4
+ * Adds a button to download a dataset from its URL.
5
+ */
6
+ export default class DownloadDataset implements Module {
7
+ readonly id: string;
8
+ readonly name: string;
9
+ private _context;
10
+ initialize(context: PieroContext): void;
11
+ private download;
12
+ }
@@ -0,0 +1,11 @@
1
+ import { PieroContext } from '../context';
2
+ import { Module } from '../module';
3
+ /**
4
+ * An analysis module that displays a flooding plane with variable altitude.
5
+ */
6
+ export default class FloodingPlaneAnalysis implements Module {
7
+ readonly id = "builtin-flooding-plane-analysis";
8
+ readonly name = "Flooding plane";
9
+ private _manager;
10
+ initialize(context: PieroContext): void;
11
+ }
@@ -4,6 +4,7 @@ import { Module } from '../module';
4
4
  * Loads IFC (Industry Foundation Classes) files.
5
5
  */
6
6
  export default class IFCLoader implements Module {
7
+ readonly id = "builtin-ifc-loader";
7
8
  readonly name = "IFC";
8
9
  initialize(context: PieroContext): Promise<void>;
9
10
  }
@@ -4,6 +4,7 @@ import { Module } from '../module';
4
4
  * Loads .ply files.
5
5
  */
6
6
  export default class PLYLoader implements Module {
7
+ readonly id = "builtin-ply-loader";
7
8
  readonly name = "PLY";
8
9
  initialize(context: PieroContext): Promise<void> | void;
9
10
  }
@@ -4,6 +4,7 @@ import { Module } from '../module';
4
4
  * Loads [Potree](https://potree.github.io/) datasets.
5
5
  */
6
6
  export default class PotreeLoader implements Module {
7
+ readonly id = "builtin-potree-loader";
7
8
  readonly name = "Potree";
8
9
  initialize(context: PieroContext): Promise<void> | void;
9
10
  }
@@ -4,6 +4,7 @@ import { Module } from '../module';
4
4
  * Provides a guided tour of the application.
5
5
  */
6
6
  export default class TourModule implements Module {
7
+ readonly id = "builtin-tour";
7
8
  readonly name = "Tour";
8
9
  private _camera;
9
10
  private _cameraCallback;
@@ -1,17 +1,22 @@
1
- import { default as Instance } from '@giro3d/giro3d/core/Instance';
1
+ import { Box3 } from '../../../../../node_modules/three';
2
+ import { PieroContext } from '../../context';
3
+ import { DatasetOrGroup } from '../../types/Dataset';
2
4
  export default class ClippingBoxManager {
5
+ private readonly context;
3
6
  private readonly _cameraStore;
4
7
  private _clippingBox;
5
8
  private _clippingBoxHelper;
6
9
  private _clippingBoxMesh;
7
10
  private readonly _datasetStore;
8
- private readonly _instance;
9
11
  private _previousTransformControls;
10
12
  private readonly _store;
11
13
  private _transformControls;
12
14
  private readonly _volumeHelpers;
13
- constructor(instance: Instance);
15
+ constructor(context: PieroContext);
16
+ clipToDataset(dataset: DatasetOrGroup): void;
14
17
  dispose(): void;
18
+ isClippingBoxEnabled(): boolean;
19
+ setClippingBox(box: Box3): void;
15
20
  /**
16
21
  * Applies defined clipping planes to all entities.
17
22
  * This is required after:
@@ -30,6 +35,7 @@ export default class ClippingBoxManager {
30
35
  */
31
36
  private disposeClippingBox;
32
37
  private getPlanesFromBoxSides;
38
+ private initialize;
33
39
  /**
34
40
  * Moves an existing clipping box, while keeping its size
35
41
  */