@thatopen/components 2.4.11 → 3.1.1

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 (161) hide show
  1. package/dist/index.cjs +18440 -25937
  2. package/dist/index.d.ts +4530 -6
  3. package/dist/index.min.cjs +3 -3
  4. package/dist/index.min.mjs +3 -3
  5. package/dist/index.mjs +18442 -25939
  6. package/package.json +8 -10
  7. package/dist/core/Clipper/index.d.ts +0 -142
  8. package/dist/core/Clipper/src/clipper-config.d.ts +0 -33
  9. package/dist/core/Clipper/src/index.d.ts +0 -1
  10. package/dist/core/Clipper/src/simple-plane.d.ts +0 -99
  11. package/dist/core/Components/index.d.ts +0 -93
  12. package/dist/core/ConfigManager/index.d.ts +0 -21
  13. package/dist/core/ConfigManager/src/configurator.d.ts +0 -13
  14. package/dist/core/ConfigManager/src/index.d.ts +0 -1
  15. package/dist/core/Cullers/index.d.ts +0 -56
  16. package/dist/core/Cullers/src/culler-renderer-config.d.ts +0 -74
  17. package/dist/core/Cullers/src/culler-renderer.d.ts +0 -76
  18. package/dist/core/Cullers/src/index.d.ts +0 -3
  19. package/dist/core/Cullers/src/mesh-culler-renderer.d.ts +0 -59
  20. package/dist/core/Cullers/src/screen-culler-helper.d.ts +0 -1
  21. package/dist/core/Disposer/index.d.ts +0 -45
  22. package/dist/core/Grids/index.d.ts +0 -46
  23. package/dist/core/Grids/src/index.d.ts +0 -2
  24. package/dist/core/Grids/src/simple-grid-config.d.ts +0 -80
  25. package/dist/core/Grids/src/simple-grid.d.ts +0 -48
  26. package/dist/core/MiniMap/index.d.ts +0 -50
  27. package/dist/core/MiniMap/src/index.d.ts +0 -2
  28. package/dist/core/MiniMap/src/mini-map-config.d.ts +0 -112
  29. package/dist/core/MiniMap/src/mini-map.d.ts +0 -100
  30. package/dist/core/OrthoPerspectiveCamera/index.d.ts +0 -65
  31. package/dist/core/OrthoPerspectiveCamera/src/first-person-mode.d.ts +0 -16
  32. package/dist/core/OrthoPerspectiveCamera/src/index.d.ts +0 -5
  33. package/dist/core/OrthoPerspectiveCamera/src/orbit-mode.d.ts +0 -16
  34. package/dist/core/OrthoPerspectiveCamera/src/plan-mode.d.ts +0 -20
  35. package/dist/core/OrthoPerspectiveCamera/src/projections.d.ts +0 -45
  36. package/dist/core/OrthoPerspectiveCamera/src/types.d.ts +0 -26
  37. package/dist/core/Raycasters/index.d.ts +0 -43
  38. package/dist/core/Raycasters/src/index.d.ts +0 -2
  39. package/dist/core/Raycasters/src/mouse.d.ts +0 -24
  40. package/dist/core/Raycasters/src/simple-raycaster.d.ts +0 -54
  41. package/dist/core/ShadowedScene/index.d.ts +0 -57
  42. package/dist/core/ShadowedScene/src/distance-renderer.d.ts +0 -67
  43. package/dist/core/ShadowedScene/src/index.d.ts +0 -1
  44. package/dist/core/Types/index.d.ts +0 -1
  45. package/dist/core/Types/src/async-event.d.ts +0 -32
  46. package/dist/core/Types/src/base-camera.d.ts +0 -28
  47. package/dist/core/Types/src/base-renderer.d.ts +0 -65
  48. package/dist/core/Types/src/base-scene.d.ts +0 -25
  49. package/dist/core/Types/src/base-world-item.d.ts +0 -23
  50. package/dist/core/Types/src/base.d.ts +0 -19
  51. package/dist/core/Types/src/component-with-ui.d.ts +0 -18
  52. package/dist/core/Types/src/component.d.ts +0 -13
  53. package/dist/core/Types/src/config-types.d.ts +0 -47
  54. package/dist/core/Types/src/data-map.d.ts +0 -73
  55. package/dist/core/Types/src/data-set.d.ts +0 -58
  56. package/dist/core/Types/src/event-manager.d.ts +0 -30
  57. package/dist/core/Types/src/event.d.ts +0 -32
  58. package/dist/core/Types/src/index.d.ts +0 -15
  59. package/dist/core/Types/src/interfaces.d.ts +0 -117
  60. package/dist/core/Types/src/world.d.ts +0 -34
  61. package/dist/core/Viewpoints/index.d.ts +0 -38
  62. package/dist/core/Viewpoints/src/index.d.ts +0 -2
  63. package/dist/core/Viewpoints/src/types.d.ts +0 -36
  64. package/dist/core/Viewpoints/src/viewpoint.d.ts +0 -197
  65. package/dist/core/Viewpoints/src/viewpoints-config.d.ts +0 -23
  66. package/dist/core/Worlds/index.d.ts +0 -54
  67. package/dist/core/Worlds/src/index.d.ts +0 -5
  68. package/dist/core/Worlds/src/simple-camera.d.ts +0 -62
  69. package/dist/core/Worlds/src/simple-renderer.d.ts +0 -54
  70. package/dist/core/Worlds/src/simple-scene-config.d.ts +0 -59
  71. package/dist/core/Worlds/src/simple-scene.d.ts +0 -25
  72. package/dist/core/Worlds/src/simple-world.d.ts +0 -79
  73. package/dist/core/index.d.ts +0 -13
  74. package/dist/fragments/BoundingBoxer/index.d.ts +0 -208
  75. package/dist/fragments/Classifier/index.d.ts +0 -197
  76. package/dist/fragments/Exploder/index.d.ts +0 -50
  77. package/dist/fragments/FragmentsManager/index.d.ts +0 -152
  78. package/dist/fragments/Hider/index.d.ts +0 -38
  79. package/dist/fragments/IfcGeometryTiler/index.d.ts +0 -103
  80. package/dist/fragments/IfcGeometryTiler/src/base-types.d.ts +0 -29
  81. package/dist/fragments/IfcGeometryTiler/src/index.d.ts +0 -2
  82. package/dist/fragments/IfcGeometryTiler/src/streaming-settings.d.ts +0 -20
  83. package/dist/fragments/IfcLoader/index.d.ts +0 -116
  84. package/dist/fragments/IfcLoader/src/civil-reader.d.ts +0 -15
  85. package/dist/fragments/IfcLoader/src/ifc-fragment-settings.d.ts +0 -41
  86. package/dist/fragments/IfcLoader/src/ifc-metadata-reader.d.ts +0 -5
  87. package/dist/fragments/IfcLoader/src/index.d.ts +0 -5
  88. package/dist/fragments/IfcLoader/src/spatial-ids-finder.d.ts +0 -5
  89. package/dist/fragments/IfcLoader/src/spatial-structure.d.ts +0 -8
  90. package/dist/fragments/IfcLoader/src/transform-helper.d.ts +0 -5
  91. package/dist/fragments/IfcLoader/src/units.d.ts +0 -10
  92. package/dist/fragments/IfcPropertiesTiler/index.d.ts +0 -66
  93. package/dist/fragments/IfcPropertiesTiler/src/index.d.ts +0 -1
  94. package/dist/fragments/IfcPropertiesTiler/src/streaming-settings.d.ts +0 -11
  95. package/dist/fragments/index.d.ts +0 -8
  96. package/dist/ifc/IfcFinder/index.d.ts +0 -50
  97. package/dist/ifc/IfcFinder/src/ifc-basic-query.d.ts +0 -35
  98. package/dist/ifc/IfcFinder/src/ifc-finder-query.d.ts +0 -96
  99. package/dist/ifc/IfcFinder/src/ifc-property-query.d.ts +0 -36
  100. package/dist/ifc/IfcFinder/src/ifc-query-group.d.ts +0 -69
  101. package/dist/ifc/IfcFinder/src/index.d.ts +0 -4
  102. package/dist/ifc/IfcFinder/src/types.d.ts +0 -84
  103. package/dist/ifc/IfcIsolator/index.d.ts +0 -24
  104. package/dist/ifc/IfcJsonExporter/index.d.ts +0 -26
  105. package/dist/ifc/IfcJsonExporter/src/ifc-geometry-types.d.ts +0 -4
  106. package/dist/ifc/IfcJsonExporter/src/index.d.ts +0 -1
  107. package/dist/ifc/IfcPropertiesManager/index.d.ts +0 -289
  108. package/dist/ifc/IfcPropertiesManager/src/index.d.ts +0 -3
  109. package/dist/ifc/IfcPropertiesManager/src/rel-attrs.d.ts +0 -7
  110. package/dist/ifc/IfcPropertiesManager/src/rel-names.d.ts +0 -3
  111. package/dist/ifc/IfcPropertiesManager/src/types.d.ts +0 -18
  112. package/dist/ifc/IfcRelationsIndexer/index.d.ts +0 -195
  113. package/dist/ifc/IfcRelationsIndexer/src/index.d.ts +0 -2
  114. package/dist/ifc/IfcRelationsIndexer/src/newVersion.d.ts +0 -51
  115. package/dist/ifc/IfcRelationsIndexer/src/relToAttributesMap.d.ts +0 -5
  116. package/dist/ifc/IfcRelationsIndexer/src/types.d.ts +0 -73
  117. package/dist/ifc/Utils/ifc-categories.d.ts +0 -7
  118. package/dist/ifc/Utils/ifc-category-case.d.ts +0 -3
  119. package/dist/ifc/Utils/ifc-category-map.d.ts +0 -6
  120. package/dist/ifc/Utils/ifc-elements-map.d.ts +0 -11
  121. package/dist/ifc/Utils/index.d.ts +0 -5
  122. package/dist/ifc/Utils/properties-utils.d.ts +0 -25
  123. package/dist/ifc/index.d.ts +0 -6
  124. package/dist/measurement/MeasurementUtils/index.d.ts +0 -105
  125. package/dist/measurement/index.d.ts +0 -1
  126. package/dist/namespace.d.ts +0 -6018
  127. package/dist/openbim/BCFTopics/index.d.ts +0 -114
  128. package/dist/openbim/BCFTopics/src/Comment.d.ts +0 -40
  129. package/dist/openbim/BCFTopics/src/Topic.d.ts +0 -127
  130. package/dist/openbim/BCFTopics/src/bcf-topics-config.d.ts +0 -121
  131. package/dist/openbim/BCFTopics/src/importers/extensions.d.ts +0 -2
  132. package/dist/openbim/BCFTopics/src/importers/index.d.ts +0 -1
  133. package/dist/openbim/BCFTopics/src/index.d.ts +0 -5
  134. package/dist/openbim/BCFTopics/src/types.d.ts +0 -19
  135. package/dist/openbim/IDSSpecifications/index.d.ts +0 -60
  136. package/dist/openbim/IDSSpecifications/src/Specification.d.ts +0 -40
  137. package/dist/openbim/IDSSpecifications/src/exporters/parameter.d.ts +0 -2
  138. package/dist/openbim/IDSSpecifications/src/facets/Attribute.d.ts +0 -13
  139. package/dist/openbim/IDSSpecifications/src/facets/Classification.d.ts +0 -21
  140. package/dist/openbim/IDSSpecifications/src/facets/Entity.d.ts +0 -15
  141. package/dist/openbim/IDSSpecifications/src/facets/Facet.d.ts +0 -26
  142. package/dist/openbim/IDSSpecifications/src/facets/Material.d.ts +0 -10
  143. package/dist/openbim/IDSSpecifications/src/facets/PartOf.d.ts +0 -26
  144. package/dist/openbim/IDSSpecifications/src/facets/Property.d.ts +0 -25
  145. package/dist/openbim/IDSSpecifications/src/facets/index.d.ts +0 -5
  146. package/dist/openbim/IDSSpecifications/src/importers/attribute.d.ts +0 -3
  147. package/dist/openbim/IDSSpecifications/src/importers/classification.d.ts +0 -3
  148. package/dist/openbim/IDSSpecifications/src/importers/entity.d.ts +0 -3
  149. package/dist/openbim/IDSSpecifications/src/importers/index.d.ts +0 -3
  150. package/dist/openbim/IDSSpecifications/src/importers/parameter.d.ts +0 -2
  151. package/dist/openbim/IDSSpecifications/src/importers/property.d.ts +0 -3
  152. package/dist/openbim/IDSSpecifications/src/index.d.ts +0 -3
  153. package/dist/openbim/IDSSpecifications/src/types.d.ts +0 -70
  154. package/dist/openbim/index.d.ts +0 -2
  155. package/dist/utils/bbox.d.ts +0 -7
  156. package/dist/utils/geometry.d.ts +0 -1
  157. package/dist/utils/index.d.ts +0 -6
  158. package/dist/utils/materials.d.ts +0 -4
  159. package/dist/utils/section-generator.d.ts +0 -31
  160. package/dist/utils/uuid.d.ts +0 -6
  161. package/dist/utils/vertex-picker.d.ts +0 -116
@@ -1,20 +0,0 @@
1
- import { NavigationMode } from "./types";
2
- import { OrthoPerspectiveCamera } from "../index";
3
- /**
4
- * A {@link NavigationMode} that allows to navigate floorplans in 2D, like many BIM tools.
5
- */
6
- export declare class PlanMode implements NavigationMode {
7
- private camera;
8
- /** {@link NavigationMode.enabled} */
9
- enabled: boolean;
10
- /** {@link NavigationMode.id} */
11
- readonly id = "Plan";
12
- private mouseAction1?;
13
- private mouseAction2?;
14
- private mouseInitialized;
15
- private readonly defaultAzimuthSpeed;
16
- private readonly defaultPolarSpeed;
17
- constructor(camera: OrthoPerspectiveCamera);
18
- /** {@link NavigationMode.set} */
19
- set(active: boolean): void;
20
- }
@@ -1,45 +0,0 @@
1
- import * as THREE from "three";
2
- import { CameraProjection } from "./types";
3
- import { Event } from "../../Types";
4
- import { OrthoPerspectiveCamera } from "../index";
5
- /**
6
- * Object to control the {@link CameraProjection} of the {@link OrthoPerspectiveCamera}.
7
- */
8
- export declare class ProjectionManager {
9
- /**
10
- * Event that fires when the {@link CameraProjection} changes.
11
- */
12
- readonly onChanged: Event<THREE.PerspectiveCamera | THREE.OrthographicCamera>;
13
- /**
14
- * Current projection mode of the camera.
15
- * Default is "Perspective".
16
- */
17
- current: CameraProjection;
18
- /**
19
- * The camera controlled by this ProjectionManager.
20
- * It can be either a PerspectiveCamera or an OrthographicCamera.
21
- */
22
- camera: THREE.PerspectiveCamera | THREE.OrthographicCamera;
23
- /** Match Ortho zoom with Perspective distance when changing projection mode */
24
- matchOrthoDistanceEnabled: boolean;
25
- private _component;
26
- private _previousDistance;
27
- constructor(camera: OrthoPerspectiveCamera);
28
- /**
29
- * Sets the {@link CameraProjection} of the {@link OrthoPerspectiveCamera}.
30
- *
31
- * @param projection - the new projection to set. If it is the current projection,
32
- * it will have no effect.
33
- */
34
- set(projection: CameraProjection): Promise<void>;
35
- /**
36
- * Changes the current {@link CameraProjection} from Ortographic to Perspective
37
- * and vice versa.
38
- */
39
- toggle(): Promise<void>;
40
- private setOrthoCamera;
41
- private getPerspectiveDims;
42
- private setupOrthoCamera;
43
- private getDistance;
44
- private setPerspectiveCamera;
45
- }
@@ -1,26 +0,0 @@
1
- /**
2
- * The projection system of the camera.
3
- */
4
- export type CameraProjection = "Perspective" | "Orthographic";
5
- /**
6
- * The extensible list of supported navigation modes.
7
- */
8
- export type NavModeID = "Orbit" | "FirstPerson" | "Plan";
9
- /**
10
- * An object that determines the behavior of the camera controls and the user input (e.g. 2D floor plan mode, first person mode, etc).
11
- */
12
- export interface NavigationMode {
13
- /** The unique ID of this navigation mode. */
14
- id: NavModeID;
15
- /**
16
- * Enable or disable this navigation mode.
17
- * When a new navigation mode is enabled, the previous navigation mode
18
- * must be disabled.
19
- *
20
- * @param active - whether to enable or disable this mode.
21
- * @param options - any additional data required to enable or disable it.
22
- * */
23
- set: (active: boolean, options?: any) => void;
24
- /** Whether this navigation mode is active or not. */
25
- enabled: boolean;
26
- }
@@ -1,43 +0,0 @@
1
- import { Component, Disposable, World, Event } from "../Types";
2
- import { SimpleRaycaster } from "./src";
3
- import { Components } from "../Components";
4
- export * from "./src";
5
- /**
6
- * A component that manages a raycaster for each world and automatically disposes it when its corresponding world is disposed. 📕 [Tutorial](https://docs.thatopen.com/Tutorials/Components/Core/Raycasters). 📘 [API](https://docs.thatopen.com/api/@thatopen/components/classes/Raycasters).
7
- */
8
- export declare class Raycasters extends Component implements Disposable {
9
- /**
10
- * A unique identifier for the component.
11
- * This UUID is used to register the component within the Components system.
12
- */
13
- static readonly uuid: "d5d8bdf0-db25-4952-b951-b643af207ace";
14
- /** {@link Component.enabled} */
15
- enabled: boolean;
16
- /**
17
- * A Map that stores raycasters for each world.
18
- * The key is the world's UUID, and the value is the corresponding SimpleRaycaster instance.
19
- */
20
- list: Map<string, SimpleRaycaster>;
21
- /** {@link Disposable.onDisposed} */
22
- onDisposed: Event<unknown>;
23
- constructor(components: Components);
24
- /**
25
- * Retrieves a SimpleRaycaster instance for the given world.
26
- * If a SimpleRaycaster instance already exists for the world, it will be returned.
27
- * Otherwise, a new SimpleRaycaster instance will be created and added to the list.
28
- *
29
- * @param world - The world for which to retrieve or create a SimpleRaycaster instance.
30
- * @returns The SimpleRaycaster instance for the given world.
31
- */
32
- get(world: World): SimpleRaycaster;
33
- /**
34
- * Deletes the SimpleRaycaster instance associated with the given world.
35
- * If a SimpleRaycaster instance exists for the given world, it will be disposed and removed from the list.
36
- *
37
- * @param world - The world for which to delete the SimpleRaycaster instance.
38
- * @returns {void}
39
- */
40
- delete(world: World): void;
41
- /** {@link Disposable.dispose} */
42
- dispose(): void;
43
- }
@@ -1,2 +0,0 @@
1
- export * from "./mouse";
2
- export * from "./simple-raycaster";
@@ -1,24 +0,0 @@
1
- import * as THREE from "three";
2
- import { Disposable, Event } from "../../Types";
3
- /**
4
- * A helper to easily get the real position of the mouse in the Three.js canvas to work with tools like the [raycaster](https://threejs.org/docs/#api/en/core/Raycaster), even if it has been transformed through CSS or doesn't occupy the whole screen.
5
- */
6
- export declare class Mouse implements Disposable {
7
- dom: HTMLCanvasElement;
8
- private _event?;
9
- private _position;
10
- /** {@link Disposable.onDisposed} */
11
- readonly onDisposed: Event<unknown>;
12
- constructor(dom: HTMLCanvasElement);
13
- /**
14
- * The real position of the mouse of the Three.js canvas.
15
- */
16
- get position(): THREE.Vector2;
17
- /** {@link Disposable.dispose} */
18
- dispose(): void;
19
- private getPositionY;
20
- private getPositionX;
21
- private updateMouseInfo;
22
- private getDataObject;
23
- private setupEvents;
24
- }
@@ -1,54 +0,0 @@
1
- import * as THREE from "three";
2
- import { Components } from "../../Components";
3
- import { Event, World, Disposable } from "../../Types";
4
- import { Mouse } from "./mouse";
5
- /**
6
- * A simple [raycaster](https://threejs.org/docs/#api/en/core/Raycaster) that allows to easily get items from the scene using the mouse and touch events.
7
- */
8
- export declare class SimpleRaycaster implements Disposable {
9
- /** {@link Component.enabled} */
10
- enabled: boolean;
11
- /** The components instance to which this Raycaster belongs. */
12
- components: Components;
13
- /** {@link Disposable.onDisposed} */
14
- readonly onDisposed: Event<unknown>;
15
- /** The position of the mouse in the screen. */
16
- readonly mouse: Mouse;
17
- /**
18
- * A reference to the Three.js Raycaster instance.
19
- * This is used for raycasting operations.
20
- */
21
- readonly three: THREE.Raycaster;
22
- /**
23
- * A reference to the world instance to which this Raycaster belongs.
24
- * This is used to access the camera and meshes.
25
- */
26
- world: World;
27
- constructor(components: Components, world: World);
28
- /** {@link Disposable.dispose} */
29
- dispose(): void;
30
- /**
31
- * Throws a ray from the camera to the mouse or touch event point and returns
32
- * the first item found. This also takes into account the clipping planes
33
- * used by the renderer.
34
- *
35
- * @param items - the [meshes](https://threejs.org/docs/#api/en/objects/Mesh)
36
- * to query. If not provided, it will query all the meshes stored in
37
- * {@link Components.meshes}.
38
- * @param position - the screen position to use for raycasting. If not provided,
39
- * the last pointer (mouse/touch) position will be used.
40
- */
41
- castRay(items?: THREE.Object3D[], position?: THREE.Vector2): THREE.Intersection | null;
42
- /**
43
- * Casts a ray from a given origin in a given direction and returns the first item found.
44
- * This method also takes into account the clipping planes used by the renderer.
45
- *
46
- * @param origin - The origin of the ray.
47
- * @param direction - The direction of the ray.
48
- * @param items - The meshes to query. If not provided, it will query all the meshes stored in {@link World.meshes}.
49
- * @returns The first intersection found or `null` if no intersection was found.
50
- */
51
- castRayFromVector(origin: THREE.Vector3, direction: THREE.Vector3, items?: THREE.Mesh<THREE.BufferGeometry<THREE.NormalBufferAttributes>, THREE.Material | THREE.Material[], THREE.Object3DEventMap>[]): THREE.Intersection<THREE.Object3D<THREE.Object3DEventMap>> | null;
52
- private intersect;
53
- private filterClippingPlanes;
54
- }
@@ -1,57 +0,0 @@
1
- import { SimpleScene, SimpleSceneConfig, SimpleSceneConfigManager } from "../Worlds";
2
- import { DistanceRenderer } from "./src";
3
- import { Configurable, Disposable } from "../Types";
4
- /**
5
- * Configuration interface for the {@link ShadowedScene}. Defines properties for directional and ambient lights, as well as shadows.
6
- */
7
- export interface ShadowedSceneConfig extends SimpleSceneConfig {
8
- shadows: {
9
- cascade: number;
10
- resolution: number;
11
- };
12
- }
13
- /**
14
- * A scene that supports efficient cast shadows. 📕 [Tutorial](https://docs.thatopen.com/Tutorials/Components/Core/ShadowedScene). 📘 [API](https://docs.thatopen.com/api/@thatopen/components/classes/ShadowedScene).
15
- */
16
- export declare class ShadowedScene extends SimpleScene implements Disposable, Configurable<SimpleSceneConfigManager, ShadowedSceneConfig> {
17
- private _distanceRenderer?;
18
- /**
19
- * Whether the bias property should be set automatically depending on the shadow distance.
20
- */
21
- autoBias: boolean;
22
- protected _defaultShadowConfig: {
23
- cascade: number;
24
- resolution: number;
25
- };
26
- private _lightsWithShadow;
27
- private _isComputingShadows;
28
- private _shadowsEnabled;
29
- private _bias;
30
- /**
31
- * The getter for the bias to prevent artifacts (stripes). It usually ranges between 0 and -0.005.
32
- */
33
- get bias(): number;
34
- /**
35
- * The setter for the bias to prevent artifacts (stripes). It usually ranges between 0 and -0.005.
36
- */
37
- set bias(value: number);
38
- /**
39
- * Getter to see whether the shadows are enabled or not in this scene instance.
40
- */
41
- get shadowsEnabled(): boolean;
42
- /**
43
- * Setter to control whether the shadows are enabled or not in this scene instance.
44
- */
45
- set shadowsEnabled(value: boolean);
46
- /**
47
- * Getter to get the renderer used to determine the farthest distance from the camera.
48
- */
49
- get distanceRenderer(): DistanceRenderer;
50
- /** {@link Configurable.setup} */
51
- setup(config?: Partial<ShadowedSceneConfig>): void;
52
- /** {@link Disposable.dispose} */
53
- dispose(): void;
54
- /** Update all the shadows of the scene. */
55
- updateShadows(): Promise<void>;
56
- private recomputeShadows;
57
- }
@@ -1,67 +0,0 @@
1
- import * as THREE from "three";
2
- import { Event, World } from "../../Types";
3
- import { Components } from "../../Components";
4
- /**
5
- * A base renderer to determine visibility on screen.
6
- */
7
- export declare class DistanceRenderer {
8
- /** {@link Disposable.onDisposed} */
9
- readonly onDisposed: Event<string>;
10
- /**
11
- * Fires after making the visibility check to the meshes. It lists the
12
- * meshes that are currently visible, and the ones that were visible
13
- * just before but not anymore.
14
- */
15
- readonly onDistanceComputed: Event<number>;
16
- /**
17
- * Objects that won't be taken into account in the distance check.
18
- */
19
- excludedObjects: Set<THREE.Object3D<THREE.Object3DEventMap>>;
20
- /**
21
- * Whether this renderer is active or not. If not, it won't render anything.
22
- */
23
- enabled: boolean;
24
- /**
25
- * Render the internal scene used to determine the object visibility. Used
26
- * for debugging purposes.
27
- */
28
- renderDebugFrame: boolean;
29
- /** The components instance to which this renderer belongs. */
30
- components: Components;
31
- /**
32
- * The scene where the distance is computed.
33
- */
34
- scene: THREE.Scene;
35
- /**
36
- * The camera used to compute the distance.
37
- */
38
- camera: THREE.OrthographicCamera;
39
- /**
40
- * The material used to compute the distance.
41
- */
42
- depthMaterial: THREE.ShaderMaterial;
43
- /** The world instance to which this renderer belongs. */
44
- readonly world: World;
45
- /** The THREE.js renderer used to make the visibility test. */
46
- readonly renderer: THREE.WebGLRenderer;
47
- protected readonly worker: Worker;
48
- private _width;
49
- private _height;
50
- private readonly _postQuad;
51
- private readonly tempRT;
52
- private readonly resultRT;
53
- private readonly bufferSize;
54
- private readonly _buffer;
55
- protected _isWorkerBusy: boolean;
56
- constructor(components: Components, world: World);
57
- /** {@link Disposable.dispose} */
58
- dispose(): void;
59
- /**
60
- * The function that the culler uses to reprocess the scene. Generally it's
61
- * better to call needsUpdate, but you can also call this to force it.
62
- * @param force if true, it will refresh the scene even if needsUpdate is
63
- * not true.
64
- */
65
- compute: () => Promise<void>;
66
- private handleWorkerMessage;
67
- }
@@ -1 +0,0 @@
1
- export * from "./distance-renderer";
@@ -1 +0,0 @@
1
- export * from "./src";
@@ -1,32 +0,0 @@
1
- /**
2
- * Simple event handler by [Jason Kleban](https://gist.github.com/JasonKleban/50cee44960c225ac1993c922563aa540). Keep in mind that if you want to remove it later, you might want to declare the callback as an object. If you want to maintain the reference to `this`, you will need to declare the callback as an arrow function.
3
- */
4
- export declare class AsyncEvent<T> {
5
- /**
6
- * Whether this event is active or not. If not, it won't trigger.
7
- */
8
- enabled: boolean;
9
- /**
10
- * Add a callback to this event instance.
11
- * @param handler - the callback to be added to this event.
12
- */
13
- add(handler: T extends void ? {
14
- (): Promise<void>;
15
- } : {
16
- (data: T): Promise<void>;
17
- }): void;
18
- /**
19
- * Removes a callback from this event instance.
20
- * @param handler - the callback to be removed from this event.
21
- */
22
- remove(handler: T extends void ? {
23
- (): Promise<void>;
24
- } : {
25
- (data: T): Promise<void>;
26
- }): void;
27
- /** Triggers all the callbacks assigned to this event. */
28
- trigger: (data?: T) => Promise<void>;
29
- /** Gets rid of all the suscribed events. */
30
- reset(): void;
31
- private handlers;
32
- }
@@ -1,28 +0,0 @@
1
- import * as THREE from "three";
2
- import CameraControls from "camera-controls";
3
- import { BaseWorldItem } from "./base-world-item";
4
- import { CameraControllable } from "./interfaces";
5
- /**
6
- * Abstract class representing a camera in a 3D world. All cameras should use this class as a base.
7
- */
8
- export declare abstract class BaseCamera extends BaseWorldItem {
9
- /**
10
- * Whether the camera is enabled or not.
11
- */
12
- abstract enabled: boolean;
13
- /**
14
- * The Three.js camera instance.
15
- */
16
- abstract three: THREE.Camera;
17
- /**
18
- * Optional CameraControls instance for controlling the camera.
19
- * This property is only available if the camera is controllable.
20
- */
21
- abstract controls?: CameraControls;
22
- /**
23
- * Checks whether the instance is {@link CameraControllable}.
24
- *
25
- * @returns True if the instance is controllable, false otherwise.
26
- */
27
- hasCameraControls: () => this is CameraControllable;
28
- }
@@ -1,65 +0,0 @@
1
- import * as THREE from "three";
2
- import { Vector2 } from "three";
3
- import { Event } from "./event";
4
- import { BaseWorldItem } from "./base-world-item";
5
- import { Disposable, Resizeable, Updateable } from "./interfaces";
6
- /**
7
- * Abstract class representing a renderer for a 3D world. All renderers should use this class as a base.
8
- */
9
- export declare abstract class BaseRenderer extends BaseWorldItem implements Updateable, Disposable, Resizeable {
10
- /**
11
- * The three.js WebGLRenderer instance associated with this renderer.
12
- *
13
- * @abstract
14
- * @type {THREE.WebGLRenderer}
15
- */
16
- abstract three: THREE.WebGLRenderer;
17
- /** {@link Updateable.onBeforeUpdate} */
18
- onAfterUpdate: Event<unknown>;
19
- /** {@link Updateable.onAfterUpdate} */
20
- onBeforeUpdate: Event<unknown>;
21
- /** {@link Disposable.onDisposed} */
22
- readonly onDisposed: Event<undefined>;
23
- /** {@link Resizeable.onResize} */
24
- readonly onResize: Event<THREE.Vector2>;
25
- /**
26
- * Event that fires when there has been a change to the list of clipping
27
- * planes used by the active renderer.
28
- */
29
- readonly onClippingPlanesUpdated: Event<unknown>;
30
- /** {@link Updateable.update} */
31
- abstract update(delta?: number): void | Promise<void>;
32
- /** {@link Disposable.dispose} */
33
- abstract dispose(): void;
34
- /** {@link Resizeable.getSize} */
35
- abstract getSize(): Vector2;
36
- /** {@link Resizeable.resize} */
37
- abstract resize(size: Vector2 | undefined): void;
38
- /**
39
- * The list of [clipping planes](https://threejs.org/docs/#api/en/renderers/WebGLRenderer.clippingPlanes) used by this instance of the renderer.
40
- */
41
- clippingPlanes: THREE.Plane[];
42
- /**
43
- * Updates the clipping planes and triggers the `onClippingPlanesUpdated` event.
44
- *
45
- * @remarks
46
- * This method is typically called when there is a change to the list of clipping planes
47
- * used by the active renderer.
48
- */
49
- updateClippingPlanes(): void;
50
- /**
51
- * Sets or removes a clipping plane from the renderer.
52
- *
53
- * @param active - A boolean indicating whether the clipping plane should be active or not.
54
- * @param plane - The clipping plane to be added or removed.
55
- * @param isLocal - An optional boolean indicating whether the clipping plane is local to the object. If not provided, it defaults to `false`.
56
- *
57
- * @remarks
58
- * This method adds or removes a clipping plane from the `clippingPlanes` array.
59
- * If `active` is `true` and the plane is not already in the array, it is added.
60
- * If `active` is `false` and the plane is in the array, it is removed.
61
- * The `three.clippingPlanes` property is then updated to reflect the current state of the `clippingPlanes` array,
62
- * excluding any planes marked as local.
63
- */
64
- setPlane(active: boolean, plane: THREE.Plane, isLocal?: boolean): void;
65
- }
@@ -1,25 +0,0 @@
1
- import * as THREE from "three";
2
- import { Disposable } from "./interfaces";
3
- import { Event } from "./event";
4
- import { Components } from "../../Components";
5
- import { BaseWorldItem } from "./base-world-item";
6
- /**
7
- * Abstract class representing a base scene in the application. All scenes should use this class as a base.
8
- */
9
- export declare abstract class BaseScene extends BaseWorldItem implements Disposable {
10
- /** {@link Disposable.onDisposed} */
11
- readonly onDisposed: Event<unknown>;
12
- /**
13
- * Abstract property representing the three.js object associated with this scene.
14
- * It should be implemented by subclasses.
15
- */
16
- abstract three: THREE.Object3D;
17
- /** The set of directional lights managed by this scene component. */
18
- directionalLights: Map<string, THREE.DirectionalLight>;
19
- /** The set of ambient lights managed by this scene component. */
20
- ambientLights: Map<string, THREE.AmbientLight>;
21
- protected constructor(components: Components);
22
- /** {@link Disposable.dispose} */
23
- dispose(): void;
24
- deleteAllLights(): void;
25
- }
@@ -1,23 +0,0 @@
1
- import { Base } from "./base";
2
- import { World } from "./world";
3
- import { Event } from "./event";
4
- import { Components } from "../../Components";
5
- /**
6
- * One of the elements that make a world. It can be either a scene, a camera or a renderer.
7
- */
8
- export declare abstract class BaseWorldItem extends Base {
9
- readonly worlds: Map<string, World>;
10
- /**
11
- * Event that is triggered when a world is added or removed from the `worlds` map.
12
- * The event payload contains the world instance and the action ("added" or "removed").
13
- */
14
- readonly onWorldChanged: Event<{
15
- world: World;
16
- action: "added" | "removed";
17
- }>;
18
- /**
19
- * The current world this item is associated with. It can be null if no world is currently active.
20
- */
21
- currentWorld: World | null;
22
- protected constructor(components: Components);
23
- }
@@ -1,19 +0,0 @@
1
- import { Disposable, Hideable, Resizeable, Updateable, Configurable } from "./interfaces";
2
- import { Components } from "../../Components";
3
- /**
4
- * Base class of the library. Useful for finding out the interfaces something implements.
5
- */
6
- export declare abstract class Base {
7
- components: Components;
8
- constructor(components: Components);
9
- /** Whether is component is {@link Disposable}. */
10
- isDisposeable: () => this is Disposable;
11
- /** Whether is component is {@link Resizeable}. */
12
- isResizeable: () => this is Resizeable;
13
- /** Whether is component is {@link Updateable}. */
14
- isUpdateable: () => this is Updateable;
15
- /** Whether is component is {@link Hideable}. */
16
- isHideable: () => this is Hideable;
17
- /** Whether is component is {@link Configurable}. */
18
- isConfigurable: () => this is Configurable<any, any>;
19
- }
@@ -1,18 +0,0 @@
1
- import { Component } from "./component";
2
- import { Configurator } from "../../ConfigManager";
3
- import { Components } from "../../Components";
4
- export type ComponentUIElement = {
5
- name: string;
6
- id: string;
7
- icon: string;
8
- componentID: string;
9
- get: (components: Components) => {
10
- element: HTMLElement;
11
- config?: Configurator;
12
- dispose?: () => void;
13
- };
14
- };
15
- export declare abstract class ComponentWithUI extends Component {
16
- abstract name: string;
17
- abstract getUI(): ComponentUIElement[];
18
- }
@@ -1,13 +0,0 @@
1
- import { Base } from "./base";
2
- /**
3
- * Components are the building blocks of this library. Components are singleton elements that contain specific functionality. For instance, the Clipper Component can create, delete and handle 3D clipping planes. Components must be unique (they can't be instanced more than once per Components instance), and have a static UUID that identifies them uniquely. The can be accessed globally using the {@link Components} instance.
4
- */
5
- export declare abstract class Component extends Base {
6
- /**
7
- * Whether this component is active or not. The behaviour can vary depending
8
- * on the type of component. E.g. a disabled dimension tool will stop creating
9
- * dimensions, while a disabled camera will stop moving. A disabled component
10
- * will not be updated automatically each frame.
11
- */
12
- abstract enabled: boolean;
13
- }
@@ -1,47 +0,0 @@
1
- import * as THREE from "three";
2
- export interface BooleanSettingsControl {
3
- type: "Boolean";
4
- value: boolean;
5
- }
6
- export interface ColorSettingsControl {
7
- type: "Color";
8
- value: THREE.Color;
9
- }
10
- export interface TextSettingsControl {
11
- type: "Text";
12
- value: string;
13
- }
14
- export interface NumberSettingControl {
15
- type: "Number";
16
- interpolable: boolean;
17
- min?: number;
18
- max?: number;
19
- value: number;
20
- }
21
- export interface SelectSettingControl {
22
- type: "Select";
23
- multiple: boolean;
24
- options: Set<string>;
25
- value: string;
26
- }
27
- export interface Vector3SettingControl {
28
- type: "Vector3";
29
- value: THREE.Vector3;
30
- }
31
- export interface TextSetSettingControl {
32
- type: "TextSet";
33
- value: Set<string>;
34
- }
35
- export interface NoControl {
36
- type: "None";
37
- value: any;
38
- }
39
- export type ControlEntry = BooleanSettingsControl | ColorSettingsControl | TextSettingsControl | NumberSettingControl | SelectSettingControl | Vector3SettingControl | TextSetSettingControl | NoControl;
40
- export interface ControlsSchema {
41
- [name: string]: ControlEntry | ControlsSchema;
42
- }
43
- export declare class ControlsUtils {
44
- static isEntry(item: any): boolean;
45
- static copySchema<T extends ControlsSchema = ControlsSchema>(schema: T, copy?: ControlsSchema): T;
46
- static copyEntry(controlEntry: ControlEntry): ControlEntry;
47
- }