@giro3d/piero 1.0.0-beta.0

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 (220) hide show
  1. package/LICENSE +9 -0
  2. package/README.md +134 -0
  3. package/dist/Components.cjs.js +2 -0
  4. package/dist/Components.cjs.js.map +1 -0
  5. package/dist/Components.es.js +608 -0
  6. package/dist/Components.es.js.map +1 -0
  7. package/dist/assets/piero.css +9 -0
  8. package/dist/index.cjs.js +9 -0
  9. package/dist/index.cjs.js.map +1 -0
  10. package/dist/index.d.ts +2 -0
  11. package/dist/index.es.js +6971 -0
  12. package/dist/index.es.js.map +1 -0
  13. package/dist/modules.cjs.js +2 -0
  14. package/dist/modules.cjs.js.map +1 -0
  15. package/dist/modules.d.ts +2 -0
  16. package/dist/modules.es.js +856 -0
  17. package/dist/modules.es.js.map +1 -0
  18. package/dist/src/App.vue.d.ts +6 -0
  19. package/dist/src/api/BookmarkApi.d.ts +6 -0
  20. package/dist/src/api/DatasetApi.d.ts +61 -0
  21. package/dist/src/api/ViewApi.d.ts +4 -0
  22. package/dist/src/api/index.d.ts +4 -0
  23. package/dist/src/components/AlertToast.vue.d.ts +4 -0
  24. package/dist/src/components/AttributeGroup.vue.d.ts +7 -0
  25. package/dist/src/components/AttributeItem.vue.d.ts +6 -0
  26. package/dist/src/components/AttributePanel.vue.d.ts +14 -0
  27. package/dist/src/components/ColorFragment.vue.d.ts +6 -0
  28. package/dist/src/components/Configuration.d.ts +14 -0
  29. package/dist/src/components/CoordinateFragment.vue.d.ts +10 -0
  30. package/dist/src/components/DropdownView.vue.d.ts +13 -0
  31. package/dist/src/components/LinkFragment.vue.d.ts +10 -0
  32. package/dist/src/components/LoadingScreen.vue.d.ts +2 -0
  33. package/dist/src/components/MainView.vue.d.ts +5 -0
  34. package/dist/src/components/MinimapView.vue.d.ts +4 -0
  35. package/dist/src/components/ModalOverlay.vue.d.ts +25 -0
  36. package/dist/src/components/NavigationButtons.vue.d.ts +2 -0
  37. package/dist/src/components/OpacitySlider.vue.d.ts +10 -0
  38. package/dist/src/components/PanelContainer.vue.d.ts +10 -0
  39. package/dist/src/components/ProgressBar.vue.d.ts +14 -0
  40. package/dist/src/components/SearchOverlay.vue.d.ts +8 -0
  41. package/dist/src/components/SpinnerControl.vue.d.ts +2 -0
  42. package/dist/src/components/StatusBar.vue.d.ts +10 -0
  43. package/dist/src/components/SwitchToggle.vue.d.ts +25 -0
  44. package/dist/src/components/VisibilityControl.vue.d.ts +9 -0
  45. package/dist/src/components/atoms/ButtonArea.vue.d.ts +17 -0
  46. package/dist/src/components/atoms/ButtonWithIcon.vue.d.ts +11 -0
  47. package/dist/src/components/atoms/CompactList.vue.d.ts +17 -0
  48. package/dist/src/components/atoms/Icon.vue.d.ts +6 -0
  49. package/dist/src/components/atoms/IconList.vue.d.ts +17 -0
  50. package/dist/src/components/atoms/IconListButton.vue.d.ts +10 -0
  51. package/dist/src/components/atoms/ImportButton.vue.d.ts +13 -0
  52. package/dist/src/components/atoms/ListLabel.vue.d.ts +5 -0
  53. package/dist/src/components/atoms/ListLabelButton.vue.d.ts +11 -0
  54. package/dist/src/components/atoms/SectionCollapsible.vue.d.ts +30 -0
  55. package/dist/src/components/charts/BarChart.vue.d.ts +4 -0
  56. package/dist/src/components/charts/DoughnutChart.vue.d.ts +4 -0
  57. package/dist/src/components/panels/AboutPanel.vue.d.ts +2 -0
  58. package/dist/src/components/panels/AnalysisPanel.vue.d.ts +2 -0
  59. package/dist/src/components/panels/AnnotationItem.vue.d.ts +21 -0
  60. package/dist/src/components/panels/AnnotationPanel.vue.d.ts +2 -0
  61. package/dist/src/components/panels/BasemapItem.vue.d.ts +17 -0
  62. package/dist/src/components/panels/BookmarkItem.vue.d.ts +16 -0
  63. package/dist/src/components/panels/BookmarkPanel.vue.d.ts +2 -0
  64. package/dist/src/components/panels/DatagroupItem.vue.d.ts +18 -0
  65. package/dist/src/components/panels/DatasetItem.vue.d.ts +18 -0
  66. package/dist/src/components/panels/DatasetOrGroupItem.vue.d.ts +18 -0
  67. package/dist/src/components/panels/DatasetPanel.vue.d.ts +2 -0
  68. package/dist/src/components/panels/EmptyIndicator.vue.d.ts +6 -0
  69. package/dist/src/components/panels/LoadingIndicator.vue.d.ts +6 -0
  70. package/dist/src/components/panels/MeasurementItem.vue.d.ts +17 -0
  71. package/dist/src/components/panels/MeasurementPanel.vue.d.ts +2 -0
  72. package/dist/src/components/panels/OverlayItem.vue.d.ts +19 -0
  73. package/dist/src/components/panels/ShareBookmarkModal.vue.d.ts +5 -0
  74. package/dist/src/components/panels/analysis/ClippingBox.vue.d.ts +2 -0
  75. package/dist/src/components/panels/analysis/CrossSection.vue.d.ts +2 -0
  76. package/dist/src/components/panels/analysis/FloodingPlane.vue.d.ts +2 -0
  77. package/dist/src/components/panels/analysis/Statistics.vue.d.ts +2 -0
  78. package/dist/src/components/panels/analysis/ToolWrapper.vue.d.ts +28 -0
  79. package/dist/src/components/toolbar/ToolBar.vue.d.ts +9 -0
  80. package/dist/src/components/toolbar/ToolbarButton.vue.d.ts +12 -0
  81. package/dist/src/config-loader.d.ts +7 -0
  82. package/dist/src/constants.d.ts +7 -0
  83. package/dist/src/context.d.ts +35 -0
  84. package/dist/src/createPieroApp.d.ts +31 -0
  85. package/dist/src/events.d.ts +30 -0
  86. package/dist/src/giro3d/CameraControlsInspector.d.ts +17 -0
  87. package/dist/src/giro3d/EntityBuilder.d.ts +21 -0
  88. package/dist/src/giro3d/Graticule.d.ts +20 -0
  89. package/dist/src/giro3d/Grid.d.ts +11 -0
  90. package/dist/src/giro3d/LayerBuilder.d.ts +46 -0
  91. package/dist/src/giro3d/Measure3D.d.ts +20 -0
  92. package/dist/src/giro3d/Plane.d.ts +11 -0
  93. package/dist/src/giro3d/Skybox.d.ts +6 -0
  94. package/dist/src/giro3d/entities/FeatureCollectionEntity.d.ts +41 -0
  95. package/dist/src/giro3d/entities/PointCloudEntity.d.ts +45 -0
  96. package/dist/src/giro3d/entities/TiledPointCloudEntity.d.ts +13 -0
  97. package/dist/src/giro3d/entities/Tiles3dEntity.d.ts +11 -0
  98. package/dist/src/giro3d/entities/VectorLabelsEntity.d.ts +48 -0
  99. package/dist/src/giro3d/entities/VectorMeshEntity.d.ts +97 -0
  100. package/dist/src/giro3d/entities/VectorShapeEntity.d.ts +8 -0
  101. package/dist/src/giro3d/entities/flatPointCloud.d.ts +2 -0
  102. package/dist/src/giro3d/entities/tiledIfc.d.ts +2 -0
  103. package/dist/src/giro3d/entities/vector.d.ts +2 -0
  104. package/dist/src/giro3d/sources/GeopackageSource.d.ts +20 -0
  105. package/dist/src/giro3d/sources/ShapefileSource.d.ts +20 -0
  106. package/dist/src/giro3d/sources/mixins.d.ts +60 -0
  107. package/dist/src/index.d.ts +17 -0
  108. package/dist/src/loaders/csv.d.ts +3 -0
  109. package/dist/src/loaders/las.d.ts +3 -0
  110. package/dist/src/loaders/loader.d.ts +29 -0
  111. package/dist/src/loaders/loader.test.d.ts +1 -0
  112. package/dist/src/loaders/userData.d.ts +8 -0
  113. package/dist/src/loaders/vector.d.ts +4 -0
  114. package/dist/src/module.d.ts +11 -0
  115. package/dist/src/modules/IFCLoader.d.ts +9 -0
  116. package/dist/src/modules/PLYLoader.d.ts +9 -0
  117. package/dist/src/modules/PotreeLoader.d.ts +9 -0
  118. package/dist/src/modules/Tour.d.ts +17 -0
  119. package/dist/src/modules/ifc/IfcEntity.d.ts +84 -0
  120. package/dist/src/modules/ifc/IfcEntityInspector.d.ts +7 -0
  121. package/dist/src/modules/ifc/IfcPropertyView.vue.d.ts +6 -0
  122. package/dist/src/modules/ifc/IfcSubtree.vue.d.ts +7 -0
  123. package/dist/src/modules/index.d.ts +5 -0
  124. package/dist/src/modules/ply/PlyEntity.d.ts +33 -0
  125. package/dist/src/providers/Alticoding.d.ts +32 -0
  126. package/dist/src/providers/BanProvider.d.ts +11 -0
  127. package/dist/src/providers/Geocoding.d.ts +7 -0
  128. package/dist/src/providers/IgnProvider.d.ts +11 -0
  129. package/dist/src/services/AnalysisManager.d.ts +10 -0
  130. package/dist/src/services/AnnotationManager.d.ts +48 -0
  131. package/dist/src/services/CameraController.d.ts +99 -0
  132. package/dist/src/services/DatasetManager.d.ts +27 -0
  133. package/dist/src/services/Giro3DManager.d.ts +42 -0
  134. package/dist/src/services/Highlighter.d.ts +11 -0
  135. package/dist/src/services/LayerManager.d.ts +37 -0
  136. package/dist/src/services/MeasureTool.d.ts +13 -0
  137. package/dist/src/services/MeasurementManager.d.ts +31 -0
  138. package/dist/src/services/MinimapController.d.ts +19 -0
  139. package/dist/src/services/Picker.d.ts +53 -0
  140. package/dist/src/services/analysis/ClippingBoxManager.d.ts +41 -0
  141. package/dist/src/services/analysis/CrossSectionManager.d.ts +9 -0
  142. package/dist/src/services/analysis/FloodingPlaneManager.d.ts +11 -0
  143. package/dist/src/stores/analysis.d.ts +1571 -0
  144. package/dist/src/stores/annotations.d.ts +60 -0
  145. package/dist/src/stores/bookmarks.d.ts +21 -0
  146. package/dist/src/stores/camera.d.ts +39 -0
  147. package/dist/src/stores/datasets.d.ts +49 -0
  148. package/dist/src/stores/giro3d.d.ts +45 -0
  149. package/dist/src/stores/layers.d.ts +40 -0
  150. package/dist/src/stores/measurement.d.ts +45 -0
  151. package/dist/src/stores/modules.d.ts +11 -0
  152. package/dist/src/stores/notifications.d.ts +8 -0
  153. package/dist/src/stores/statistics.d.ts +8 -0
  154. package/dist/src/types/Annotation.d.ts +35 -0
  155. package/dist/src/types/AnnotationMode.d.ts +7 -0
  156. package/dist/src/types/BaseLayer.d.ts +30 -0
  157. package/dist/src/types/Bookmark.d.ts +19 -0
  158. package/dist/src/types/CameraPosition.d.ts +7 -0
  159. package/dist/src/types/Configuration.d.ts +106 -0
  160. package/dist/src/types/Dataset.d.ts +78 -0
  161. package/dist/src/types/Feature.d.ts +13 -0
  162. package/dist/src/types/FloodingPlane.d.ts +14 -0
  163. package/dist/src/types/IFCTypes.d.ts +5 -0
  164. package/dist/src/types/LayerObject.d.ts +20 -0
  165. package/dist/src/types/Measure.d.ts +20 -0
  166. package/dist/src/types/MeasurementMode.d.ts +7 -0
  167. package/dist/src/types/Named.d.ts +5 -0
  168. package/dist/src/types/NavigationMode.d.ts +2 -0
  169. package/dist/src/types/Notification.d.ts +8 -0
  170. package/dist/src/types/OLGeometry.d.ts +1 -0
  171. package/dist/src/types/Overlay.d.ts +24 -0
  172. package/dist/src/types/VectorStyle.d.ts +31 -0
  173. package/dist/src/types/Viewbox.d.ts +7 -0
  174. package/dist/src/types/configuration/analysis.d.ts +26 -0
  175. package/dist/src/types/configuration/bookmark.d.ts +16 -0
  176. package/dist/src/types/configuration/camera.d.ts +19 -0
  177. package/dist/src/types/configuration/color.d.ts +18 -0
  178. package/dist/src/types/configuration/datasets/cityjson.d.ts +9 -0
  179. package/dist/src/types/configuration/datasets/core.d.ts +49 -0
  180. package/dist/src/types/configuration/datasets/featureCollection.d.ts +6 -0
  181. package/dist/src/types/configuration/datasets/ifc.d.ts +10 -0
  182. package/dist/src/types/configuration/datasets/index.d.ts +27 -0
  183. package/dist/src/types/configuration/datasets/layer.d.ts +43 -0
  184. package/dist/src/types/configuration/datasets/ply.d.ts +10 -0
  185. package/dist/src/types/configuration/datasets/pointCloud.d.ts +12 -0
  186. package/dist/src/types/configuration/datasets/potreePointCloud.d.ts +10 -0
  187. package/dist/src/types/configuration/datasets/tiledIfc.d.ts +9 -0
  188. package/dist/src/types/configuration/datasets/tiledPointCloud.d.ts +9 -0
  189. package/dist/src/types/configuration/datasets/vector.d.ts +34 -0
  190. package/dist/src/types/configuration/features.d.ts +2 -0
  191. package/dist/src/types/configuration/geographic.d.ts +51 -0
  192. package/dist/src/types/configuration/layers/core.d.ts +50 -0
  193. package/dist/src/types/configuration/layers/index.d.ts +51 -0
  194. package/dist/src/types/configuration/sources/bingMaps.d.ts +5 -0
  195. package/dist/src/types/configuration/sources/core/baseConfig.d.ts +70 -0
  196. package/dist/src/types/configuration/sources/core/tiled.d.ts +19 -0
  197. package/dist/src/types/configuration/sources/core/vector.d.ts +13 -0
  198. package/dist/src/types/configuration/sources/core/vectorTile.d.ts +8 -0
  199. package/dist/src/types/configuration/sources/customVector.d.ts +7 -0
  200. package/dist/src/types/configuration/sources/customVectorTile.d.ts +8 -0
  201. package/dist/src/types/configuration/sources/geojson.d.ts +5 -0
  202. package/dist/src/types/configuration/sources/geotiff.d.ts +8 -0
  203. package/dist/src/types/configuration/sources/gpx.d.ts +5 -0
  204. package/dist/src/types/configuration/sources/kml.d.ts +5 -0
  205. package/dist/src/types/configuration/sources/mvt.d.ts +10 -0
  206. package/dist/src/types/configuration/sources/osm.d.ts +5 -0
  207. package/dist/src/types/configuration/sources/stadiaMaps.d.ts +5 -0
  208. package/dist/src/types/configuration/sources/wms.d.ts +15 -0
  209. package/dist/src/types/configuration/sources/wmts.d.ts +15 -0
  210. package/dist/src/types/configuration/sources/xyz.d.ts +9 -0
  211. package/dist/src/types/utilities.d.ts +5 -0
  212. package/dist/src/utils/Components.d.ts +8 -0
  213. package/dist/src/utils/Configuration.d.ts +15 -0
  214. package/dist/src/utils/Download.d.ts +11 -0
  215. package/dist/src/utils/Fetcher.d.ts +77 -0
  216. package/dist/src/utils/Measure.d.ts +7 -0
  217. package/dist/src/utils/OLFeatures.d.ts +57 -0
  218. package/dist/src/utils/Projections.d.ts +10 -0
  219. package/dist/src/utils/Types.d.ts +11 -0
  220. package/package.json +103 -0
@@ -0,0 +1,20 @@
1
+ import { Vector3 } from '../../../../node_modules/three';
2
+ import { default as Shape } from '@giro3d/giro3d/entities/Shape';
3
+ import { default as Measure } from '../types/Measure';
4
+ import { HIGHLIGHT_MEASURE_COLOR } from '../constants';
5
+ declare class Measure3D extends Shape<MeasureUserData> {
6
+ readonly isMeasure3D: true;
7
+ get from(): Vector3;
8
+ get length(): number;
9
+ get to(): Vector3;
10
+ constructor();
11
+ static isMeasure3D: (obj: unknown) => obj is Measure3D;
12
+ clone(): Measure3D;
13
+ copy(source: this): this;
14
+ }
15
+ export type MeasureUserData = {
16
+ highlightable: true;
17
+ highlightColor: typeof HIGHLIGHT_MEASURE_COLOR;
18
+ measure: Measure;
19
+ };
20
+ export default Measure3D;
@@ -0,0 +1,11 @@
1
+ import { default as Extent } from '@giro3d/giro3d/core/geographic/Extent';
2
+ import { default as Instance } from '@giro3d/giro3d/core/Instance';
3
+ declare class Plane {
4
+ get visible(): boolean;
5
+ set visible(v: boolean);
6
+ private readonly _instance;
7
+ private readonly _plane;
8
+ constructor(instance: Instance, extent: Extent, name: string);
9
+ dispose(): void;
10
+ }
11
+ export default Plane;
@@ -0,0 +1,6 @@
1
+ import { default as Instance } from '@giro3d/giro3d/core/Instance';
2
+ declare function addSkybox(instance: Instance): Promise<void>;
3
+ declare const _default: {
4
+ addSkybox: typeof addSkybox;
5
+ };
6
+ export default _default;
@@ -0,0 +1,41 @@
1
+ import { FeatureElevationCallback, FeatureExtrusionOffsetCallback, FeatureStyle, FeatureStyleCallback } from '@giro3d/giro3d/core/FeatureTypes';
2
+ import { default as FeatureCollection } from '@giro3d/giro3d/entities/FeatureCollection';
3
+ import { EntityBuilder } from '../EntityBuilder';
4
+ import { FeatureProjectionMixin } from '../sources/mixins';
5
+ /** Options for the Giro3D FeatureCollection */
6
+ type FeatureCollectionConstructorOptions = ConstructorParameters<typeof FeatureCollection>[0];
7
+ /** Options for {@link FeatureCollectionEntity} */
8
+ export interface FeatureCollectionEntityOptions extends Partial<Pick<FeatureCollectionConstructorOptions, 'extent' | 'ignoreZ' | 'maxLevel' | 'minLevel'>>, Required<FeatureProjectionMixin> {
9
+ /**
10
+ * Set the elevation of the features received from the source.
11
+ * It can be a constant for every feature, or a callback.
12
+ * The callback version is particularly useful to derive the elevation
13
+ * from the properties of the feature.
14
+ * Requires {@link _ignoreZ} to be `false`.
15
+ */
16
+ elevation?: FeatureElevationCallback | number;
17
+ /**
18
+ * If set, this will cause 2D features to be extruded of the corresponding amount.
19
+ * If a single value is given, it will be used for all the vertices of every feature.
20
+ * If an array is given, each extruded vertex will use the corresponding value.
21
+ * If a callback is given, it allows to extrude each feature individually.
22
+ */
23
+ extrusionOffset?: FeatureExtrusionOffsetCallback | number;
24
+ /** Source to use */
25
+ source: 'bdtopo';
26
+ /**
27
+ * An style or a callback returning a style to style the individual features.
28
+ * If an object is used, the informations it contains will be used to style every
29
+ * feature the same way. If a function is provided, it will be called with the feature.
30
+ * This allows to individually style each feature.
31
+ */
32
+ style?: FeatureStyle | FeatureStyleCallback;
33
+ }
34
+ /**
35
+ * Entity for displaying 3D buildings
36
+ */
37
+ export declare class FeatureCollectionEntity extends FeatureCollection {
38
+ constructor(options: FeatureCollectionEntityOptions);
39
+ }
40
+ export declare const build: EntityBuilder;
41
+ export {};
@@ -0,0 +1,45 @@
1
+ import { GetMemoryUsageContext } from '@giro3d/giro3d/core/MemoryUsage';
2
+ import { EntityPreprocessOptions } from '@giro3d/giro3d/entities/Entity';
3
+ import { PointCloudOptions, default as PointCloud } from '@giro3d/giro3d/entities/PointCloud';
4
+ import { GetNodeDataOptions, PointCloudMetadata, PointCloudNode, PointCloudNodeData, PointCloudSourceBase } from '@giro3d/giro3d/sources/PointCloudSource';
5
+ import { UrlOrData } from '../../utils/Fetcher';
6
+ import { DataProjectionMixin, UrlOrDataMixin } from '../sources/mixins';
7
+ export type CSVPointCloudSourceOptions = DataProjectionMixin & UrlOrDataMixin;
8
+ /** Parameters for {@link PointCloudSource} for creating {@link PointCloudEntity} */
9
+ export interface PointCloudSourceOptions extends DataProjectionMixin, UrlOrDataMixin {
10
+ }
11
+ /**
12
+ * Source for loading CSV (as X, Y, Z) point clouds.
13
+ *
14
+ * @see https://loaders.gl/docs/modules/csv/api-reference/csv-loader
15
+ */
16
+ export declare class CSVPointCloudSource extends PointCloudSourceBase {
17
+ readonly dataProjection?: string;
18
+ readonly isCSVPointCloudSource: true;
19
+ readonly type = "CSVPointCloudSource";
20
+ readonly url: UrlOrData;
21
+ get loading(): boolean;
22
+ get progress(): number;
23
+ private _localVolume;
24
+ private _metadata;
25
+ private readonly _opCounter;
26
+ private _origin;
27
+ private _points;
28
+ private _root;
29
+ private _zArray;
30
+ constructor(options: CSVPointCloudSourceOptions);
31
+ dispose(): void;
32
+ getHierarchy(): Promise<PointCloudNode>;
33
+ getMemoryUsage(context: GetMemoryUsageContext): void;
34
+ getMetadata(): Promise<PointCloudMetadata>;
35
+ getNodeData(params: GetNodeDataOptions): Promise<PointCloudNodeData>;
36
+ protected initializeOnce(): Promise<this>;
37
+ }
38
+ /**
39
+ * Point cloud entity
40
+ */
41
+ export default class PointCloudEntity extends PointCloud {
42
+ readonly isPointCloudEntity = true;
43
+ constructor(options: PointCloudOptions);
44
+ initialize(opts: EntityPreprocessOptions): Promise<void>;
45
+ }
@@ -0,0 +1,13 @@
1
+ import { EntityBuilder } from '../EntityBuilder';
2
+ import { Tiles3dSource, default as Tiles3dEntity } from './Tiles3dEntity';
3
+ /** Parameters for creating {@link TiledPointCloudEntity} */
4
+ export interface TiledPointCloudSource extends Tiles3dSource {
5
+ name: string;
6
+ }
7
+ /**
8
+ * Entity for displaying 3D-Tiles point clouds
9
+ */
10
+ export default class TiledPointCloudEntity extends Tiles3dEntity {
11
+ constructor(parameters: TiledPointCloudSource);
12
+ }
13
+ export declare const build: EntityBuilder;
@@ -0,0 +1,11 @@
1
+ import { Tiles3DOptions, default as Tiles3D } from '@giro3d/giro3d/entities/Tiles3D';
2
+ import { UrlMixin } from '../sources/mixins';
3
+ /** Parameters for creating {@link Tiles3dEntity} */
4
+ export interface Tiles3dSource extends UrlMixin {
5
+ }
6
+ /**
7
+ * Entity for displaying 3D-Tiles files
8
+ */
9
+ export default class Tiles3dEntity extends Tiles3D {
10
+ constructor(parameters: Tiles3dSource, options?: Tiles3DOptions);
11
+ }
@@ -0,0 +1,48 @@
1
+ import { default as PickOptions } from '@giro3d/giro3d/core/picking/PickOptions';
2
+ import { default as PickResult } from '@giro3d/giro3d/core/picking/PickResult';
3
+ import { default as Entity3D } from '@giro3d/giro3d/entities/Entity3D';
4
+ import { Box3, Vector2, Vector3 } from '../../../../../node_modules/three';
5
+ import { SimpleFeature } from '../../utils/OLFeatures';
6
+ import { VectorMeshSource } from './VectorMeshEntity';
7
+ /**
8
+ * Pick result on {@link VectorLabelsEntity}
9
+ */
10
+ export type LabelPickResult = PickResult & {
11
+ entity: VectorLabelsEntity;
12
+ isLabelPickResult: true;
13
+ };
14
+ export interface VectorLabelOptions {
15
+ /**
16
+ * Callback for styling the label
17
+ * @param span - Label
18
+ * @param feature - Feature corresponding to the label
19
+ * @returns Nothing
20
+ */
21
+ style?: (span: HTMLSpanElement, feature: SimpleFeature) => void;
22
+ /**
23
+ * Callback for generating the text of labels
24
+ * @param feature - Feature corresponding to the label
25
+ * @param at - 3D position
26
+ * @returns Content of the label to create
27
+ */
28
+ text?: (feature: SimpleFeature, at: Vector3) => string;
29
+ }
30
+ /**
31
+ * Entity for displaying vector data as labels
32
+ */
33
+ export default class VectorLabelsEntity extends Entity3D {
34
+ readonly sources: VectorMeshSource[];
35
+ private _labels;
36
+ private _styleCallback?;
37
+ private _textCallback;
38
+ constructor(sources: VectorMeshSource | VectorMeshSource[], options?: VectorLabelOptions);
39
+ getBoundingBox(): Box3 | null;
40
+ pick(coordinates: Vector2, _options?: PickOptions): LabelPickResult[];
41
+ updateOpacity(): void;
42
+ updateVisibility(): void;
43
+ protected preprocess(): Promise<void>;
44
+ private createLabel;
45
+ private pickLabels;
46
+ private raycastLabel;
47
+ private updateStyle;
48
+ }
@@ -0,0 +1,97 @@
1
+ import { default as Instance } from '@giro3d/giro3d/core/Instance';
2
+ import { PolygonOptions } from '@giro3d/giro3d/renderer/geometries/GeometryConverter';
3
+ import { default as FeatureFormat } from 'ol/format/Feature';
4
+ import { default as Entity3D } from '@giro3d/giro3d/entities/Entity3D';
5
+ import { Group } from '../../../../../node_modules/three';
6
+ import { ExtractOptional } from '../../types/utilities';
7
+ import { FetchContext } from '../../utils/Fetcher';
8
+ import { SimpleFeature } from '../../utils/OLFeatures';
9
+ import { DataProjectionMixin, ElevationMixin, FeatureProjectionMixin, UrlOrDataMixin } from '../sources/mixins';
10
+ /** Source for {@link VectorMeshEntity} */
11
+ export interface VectorMeshSourceOptions extends DataProjectionMixin, ElevationMixin, Required<FeatureProjectionMixin>, UrlOrDataMixin {
12
+ }
13
+ export declare const defaultParameters: Required<ExtractOptional<VectorMeshSourceOptions>>;
14
+ /** Interface to implement for a new source for {@link VectorMeshEntity} */
15
+ export interface VectorMeshSource {
16
+ /** Elevation of the features */
17
+ elevation?: number;
18
+ /** No data value for elevation */
19
+ noDataValue?: number;
20
+ /** Context of the data */
21
+ context(): FetchContext;
22
+ /** Loads the features. Will be called only once */
23
+ load(instance: Instance): Promise<SimpleFeature[]>;
24
+ }
25
+ /** GeoJSON source */
26
+ export declare class GeoJsonMeshSource implements VectorMeshSource {
27
+ elevation?: number;
28
+ readonly options: VectorMeshSourceOptions;
29
+ constructor(options: VectorMeshSourceOptions);
30
+ context(): FetchContext;
31
+ load(instance: Instance): Promise<SimpleFeature[]>;
32
+ }
33
+ /** OpenLayers-based source */
34
+ export declare class OlMeshSource implements VectorMeshSource {
35
+ elevation?: number;
36
+ /** OL Feature format */
37
+ readonly format: FeatureFormat;
38
+ noDataValue?: number;
39
+ readonly options: VectorMeshSourceOptions;
40
+ constructor(format: FeatureFormat, options: VectorMeshSourceOptions);
41
+ context(): FetchContext;
42
+ load(instance: Instance): Promise<SimpleFeature[]>;
43
+ }
44
+ /** GPX source */
45
+ export declare class GpxMeshSource extends OlMeshSource {
46
+ constructor(options: VectorMeshSourceOptions);
47
+ }
48
+ /** KML source */
49
+ export declare class KmlMeshSource extends OlMeshSource {
50
+ constructor(options: VectorMeshSourceOptions);
51
+ }
52
+ /**
53
+ * Converts GeoJSON features into OpenLayers features.
54
+ * Will handle reprojection if needed.
55
+ * Will fetch elevation if `parameters.fetchElevation` is `true`.
56
+ *
57
+ * @param features - Array of GeoJSON features
58
+ * @param parameters - Loader parameters
59
+ * @returns Array of simple features, where unsupported features are discarded
60
+ */
61
+ export declare function geojsonToOlFeatures(instance: Instance, features: GeoJSON.Feature[], parameters: VectorMeshSourceOptions): Promise<SimpleFeature[]>;
62
+ /**
63
+ * Converts {@link SimpleFeature}s into a Three.js `Group`.
64
+ * Assumes features are already in the correct CRS.
65
+ * If Z-coordinates are missing in the features (`null` or equal to `noDataValue`),
66
+ * they are filled at `options?.elevation` or at `defaultElevation`.
67
+ *
68
+ * @param features - Features to convert
69
+ * @param options - GeometryConverter options
70
+ * @param defaultElevation - Default elevation if not provided via options
71
+ * @param noDataValue - Value considered as no data for filling Z.
72
+ * @returns Group containing all meshes for all features
73
+ */
74
+ export declare function olFeaturestoGroup(features: SimpleFeature[], options?: PolygonOptions, defaultElevation?: number, noDataValue?: number): Group;
75
+ /**
76
+ * Converts a GeoJSON object into a list of GeoJSON features
77
+ * @param json - GeoJSON object
78
+ * @returns Array of GeoJSON features
79
+ */
80
+ export declare function toGeoJSONFeatures(json: GeoJSON.GeoJSON): GeoJSON.Feature[];
81
+ /**
82
+ * Converts loaded data into OpenLayers {@link SimpleFeature}s.
83
+ * Will handle reprojection if needed.
84
+ * Will fetch elevation if `parameters.fetchElevation` is `true`.
85
+ *
86
+ * @param data - Loaded data
87
+ * @param format - OpenLayers format used for decoding `data`
88
+ * @param parameters - Loader parameters
89
+ * @returns Array of simple features, where unsupported features are discarded
90
+ */
91
+ export declare function toOlFeatures(instance: Instance, data: string, format: FeatureFormat, parameters: VectorMeshSourceOptions): Promise<SimpleFeature[]>;
92
+ /** Entity for displaying vector data as meshes */
93
+ export default class VectorMeshEntity extends Entity3D {
94
+ readonly sources: VectorMeshSource[];
95
+ constructor(sources: VectorMeshSource | VectorMeshSource[]);
96
+ protected preprocess(): Promise<void>;
97
+ }
@@ -0,0 +1,8 @@
1
+ import { default as Shape } from '@giro3d/giro3d/entities/Shape';
2
+ import { VectorMeshSource } from './VectorMeshEntity';
3
+ /** Entity for displaying vector data as meshes */
4
+ export default class VectorShapeEntity extends Shape {
5
+ readonly source: VectorMeshSource;
6
+ constructor(source: VectorMeshSource);
7
+ protected preprocess(): Promise<void>;
8
+ }
@@ -0,0 +1,2 @@
1
+ import { EntityBuilder } from '../EntityBuilder';
2
+ export declare const build: EntityBuilder;
@@ -0,0 +1,2 @@
1
+ import { EntityBuilder } from '../EntityBuilder';
2
+ export declare const build: EntityBuilder;
@@ -0,0 +1,2 @@
1
+ import { EntityBuilder } from '../EntityBuilder';
2
+ export declare const build: EntityBuilder;
@@ -0,0 +1,20 @@
1
+ import { default as Instance } from '@giro3d/giro3d/core/Instance';
2
+ import { SimpleFeature } from '../../utils/OLFeatures';
3
+ import { FetchContext } from '../../utils/Fetcher';
4
+ import { DataProjectionMixin, ElevationMixin, FeatureProjectionMixin, UrlOrDataMixin } from './mixins';
5
+ import { VectorMeshSource } from '../entities/VectorMeshEntity';
6
+ /**
7
+ * Options for loading Geopackage files into a {@link VectorMeshEntity}
8
+ */
9
+ export interface GeopackageSourceParameters extends DataProjectionMixin, ElevationMixin, Required<FeatureProjectionMixin>, UrlOrDataMixin {
10
+ }
11
+ /**
12
+ * Source for loading a Geopackage file into a {@link VectorMeshEntity}
13
+ */
14
+ export default class GeopackageSource implements VectorMeshSource {
15
+ elevation?: number;
16
+ readonly options: GeopackageSourceParameters;
17
+ constructor(options: GeopackageSourceParameters);
18
+ context(): FetchContext;
19
+ load(instance: Instance): Promise<SimpleFeature[]>;
20
+ }
@@ -0,0 +1,20 @@
1
+ import { default as Instance } from '@giro3d/giro3d/core/Instance';
2
+ import { FetchContext } from '../../utils/Fetcher';
3
+ import { SimpleFeature } from '../../utils/OLFeatures';
4
+ import { VectorMeshSource } from '../entities/VectorMeshEntity';
5
+ import { DataProjectionMixin, ElevationMixin, FeatureProjectionMixin, UrlOrDataMixin } from './mixins';
6
+ /**
7
+ * Options for loading Shapefile files into a {@link VectorMeshEntity}
8
+ */
9
+ export interface ShapefileSourceParameters extends DataProjectionMixin, ElevationMixin, Required<FeatureProjectionMixin>, UrlOrDataMixin {
10
+ }
11
+ /**
12
+ * Source for loading a Shapefile file into a {@link VectorMeshEntity}
13
+ */
14
+ export default class ShapefileSource implements VectorMeshSource {
15
+ elevation?: number;
16
+ readonly options: ShapefileSourceParameters;
17
+ constructor(options: ShapefileSourceParameters);
18
+ context(): FetchContext;
19
+ load(instance: Instance): Promise<SimpleFeature[]>;
20
+ }
@@ -0,0 +1,60 @@
1
+ import { default as Coordinates } from '@giro3d/giro3d/core/geographic/Coordinates';
2
+ import { UrlOrData } from '../../utils/Fetcher';
3
+ /** Mixin configuration for sources that may set their geolocation */
4
+ export interface CoordinatesMixin {
5
+ /** Location, should be in the instance's CRS */
6
+ at?: Coordinates;
7
+ }
8
+ /** Mixin configuration for sources that may have a data projection */
9
+ export interface DataProjectionMixin {
10
+ /** CRS of the source */
11
+ dataProjection?: string;
12
+ }
13
+ /** Mixin configuration for sources that may require elevation configuration */
14
+ export interface ElevationMixin {
15
+ /**
16
+ * Elevation of data
17
+ *
18
+ * @defaultValue 0
19
+ */
20
+ elevation?: number;
21
+ /**
22
+ * Fetch elevation from provider
23
+ *
24
+ * @defaultValue false
25
+ */
26
+ fetchElevation?: boolean;
27
+ /**
28
+ * Fetch elevation from map instead of API
29
+ *
30
+ * @defaultValue false
31
+ */
32
+ fetchElevationFast?: boolean;
33
+ /**
34
+ * When fetching elevation, add this offset
35
+ *
36
+ * @defaultValue 0.1
37
+ */
38
+ fetchElevationOffset?: number;
39
+ /**
40
+ * When fetching or setting elevation, consider this value as no data
41
+ *
42
+ * @defaultValue 0
43
+ */
44
+ noDataValue?: number;
45
+ }
46
+ /** Mixin configuration for sources that may have a feature projection */
47
+ export interface FeatureProjectionMixin {
48
+ /** CRS of the target, should be the instance's CRS */
49
+ featureProjection?: string;
50
+ }
51
+ /** Mixin configuration for sources that require a URL */
52
+ export interface UrlMixin {
53
+ /** URL of the source */
54
+ url: string;
55
+ }
56
+ /** Mixin configuration for sources that require a URL or Blob */
57
+ export interface UrlOrDataMixin {
58
+ /** URL of the source */
59
+ url: UrlOrData;
60
+ }
@@ -0,0 +1,17 @@
1
+ import { default as BookmarkApi } from './api/BookmarkApi';
2
+ import { default as DatasetApi } from './api/DatasetApi';
3
+ import { default as ViewApi } from './api/ViewApi';
4
+ import { PieroContext } from './context';
5
+ import { BookmarkEvents, PieroEmptyEvent, PieroEvents, PieroGlobalEvents } from './events';
6
+ import { EntityBuilder } from './giro3d/EntityBuilder';
7
+ import { LoadDatasetFromFile } from './loaders/loader';
8
+ import { Module } from './module';
9
+ import { AttributeExtractorFn } from './services/Picker';
10
+ import { Configuration } from './types/Configuration';
11
+ import { Attribute, AttributesGroups } from './types/Feature';
12
+ import { default as createPieroApp } from './createPieroApp';
13
+ import { fillObject3DUserData, UserData } from './loaders/userData';
14
+ import { default as Bookmark } from './types/Bookmark';
15
+ import { default as Fetcher } from './utils/Fetcher';
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, };
@@ -0,0 +1,3 @@
1
+ import { PointCloudDatasetConfig } from '../types/configuration/datasets/pointCloud';
2
+ import { LoadDatasetFromFile } from './loader';
3
+ export declare const load: LoadDatasetFromFile<PointCloudDatasetConfig>;
@@ -0,0 +1,3 @@
1
+ import { PointCloudDatasetConfig } from '../types/configuration/datasets/pointCloud';
2
+ import { LoadDatasetFromFile } from './loader';
3
+ export declare const load: LoadDatasetFromFile<PointCloudDatasetConfig>;
@@ -0,0 +1,29 @@
1
+ import { Configuration } from '../types/Configuration';
2
+ import { DatasetConfigImportable } from '../types/configuration/datasets';
3
+ import { Dataset } from '../types/Dataset';
4
+ export type LoadDatasetFromFile<O extends DatasetConfigImportable = DatasetConfigImportable> = (context: LoaderContext) => O;
5
+ export type LoaderContext = {
6
+ configuration: Configuration;
7
+ extension: string;
8
+ file: File | string;
9
+ filename: string;
10
+ };
11
+ /**
12
+ * Loads a file and creates its Dataset.
13
+ *
14
+ * @param fileOrUrl - File to load
15
+ * @returns Created objects
16
+ * @throws `Error` if file cannot be imported (unsupported, etc.)
17
+ */
18
+ declare function importFile(fileOrUrl: File | string, config: Readonly<Configuration>): Promise<Dataset>;
19
+ /**
20
+ * Registers a custom loader for a specific file extension.
21
+ * If a loader for the same extension exists, it is replaced by the new one.
22
+ * @param fileExtension - The file extension, without the dot.
23
+ * @param loader - The loader to use.
24
+ */
25
+ export declare function registerLoader(fileExtension: string, loader: LoadDatasetFromFile): void;
26
+ declare const _default: {
27
+ importFile: typeof importFile;
28
+ };
29
+ export default _default;
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,8 @@
1
+ import { default as Entity3D } from '@giro3d/giro3d/entities/Entity3D';
2
+ import { Object3D } from '../../../../node_modules/three';
3
+ /** User data to be set on the loaded entities */
4
+ export interface UserData {
5
+ /** File that the entity was loaded from */
6
+ filename?: string | null;
7
+ }
8
+ export declare function fillObject3DUserData(root: Entity3D | Object3D, userData: UserData): void;
@@ -0,0 +1,4 @@
1
+ import { ColorLayerDatasetConfig } from '../types/configuration/datasets/layer';
2
+ import { VectorLabelsDatasetConfig, VectorMeshDatasetConfig, VectorShapeDatasetConfig } from '../types/configuration/datasets/vector';
3
+ import { LoadDatasetFromFile } from './loader';
4
+ export declare const load: LoadDatasetFromFile<ColorLayerDatasetConfig | VectorLabelsDatasetConfig | VectorMeshDatasetConfig | VectorShapeDatasetConfig>;
@@ -0,0 +1,11 @@
1
+ import { PieroContext } from './context';
2
+ export interface Module {
3
+ /**
4
+ * The readable name of the module.
5
+ */
6
+ name: string;
7
+ /**
8
+ * Initialize this module on the Piero context.
9
+ */
10
+ initialize(context: PieroContext): Promise<void> | void;
11
+ }
@@ -0,0 +1,9 @@
1
+ import { PieroContext } from '../context';
2
+ import { Module } from '../module';
3
+ /**
4
+ * Loads IFC (Industry Foundation Classes) files.
5
+ */
6
+ export default class IFCLoader implements Module {
7
+ readonly name = "IFC";
8
+ initialize(context: PieroContext): Promise<void>;
9
+ }
@@ -0,0 +1,9 @@
1
+ import { PieroContext } from '../context';
2
+ import { Module } from '../module';
3
+ /**
4
+ * Loads .ply files.
5
+ */
6
+ export default class PLYLoader implements Module {
7
+ readonly name = "PLY";
8
+ initialize(context: PieroContext): Promise<void> | void;
9
+ }
@@ -0,0 +1,9 @@
1
+ import { PieroContext } from '../context';
2
+ import { Module } from '../module';
3
+ /**
4
+ * Loads [Potree](https://potree.github.io/) datasets.
5
+ */
6
+ export default class PotreeLoader implements Module {
7
+ readonly name = "Potree";
8
+ initialize(context: PieroContext): Promise<void> | void;
9
+ }
@@ -0,0 +1,17 @@
1
+ import { PieroContext } from '../context';
2
+ import { Module } from '../module';
3
+ /**
4
+ * Provides a guided tour of the application.
5
+ */
6
+ export default class TourModule implements Module {
7
+ readonly name = "Tour";
8
+ private _camera;
9
+ private _cameraCallback;
10
+ private _context;
11
+ private _tours;
12
+ initialize(context: PieroContext): Promise<void> | void;
13
+ private buildTours;
14
+ private getTours;
15
+ private restart;
16
+ private start;
17
+ }
@@ -0,0 +1,84 @@
1
+ import { default as PickableFeatures } from '@giro3d/giro3d/core/picking/PickableFeatures';
2
+ import { default as PickOptions } from '@giro3d/giro3d/core/picking/PickOptions';
3
+ import { default as PickResult } from '@giro3d/giro3d/core/picking/PickResult';
4
+ import { FragmentMesh } from 'bim-fragment/fragment-mesh';
5
+ import { FragmentIdMap } from 'openbim-components';
6
+ import { Box3, Vector2 } from '../../../../../node_modules/three';
7
+ import { default as Entity3D } from '@giro3d/giro3d/entities/Entity3D';
8
+ import { CoordinatesMixin, UrlOrDataMixin } from '../../giro3d/sources/mixins';
9
+ type FragmentTypeName = 'bbox' | 'selection';
10
+ export declare enum ClassificationSystem {
11
+ ENTITY = "entities",
12
+ STOREY = "storeys"
13
+ }
14
+ export type ClassificationItem = {
15
+ children: ClassificationItem[];
16
+ fragments: FragmentIdMap;
17
+ name: string;
18
+ treeItemName: string;
19
+ };
20
+ export interface IFCFeature {
21
+ ifcProperties: IFCProperty[];
22
+ itemProperties: {
23
+ [attribute: string]: any;
24
+ };
25
+ }
26
+ export interface IFCPickResult extends PickResult<IFCFeature> {
27
+ entity: IfcEntity;
28
+ features?: IFCFeature[];
29
+ isIFCPickResult: true;
30
+ object: FragmentMesh;
31
+ }
32
+ export interface IFCProperty {
33
+ name: string;
34
+ parentName: string;
35
+ value: number | null;
36
+ }
37
+ export declare const isIFCPickResult: (obj: unknown) => obj is IFCPickResult;
38
+ /** Source interface for {@link IfcEntity} */
39
+ export interface IfcSource extends CoordinatesMixin, UrlOrDataMixin {
40
+ /** Name of the IFC */
41
+ name: string;
42
+ }
43
+ /**
44
+ * Entity for displaying an IFC file
45
+ */
46
+ export default class IfcEntity extends Entity3D implements PickableFeatures<IFCFeature, IFCPickResult> {
47
+ readonly isIfcEntity: true;
48
+ readonly isPickableFeatures: true;
49
+ readonly type: "IfcEntity";
50
+ private _classificationCache;
51
+ private _components;
52
+ private _fragmentBoundingBox;
53
+ private _fragmentClassifier;
54
+ private _fragmentManager;
55
+ private _ifcSelection;
56
+ private _indexMap;
57
+ private _model;
58
+ private readonly _source;
59
+ constructor(source: IfcSource);
60
+ static isIFCEntity: (obj: unknown) => obj is IfcEntity;
61
+ static isIFCPickResult: (obj: unknown) => obj is IFCPickResult;
62
+ clearHighlight(name?: FragmentTypeName): void;
63
+ getBoundingBoxById(ids: FragmentIdMap): Box3 | undefined;
64
+ getClassification(): ClassificationItem[];
65
+ getProperties(expressID: string): IFCProperty[];
66
+ getProperty(expressID: number): {
67
+ name: string;
68
+ value: number | null;
69
+ } | null;
70
+ highlight(name: FragmentTypeName, mesh: FragmentMesh, itemId: string): void;
71
+ highlightById(ids: FragmentIdMap, name?: FragmentTypeName): void;
72
+ pick(canvasCoords: Vector2, options?: PickOptions): IFCPickResult[];
73
+ pickFeaturesFrom(pickedResult: IFCPickResult): IFCFeature[];
74
+ protected initClassification(): Promise<void>;
75
+ protected preprocess(): Promise<void>;
76
+ private addComposites;
77
+ private addHighlightToFragment;
78
+ private initializeEntityIndexes;
79
+ private regenerate;
80
+ private regenerateClassification;
81
+ private setEntityIndex;
82
+ private updateFragmentFill;
83
+ }
84
+ export {};