@xeokit/xeokit-sdk 2.6.64 → 2.6.66
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/dist/xeokit-sdk.cjs.js +277 -272
- package/dist/xeokit-sdk.es.js +277 -272
- package/dist/xeokit-sdk.es5.js +132 -119
- package/dist/xeokit-sdk.min.cjs.js +5 -5
- package/dist/xeokit-sdk.min.es.js +5 -5
- package/dist/xeokit-sdk.min.es5.js +4 -4
- package/package.json +1 -1
- package/src/extras/PointerCircle/PointerCircle.js +1 -1
- package/src/extras/PointerLens/PointerLens.js +27 -46
- package/src/plugins/AngleMeasurementsPlugin/AngleMeasurementsTouchControl.js +29 -20
- package/src/plugins/AnnotationsPlugin/Annotation.js +3 -0
- package/src/plugins/DistanceMeasurementsPlugin/DistanceMeasurementsTouchControl.js +27 -33
- package/src/plugins/SectionPlanesPlugin/Control.js +36 -126
- package/src/plugins/TreeViewPlugin/TreeViewPlugin.js +10 -4
- package/src/plugins/lib/html/MenuEvent.js +3 -1
- package/src/viewer/scene/model/SceneModel.js +1 -0
- package/src/viewer/scene/model/dtx/triangles/DTXTrianglesLayer.js +1 -2
- package/src/viewer/scene/model/vbo/batching/triangles/renderers/TrianglesColorRenderer.js +4 -1
- package/src/viewer/scene/model/vbo/instancing/lines/VBOInstancingLinesLayer.js +1 -1
- package/src/viewer/scene/model/vbo/instancing/triangles/renderers/TrianglesColorRenderer.js +4 -1
- package/src/viewer/scene/sectionPlane/SectionPlane.js +79 -1
- package/src/viewer/scene/webgl/Renderer.js +9 -3
- package/types/extras/PointerCircle/PointerCircle.d.ts +50 -0
- package/types/extras/PointerCircle/index.d.ts +1 -0
- package/types/plugins/AngleMeasurementsPlugin/index.d.ts +2 -1
- package/types/plugins/CityJSONLoaderPlugin/CityJSONLoaderPlugin.d.ts +4 -0
- package/types/plugins/DotBIMLoaderPlugin/DotBIMLoaderPlugin.d.ts +121 -0
- package/types/plugins/DotBIMLoaderPlugin/index.d.ts +1 -0
- package/types/plugins/GLTFLoaderPlugin/GLTFLoaderPlugin.d.ts +4 -0
- package/types/plugins/LASLoaderPlugin/LASLoaderPlugin.d.ts +4 -0
- package/types/plugins/STLLoaderPlugin/STLLoaderPlugin.d.ts +4 -0
- package/types/plugins/TreeViewPlugin/TreeViewPlugin.d.ts +4 -0
- package/types/plugins/WebIFCLoaderPlugin/WebIFCLoaderPlugin.d.ts +4 -0
- package/types/plugins/XKTLoaderPlugin/XKTLoaderPlugin.d.ts +19 -1
- package/types/plugins/index.d.ts +2 -0
- package/types/plugins/lib/ui/index.d.ts +12 -0
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
import {IFCObjectDefaults, Plugin, VBOSceneModel, Viewer} from "../../viewer";
|
|
2
|
+
|
|
3
|
+
export declare interface IDotBIMDefaultDataSource {
|
|
4
|
+
/**
|
|
5
|
+
* Gets the contents of the given ````.xkt```` file in an arraybuffer.
|
|
6
|
+
*
|
|
7
|
+
* @param {String|Number} dotBIMSrc Path or ID of an ````.bim```` file.
|
|
8
|
+
* @param {Function} ok Callback fired on success, argument is the ````.xkt```` file in an arraybuffer.
|
|
9
|
+
* @param {Function} error Callback fired on error.
|
|
10
|
+
*/
|
|
11
|
+
getDotBIM(dotBIMSrc: string | number, ok: (buffer: ArrayBuffer) => void, error: (e: Error) => void): void;
|
|
12
|
+
|
|
13
|
+
get cacheBuster(): boolean;
|
|
14
|
+
|
|
15
|
+
set cacheBuster(value: boolean);
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export declare type DotBIMLoaderPluginConfiguration = {
|
|
19
|
+
/** Optional ID for this plugin, so that we can find it within {@link Viewer.plugins}. */
|
|
20
|
+
id?: string;
|
|
21
|
+
/** Map of initial default states for each loaded {@link Entity} that represents an object. Default value is {@link IFCObjectDefaults}.*/
|
|
22
|
+
objectDefaults?: IFCObjectDefaults;
|
|
23
|
+
/** A custom data source through which the XKTLoaderPlugin can load model and metadata files. Defaults to an instance of {@link DotBIMDefaultDataSource}, which loads uover HTTP. */
|
|
24
|
+
dataSource?: IDotBIMDefaultDataSource;
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* @param {Number[]} [params.rotation=[0,0,0]] The model's orientation, as Euler angles given in degrees, for each of the X, Y and Z axis.
|
|
30
|
+
* @param {Boolean} [params.backfaces=true] When true, always show backfaces, even on objects for which the .BIM material is single-sided. When false, only show backfaces on geometries whenever the .BIM material is double-sided.
|
|
31
|
+
* @param {Boolean} [params.dtxEnabled=true] When ````true```` (default) use data textures (DTX), where appropriate, to
|
|
32
|
+
* represent the returned model. Set false to always use vertex buffer objects (VBOs). Note that DTX is only applicable
|
|
33
|
+
* to non-textured triangle meshes, and that VBOs are always used for meshes that have textures, line segments, or point
|
|
34
|
+
* primitives. Only works while {@link DTX#enabled} is also ````true````.
|
|
35
|
+
*/
|
|
36
|
+
export declare type LoadDotBIMModel = {
|
|
37
|
+
/** ID to assign to the root {@link Entity#id}, unique among all components in the Viewer's {@link Scene}, generated automatically by default. */
|
|
38
|
+
id?: string;
|
|
39
|
+
/** Path to a .BIM file, as an alternative to the ````bim```` parameter. */
|
|
40
|
+
src?: string;
|
|
41
|
+
/** .BIM JSON, as an alternative to the ````src```` parameter. */
|
|
42
|
+
bim?: any;
|
|
43
|
+
/** Map of initial default states for each loaded {@link Entity} that represents an object. Default value is {@link IFCObjectDefaults}. */
|
|
44
|
+
objectDefaults?: object;
|
|
45
|
+
/** When loading metadata, only loads objects that have {@link MetaObject}s with {@link MetaObject.type} values in this list. */
|
|
46
|
+
includeTypes?: string[]
|
|
47
|
+
/** When loading metadata, never loads objects that have {@link MetaObject}s with {@link MetaObject.type} values in this list. */
|
|
48
|
+
excludeTypes?: string[];
|
|
49
|
+
/** The double-precision World-space origin of the model's coordinates. */
|
|
50
|
+
origin?: number[];
|
|
51
|
+
/** The single-precision position, relative to ````origin````. */
|
|
52
|
+
position?: number[];
|
|
53
|
+
/** The model's scale. */
|
|
54
|
+
scale?: number[];
|
|
55
|
+
/** The model's orientation, given as Euler angles in degrees, for each of the X, Y and Z axis. */
|
|
56
|
+
rotation?: number[];
|
|
57
|
+
/** When true, always show backfaces, even on objects for which the .BIM material is single-sided. When false, only show backfaces on geometries whenever the .BIM material is double-sided. */
|
|
58
|
+
backfaces?: boolean;
|
|
59
|
+
/** When ````true```` (default) use data textures (DTX), where appropriate, to
|
|
60
|
+
* represent the returned model. Set false to always use vertex buffer objects (VBOs). Note that DTX is only applicable
|
|
61
|
+
* to non-textured triangle meshes, and that VBOs are always used for meshes that have textures, line segments, or point
|
|
62
|
+
* primitives. Only works while {@link DTX#enabled} is also ````true````. */
|
|
63
|
+
dtxEnabled?: boolean;
|
|
64
|
+
};
|
|
65
|
+
|
|
66
|
+
export declare class DotBIMLoaderPlugin extends Plugin {
|
|
67
|
+
/**
|
|
68
|
+
* @constructor
|
|
69
|
+
*
|
|
70
|
+
* @param {Viewer} viewer The Viewer.
|
|
71
|
+
* @param {DotBIMLoaderPluginConfiguration} cfg Plugin configuration.
|
|
72
|
+
*/
|
|
73
|
+
constructor(viewer: Viewer, cfg?: DotBIMLoaderPluginConfiguration);
|
|
74
|
+
|
|
75
|
+
/**
|
|
76
|
+
* Sets a custom data source through which the DotBIMLoaderPlugin can .BIM files.
|
|
77
|
+
*
|
|
78
|
+
* Default value is {@link DotBIMDefaultDataSource}, which loads via an XMLHttpRequest.
|
|
79
|
+
*
|
|
80
|
+
* @type {IXKTDefaultDataSource}
|
|
81
|
+
*/
|
|
82
|
+
set dataSource(arg: IDotBIMDefaultDataSource);
|
|
83
|
+
|
|
84
|
+
/**
|
|
85
|
+
* Gets the custom data source through which the DotBIMLoaderPlugin can load .BIM files.
|
|
86
|
+
*
|
|
87
|
+
* Default value is {@link DotBIMDefaultDataSource}, which loads via an XMLHttpRequest.
|
|
88
|
+
*
|
|
89
|
+
* @type {IXKTDefaultDataSource}
|
|
90
|
+
*/
|
|
91
|
+
get dataSource(): IDotBIMDefaultDataSource;
|
|
92
|
+
|
|
93
|
+
/**
|
|
94
|
+
* Sets map of initial default states for each loaded {@link Entity} that represents an object.
|
|
95
|
+
*
|
|
96
|
+
* @type {IFCObjectDefaults}
|
|
97
|
+
*/
|
|
98
|
+
set objectDefaults(arg: IFCObjectDefaults);
|
|
99
|
+
|
|
100
|
+
/**
|
|
101
|
+
* Gets map of initial default states for each loaded {@link Entity} that represents an object.
|
|
102
|
+
*
|
|
103
|
+
* @type {IFCObjectDefaults}
|
|
104
|
+
*/
|
|
105
|
+
get objectDefaults(): IFCObjectDefaults;
|
|
106
|
+
|
|
107
|
+
/**
|
|
108
|
+
* Loads a .BIM model from a file into this DotBIMLoaderPlugin's {@link Viewer}.
|
|
109
|
+
*
|
|
110
|
+
* @param {LoadBIMModel} params Loading parameters.
|
|
111
|
+
* @returns {VBOSceneModel} Entity representing the model, which will have {@link Entity#isModel} set ````true```` and will be registered by {@link Entity#id} in {@link Scene#models}
|
|
112
|
+
*/
|
|
113
|
+
|
|
114
|
+
/**
|
|
115
|
+
* Loads a .BIM model from a file into this DotBIMLoaderPlugin's {@link Viewer}.
|
|
116
|
+
*
|
|
117
|
+
* @param {LoadDotBIMModel} params Loading parameters.
|
|
118
|
+
* @returns {VBOSceneModel} Entity representing the model, which will have {@link Entity.isModel} set ````true```` and will be registered by {@link Entity.id} in {@link Scene.models}.
|
|
119
|
+
*/
|
|
120
|
+
load(params: LoadDotBIMModel): VBOSceneModel;
|
|
121
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./DotBIMLoaderPlugin";
|
|
@@ -31,6 +31,10 @@ export declare interface IGLTFDefaultDataSource {
|
|
|
31
31
|
* @param {Function} error Fired on error while loading the glTF binary asset.
|
|
32
32
|
*/
|
|
33
33
|
getArrayBuffer(glTFSrc: string | number, binarySrc: string | number, ok: Function, error: Function): void;
|
|
34
|
+
|
|
35
|
+
get cacheBuster(): boolean;
|
|
36
|
+
|
|
37
|
+
set cacheBuster(value: boolean);
|
|
34
38
|
}
|
|
35
39
|
|
|
36
40
|
export declare type GLTFLoaderPluginConfiguration = {
|
|
@@ -10,6 +10,10 @@ export declare interface ILASDefaultDataSource {
|
|
|
10
10
|
* @param {Function} error Callback fired on error.
|
|
11
11
|
*/
|
|
12
12
|
getLAS(src: string | number, ok: (LAS: ArrayBuffer) => void, error: (e: Error) => void): void;
|
|
13
|
+
|
|
14
|
+
get cacheBuster(): boolean;
|
|
15
|
+
|
|
16
|
+
set cacheBuster(value: boolean);
|
|
13
17
|
}
|
|
14
18
|
|
|
15
19
|
export declare type LASLoaderPluginConfiguration = {
|
|
@@ -9,6 +9,10 @@ export declare interface ISTLDefaultDataSource {
|
|
|
9
9
|
* @param {Function} error Fired on error while loading the STL file.
|
|
10
10
|
*/
|
|
11
11
|
getSTL(src: string | number, ok: Function, error: Function): void;
|
|
12
|
+
|
|
13
|
+
get cacheBuster(): boolean;
|
|
14
|
+
|
|
15
|
+
set cacheBuster(value: boolean);
|
|
12
16
|
}
|
|
13
17
|
|
|
14
18
|
export declare type STLLoaderPluginCOnfiguration = {
|
|
@@ -21,6 +21,10 @@ export declare type TreeViewPluginConfiguration = {
|
|
|
21
21
|
renderService?: ITreeViewRenderService;
|
|
22
22
|
/** When true, will show indeterminate state for checkboxes when some but not all child nodes are checked */
|
|
23
23
|
showIndeterminate?: boolean;
|
|
24
|
+
/** Optional function to replace the default elevation sort function. The function should take two nodes and return -1, 0 or 1. */
|
|
25
|
+
elevationSortFunction?: (node1: TreeViewNode, node2: TreeViewNode) => number;
|
|
26
|
+
/** Optional function to replace the default sort function. The function should take two nodes and return -1, 0 or 1. */
|
|
27
|
+
defaultSortFunction?: (node1: TreeViewNode, node2: TreeViewNode) => number;
|
|
24
28
|
};
|
|
25
29
|
|
|
26
30
|
/**
|
|
@@ -13,6 +13,10 @@ import { ModelStats } from "../index";
|
|
|
13
13
|
* @param {Function} error Callback fired on error.
|
|
14
14
|
*/
|
|
15
15
|
getIFC(src: string | number, ok: (buffer: ArrayBuffer)=> void, error: (e: Error)=> void): void;
|
|
16
|
+
|
|
17
|
+
get cacheBuster(): boolean;
|
|
18
|
+
|
|
19
|
+
set cacheBuster(value: boolean);
|
|
16
20
|
}
|
|
17
21
|
|
|
18
22
|
export declare type WebIFCLoaderPluginConfiguration = {
|
|
@@ -56,14 +56,28 @@ export declare type LoadXKTModel = {
|
|
|
56
56
|
saoEnabled?: boolean;
|
|
57
57
|
/** Indicates if physically-based rendering (PBR) will apply to the model. Only works when {@link Scene.pbrEnabled} is also ````true````. */
|
|
58
58
|
pbrEnabled?: boolean;
|
|
59
|
+
/** Indicates if base color texture rendering is enabled for the model. Overridden by ````pbrEnabled````. Only works when {@link Scene#colorTextureEnabled} is also ````true````. */
|
|
60
|
+
colorTextureEnabled?: boolean;
|
|
59
61
|
/** When we set this ````true````, then we force rendering of backfaces for the model. */
|
|
60
62
|
backfaces?: boolean;
|
|
61
63
|
/** When loading metadata and this is ````true````, will only load {@link Entity}s that have {@link MetaObject}s (that are not excluded). */
|
|
62
64
|
excludeUnclassifiedObjects?: boolean;
|
|
63
65
|
/** Indicates whether to globalize each {@link Entity.id} and {@link MetaObject.id}, in case you need to prevent ID clashes with other models. */
|
|
64
66
|
globalizeObjectIds?: boolean;
|
|
65
|
-
/** Indicates whether to enable geometry reuse
|
|
67
|
+
/** Indicates whether to enable geometry reuse (````true```` by default) or whether to expand
|
|
68
|
+
* all geometry instances into batches (````false````), and not use instancing to render them. Setting this ````false```` can significantly
|
|
69
|
+
* improve Viewer performance for models that have excessive geometry reuse, but may also increases the amount of
|
|
70
|
+
* browser and GPU memory used by the model. See [#769](https://github.com/xeokit/xeokit-sdk/issues/769) for more info. */
|
|
66
71
|
reuseGeometries?: boolean;
|
|
72
|
+
/** When ````true```` (default) use data textures (DTX), where appropriate, to
|
|
73
|
+
* represent the returned model. Set false to always use vertex buffer objects (VBOs). Note that DTX is only applicable
|
|
74
|
+
* to non-textured triangle meshes, and that VBOs are always used for meshes that have textures, line segments, or point
|
|
75
|
+
* primitives. Only works while {@link DTX#enabled} is also ````true````. */
|
|
76
|
+
dtxEnabled?: boolean;
|
|
77
|
+
/** Specifies the rendering order for the model. This is used to control the order in which
|
|
78
|
+
* SceneModels are drawn when they have transparent objects, to give control over the order in which those objects are blended within the transparent
|
|
79
|
+
* render pass. */
|
|
80
|
+
renderOrder?: number;
|
|
67
81
|
}
|
|
68
82
|
|
|
69
83
|
export declare interface IXKTDefaultDataSource {
|
|
@@ -84,6 +98,10 @@ export declare interface IXKTDefaultDataSource {
|
|
|
84
98
|
* @param {Function} error Callback fired on error.
|
|
85
99
|
*/
|
|
86
100
|
getXKT(src: string | number, ok: (buffer: ArrayBuffer) => void, error: (e: Error) => void): void;
|
|
101
|
+
|
|
102
|
+
get cacheBuster(): boolean;
|
|
103
|
+
|
|
104
|
+
set cacheBuster(value: boolean);
|
|
87
105
|
}
|
|
88
106
|
|
|
89
107
|
/**
|
package/types/plugins/index.d.ts
CHANGED
|
@@ -4,6 +4,7 @@ export * from "./AxisGizmoPlugin";
|
|
|
4
4
|
export * from "./BCFViewpointsPlugin";
|
|
5
5
|
export * from "./CityJSONLoaderPlugin";
|
|
6
6
|
export * from "./DistanceMeasurementsPlugin";
|
|
7
|
+
export * from "./DotBIMLoaderPlugin";
|
|
7
8
|
export * from "./FastNavPlugin";
|
|
8
9
|
export * from "./GLTFLoaderPlugin";
|
|
9
10
|
export * from "./LASLoaderPlugin";
|
|
@@ -18,6 +19,7 @@ export * from "./ViewCullPlugin";
|
|
|
18
19
|
export * from "./XKTLoaderPlugin";
|
|
19
20
|
export * from "./WebIFCLoaderPlugin";
|
|
20
21
|
export * from "./XML3DLoaderPlugin";
|
|
22
|
+
export * from "./lib/ui";
|
|
21
23
|
|
|
22
24
|
export declare type ModelStats = {
|
|
23
25
|
sourceFormat: string;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { Viewer } from "../../../viewer";
|
|
2
|
+
import { PointerCircle } from "../../../extras/PointerCircle";
|
|
3
|
+
|
|
4
|
+
type Cleanup = () => void;
|
|
5
|
+
|
|
6
|
+
type OnCancel = () => void;
|
|
7
|
+
type OnChange = () => void;
|
|
8
|
+
type OnCommit = () => void;
|
|
9
|
+
|
|
10
|
+
type Ray2WorldPos = (origin: number[], direction: number[]) => boolean | number[];
|
|
11
|
+
|
|
12
|
+
declare function touchPointSelector(viewer: Viewer, pointerCircle: PointerCircle, ray2WorldPos: Ray2WorldPos): (onCancel: OnCancel, onChange: OnChange, onCommit: OnCommit) => Cleanup;
|