@inweb/viewer-three 26.7.6 → 26.8.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.
@@ -1,11 +1,11 @@
1
- import { LineBasicMaterial, MeshBasicMaterial, Object3D, WebGLRenderTarget } from "three";
1
+ import { LineBasicMaterial, MeshPhongMaterial, Object3D, WebGLRenderTarget } from "three";
2
2
  import { LineMaterial } from "three/examples/jsm/lines/LineMaterial.js";
3
3
  import { IComponent, ResizeEvent } from "@inweb/viewer-core";
4
4
  import { Viewer } from "../Viewer";
5
5
  export declare class HighlighterComponent implements IComponent {
6
6
  protected viewer: Viewer;
7
7
  renderTarget: WebGLRenderTarget;
8
- highlightMaterial: MeshBasicMaterial;
8
+ highlightMaterial: MeshPhongMaterial;
9
9
  outlineMaterial: LineMaterial;
10
10
  highlightLineMaterial: LineBasicMaterial;
11
11
  highlightLineGlowMaterial: LineMaterial;
@@ -1,10 +1,8 @@
1
- import { Group } from "three";
2
1
  import { ILoader, LoadParams } from "@inweb/viewer-core";
3
2
  import { Viewer } from "../Viewer";
4
3
  import { DynamicGltfLoader } from "./DynamicGltfLoader/DynamicGltfLoader.js";
5
4
  export declare class GLTFCloudDynamicLoader implements ILoader {
6
5
  viewer: Viewer;
7
- scene: Group;
8
6
  gltfLoader: DynamicGltfLoader;
9
7
  requestId: number;
10
8
  constructor(viewer: Viewer);
@@ -11,7 +11,7 @@ import { ILoadersRegistry } from "@inweb/viewer-core";
11
11
  *
12
12
  * The loader should do:
13
13
  *
14
- * - Load scene from file. The scene must be a Three.js object of type `Object3D` or a descendant of it.
14
+ * - Load raw data from file and convert it to the `Three.js` scene.
15
15
  * - Add scene to the viewer `scene`.
16
16
  * - Create `ModelImpl` for the scene and to the viewer `models` list.
17
17
  * - Synchronize viewer options and overlay.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@inweb/viewer-three",
3
- "version": "26.7.6",
3
+ "version": "26.8.1",
4
4
  "description": "JavaScript library for rendering CAD and BIM files in a browser using Three.js",
5
5
  "homepage": "https://cloud.opendesign.com/docs/index.html",
6
6
  "license": "SEE LICENSE IN LICENSE",
@@ -35,10 +35,10 @@
35
35
  "docs": "typedoc"
36
36
  },
37
37
  "dependencies": {
38
- "@inweb/client": "~26.7.6",
39
- "@inweb/eventemitter2": "~26.7.6",
40
- "@inweb/markup": "~26.7.6",
41
- "@inweb/viewer-core": "~26.7.6"
38
+ "@inweb/client": "~26.8.1",
39
+ "@inweb/eventemitter2": "~26.8.1",
40
+ "@inweb/markup": "~26.8.1",
41
+ "@inweb/viewer-core": "~26.8.1"
42
42
  },
43
43
  "devDependencies": {
44
44
  "@types/three": "^0.173.0",
@@ -58,13 +58,10 @@ class IFCXLoader extends Loader<Scene> {
58
58
  }
59
59
 
60
60
  parse(json: any, onLoad: (scene: Scene) => void, onError: (err: unknown) => void) {
61
- try {
62
- onLoad(parse(json));
63
- } catch (e) {
64
- onError(e);
65
- } finally {
66
- clear();
67
- }
61
+ parse(json)
62
+ .then((scene: Scene) => onLoad(scene))
63
+ .catch((err: unknown) => onError(err))
64
+ .finally(() => clear());
68
65
  }
69
66
  }
70
67