@thatopen/components 2.4.11 → 3.1.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.
- package/README.md +92 -92
- package/dist/index.cjs +18440 -25937
- package/dist/index.d.ts +4537 -6
- package/dist/index.min.cjs +3 -3
- package/dist/index.min.mjs +3 -3
- package/dist/index.mjs +18442 -25939
- package/package.json +58 -60
- package/dist/core/Clipper/index.d.ts +0 -142
- package/dist/core/Clipper/src/clipper-config.d.ts +0 -33
- package/dist/core/Clipper/src/index.d.ts +0 -1
- package/dist/core/Clipper/src/simple-plane.d.ts +0 -99
- package/dist/core/Components/index.d.ts +0 -93
- package/dist/core/ConfigManager/index.d.ts +0 -21
- package/dist/core/ConfigManager/src/configurator.d.ts +0 -13
- package/dist/core/ConfigManager/src/index.d.ts +0 -1
- package/dist/core/Cullers/index.d.ts +0 -56
- package/dist/core/Cullers/src/culler-renderer-config.d.ts +0 -74
- package/dist/core/Cullers/src/culler-renderer.d.ts +0 -76
- package/dist/core/Cullers/src/index.d.ts +0 -3
- package/dist/core/Cullers/src/mesh-culler-renderer.d.ts +0 -59
- package/dist/core/Cullers/src/screen-culler-helper.d.ts +0 -1
- package/dist/core/Disposer/index.d.ts +0 -45
- package/dist/core/Grids/index.d.ts +0 -46
- package/dist/core/Grids/src/index.d.ts +0 -2
- package/dist/core/Grids/src/simple-grid-config.d.ts +0 -80
- package/dist/core/Grids/src/simple-grid.d.ts +0 -48
- package/dist/core/MiniMap/index.d.ts +0 -50
- package/dist/core/MiniMap/src/index.d.ts +0 -2
- package/dist/core/MiniMap/src/mini-map-config.d.ts +0 -112
- package/dist/core/MiniMap/src/mini-map.d.ts +0 -100
- package/dist/core/OrthoPerspectiveCamera/index.d.ts +0 -65
- package/dist/core/OrthoPerspectiveCamera/src/first-person-mode.d.ts +0 -16
- package/dist/core/OrthoPerspectiveCamera/src/index.d.ts +0 -5
- package/dist/core/OrthoPerspectiveCamera/src/orbit-mode.d.ts +0 -16
- package/dist/core/OrthoPerspectiveCamera/src/plan-mode.d.ts +0 -20
- package/dist/core/OrthoPerspectiveCamera/src/projections.d.ts +0 -45
- package/dist/core/OrthoPerspectiveCamera/src/types.d.ts +0 -26
- package/dist/core/Raycasters/index.d.ts +0 -43
- package/dist/core/Raycasters/src/index.d.ts +0 -2
- package/dist/core/Raycasters/src/mouse.d.ts +0 -24
- package/dist/core/Raycasters/src/simple-raycaster.d.ts +0 -54
- package/dist/core/ShadowedScene/index.d.ts +0 -57
- package/dist/core/ShadowedScene/src/distance-renderer.d.ts +0 -67
- package/dist/core/ShadowedScene/src/index.d.ts +0 -1
- package/dist/core/Types/index.d.ts +0 -1
- package/dist/core/Types/src/async-event.d.ts +0 -32
- package/dist/core/Types/src/base-camera.d.ts +0 -28
- package/dist/core/Types/src/base-renderer.d.ts +0 -65
- package/dist/core/Types/src/base-scene.d.ts +0 -25
- package/dist/core/Types/src/base-world-item.d.ts +0 -23
- package/dist/core/Types/src/base.d.ts +0 -19
- package/dist/core/Types/src/component-with-ui.d.ts +0 -18
- package/dist/core/Types/src/component.d.ts +0 -13
- package/dist/core/Types/src/config-types.d.ts +0 -47
- package/dist/core/Types/src/data-map.d.ts +0 -73
- package/dist/core/Types/src/data-set.d.ts +0 -58
- package/dist/core/Types/src/event-manager.d.ts +0 -30
- package/dist/core/Types/src/event.d.ts +0 -32
- package/dist/core/Types/src/index.d.ts +0 -15
- package/dist/core/Types/src/interfaces.d.ts +0 -117
- package/dist/core/Types/src/world.d.ts +0 -34
- package/dist/core/Viewpoints/index.d.ts +0 -38
- package/dist/core/Viewpoints/src/index.d.ts +0 -2
- package/dist/core/Viewpoints/src/types.d.ts +0 -36
- package/dist/core/Viewpoints/src/viewpoint.d.ts +0 -197
- package/dist/core/Viewpoints/src/viewpoints-config.d.ts +0 -23
- package/dist/core/Worlds/index.d.ts +0 -54
- package/dist/core/Worlds/src/index.d.ts +0 -5
- package/dist/core/Worlds/src/simple-camera.d.ts +0 -62
- package/dist/core/Worlds/src/simple-renderer.d.ts +0 -54
- package/dist/core/Worlds/src/simple-scene-config.d.ts +0 -59
- package/dist/core/Worlds/src/simple-scene.d.ts +0 -25
- package/dist/core/Worlds/src/simple-world.d.ts +0 -79
- package/dist/core/index.d.ts +0 -13
- package/dist/fragments/BoundingBoxer/index.d.ts +0 -208
- package/dist/fragments/Classifier/index.d.ts +0 -197
- package/dist/fragments/Exploder/index.d.ts +0 -50
- package/dist/fragments/FragmentsManager/index.d.ts +0 -152
- package/dist/fragments/Hider/index.d.ts +0 -38
- package/dist/fragments/IfcGeometryTiler/index.d.ts +0 -103
- package/dist/fragments/IfcGeometryTiler/src/base-types.d.ts +0 -29
- package/dist/fragments/IfcGeometryTiler/src/index.d.ts +0 -2
- package/dist/fragments/IfcGeometryTiler/src/streaming-settings.d.ts +0 -20
- package/dist/fragments/IfcLoader/index.d.ts +0 -116
- package/dist/fragments/IfcLoader/src/civil-reader.d.ts +0 -15
- package/dist/fragments/IfcLoader/src/ifc-fragment-settings.d.ts +0 -41
- package/dist/fragments/IfcLoader/src/ifc-metadata-reader.d.ts +0 -5
- package/dist/fragments/IfcLoader/src/index.d.ts +0 -5
- package/dist/fragments/IfcLoader/src/spatial-ids-finder.d.ts +0 -5
- package/dist/fragments/IfcLoader/src/spatial-structure.d.ts +0 -8
- package/dist/fragments/IfcLoader/src/transform-helper.d.ts +0 -5
- package/dist/fragments/IfcLoader/src/units.d.ts +0 -10
- package/dist/fragments/IfcPropertiesTiler/index.d.ts +0 -66
- package/dist/fragments/IfcPropertiesTiler/src/index.d.ts +0 -1
- package/dist/fragments/IfcPropertiesTiler/src/streaming-settings.d.ts +0 -11
- package/dist/fragments/index.d.ts +0 -8
- package/dist/ifc/IfcFinder/index.d.ts +0 -50
- package/dist/ifc/IfcFinder/src/ifc-basic-query.d.ts +0 -35
- package/dist/ifc/IfcFinder/src/ifc-finder-query.d.ts +0 -96
- package/dist/ifc/IfcFinder/src/ifc-property-query.d.ts +0 -36
- package/dist/ifc/IfcFinder/src/ifc-query-group.d.ts +0 -69
- package/dist/ifc/IfcFinder/src/index.d.ts +0 -4
- package/dist/ifc/IfcFinder/src/types.d.ts +0 -84
- package/dist/ifc/IfcIsolator/index.d.ts +0 -24
- package/dist/ifc/IfcJsonExporter/index.d.ts +0 -26
- package/dist/ifc/IfcJsonExporter/src/ifc-geometry-types.d.ts +0 -4
- package/dist/ifc/IfcJsonExporter/src/index.d.ts +0 -1
- package/dist/ifc/IfcPropertiesManager/index.d.ts +0 -289
- package/dist/ifc/IfcPropertiesManager/src/index.d.ts +0 -3
- package/dist/ifc/IfcPropertiesManager/src/rel-attrs.d.ts +0 -7
- package/dist/ifc/IfcPropertiesManager/src/rel-names.d.ts +0 -3
- package/dist/ifc/IfcPropertiesManager/src/types.d.ts +0 -18
- package/dist/ifc/IfcRelationsIndexer/index.d.ts +0 -195
- package/dist/ifc/IfcRelationsIndexer/src/index.d.ts +0 -2
- package/dist/ifc/IfcRelationsIndexer/src/newVersion.d.ts +0 -51
- package/dist/ifc/IfcRelationsIndexer/src/relToAttributesMap.d.ts +0 -5
- package/dist/ifc/IfcRelationsIndexer/src/types.d.ts +0 -73
- package/dist/ifc/Utils/ifc-categories.d.ts +0 -7
- package/dist/ifc/Utils/ifc-category-case.d.ts +0 -3
- package/dist/ifc/Utils/ifc-category-map.d.ts +0 -6
- package/dist/ifc/Utils/ifc-elements-map.d.ts +0 -11
- package/dist/ifc/Utils/index.d.ts +0 -5
- package/dist/ifc/Utils/properties-utils.d.ts +0 -25
- package/dist/ifc/index.d.ts +0 -6
- package/dist/measurement/MeasurementUtils/index.d.ts +0 -105
- package/dist/measurement/index.d.ts +0 -1
- package/dist/namespace.d.ts +0 -6018
- package/dist/openbim/BCFTopics/index.d.ts +0 -114
- package/dist/openbim/BCFTopics/src/Comment.d.ts +0 -40
- package/dist/openbim/BCFTopics/src/Topic.d.ts +0 -127
- package/dist/openbim/BCFTopics/src/bcf-topics-config.d.ts +0 -121
- package/dist/openbim/BCFTopics/src/importers/extensions.d.ts +0 -2
- package/dist/openbim/BCFTopics/src/importers/index.d.ts +0 -1
- package/dist/openbim/BCFTopics/src/index.d.ts +0 -5
- package/dist/openbim/BCFTopics/src/types.d.ts +0 -19
- package/dist/openbim/IDSSpecifications/index.d.ts +0 -60
- package/dist/openbim/IDSSpecifications/src/Specification.d.ts +0 -40
- package/dist/openbim/IDSSpecifications/src/exporters/parameter.d.ts +0 -2
- package/dist/openbim/IDSSpecifications/src/facets/Attribute.d.ts +0 -13
- package/dist/openbim/IDSSpecifications/src/facets/Classification.d.ts +0 -21
- package/dist/openbim/IDSSpecifications/src/facets/Entity.d.ts +0 -15
- package/dist/openbim/IDSSpecifications/src/facets/Facet.d.ts +0 -26
- package/dist/openbim/IDSSpecifications/src/facets/Material.d.ts +0 -10
- package/dist/openbim/IDSSpecifications/src/facets/PartOf.d.ts +0 -26
- package/dist/openbim/IDSSpecifications/src/facets/Property.d.ts +0 -25
- package/dist/openbim/IDSSpecifications/src/facets/index.d.ts +0 -5
- package/dist/openbim/IDSSpecifications/src/importers/attribute.d.ts +0 -3
- package/dist/openbim/IDSSpecifications/src/importers/classification.d.ts +0 -3
- package/dist/openbim/IDSSpecifications/src/importers/entity.d.ts +0 -3
- package/dist/openbim/IDSSpecifications/src/importers/index.d.ts +0 -3
- package/dist/openbim/IDSSpecifications/src/importers/parameter.d.ts +0 -2
- package/dist/openbim/IDSSpecifications/src/importers/property.d.ts +0 -3
- package/dist/openbim/IDSSpecifications/src/index.d.ts +0 -3
- package/dist/openbim/IDSSpecifications/src/types.d.ts +0 -70
- package/dist/openbim/index.d.ts +0 -2
- package/dist/utils/bbox.d.ts +0 -7
- package/dist/utils/geometry.d.ts +0 -1
- package/dist/utils/index.d.ts +0 -6
- package/dist/utils/materials.d.ts +0 -4
- package/dist/utils/section-generator.d.ts +0 -31
- package/dist/utils/uuid.d.ts +0 -6
- package/dist/utils/vertex-picker.d.ts +0 -116
package/package.json
CHANGED
|
@@ -1,60 +1,58 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@thatopen/components",
|
|
3
|
-
"description": "Collection of core functionalities to author BIM apps.",
|
|
4
|
-
"version": "
|
|
5
|
-
"author": "That Open Company",
|
|
6
|
-
"contributors": [
|
|
7
|
-
"Antonio Gonzalez Viegas (https://github.com/agviegas)",
|
|
8
|
-
"Juan Hoyos (https://github.com/HoyosJuan)",
|
|
9
|
-
"Harry Collin (https://github.com/harrycollin)"
|
|
10
|
-
],
|
|
11
|
-
"license": "MIT",
|
|
12
|
-
"homepage": "https://github.com/ThatOpen/engine_components/tree/main/packages/components#readme",
|
|
13
|
-
"bugs": {
|
|
14
|
-
"url": "https://github.com/ThatOpen/engine_components/issues"
|
|
15
|
-
},
|
|
16
|
-
"type": "module",
|
|
17
|
-
"main": "dist/index.cjs",
|
|
18
|
-
"module": "dist/index.mjs",
|
|
19
|
-
"types": "dist/index.d.ts",
|
|
20
|
-
"files": [
|
|
21
|
-
"dist",
|
|
22
|
-
"README.md"
|
|
23
|
-
],
|
|
24
|
-
"repository": {
|
|
25
|
-
"type": "git",
|
|
26
|
-
"url": "git+https://github.com/ThatOpen/engine_components/tree/main/packages/components.git"
|
|
27
|
-
},
|
|
28
|
-
"
|
|
29
|
-
|
|
30
|
-
"
|
|
31
|
-
"
|
|
32
|
-
"
|
|
33
|
-
"
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
"@thatopen/
|
|
41
|
-
"@
|
|
42
|
-
"@types/
|
|
43
|
-
"
|
|
44
|
-
"
|
|
45
|
-
"
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
"
|
|
50
|
-
"
|
|
51
|
-
"
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
"
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
}
|
|
60
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "@thatopen/components",
|
|
3
|
+
"description": "Collection of core functionalities to author BIM apps.",
|
|
4
|
+
"version": "3.1.0",
|
|
5
|
+
"author": "That Open Company",
|
|
6
|
+
"contributors": [
|
|
7
|
+
"Antonio Gonzalez Viegas (https://github.com/agviegas)",
|
|
8
|
+
"Juan Hoyos (https://github.com/HoyosJuan)",
|
|
9
|
+
"Harry Collin (https://github.com/harrycollin)"
|
|
10
|
+
],
|
|
11
|
+
"license": "MIT",
|
|
12
|
+
"homepage": "https://github.com/ThatOpen/engine_components/tree/main/packages/components#readme",
|
|
13
|
+
"bugs": {
|
|
14
|
+
"url": "https://github.com/ThatOpen/engine_components/issues"
|
|
15
|
+
},
|
|
16
|
+
"type": "module",
|
|
17
|
+
"main": "dist/index.cjs",
|
|
18
|
+
"module": "dist/index.mjs",
|
|
19
|
+
"types": "dist/index.d.ts",
|
|
20
|
+
"files": [
|
|
21
|
+
"dist",
|
|
22
|
+
"README.md"
|
|
23
|
+
],
|
|
24
|
+
"repository": {
|
|
25
|
+
"type": "git",
|
|
26
|
+
"url": "git+https://github.com/ThatOpen/engine_components/tree/main/packages/components.git"
|
|
27
|
+
},
|
|
28
|
+
"scripts": {
|
|
29
|
+
"dev": "vite --host",
|
|
30
|
+
"test": "jest",
|
|
31
|
+
"build": "tsc --p ./tsconfig-build.json && vite build",
|
|
32
|
+
"prepublishOnly": "node ./resources/updateComponentsVersion.mjs && yarn build",
|
|
33
|
+
"publish-repo": "npm publish"
|
|
34
|
+
},
|
|
35
|
+
"publishConfig": {
|
|
36
|
+
"access": "public"
|
|
37
|
+
},
|
|
38
|
+
"devDependencies": {
|
|
39
|
+
"@thatopen/fragments": "~3.1.0",
|
|
40
|
+
"@thatopen/ui": "~2.4.0",
|
|
41
|
+
"@types/convert-units": "2.3.11",
|
|
42
|
+
"@types/three": "0.175.0",
|
|
43
|
+
"stats.js": "^0.17.0",
|
|
44
|
+
"three": "^0.175.0",
|
|
45
|
+
"web-ifc": "0.0.69"
|
|
46
|
+
},
|
|
47
|
+
"dependencies": {
|
|
48
|
+
"camera-controls": "^2.9.0",
|
|
49
|
+
"fast-xml-parser": "4.4.1",
|
|
50
|
+
"jszip": "3.10.1",
|
|
51
|
+
"three-mesh-bvh": "0.7.0"
|
|
52
|
+
},
|
|
53
|
+
"peerDependencies": {
|
|
54
|
+
"@thatopen/fragments": "~3.1.0",
|
|
55
|
+
"three": ">=0.175.0",
|
|
56
|
+
"web-ifc": "0.0.69"
|
|
57
|
+
}
|
|
58
|
+
}
|
|
@@ -1,142 +0,0 @@
|
|
|
1
|
-
import * as THREE from "three";
|
|
2
|
-
import { Component, Configurable, Createable, Disposable, Event, Hideable, World } from "../Types";
|
|
3
|
-
import { SimplePlane } from "./src";
|
|
4
|
-
import { Components } from "../Components";
|
|
5
|
-
import { ClipperConfig, ClipperConfigManager } from "./src/clipper-config";
|
|
6
|
-
export * from "./src";
|
|
7
|
-
/**
|
|
8
|
-
* A lightweight component to easily create, delete and handle [clipping planes](https://threejs.org/docs/#api/en/materials/Material.clippingPlanes). 📕 [Tutorial](https://docs.thatopen.com/Tutorials/Components/Core/Clipper). 📘 [API](https://docs.thatopen.com/api/@thatopen/components/classes/Clipper).
|
|
9
|
-
*
|
|
10
|
-
* @param components - the instance of {@link Components} used.
|
|
11
|
-
* E.g. {@link SimplePlane}.
|
|
12
|
-
*/
|
|
13
|
-
export declare class Clipper extends Component implements Createable, Disposable, Hideable, Configurable<ClipperConfigManager, ClipperConfig> {
|
|
14
|
-
/**
|
|
15
|
-
* A unique identifier for the component.
|
|
16
|
-
* This UUID is used to register the component within the Components system.
|
|
17
|
-
*/
|
|
18
|
-
static readonly uuid: "66290bc5-18c4-4cd1-9379-2e17a0617611";
|
|
19
|
-
/** {@link Configurable.onSetup} */
|
|
20
|
-
readonly onSetup: Event<unknown>;
|
|
21
|
-
/** Event that fires when the user starts dragging a clipping plane. */
|
|
22
|
-
readonly onBeforeDrag: Event<void>;
|
|
23
|
-
/** Event that fires when the user stops dragging a clipping plane. */
|
|
24
|
-
readonly onAfterDrag: Event<void>;
|
|
25
|
-
/**
|
|
26
|
-
* Event that fires when the user starts creating a clipping plane.
|
|
27
|
-
*/
|
|
28
|
-
readonly onBeforeCreate: Event<unknown>;
|
|
29
|
-
/**
|
|
30
|
-
* Event that fires when the user cancels the creation of a clipping plane.
|
|
31
|
-
*/
|
|
32
|
-
readonly onBeforeCancel: Event<unknown>;
|
|
33
|
-
/**
|
|
34
|
-
* Event that fires after the user cancels the creation of a clipping plane.
|
|
35
|
-
*/
|
|
36
|
-
readonly onAfterCancel: Event<unknown>;
|
|
37
|
-
/**
|
|
38
|
-
* Event that fires when the user starts deleting a clipping plane.
|
|
39
|
-
*/
|
|
40
|
-
readonly onBeforeDelete: Event<unknown>;
|
|
41
|
-
/**
|
|
42
|
-
* Event that fires after a clipping plane has been created.
|
|
43
|
-
* @param plane - The newly created clipping plane.
|
|
44
|
-
*/
|
|
45
|
-
readonly onAfterCreate: Event<SimplePlane>;
|
|
46
|
-
/**
|
|
47
|
-
* Event that fires after a clipping plane has been deleted.
|
|
48
|
-
* @param plane - The deleted clipping plane.
|
|
49
|
-
*/
|
|
50
|
-
readonly onAfterDelete: Event<SimplePlane>;
|
|
51
|
-
/** {@link Disposable.onDisposed} */
|
|
52
|
-
readonly onDisposed: Event<string>;
|
|
53
|
-
/** {@link Configurable.isSetup} */
|
|
54
|
-
isSetup: boolean;
|
|
55
|
-
/**
|
|
56
|
-
* Whether to force the clipping plane to be orthogonal in the Y direction
|
|
57
|
-
* (up). This is desirable when clipping a building horizontally and a
|
|
58
|
-
* clipping plane is created in its roof, which might have a slight
|
|
59
|
-
* slope for draining purposes.
|
|
60
|
-
*/
|
|
61
|
-
orthogonalY: boolean;
|
|
62
|
-
/**
|
|
63
|
-
* The tolerance that determines whether an almost-horizontal clipping plane
|
|
64
|
-
* will be forced to be orthogonal to the Y direction. {@link orthogonalY}
|
|
65
|
-
* has to be `true` for this to apply.
|
|
66
|
-
*/
|
|
67
|
-
toleranceOrthogonalY: number;
|
|
68
|
-
/**
|
|
69
|
-
* The type of clipping plane to be created.
|
|
70
|
-
* Default is {@link SimplePlane}.
|
|
71
|
-
*/
|
|
72
|
-
Type: new (...args: any) => SimplePlane;
|
|
73
|
-
/**
|
|
74
|
-
* A list of all the clipping planes created by this component.
|
|
75
|
-
*/
|
|
76
|
-
list: SimplePlane[];
|
|
77
|
-
/** {@link Configurable.config} */
|
|
78
|
-
config: ClipperConfigManager;
|
|
79
|
-
protected _defaultConfig: ClipperConfig;
|
|
80
|
-
/** The material used in all the clipping planes. */
|
|
81
|
-
private _material;
|
|
82
|
-
private _size;
|
|
83
|
-
private _enabled;
|
|
84
|
-
private _visible;
|
|
85
|
-
/** {@link Component.enabled} */
|
|
86
|
-
get enabled(): boolean;
|
|
87
|
-
/** {@link Component.enabled} */
|
|
88
|
-
set enabled(state: boolean);
|
|
89
|
-
/** {@link Hideable.visible } */
|
|
90
|
-
get visible(): boolean;
|
|
91
|
-
/** {@link Hideable.visible } */
|
|
92
|
-
set visible(state: boolean);
|
|
93
|
-
/** The material of the clipping plane representation. */
|
|
94
|
-
get material(): THREE.MeshBasicMaterial;
|
|
95
|
-
/** The material of the clipping plane representation. */
|
|
96
|
-
set material(material: THREE.MeshBasicMaterial);
|
|
97
|
-
/** The size of the geometric representation of the clippings planes. */
|
|
98
|
-
get size(): number;
|
|
99
|
-
/** The size of the geometric representation of the clippings planes. */
|
|
100
|
-
set size(size: number);
|
|
101
|
-
constructor(components: Components);
|
|
102
|
-
/** {@link Disposable.dispose} */
|
|
103
|
-
dispose(): void;
|
|
104
|
-
/** {@link Createable.create} */
|
|
105
|
-
create(world: World): SimplePlane | null;
|
|
106
|
-
/**
|
|
107
|
-
* Creates a plane in a certain place and with a certain orientation,
|
|
108
|
-
* without the need of the mouse.
|
|
109
|
-
*
|
|
110
|
-
* @param world - the world where this plane should be created.
|
|
111
|
-
* @param normal - the orientation of the clipping plane.
|
|
112
|
-
* @param point - the position of the clipping plane.
|
|
113
|
-
* navigation.
|
|
114
|
-
*/
|
|
115
|
-
createFromNormalAndCoplanarPoint(world: World, normal: THREE.Vector3, point: THREE.Vector3): SimplePlane;
|
|
116
|
-
/**
|
|
117
|
-
* {@link Createable.delete}
|
|
118
|
-
*
|
|
119
|
-
* @param world - the world where the plane to delete is.
|
|
120
|
-
* @param plane - the plane to delete. If undefined, the first plane
|
|
121
|
-
* found under the cursor will be deleted.
|
|
122
|
-
*/
|
|
123
|
-
delete(world: World, plane?: SimplePlane): void;
|
|
124
|
-
/**
|
|
125
|
-
* Deletes all the existing clipping planes.
|
|
126
|
-
*
|
|
127
|
-
* @param types - the types of planes to be deleted. If not provided, all planes will be deleted.
|
|
128
|
-
*/
|
|
129
|
-
deleteAll(types?: Set<string>): void;
|
|
130
|
-
/** {@link Configurable.setup} */
|
|
131
|
-
setup(config?: Partial<ClipperConfig>): void;
|
|
132
|
-
private deletePlane;
|
|
133
|
-
private pickPlane;
|
|
134
|
-
private getAllPlaneMeshes;
|
|
135
|
-
private createPlaneFromIntersection;
|
|
136
|
-
private getWorldNormal;
|
|
137
|
-
private normalizePlaneDirectionY;
|
|
138
|
-
private newPlane;
|
|
139
|
-
private updateMaterialsAndPlanes;
|
|
140
|
-
private _onStartDragging;
|
|
141
|
-
private _onEndDragging;
|
|
142
|
-
}
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
import * as THREE from "three";
|
|
2
|
-
import { BooleanSettingsControl, ColorSettingsControl, NumberSettingControl } from "../../Types";
|
|
3
|
-
import { Configurator } from "../../ConfigManager";
|
|
4
|
-
import { Clipper } from "../index";
|
|
5
|
-
type ClipperConfigType = {
|
|
6
|
-
enabled: BooleanSettingsControl;
|
|
7
|
-
visible: BooleanSettingsControl;
|
|
8
|
-
color: ColorSettingsControl;
|
|
9
|
-
opacity: NumberSettingControl;
|
|
10
|
-
size: NumberSettingControl;
|
|
11
|
-
};
|
|
12
|
-
/**
|
|
13
|
-
* Configuration interface for the {@link Clipper}.
|
|
14
|
-
*/
|
|
15
|
-
export interface ClipperConfig {
|
|
16
|
-
color: THREE.Color;
|
|
17
|
-
opacity: number;
|
|
18
|
-
size: number;
|
|
19
|
-
}
|
|
20
|
-
export declare class ClipperConfigManager extends Configurator<Clipper, ClipperConfigType> {
|
|
21
|
-
protected _config: ClipperConfigType;
|
|
22
|
-
get enabled(): boolean;
|
|
23
|
-
set enabled(value: boolean);
|
|
24
|
-
get visible(): boolean;
|
|
25
|
-
set visible(value: boolean);
|
|
26
|
-
get color(): THREE.Color;
|
|
27
|
-
set color(value: THREE.Color);
|
|
28
|
-
get opacity(): number;
|
|
29
|
-
set opacity(value: number);
|
|
30
|
-
get size(): number;
|
|
31
|
-
set size(value: number);
|
|
32
|
-
}
|
|
33
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from "./simple-plane";
|
|
@@ -1,99 +0,0 @@
|
|
|
1
|
-
import * as THREE from "three";
|
|
2
|
-
import { Hideable, Disposable, Event, World } from "../../Types";
|
|
3
|
-
import { Components } from "../../Components";
|
|
4
|
-
/**
|
|
5
|
-
* Each of the clipping planes created by the clipper.
|
|
6
|
-
*/
|
|
7
|
-
export declare class SimplePlane implements Disposable, Hideable {
|
|
8
|
-
/** Event that fires when the user starts dragging a clipping plane. */
|
|
9
|
-
readonly onDraggingStarted: Event<unknown>;
|
|
10
|
-
/** Event that fires when the user stops dragging a clipping plane. */
|
|
11
|
-
readonly onDraggingEnded: Event<unknown>;
|
|
12
|
-
/** {@link Disposable.onDisposed} */
|
|
13
|
-
readonly onDisposed: Event<unknown>;
|
|
14
|
-
/**
|
|
15
|
-
* The normal vector of the clipping plane.
|
|
16
|
-
*/
|
|
17
|
-
readonly normal: THREE.Vector3;
|
|
18
|
-
/**
|
|
19
|
-
* The origin point of the clipping plane.
|
|
20
|
-
*/
|
|
21
|
-
readonly origin: THREE.Vector3;
|
|
22
|
-
/**
|
|
23
|
-
* The THREE.js Plane object representing the clipping plane.
|
|
24
|
-
*/
|
|
25
|
-
readonly three: THREE.Plane;
|
|
26
|
-
/** The components instance to which this plane belongs. */
|
|
27
|
-
components: Components;
|
|
28
|
-
/** The world instance to which this plane belongs. */
|
|
29
|
-
world: World;
|
|
30
|
-
/** A custom string to identify what this plane is used for. */
|
|
31
|
-
type: string;
|
|
32
|
-
protected readonly _helper: THREE.Object3D;
|
|
33
|
-
protected _visible: boolean;
|
|
34
|
-
protected _enabled: boolean;
|
|
35
|
-
private _controlsActive;
|
|
36
|
-
private readonly _arrowBoundBox;
|
|
37
|
-
private readonly _planeMesh;
|
|
38
|
-
private readonly _controls;
|
|
39
|
-
private readonly _hiddenMaterial;
|
|
40
|
-
/**
|
|
41
|
-
* Getter for the enabled state of the clipping plane.
|
|
42
|
-
* @returns {boolean} The current enabled state.
|
|
43
|
-
*/
|
|
44
|
-
get enabled(): boolean;
|
|
45
|
-
/**
|
|
46
|
-
* Setter for the enabled state of the clipping plane.
|
|
47
|
-
* Updates the clipping plane state in the renderer and throws an error if no renderer is found.
|
|
48
|
-
* @param {boolean} state - The new enabled state.
|
|
49
|
-
*/
|
|
50
|
-
set enabled(state: boolean);
|
|
51
|
-
/** {@link Hideable.visible } */
|
|
52
|
-
get visible(): boolean;
|
|
53
|
-
/** {@link Hideable.visible } */
|
|
54
|
-
set visible(state: boolean);
|
|
55
|
-
/** The meshes used for raycasting */
|
|
56
|
-
get meshes(): THREE.Mesh[];
|
|
57
|
-
/** The material of the clipping plane representation. */
|
|
58
|
-
get planeMaterial(): THREE.Material | THREE.Material[];
|
|
59
|
-
/** The material of the clipping plane representation. */
|
|
60
|
-
set planeMaterial(material: THREE.Material | THREE.Material[]);
|
|
61
|
-
/** The size of the clipping plane representation. */
|
|
62
|
-
get size(): number;
|
|
63
|
-
/** Sets the size of the clipping plane representation. */
|
|
64
|
-
set size(size: number);
|
|
65
|
-
/**
|
|
66
|
-
* Getter for the helper object of the clipping plane.
|
|
67
|
-
* The helper object is a THREE.Object3D that contains the clipping plane mesh and other related objects.
|
|
68
|
-
* It is used for positioning, rotating, and scaling the clipping plane in the 3D scene.
|
|
69
|
-
*
|
|
70
|
-
* @returns {THREE.Object3D} The helper object of the clipping plane.
|
|
71
|
-
*/
|
|
72
|
-
get helper(): THREE.Object3D<THREE.Object3DEventMap>;
|
|
73
|
-
constructor(components: Components, world: World, origin: THREE.Vector3, normal: THREE.Vector3, material: THREE.Material, size?: number, activateControls?: boolean);
|
|
74
|
-
/**
|
|
75
|
-
* Sets the clipping plane's normal and origin from the given normal and point.
|
|
76
|
-
* This method resets the clipping plane's state, updates the normal and origin,
|
|
77
|
-
* and positions the helper object accordingly.
|
|
78
|
-
*
|
|
79
|
-
* @param normal - The new normal vector for the clipping plane.
|
|
80
|
-
* @param point - The new origin point for the clipping plane.
|
|
81
|
-
*
|
|
82
|
-
* @returns {void}
|
|
83
|
-
*/
|
|
84
|
-
setFromNormalAndCoplanarPoint(normal: THREE.Vector3, point: THREE.Vector3): void;
|
|
85
|
-
/** {@link Updateable.update} */
|
|
86
|
-
update: () => void;
|
|
87
|
-
/** {@link Disposable.dispose} */
|
|
88
|
-
dispose(): void;
|
|
89
|
-
private reset;
|
|
90
|
-
protected toggleControls(state: boolean): void;
|
|
91
|
-
private newTransformControls;
|
|
92
|
-
private initializeControls;
|
|
93
|
-
private createArrowBoundingBox;
|
|
94
|
-
private changeDrag;
|
|
95
|
-
private notifyDraggingChanged;
|
|
96
|
-
private preventCameraMovement;
|
|
97
|
-
private newHelper;
|
|
98
|
-
private static newPlaneMesh;
|
|
99
|
-
}
|
|
@@ -1,93 +0,0 @@
|
|
|
1
|
-
import { Component, Disposable, Event } from "../Types";
|
|
2
|
-
/**
|
|
3
|
-
* The entry point of the Components library. It can create, delete and access all the components of the library globally, update all the updatable components automatically and dispose all the components, preventing memory leaks.
|
|
4
|
-
*/
|
|
5
|
-
export declare class Components implements Disposable {
|
|
6
|
-
/**
|
|
7
|
-
* The version of the @thatopen/components library.
|
|
8
|
-
*/
|
|
9
|
-
static readonly release = "2.4.11";
|
|
10
|
-
/** {@link Disposable.onDisposed} */
|
|
11
|
-
readonly onDisposed: Event<void>;
|
|
12
|
-
/**
|
|
13
|
-
* The list of components created in this app.
|
|
14
|
-
* The keys are UUIDs and the values are instances of the components.
|
|
15
|
-
*/
|
|
16
|
-
readonly list: Map<string, Component>;
|
|
17
|
-
/**
|
|
18
|
-
* If disabled, the animation loop will be stopped.
|
|
19
|
-
* Default value is false.
|
|
20
|
-
*/
|
|
21
|
-
enabled: boolean;
|
|
22
|
-
private _clock;
|
|
23
|
-
/**
|
|
24
|
-
* Event that triggers the Components instance is initialized.
|
|
25
|
-
*
|
|
26
|
-
* @remarks
|
|
27
|
-
* This event is triggered once when the {@link Components.init} method has been called and finish processing.
|
|
28
|
-
* This is useful to set configuration placeholders that need to be executed when the components instance is initialized.
|
|
29
|
-
* For example, enabling and configuring custom effects in a post-production renderer.
|
|
30
|
-
*
|
|
31
|
-
* @example
|
|
32
|
-
* ```typescript
|
|
33
|
-
* const components = new Components();
|
|
34
|
-
* components.onInit.add(() => {
|
|
35
|
-
* // Enable custom effects in the post-production renderer
|
|
36
|
-
* // or any other operation dependant on the component initialization
|
|
37
|
-
* });
|
|
38
|
-
* components.init();
|
|
39
|
-
* ```
|
|
40
|
-
*/
|
|
41
|
-
readonly onInit: Event<undefined>;
|
|
42
|
-
/**
|
|
43
|
-
* Adds a component to the list of components.
|
|
44
|
-
* Throws an error if a component with the same UUID already exists.
|
|
45
|
-
*
|
|
46
|
-
* @param uuid - The unique identifier of the component.
|
|
47
|
-
* @param instance - The instance of the component to be added.
|
|
48
|
-
*
|
|
49
|
-
* @throws Will throw an error if a component with the same UUID already exists.
|
|
50
|
-
*
|
|
51
|
-
* @internal
|
|
52
|
-
*/
|
|
53
|
-
add(uuid: string, instance: Component): void;
|
|
54
|
-
/**
|
|
55
|
-
* Retrieves a component instance by its constructor function.
|
|
56
|
-
* If the component does not exist in the list, it will be created and added.
|
|
57
|
-
*
|
|
58
|
-
* @template U - The type of the component to retrieve.
|
|
59
|
-
* @param Component - The constructor function of the component to retrieve.
|
|
60
|
-
*
|
|
61
|
-
* @returns The instance of the requested component.
|
|
62
|
-
*
|
|
63
|
-
* @throws Will throw an error if a component with the same UUID already exists.
|
|
64
|
-
*
|
|
65
|
-
* @internal
|
|
66
|
-
*/
|
|
67
|
-
get<U extends Component>(Component: new (components: Components) => U): U;
|
|
68
|
-
constructor();
|
|
69
|
-
/**
|
|
70
|
-
* Initializes the Components instance.
|
|
71
|
-
* This method starts the animation loop, sets the enabled flag to true,
|
|
72
|
-
* and calls the update method.
|
|
73
|
-
*/
|
|
74
|
-
init(): void;
|
|
75
|
-
/**
|
|
76
|
-
* Disposes the memory of all the components and tools of this instance of
|
|
77
|
-
* the library. A memory leak will be created if:
|
|
78
|
-
*
|
|
79
|
-
* - An instance of the library ends up out of scope and this function isn't
|
|
80
|
-
* called. This is especially relevant in Single Page Applications (React,
|
|
81
|
-
* Angular, Vue, etc).
|
|
82
|
-
*
|
|
83
|
-
* - Any of the objects of this instance (meshes, geometries,materials, etc) is
|
|
84
|
-
* referenced by a reference type (object or array).
|
|
85
|
-
*
|
|
86
|
-
* You can learn more about how Three.js handles memory leaks
|
|
87
|
-
* [here](https://threejs.org/docs/#manual/en/introduction/How-to-dispose-of-objects).
|
|
88
|
-
*
|
|
89
|
-
*/
|
|
90
|
-
dispose(): void;
|
|
91
|
-
private update;
|
|
92
|
-
private static setupBVH;
|
|
93
|
-
}
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { Component, DataMap } from "../Types";
|
|
2
|
-
import { Components } from "../Components";
|
|
3
|
-
import { Configurator } from "./src";
|
|
4
|
-
export * from "./src";
|
|
5
|
-
/**
|
|
6
|
-
* A tool to manage all the configuration from the app centrally.
|
|
7
|
-
*/
|
|
8
|
-
export declare class ConfigManager extends Component {
|
|
9
|
-
/**
|
|
10
|
-
* The list of all configurations of this app.
|
|
11
|
-
*/
|
|
12
|
-
list: DataMap<string, Configurator<any, any>>;
|
|
13
|
-
/** {@link Component.enabled} */
|
|
14
|
-
enabled: boolean;
|
|
15
|
-
/**
|
|
16
|
-
* A unique identifier for the component.
|
|
17
|
-
* This UUID is used to register the component within the Components system.
|
|
18
|
-
*/
|
|
19
|
-
static readonly uuid: "b8c764e0-6b24-4e77-9a32-35fa728ee5b4";
|
|
20
|
-
constructor(components: Components);
|
|
21
|
-
}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { ControlsSchema } from "../../Types";
|
|
2
|
-
import { Components } from "../../Components";
|
|
3
|
-
export declare abstract class Configurator<T = any, U extends ControlsSchema = ControlsSchema> {
|
|
4
|
-
protected abstract _config: U;
|
|
5
|
-
protected _component: T;
|
|
6
|
-
name: string;
|
|
7
|
-
uuid: string;
|
|
8
|
-
get controls(): U;
|
|
9
|
-
constructor(component: T, components: Components, name: string, uuid?: string);
|
|
10
|
-
set(data: Partial<U>): void;
|
|
11
|
-
export(controls?: ControlsSchema, exported?: any): any;
|
|
12
|
-
import(exported: any, imported?: any, first?: boolean): void;
|
|
13
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from "./configurator";
|
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
import * as THREE from "three";
|
|
2
|
-
import { Components } from "../Components";
|
|
3
|
-
import { MeshCullerRenderer } from "./src";
|
|
4
|
-
import { Component, Event, Disposable, World } from "../Types";
|
|
5
|
-
export * from "./src";
|
|
6
|
-
/**
|
|
7
|
-
* A component that provides culling functionality for meshes in a 3D scene. 📕 [Tutorial](https://docs.thatopen.com/Tutorials/Components/Core/Cullers). 📘 [API](https://docs.thatopen.com/api/@thatopen/components/classes/Cullers).
|
|
8
|
-
*/
|
|
9
|
-
export declare class Cullers extends Component implements Disposable {
|
|
10
|
-
/**
|
|
11
|
-
* A unique identifier for the component.
|
|
12
|
-
* This UUID is used to register the component within the Components system.
|
|
13
|
-
*/
|
|
14
|
-
static readonly uuid: "69f2a50d-c266-44fc-b1bd-fa4d34be89e6";
|
|
15
|
-
/**
|
|
16
|
-
* An event that is triggered when the Cullers component is disposed.
|
|
17
|
-
*/
|
|
18
|
-
readonly onDisposed: Event<unknown>;
|
|
19
|
-
private _enabled;
|
|
20
|
-
/**
|
|
21
|
-
* A map of MeshCullerRenderer instances, keyed by their world UUIDs.
|
|
22
|
-
*/
|
|
23
|
-
list: Map<string, MeshCullerRenderer>;
|
|
24
|
-
/** {@link Component.enabled} */
|
|
25
|
-
get enabled(): boolean;
|
|
26
|
-
/** {@link Component.enabled} */
|
|
27
|
-
set enabled(value: boolean);
|
|
28
|
-
constructor(components: Components);
|
|
29
|
-
/**
|
|
30
|
-
* Creates a new MeshCullerRenderer for the given world.
|
|
31
|
-
* If a MeshCullerRenderer already exists for the world, it will return the existing one.
|
|
32
|
-
*
|
|
33
|
-
* @param world - The world for which to create the MeshCullerRenderer.
|
|
34
|
-
*
|
|
35
|
-
* @returns The newly created or existing MeshCullerRenderer for the given world.
|
|
36
|
-
*/
|
|
37
|
-
create(world: World): MeshCullerRenderer;
|
|
38
|
-
/**
|
|
39
|
-
* Deletes the MeshCullerRenderer associated with the given world.
|
|
40
|
-
* If a MeshCullerRenderer exists for the given world, it will be disposed and removed from the list.
|
|
41
|
-
*
|
|
42
|
-
* @param world - The world for which to delete the MeshCullerRenderer.
|
|
43
|
-
*
|
|
44
|
-
* @returns {void}
|
|
45
|
-
*/
|
|
46
|
-
delete(world: World): void;
|
|
47
|
-
/** {@link Disposable.dispose} */
|
|
48
|
-
dispose(): void;
|
|
49
|
-
/**
|
|
50
|
-
* Updates the given instanced meshes inside the all the cullers. You should use this if you change the count property, e.g. when changing the visibility of fragments.
|
|
51
|
-
*
|
|
52
|
-
* @param meshes - The meshes to update.
|
|
53
|
-
*
|
|
54
|
-
*/
|
|
55
|
-
updateInstanced(meshes: Iterable<THREE.InstancedMesh>): void;
|
|
56
|
-
}
|
|
@@ -1,74 +0,0 @@
|
|
|
1
|
-
import { BooleanSettingsControl, NumberSettingControl } from "../../Types";
|
|
2
|
-
import { Configurator } from "../../ConfigManager";
|
|
3
|
-
import { CullerRenderer } from "../index";
|
|
4
|
-
type CullerRendererConfigType = {
|
|
5
|
-
enabled: BooleanSettingsControl;
|
|
6
|
-
width: NumberSettingControl;
|
|
7
|
-
height: NumberSettingControl;
|
|
8
|
-
updateInterval: NumberSettingControl;
|
|
9
|
-
autoUpdate: BooleanSettingsControl;
|
|
10
|
-
renderDebugFrame: BooleanSettingsControl;
|
|
11
|
-
threshold: NumberSettingControl;
|
|
12
|
-
};
|
|
13
|
-
/**
|
|
14
|
-
* Configuration interface for the {@link CullerRenderer}.
|
|
15
|
-
*/
|
|
16
|
-
export interface CullerRendererConfig {
|
|
17
|
-
/**
|
|
18
|
-
* Whether the culler renderer should make renders or not.
|
|
19
|
-
*/
|
|
20
|
-
enabled: boolean;
|
|
21
|
-
/**
|
|
22
|
-
* Width of the render target used for visibility checks.
|
|
23
|
-
*/
|
|
24
|
-
width: number;
|
|
25
|
-
/**
|
|
26
|
-
* Height of the render target used for visibility checks.
|
|
27
|
-
* Default value is 512.
|
|
28
|
-
*/
|
|
29
|
-
height: number;
|
|
30
|
-
/**
|
|
31
|
-
* Whether the visibility check should be performed automatically.
|
|
32
|
-
* Default value is true.
|
|
33
|
-
*/
|
|
34
|
-
autoUpdate: boolean;
|
|
35
|
-
/**
|
|
36
|
-
* Interval in milliseconds at which the visibility check should be performed.
|
|
37
|
-
*/
|
|
38
|
-
updateInterval: number;
|
|
39
|
-
/**
|
|
40
|
-
* Whether to render the frame use to debug the culler behavior.
|
|
41
|
-
*/
|
|
42
|
-
renderDebugFrame: boolean;
|
|
43
|
-
/**
|
|
44
|
-
* Pixels in screen a geometry must occupy to be considered "seen".
|
|
45
|
-
* Default value is 100.
|
|
46
|
-
*/
|
|
47
|
-
threshold: number;
|
|
48
|
-
}
|
|
49
|
-
/**
|
|
50
|
-
* Settings to configure the CullerRenderer.
|
|
51
|
-
*/
|
|
52
|
-
export declare class CullerRendererConfigManager extends Configurator<CullerRenderer, CullerRendererConfigType> {
|
|
53
|
-
protected _config: CullerRendererConfigType;
|
|
54
|
-
private _interval;
|
|
55
|
-
get enabled(): boolean;
|
|
56
|
-
set enabled(value: boolean);
|
|
57
|
-
get width(): number;
|
|
58
|
-
set width(value: number);
|
|
59
|
-
get height(): number;
|
|
60
|
-
set height(value: number);
|
|
61
|
-
get autoUpdate(): boolean;
|
|
62
|
-
set autoUpdate(value: boolean);
|
|
63
|
-
get updateInterval(): number;
|
|
64
|
-
set updateInterval(value: number);
|
|
65
|
-
get renderDebugFrame(): boolean;
|
|
66
|
-
set renderDebugFrame(value: boolean);
|
|
67
|
-
get threshold(): number;
|
|
68
|
-
set threshold(value: number);
|
|
69
|
-
setWidthHeight(width: number, height: number): void;
|
|
70
|
-
setAutoAndInterval(auto: boolean, interval: number): void;
|
|
71
|
-
private resetRenderTarget;
|
|
72
|
-
private resetInterval;
|
|
73
|
-
}
|
|
74
|
-
export {};
|