@xeokit/xeokit-sdk 2.2.5 → 2.3.0-beta-4

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 (120) hide show
  1. package/dist/web-ifc.wasm +0 -0
  2. package/dist/xeokit-sdk.cjs.js +87130 -80004
  3. package/dist/xeokit-sdk.es.js +87130 -80004
  4. package/dist/xeokit-sdk.min.cjs.js +1 -1
  5. package/dist/xeokit-sdk.min.es.js +1 -1
  6. package/package.json +18 -22
  7. package/types/extras/ContextMenu/ContextMenu.d.ts +125 -0
  8. package/types/extras/ContextMenu/index.d.ts +1 -0
  9. package/types/extras/index.d.ts +1 -0
  10. package/types/index.d.ts +3 -0
  11. package/types/plugins/AngleMeasurementsPlugin/AngleMeasurement.d.ts +144 -0
  12. package/types/plugins/AngleMeasurementsPlugin/AngleMeasurementsControl.d.ts +67 -0
  13. package/types/plugins/AngleMeasurementsPlugin/AngleMeasurementsPlugin.d.ts +99 -0
  14. package/types/plugins/AngleMeasurementsPlugin/index.d.ts +1 -0
  15. package/types/plugins/AnnotationsPlugin/Annotation.d.ts +135 -0
  16. package/types/plugins/AnnotationsPlugin/AnnotationsPlugin.d.ts +150 -0
  17. package/types/plugins/AnnotationsPlugin/index.d.ts +2 -0
  18. package/types/plugins/AxisGizmoPlugin/AxisGizmoPlugin.d.ts +28 -0
  19. package/types/plugins/AxisGizmoPlugin/index.d.ts +1 -0
  20. package/types/plugins/BCFViewpointsPlugin/BCFViewpointsPlugin.d.ts +146 -0
  21. package/types/plugins/BCFViewpointsPlugin/index.d.ts +1 -0
  22. package/types/plugins/CityJSONLoaderPlugin/CityJSONLoaderPlugin.d.ts +81 -0
  23. package/types/plugins/CityJSONLoaderPlugin/index.d.ts +1 -0
  24. package/types/plugins/DistanceMeasurementsPlugin/DistanceMeasurement.d.ts +137 -0
  25. package/types/plugins/DistanceMeasurementsPlugin/DistanceMeasurementsControl.d.ts +65 -0
  26. package/types/plugins/DistanceMeasurementsPlugin/DistanceMeasurementsPlugin.d.ts +135 -0
  27. package/types/plugins/DistanceMeasurementsPlugin/index.d.ts +1 -0
  28. package/types/plugins/FastNavPlugin/FastNavPlugin.d.ts +203 -0
  29. package/types/plugins/FastNavPlugin/index.d.ts +1 -0
  30. package/types/plugins/GLTFLoaderPlugin/GLTFLoaderPlugin.d.ts +140 -0
  31. package/types/plugins/GLTFLoaderPlugin/index.d.ts +1 -0
  32. package/types/plugins/LASLoaderPlugin/LASLoaderPlugin.d.ts +146 -0
  33. package/types/plugins/LASLoaderPlugin/index.d.ts +1 -0
  34. package/types/plugins/NavCubePlugin/NavCubePlugin.d.ts +160 -0
  35. package/types/plugins/NavCubePlugin/index.d.ts +1 -0
  36. package/types/plugins/OBJLoaderPlugin/OBJLoaderPlugin.d.ts +44 -0
  37. package/types/plugins/OBJLoaderPlugin/index.d.ts +1 -0
  38. package/types/plugins/STLLoaderPlugin/STLLoaderPlugin.d.ts +88 -0
  39. package/types/plugins/STLLoaderPlugin/index.d.ts +1 -0
  40. package/types/plugins/SectionPlanesPlugin/SectionPlanesPlugin.d.ts +103 -0
  41. package/types/plugins/SectionPlanesPlugin/index.d.ts +1 -0
  42. package/types/plugins/SkyboxesPlugin/SkyboxesPlugin.d.ts +34 -0
  43. package/types/plugins/SkyboxesPlugin/index.d.ts +1 -0
  44. package/types/plugins/StoreyViewsPlugin/Storey.d.ts +47 -0
  45. package/types/plugins/StoreyViewsPlugin/StoreyMap.d.ts +41 -0
  46. package/types/plugins/StoreyViewsPlugin/StoreyViewsPlugin.d.ts +180 -0
  47. package/types/plugins/StoreyViewsPlugin/index.d.ts +1 -0
  48. package/types/plugins/TreeViewPlugin/ModelTreeView.d.ts +24 -0
  49. package/types/plugins/TreeViewPlugin/TreeViewNode.d.ts +66 -0
  50. package/types/plugins/TreeViewPlugin/TreeViewPlugin.d.ts +150 -0
  51. package/types/plugins/TreeViewPlugin/index.d.ts +1 -0
  52. package/types/plugins/ViewCullPlugin/ViewCullPlugin.d.ts +34 -0
  53. package/types/plugins/ViewCullPlugin/index.d.ts +1 -0
  54. package/types/plugins/WebIFCLoaderPlugin/WebIFCLoaderPlugin.d.ts +230 -0
  55. package/types/plugins/WebIFCLoaderPlugin/index.d.ts +1 -0
  56. package/types/plugins/XKTLoaderPlugin/XKTLoaderPlugin.d.ts +277 -0
  57. package/types/plugins/XKTLoaderPlugin/index.d.ts +1 -0
  58. package/types/plugins/XML3DLoaderPlugin/XML3DLoaderPlugin.d.ts +65 -0
  59. package/types/plugins/XML3DLoaderPlugin/index.d.ts +1 -0
  60. package/types/plugins/index.d.ts +34 -0
  61. package/types/viewer/Configs.d.ts +20 -0
  62. package/types/viewer/Plugin.d.ts +69 -0
  63. package/types/viewer/Viewer.d.ts +212 -0
  64. package/types/viewer/index.d.ts +6 -0
  65. package/types/viewer/localization/LocaleService.d.ts +183 -0
  66. package/types/viewer/metadata/IFCObjectDefaults.d.ts +9 -0
  67. package/types/viewer/metadata/MetaModel.d.ts +65 -0
  68. package/types/viewer/metadata/MetaObject.d.ts +74 -0
  69. package/types/viewer/metadata/MetaScene.d.ts +135 -0
  70. package/types/viewer/metadata/Property.d.ts +29 -0
  71. package/types/viewer/metadata/PropertySet.d.ts +31 -0
  72. package/types/viewer/metadata/index.d.ts +6 -0
  73. package/types/viewer/scene/CameraControl/CameraControl.d.ts +681 -0
  74. package/types/viewer/scene/Component.d.ts +155 -0
  75. package/types/viewer/scene/Entity.d.ts +394 -0
  76. package/types/viewer/scene/camera/Camera.d.ts +364 -0
  77. package/types/viewer/scene/camera/CameraFlightAnimation.d.ts +167 -0
  78. package/types/viewer/scene/camera/CameraPath.d.ts +28 -0
  79. package/types/viewer/scene/camera/CameraPathAnimation.d.ts +95 -0
  80. package/types/viewer/scene/camera/CustomProjection.d.ts +57 -0
  81. package/types/viewer/scene/camera/Frustum.d.ts +166 -0
  82. package/types/viewer/scene/camera/Ortho.d.ts +115 -0
  83. package/types/viewer/scene/camera/Perspective.d.ts +136 -0
  84. package/types/viewer/scene/camera/index.d.ts +4 -0
  85. package/types/viewer/scene/geometry/Geometry.d.ts +7 -0
  86. package/types/viewer/scene/geometry/ReadableGeometry.d.ts +95 -0
  87. package/types/viewer/scene/geometry/index.d.ts +1 -0
  88. package/types/viewer/scene/index.d.ts +17 -0
  89. package/types/viewer/scene/marker/Marker.d.ts +136 -0
  90. package/types/viewer/scene/marker/index.d.ts +1 -0
  91. package/types/viewer/scene/materials/EdgeMaterial.d.ts +83 -0
  92. package/types/viewer/scene/materials/EmphasisMaterial.d.ts +241 -0
  93. package/types/viewer/scene/materials/Fresnel.d.ts +148 -0
  94. package/types/viewer/scene/materials/LinesMaterial.d.ts +71 -0
  95. package/types/viewer/scene/materials/Material.d.ts +3 -0
  96. package/types/viewer/scene/materials/PhongMaterial.d.ts +468 -0
  97. package/types/viewer/scene/materials/PointsMaterial.d.ts +206 -0
  98. package/types/viewer/scene/materials/Texture.d.ts +260 -0
  99. package/types/viewer/scene/materials/index.d.ts +6 -0
  100. package/types/viewer/scene/math/math.d.ts +56 -0
  101. package/types/viewer/scene/mementos/CameraMemento.d.ts +28 -0
  102. package/types/viewer/scene/mementos/ModelMemento.d.ts +44 -0
  103. package/types/viewer/scene/mementos/ObjectsMemento.d.ts +39 -0
  104. package/types/viewer/scene/mementos/index.d.ts +3 -0
  105. package/types/viewer/scene/mesh/Mesh.d.ts +786 -0
  106. package/types/viewer/scene/mesh/index.d.ts +1 -0
  107. package/types/viewer/scene/models/PerformanceModel/PerformanceModel.d.ts +622 -0
  108. package/types/viewer/scene/models/PerformanceModel/PerformanceNode.d.ts +302 -0
  109. package/types/viewer/scene/models/PerformanceModel/index.d.ts +2 -0
  110. package/types/viewer/scene/models/index.d.ts +1 -0
  111. package/types/viewer/scene/nodes/Node.d.ts +664 -0
  112. package/types/viewer/scene/nodes/index.d.ts +1 -0
  113. package/types/viewer/scene/postfx/SAO.d.ts +209 -0
  114. package/types/viewer/scene/scene/Scene.d.ts +771 -0
  115. package/types/viewer/scene/sectionPlane/SectionPlane.d.ts +93 -0
  116. package/types/viewer/scene/sectionPlane/index.d.ts +1 -0
  117. package/types/viewer/scene/viewport/Viewport.d.ts +23 -0
  118. package/types/viewer/scene/viewport/index.d.ts +1 -0
  119. package/types/viewer/scene/webgl/PickResult.d.ts +103 -0
  120. package/types/viewer/scene/webgl/index.d.ts +1 -0
@@ -0,0 +1,260 @@
1
+ /**
2
+ * @desc A 2D texture map.
3
+ *
4
+ * * Textures are attached to {@link Material}s, which are attached to {@link Mesh}es.
5
+ * * To create a Texture from an image file, set {@link Texture.src} to the image file path.
6
+ * * To create a Texture from an HTMLImageElement, set the Texture's {@link Texture.image} to the HTMLImageElement.
7
+ *
8
+ * ## Usage
9
+ *
10
+ * In this example we have a Mesh with a {@link PhongMaterial} which applies diffuse {@link Texture}, and a {@link buildTorusGeometry} which builds a {@link ReadableGeometry}.
11
+ *
12
+ * Note that xeokit will ignore {@link PhongMaterial.diffuse} and {@link PhongMaterial.specular}, since we override those
13
+ * with {@link PhongMaterial.diffuseMap} and {@link PhongMaterial.specularMap}. The {@link Texture} pixel colors directly
14
+ * provide the diffuse and specular components for each fragment across the {@link ReadableGeometry} surface.
15
+ *
16
+ * [[Run this example](http://xeokit.github.io/xeokit-sdk/examples/#materials_Texture)]
17
+ *
18
+ * ```` javascript
19
+ * import {Viewer, Mesh, buildTorusGeometry,
20
+ * ReadableGeometry, PhongMaterial, Texture} from "xeokit-sdk.es.js";
21
+ *
22
+ * const viewer = new Viewer({
23
+ * canvasId: "myCanvas"
24
+ * });
25
+ *
26
+ * viewer.camera.eye = [0, 0, 5];
27
+ * viewer.camera.look = [0, 0, 0];
28
+ * viewer.camera.up = [0, 1, 0];
29
+ *
30
+ * new Mesh(viewer.scene, {
31
+ * geometry: new ReadableGeometry(viewer.scene, buildTorusGeometry({
32
+ * center: [0, 0, 0],
33
+ * radius: 1.5,
34
+ * tube: 0.5,
35
+ * radialSegments: 32,
36
+ * tubeSegments: 24,
37
+ * arc: Math.PI * 2.0
38
+ * }),
39
+ * material: new PhongMaterial(viewer.scene, {
40
+ * ambient: [0.9, 0.3, 0.9],
41
+ * shininess: 30,
42
+ * diffuseMap: new Texture(viewer.scene, {
43
+ * src: "textures/diffuse/uvGrid2.jpg"
44
+ * })
45
+ * })
46
+ * });
47
+ *````
48
+ */
49
+ export declare class Texture extends Component {
50
+ /**
51
+ * @constructor
52
+ * @param {Component} owner Owner component. When destroyed, the owner will destroy this Texture as well.
53
+ * @param {*} [cfg] Configs
54
+ * @param {String} [cfg.id] Optional ID for this Texture, unique among all components in the parent scene, generated automatically when omitted.
55
+ * @param {String} [cfg.src=null] Path to image file to load into this Texture. See the {@link Texture.src} property for more info.
56
+ * @param {HTMLImageElement} [cfg.image=null] HTML Image object to load into this Texture. See the {@link Texture.image} property for more info.
57
+ * @param {String} [cfg.minFilter="linearMipmapLinear"] How the texture is sampled when a texel covers less than one pixel. See the {@link Texture.minFilter} property for more info.
58
+ * @param {String} [cfg.magFilter="linear"] How the texture is sampled when a texel covers more than one pixel. See the {@link Texture.magFilter} property for more info.
59
+ * @param {String} [cfg.wrapS="repeat"] Wrap parameter for texture coordinate *S*. See the {@link Texture.wrapS} property for more info.
60
+ * @param {String} [cfg.wrapT="repeat"] Wrap parameter for texture coordinate *S*. See the {@link Texture.wrapT} property for more info.
61
+ * @param {Boolean} [cfg.flipY=false] Flips this Texture's source data along its vertical axis when true.
62
+ * @param {Number[]} [cfg.translate=[0,0]] 2D translation vector that will be added to texture's *S* and *T* coordinates.
63
+ * @param {Number[]} [cfg.scale=[1,1]] 2D scaling vector that will be applied to texture's *S* and *T* coordinates.
64
+ * @param {Number} [cfg.rotate=0] Rotation, in degrees, that will be applied to texture's *S* and *T* coordinates.
65
+ * @param {String} [cfg.encoding="linear"] Encoding format. See the {@link Texture.encoding} property for more info.
66
+ */
67
+ constructor(owner: Component, cfg?: any);
68
+ _state: any;
69
+ _src: string;
70
+ _image: any;
71
+ _translate: any;
72
+ _scale: any;
73
+ _rotate: any;
74
+ _matrixDirty: boolean;
75
+ /**
76
+ * Sets the 2D translation vector added to this Texture's *S* and *T* UV coordinates.
77
+ *
78
+ * Default value is ````[0, 0]````.
79
+ *
80
+ * @type {Number[]}
81
+ */
82
+ set translate(arg: number[]);
83
+ /**
84
+ * Gets the 2D translation vector added to this Texture's *S* and *T* UV coordinates.
85
+ *
86
+ * Default value is ````[0, 0]````.
87
+ *
88
+ * @type {Number[]}
89
+ */
90
+ get translate(): number[];
91
+ /**
92
+ * Sets the 2D scaling vector that will be applied to this Texture's *S* and *T* UV coordinates.
93
+ *
94
+ * Default value is ````[1, 1]````.
95
+ *
96
+ * @type {Number[]}
97
+ */
98
+ set scale(arg: number[]);
99
+ /**
100
+ * Gets the 2D scaling vector that will be applied to this Texture's *S* and *T* UV coordinates.
101
+ *
102
+ * Default value is ````[1, 1]````.
103
+ *
104
+ * @type {Number[]}
105
+ */
106
+ get scale(): number[];
107
+ /**
108
+ * Sets the rotation angles, in degrees, that will be applied to this Texture's *S* and *T* UV coordinates.
109
+ *
110
+ * Default value is ````0````.
111
+ *
112
+ * @type {Number}
113
+ */
114
+ set rotate(arg: number);
115
+ /**
116
+ * Gets the rotation angles, in degrees, that will be applied to this Texture's *S* and *T* UV coordinates.
117
+ *
118
+ * Default value is ````0````.
119
+ *
120
+ * @type {Number}
121
+ */
122
+ get rotate(): number;
123
+ /**
124
+ * Sets path to an image file to source this Texture from.
125
+ *
126
+ * Sets {@link Texture.image} null.
127
+ *
128
+ * @type {String}
129
+ */
130
+ set src(arg: string);
131
+ /**
132
+ * Gets path to the image file this Texture from, if any.
133
+ *
134
+ * Returns null if not set.
135
+ *
136
+ * @type {String}
137
+ */
138
+ get src(): string;
139
+ /**
140
+ * Sets an HTML DOM Image object to source this Texture from.
141
+ *
142
+ * Sets {@link Texture.src} null.
143
+ *
144
+ * @type {HTMLImageElement}
145
+ */
146
+ set image(arg: HTMLImageElement);
147
+ /**
148
+ * Gets HTML DOM Image object this Texture is sourced from, if any.
149
+ *
150
+ * Returns null if not set.
151
+ *
152
+ * @type {HTMLImageElement}
153
+ */
154
+ get image(): HTMLImageElement;
155
+ _checkMinFilter(value: any): any;
156
+ _checkMagFilter(value: any): any;
157
+ _checkFilter(value: any): any;
158
+ _checkWrapS(value: any): any;
159
+ _checkWrapT(value: any): any;
160
+ _checkFlipY(value: any): boolean;
161
+ _checkEncoding(value: any): any;
162
+ _webglContextRestored(): void;
163
+ /**
164
+ * Gets how this Texture is sampled when a texel covers less than one pixel.
165
+ *
166
+ * Options are:
167
+ *
168
+ * * "nearest" - Uses the value of the texture element that is nearest
169
+ * (in Manhattan distance) to the center of the pixel being textured.
170
+ *
171
+ * * "linear" - Uses the weighted average of the four texture elements that are
172
+ * closest to the center of the pixel being textured.
173
+ *
174
+ * * "nearestMipmapNearest" - Chooses the mipmap that most closely matches the
175
+ * size of the pixel being textured and uses the "nearest" criterion (the texture
176
+ * element nearest to the center of the pixel) to produce a texture value.
177
+ *
178
+ * * "linearMipmapNearest" - Chooses the mipmap that most closely matches the size of
179
+ * the pixel being textured and uses the "linear" criterion (a weighted average of the
180
+ * four texture elements that are closest to the center of the pixel) to produce a
181
+ * texture value.
182
+ *
183
+ * * "nearestMipmapLinear" - Chooses the two mipmaps that most closely
184
+ * match the size of the pixel being textured and uses the "nearest" criterion
185
+ * (the texture element nearest to the center of the pixel) to produce a texture
186
+ * value from each mipmap. The final texture value is a weighted average of those two
187
+ * values.
188
+ *
189
+ * * "linearMipmapLinear" - (default) - Chooses the two mipmaps that most closely match the size
190
+ * of the pixel being textured and uses the "linear" criterion (a weighted average
191
+ * of the four texture elements that are closest to the center of the pixel) to
192
+ * produce a texture value from each mipmap. The final texture value is a weighted
193
+ * average of those two values.
194
+ *
195
+ * Default value is "linearMipmapLinear".
196
+ *
197
+ * @type {String}
198
+ */
199
+ get minFilter(): string;
200
+ /**
201
+ * Gets how this Texture is sampled when a texel covers more than one pixel.
202
+ *
203
+ * * "nearest" - Uses the value of the texture element that is nearest
204
+ * (in Manhattan distance) to the center of the pixel being textured.
205
+ * * "linear" - (default) - Uses the weighted average of the four texture elements that are
206
+ * closest to the center of the pixel being textured.
207
+ *
208
+ * Default value is "linearMipmapLinear".
209
+ *
210
+ * @type {String}
211
+ */
212
+ get magFilter(): string;
213
+ /**
214
+ * Gets the wrap parameter for this Texture's *S* coordinate.
215
+ *
216
+ * Values can be:
217
+ *
218
+ * * "clampToEdge" - causes *S* coordinates to be clamped to the size of the texture.
219
+ * * "mirroredRepeat" - causes the *S* coordinate to be set to the fractional part of the texture coordinate
220
+ * if the integer part of *S* is even; if the integer part of *S* is odd, then the *S* texture coordinate is
221
+ * set to *1 - frac ⁡ S* , where *frac ⁡ S* represents the fractional part of *S*.
222
+ * * "repeat" - (default) - causes the integer part of the *S* coordinate to be ignored; xeokit uses only the
223
+ * fractional part, thereby creating a repeating pattern.
224
+ *
225
+ * Default value is "repeat".
226
+ *
227
+ * @type {String}
228
+ */
229
+ get wrapS(): string;
230
+ /**
231
+ * Gets the wrap parameter for this Texture's *T* coordinate.
232
+ *
233
+ * Values can be:
234
+ *
235
+ * * "clampToEdge" - causes *S* coordinates to be clamped to the size of the texture.
236
+ * * "mirroredRepeat" - causes the *S* coordinate to be set to the fractional part of the texture coordinate
237
+ * if the integer part of *S* is even; if the integer part of *S* is odd, then the *S* texture coordinate is
238
+ * set to *1 - frac ⁡ S* , where *frac ⁡ S* represents the fractional part of *S*.
239
+ * * "repeat" - (default) - causes the integer part of the *S* coordinate to be ignored; xeokit uses only the
240
+ * fractional part, thereby creating a repeating pattern.
241
+ *
242
+ * Default value is "repeat".
243
+ *
244
+ * @type {String}
245
+ */
246
+ get wrapT(): string;
247
+ /**
248
+ * Gets if this Texture's source data is flipped along its vertical axis.
249
+ *
250
+ * @type {Boolean}
251
+ */
252
+ get flipY(): boolean;
253
+ /**
254
+ * Gets the Texture's encoding format.
255
+ *
256
+ * @type {String}
257
+ */
258
+ get encoding(): string;
259
+ }
260
+ import { Component } from "../Component.js";
@@ -0,0 +1,6 @@
1
+ export * from "./Material";
2
+ export * from "./EdgeMaterial";
3
+ export * from "./EmphasisMaterial";
4
+ export * from "./LinesMaterial";
5
+ export * from "./PhongMaterial";
6
+ export * from "./PointsMaterial";
@@ -0,0 +1,56 @@
1
+ declare const math: {
2
+ /**
3
+ * The number of radiians in a degree (0.0174532925).
4
+ */
5
+ DEGTORAD: 0.017453292;
6
+
7
+ /**
8
+ * The number of degrees in a radian.
9
+ */
10
+ RADTODEG: 57.295779513;
11
+
12
+ unglobalizeObjectId(modelId: string, globalId: string): string;
13
+ globalizeObjectId(modelId: string, objectId: string): string;
14
+
15
+ /**
16
+ * Returns a new, uninitialized two-element vector.
17
+ * @returns {Number[]}
18
+ */
19
+ vec2: (values?: number[]) => number[];
20
+
21
+ /**
22
+ * Returns a new, uninitialized three-element vector.
23
+ * @returns {Number[]}
24
+ */
25
+ vec3: (values?: number[]) => number[];
26
+
27
+ /**
28
+ * Returns a new, uninitialized four-element vector.
29
+ * @returns {Number[]}
30
+ */
31
+ vec4: (values?: number[]) => number[];
32
+
33
+ /**
34
+ * Gets the center of a 2D AABB.
35
+ * @returns {Number[]}
36
+ */
37
+ getAABB2Center(aabb: number[], dest?: (values?: number[]) => number[]): number[];
38
+
39
+ /**
40
+ * Gets the center of an AABB.
41
+ * @returns {Number[]}
42
+ */
43
+ getAABB3Center(aabb: number[], dest?: (values?: number[]) => number[]): number[];
44
+
45
+ /**
46
+ * Gets the diagonal size of an AABB3 given as minima and maxima.
47
+ */
48
+ getAABB3Diag: (aabb: number[]) => number;
49
+
50
+ /**
51
+ * Normalizes a three-element vector
52
+ */
53
+ normalizeVec3: (v: number[], dest?: any) => number[];
54
+ };
55
+
56
+ export {math};
@@ -0,0 +1,28 @@
1
+ import { Scene } from "../scene/Scene";
2
+
3
+ /**
4
+ * Saves and restores the state of a {@link Scene}'s {@link Camera}.
5
+ */
6
+ export declare class CameraMemento {
7
+ /**
8
+ * Creates a CameraState.
9
+ *
10
+ * @param {Scene} [scene] When given, immediately saves the state of the given {@link Scene}'s {@link Camera}.
11
+ */
12
+ constructor(scene?: Scene);
13
+
14
+ /**
15
+ * Saves the state of the given {@link Scene}'s {@link Camera}.
16
+ *
17
+ * @param {Scene} scene The scene that contains the {@link Camera}.
18
+ */
19
+ saveCamera(scene: Scene): void;
20
+
21
+ /**
22
+ * Restores a {@link Scene}'s {@link Camera} to the state previously captured with {@link CameraMemento#saveCamera}.
23
+ *
24
+ * @param {Scene} scene The scene.
25
+ * @param {Function} [done] When this callback is given, will fly the {@link Camera} to the saved state then fire the callback. Otherwise will just jump the Camera to the saved state.
26
+ */
27
+ restoreCamera(scene: Scene, done?: ()=> void): void;
28
+ }
@@ -0,0 +1,44 @@
1
+ import { Scene } from "../scene/Scene";
2
+ import { MetaModel } from '../../metadata/MetaModel';
3
+ /**
4
+ * Saves and restores a snapshot of the visual state of the {@link Entity}'s of a model within a {@link Scene}.
5
+ */
6
+ export declare class ModelMemento {
7
+ /**
8
+ * Saves a snapshot of the visual state of the {@link Entity}'s that represent objects within a model.
9
+ *
10
+ * @param {Scene} scene The scene.
11
+ * @param {MetaModel} metaModel Represents the model. Corresponds with an {@link Entity} that represents the model in the scene.
12
+ * @param {Object} [mask] Masks what state gets saved. Saves all state when not supplied.
13
+ * @param {boolean} [mask.visible] Saves {@link Entity#visible} values when ````true````.
14
+ * @param {boolean} [mask.edges] Saves {@link Entity#edges} values when ````true````.
15
+ * @param {boolean} [mask.xrayed] Saves {@link Entity#xrayed} values when ````true````.
16
+ * @param {boolean} [mask.highlighted] Saves {@link Entity#highlighted} values when ````true````.
17
+ * @param {boolean} [mask.selected] Saves {@link Entity#selected} values when ````true````.
18
+ * @param {boolean} [mask.clippable] Saves {@link Entity#clippable} values when ````true````.
19
+ * @param {boolean} [mask.pickable] Saves {@link Entity#pickable} values when ````true````.
20
+ * @param {boolean} [mask.colorize] Saves {@link Entity#colorize} values when ````true````.
21
+ * @param {boolean} [mask.opacity] Saves {@link Entity#opacity} values when ````true````.
22
+ */
23
+ saveObjects(scene: Scene, metaModel: MetaModel, mask?: {
24
+ visible?: boolean;
25
+ edges?: boolean;
26
+ xrayed?: boolean;
27
+ highlighted?: boolean;
28
+ selected?: boolean;
29
+ clippable?: boolean;
30
+ pickable?: boolean;
31
+ colorize?: boolean;
32
+ opacity?: boolean;
33
+ }): void;
34
+
35
+ /**
36
+ * Restores a {@link Scene}'s {@link Entity}'s to their state previously captured with {@link ModelMemento#saveObjects}.
37
+ *
38
+ * Assumes that the model has not been destroyed or modified since saving.
39
+ *
40
+ * @param {Scene} scene The scene that was given to {@link ModelMemento#saveObjects}.
41
+ * @param {MetaModel} metaModel The metamodel that was given to {@link ModelMemento#saveObjects}.
42
+ */
43
+ restoreObjects(scene: Scene, metaModel: MetaModel): void;
44
+ }
@@ -0,0 +1,39 @@
1
+ import { Scene } from "../scene/Scene";
2
+
3
+ /**
4
+ * Saves and restores a snapshot of the visual state of the {@link Entity}'s that represent objects within a {@link Scene}.
5
+ */
6
+ export declare class ObjectsMemento {
7
+ /**
8
+ * Saves a snapshot of the visual state of the {@link Entity}'s that represent objects within a {@link Scene}.
9
+ *
10
+ * @param {Scene} scene The scene.
11
+ * @param {Object} [mask] Masks what state gets saved. Saves all state when not supplied.
12
+ * @param {boolean} [mask.visible] Saves {@link Entity#visible} values when ````true````.
13
+ * @param {boolean} [mask.edges] Saves {@link Entity#edges} values when ````true````.
14
+ * @param {boolean} [mask.xrayed] Saves {@link Entity#xrayed} values when ````true````.
15
+ * @param {boolean} [mask.highlighted] Saves {@link Entity#highlighted} values when ````true````.
16
+ * @param {boolean} [mask.selected] Saves {@link Entity#selected} values when ````true````.
17
+ * @param {boolean} [mask.clippable] Saves {@link Entity#clippable} values when ````true````.
18
+ * @param {boolean} [mask.pickable] Saves {@link Entity#pickable} values when ````true````.
19
+ * @param {boolean} [mask.colorize] Saves {@link Entity#colorize} values when ````true````.
20
+ * @param {boolean} [mask.opacity] Saves {@link Entity#opacity} values when ````true````.
21
+ */
22
+ saveObjects(scene: Scene, mask?: {
23
+ visible?: boolean;
24
+ edges?: boolean;
25
+ xrayed?: boolean;
26
+ highlighted?: boolean;
27
+ selected?: boolean;
28
+ clippable?: boolean;
29
+ pickable?: boolean;
30
+ colorize?: boolean;
31
+ opacity?: boolean;
32
+ }): void;
33
+
34
+ /**
35
+ * Restores a {@link Scene}'s {@link Entity}'s to their state previously captured with {@link ObjectsMemento#saveObjects}.
36
+ * @param {Scene} scene The scene.
37
+ */
38
+ restoreObjects(scene: Scene): void;
39
+ }
@@ -0,0 +1,3 @@
1
+ export * from "./CameraMemento";
2
+ export * from "./ModelMemento";
3
+ export * from "./ObjectsMemento";