@xtctwins/tctwins-core 1.1.18 → 1.1.19
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/tctwins-core.es5.js +1490 -1487
- package/dist/tctwins-core.min.es5.js +4 -4
- package/dist/tctwins-core.umd.js +37 -0
- package/package.json +1 -1
- package/types/viewer/metadata/MetaModel.d.ts +8 -0
- package/types/viewer/scene/models/SceneModel.d.ts +5 -0
- package/types/viewer/scene/utils.d.ts +165 -165
package/package.json
CHANGED
|
@@ -52,6 +52,14 @@ export declare class MetaModel {
|
|
|
52
52
|
*/
|
|
53
53
|
schema?: string;
|
|
54
54
|
|
|
55
|
+
/** Model coordinate unit from metadata; independent of measurement scale. */
|
|
56
|
+
unit?: string;
|
|
57
|
+
/** XTC takes precedence over separately loaded metadata. */
|
|
58
|
+
unitSource?: "xtc";
|
|
59
|
+
lengthUnitName?: string;
|
|
60
|
+
/** Original XTC factor; not applied to measurement scale. */
|
|
61
|
+
lengthUnit?: number;
|
|
62
|
+
|
|
55
63
|
/**
|
|
56
64
|
* Metadata on the {@link Scene}.
|
|
57
65
|
*/
|
|
@@ -8,6 +8,11 @@ import { SceneModelTextureSet } from "./SceneModelTextureSet";
|
|
|
8
8
|
* A high-performance model representation for efficient rendering and low memory usage.
|
|
9
9
|
*/
|
|
10
10
|
export declare class SceneModel extends Component {
|
|
11
|
+
/** Coordinate unit read from XTC; does not change geometry or measurement scale. */
|
|
12
|
+
unit?: string;
|
|
13
|
+
unitSource?: "xtc";
|
|
14
|
+
lengthUnitName?: string;
|
|
15
|
+
lengthUnit?: number;
|
|
11
16
|
/**
|
|
12
17
|
* Fires when the model is loaded
|
|
13
18
|
* @param event The loaded event
|
|
@@ -1,166 +1,166 @@
|
|
|
1
|
-
|
|
2
|
-
interface JsonNode {
|
|
3
|
-
type: string;
|
|
4
|
-
children: JsonNode[];
|
|
5
|
-
[key: string]: string | JsonNode[] | undefined;
|
|
6
|
-
}
|
|
7
|
-
|
|
8
|
-
interface HttpRequestArgs {
|
|
9
|
-
method?: string;
|
|
10
|
-
url: string;
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
export declare const utils: {
|
|
14
|
-
/**
|
|
15
|
-
*
|
|
16
|
-
*/
|
|
17
|
-
xmlToJson: (node: any, attributeRenamer: Record<string, string>) => JsonNode | string | undefined;
|
|
18
|
-
|
|
19
|
-
/**
|
|
20
|
-
*
|
|
21
|
-
*/
|
|
22
|
-
clone: (ob: any) => any;
|
|
23
|
-
|
|
24
|
-
/**
|
|
25
|
-
*
|
|
26
|
-
*/
|
|
27
|
-
compressGuid: (g: string) => string;
|
|
28
|
-
|
|
29
|
-
/**
|
|
30
|
-
*
|
|
31
|
-
*/
|
|
32
|
-
findNodeOfType: (m: any, t: string) => any;
|
|
33
|
-
|
|
34
|
-
/**
|
|
35
|
-
*
|
|
36
|
-
*/
|
|
37
|
-
timeout: (dt: number) => Promise<void>;
|
|
38
|
-
|
|
39
|
-
/**
|
|
40
|
-
*
|
|
41
|
-
*/
|
|
42
|
-
httpRequest: (args: HttpRequestArgs) => Promise<Document>;
|
|
43
|
-
|
|
44
|
-
/**
|
|
45
|
-
*
|
|
46
|
-
*/
|
|
47
|
-
loadJSON: (url: string, ok?: Function, err?: Function) => void;
|
|
48
|
-
|
|
49
|
-
/**
|
|
50
|
-
*
|
|
51
|
-
*/
|
|
52
|
-
loadArraybuffer: (url: string, ok?: Function, err?: Function) => void;
|
|
53
|
-
|
|
54
|
-
/**
|
|
55
|
-
*
|
|
56
|
-
*/
|
|
57
|
-
queryString: () => Record<string, string | string[]>;
|
|
58
|
-
|
|
59
|
-
/**
|
|
60
|
-
Tests if the given object is an array
|
|
61
|
-
@private
|
|
62
|
-
*/
|
|
63
|
-
isArray: (value: any) => boolean;
|
|
64
|
-
|
|
65
|
-
/**
|
|
66
|
-
Tests if the given value is a string
|
|
67
|
-
@param value
|
|
68
|
-
@returns {Boolean}
|
|
69
|
-
@private
|
|
70
|
-
*/
|
|
71
|
-
isString: (value: any) => boolean;
|
|
72
|
-
|
|
73
|
-
/**
|
|
74
|
-
Tests if the given value is a number
|
|
75
|
-
@param value
|
|
76
|
-
@returns {Boolean}
|
|
77
|
-
@private
|
|
78
|
-
*/
|
|
79
|
-
isNumeric: (value: any) => boolean;
|
|
80
|
-
|
|
81
|
-
/**
|
|
82
|
-
Tests if the given value is an ID
|
|
83
|
-
@param value
|
|
84
|
-
@returns {Boolean}
|
|
85
|
-
@private
|
|
86
|
-
*/
|
|
87
|
-
isID: (value: any) => boolean;
|
|
88
|
-
|
|
89
|
-
/**
|
|
90
|
-
Tests if the given components are the same, where the components can be either IDs or instances.
|
|
91
|
-
@param c1
|
|
92
|
-
@param c2
|
|
93
|
-
@returns {Boolean}
|
|
94
|
-
@private
|
|
95
|
-
*/
|
|
96
|
-
isSameComponent: (c1: any, c2: any) => boolean;
|
|
97
|
-
|
|
98
|
-
/**
|
|
99
|
-
Tests if the given value is a function
|
|
100
|
-
@param value
|
|
101
|
-
@returns {Boolean}
|
|
102
|
-
@private
|
|
103
|
-
*/
|
|
104
|
-
isFunction: (value: any) => boolean;
|
|
105
|
-
|
|
106
|
-
/**
|
|
107
|
-
Tests if the given value is a JavaScript JSON object, eg, ````{ foo: "bar" }````.
|
|
108
|
-
@param value
|
|
109
|
-
@returns {Boolean}
|
|
110
|
-
@private
|
|
111
|
-
*/
|
|
112
|
-
isObject: (value: any) => boolean;
|
|
113
|
-
|
|
114
|
-
/** Returns a shallow copy
|
|
115
|
-
*/
|
|
116
|
-
copy: (o: any) => any;
|
|
117
|
-
|
|
118
|
-
/** Add properties of o to o2, overwriting them on o2 if already there
|
|
119
|
-
*/
|
|
120
|
-
apply: (o: any, o2: any) => any;
|
|
121
|
-
|
|
122
|
-
/**
|
|
123
|
-
Add non-null/defined properties of o to o2
|
|
124
|
-
@private
|
|
125
|
-
*/
|
|
126
|
-
apply2: (o: any, o2: any) => any;
|
|
127
|
-
|
|
128
|
-
/**
|
|
129
|
-
Add properties of o to o2 where undefined or null on o2
|
|
130
|
-
@private
|
|
131
|
-
*/
|
|
132
|
-
applyIf: (o: any, o2: any) => any;
|
|
133
|
-
|
|
134
|
-
/**
|
|
135
|
-
Returns true if the given map is empty.
|
|
136
|
-
@param obj
|
|
137
|
-
@returns {Boolean}
|
|
138
|
-
@private
|
|
139
|
-
*/
|
|
140
|
-
isEmptyObject: (obj: any) => boolean;
|
|
141
|
-
|
|
142
|
-
/**
|
|
143
|
-
Returns the given ID as a string, in quotes if the ID was a string to begin with.
|
|
144
|
-
|
|
145
|
-
This is useful for logging IDs.
|
|
146
|
-
|
|
147
|
-
@param {Number| String} id The ID
|
|
148
|
-
@returns {String}
|
|
149
|
-
@private
|
|
150
|
-
*/
|
|
151
|
-
inQuotes: (id: number | string) => string;
|
|
152
|
-
|
|
153
|
-
/**
|
|
154
|
-
Returns the concatenation of two typed arrays.
|
|
155
|
-
@param a
|
|
156
|
-
@param b
|
|
157
|
-
@returns {*|a}
|
|
158
|
-
@private
|
|
159
|
-
*/
|
|
160
|
-
concat: (a: any, b: any) => any;
|
|
161
|
-
|
|
162
|
-
/**
|
|
163
|
-
*
|
|
164
|
-
*/
|
|
165
|
-
flattenParentChildHierarchy: (root: JsonNode) => JsonNode[];
|
|
1
|
+
|
|
2
|
+
interface JsonNode {
|
|
3
|
+
type: string;
|
|
4
|
+
children: JsonNode[];
|
|
5
|
+
[key: string]: string | JsonNode[] | undefined;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
interface HttpRequestArgs {
|
|
9
|
+
method?: string;
|
|
10
|
+
url: string;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export declare const utils: {
|
|
14
|
+
/**
|
|
15
|
+
*
|
|
16
|
+
*/
|
|
17
|
+
xmlToJson: (node: any, attributeRenamer: Record<string, string>) => JsonNode | string | undefined;
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
*
|
|
21
|
+
*/
|
|
22
|
+
clone: (ob: any) => any;
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
*
|
|
26
|
+
*/
|
|
27
|
+
compressGuid: (g: string) => string;
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
*
|
|
31
|
+
*/
|
|
32
|
+
findNodeOfType: (m: any, t: string) => any;
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
*
|
|
36
|
+
*/
|
|
37
|
+
timeout: (dt: number) => Promise<void>;
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
*
|
|
41
|
+
*/
|
|
42
|
+
httpRequest: (args: HttpRequestArgs) => Promise<Document>;
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
*
|
|
46
|
+
*/
|
|
47
|
+
loadJSON: (url: string, ok?: Function, err?: Function) => void;
|
|
48
|
+
|
|
49
|
+
/**
|
|
50
|
+
*
|
|
51
|
+
*/
|
|
52
|
+
loadArraybuffer: (url: string, ok?: Function, err?: Function) => void;
|
|
53
|
+
|
|
54
|
+
/**
|
|
55
|
+
*
|
|
56
|
+
*/
|
|
57
|
+
queryString: () => Record<string, string | string[]>;
|
|
58
|
+
|
|
59
|
+
/**
|
|
60
|
+
Tests if the given object is an array
|
|
61
|
+
@private
|
|
62
|
+
*/
|
|
63
|
+
isArray: (value: any) => boolean;
|
|
64
|
+
|
|
65
|
+
/**
|
|
66
|
+
Tests if the given value is a string
|
|
67
|
+
@param value
|
|
68
|
+
@returns {Boolean}
|
|
69
|
+
@private
|
|
70
|
+
*/
|
|
71
|
+
isString: (value: any) => boolean;
|
|
72
|
+
|
|
73
|
+
/**
|
|
74
|
+
Tests if the given value is a number
|
|
75
|
+
@param value
|
|
76
|
+
@returns {Boolean}
|
|
77
|
+
@private
|
|
78
|
+
*/
|
|
79
|
+
isNumeric: (value: any) => boolean;
|
|
80
|
+
|
|
81
|
+
/**
|
|
82
|
+
Tests if the given value is an ID
|
|
83
|
+
@param value
|
|
84
|
+
@returns {Boolean}
|
|
85
|
+
@private
|
|
86
|
+
*/
|
|
87
|
+
isID: (value: any) => boolean;
|
|
88
|
+
|
|
89
|
+
/**
|
|
90
|
+
Tests if the given components are the same, where the components can be either IDs or instances.
|
|
91
|
+
@param c1
|
|
92
|
+
@param c2
|
|
93
|
+
@returns {Boolean}
|
|
94
|
+
@private
|
|
95
|
+
*/
|
|
96
|
+
isSameComponent: (c1: any, c2: any) => boolean;
|
|
97
|
+
|
|
98
|
+
/**
|
|
99
|
+
Tests if the given value is a function
|
|
100
|
+
@param value
|
|
101
|
+
@returns {Boolean}
|
|
102
|
+
@private
|
|
103
|
+
*/
|
|
104
|
+
isFunction: (value: any) => boolean;
|
|
105
|
+
|
|
106
|
+
/**
|
|
107
|
+
Tests if the given value is a JavaScript JSON object, eg, ````{ foo: "bar" }````.
|
|
108
|
+
@param value
|
|
109
|
+
@returns {Boolean}
|
|
110
|
+
@private
|
|
111
|
+
*/
|
|
112
|
+
isObject: (value: any) => boolean;
|
|
113
|
+
|
|
114
|
+
/** Returns a shallow copy
|
|
115
|
+
*/
|
|
116
|
+
copy: (o: any) => any;
|
|
117
|
+
|
|
118
|
+
/** Add properties of o to o2, overwriting them on o2 if already there
|
|
119
|
+
*/
|
|
120
|
+
apply: (o: any, o2: any) => any;
|
|
121
|
+
|
|
122
|
+
/**
|
|
123
|
+
Add non-null/defined properties of o to o2
|
|
124
|
+
@private
|
|
125
|
+
*/
|
|
126
|
+
apply2: (o: any, o2: any) => any;
|
|
127
|
+
|
|
128
|
+
/**
|
|
129
|
+
Add properties of o to o2 where undefined or null on o2
|
|
130
|
+
@private
|
|
131
|
+
*/
|
|
132
|
+
applyIf: (o: any, o2: any) => any;
|
|
133
|
+
|
|
134
|
+
/**
|
|
135
|
+
Returns true if the given map is empty.
|
|
136
|
+
@param obj
|
|
137
|
+
@returns {Boolean}
|
|
138
|
+
@private
|
|
139
|
+
*/
|
|
140
|
+
isEmptyObject: (obj: any) => boolean;
|
|
141
|
+
|
|
142
|
+
/**
|
|
143
|
+
Returns the given ID as a string, in quotes if the ID was a string to begin with.
|
|
144
|
+
|
|
145
|
+
This is useful for logging IDs.
|
|
146
|
+
|
|
147
|
+
@param {Number| String} id The ID
|
|
148
|
+
@returns {String}
|
|
149
|
+
@private
|
|
150
|
+
*/
|
|
151
|
+
inQuotes: (id: number | string) => string;
|
|
152
|
+
|
|
153
|
+
/**
|
|
154
|
+
Returns the concatenation of two typed arrays.
|
|
155
|
+
@param a
|
|
156
|
+
@param b
|
|
157
|
+
@returns {*|a}
|
|
158
|
+
@private
|
|
159
|
+
*/
|
|
160
|
+
concat: (a: any, b: any) => any;
|
|
161
|
+
|
|
162
|
+
/**
|
|
163
|
+
*
|
|
164
|
+
*/
|
|
165
|
+
flattenParentChildHierarchy: (root: JsonNode) => JsonNode[];
|
|
166
166
|
}
|