soonspacejs 2.5.1 → 2.5.3

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "soonspacejs",
3
- "version": "2.5.1",
3
+ "version": "2.5.3",
4
4
  "homepage": "http://www.xwbuilders.com:8800/",
5
5
  "description": "soonspacejs 2.x",
6
6
  "module": "./dist/index.esm.js",
@@ -25,5 +25,5 @@
25
25
  "@tweenjs/tween.js": "^18.6.4",
26
26
  "@types/three": "0.141.0"
27
27
  },
28
- "gitHead": "49430ab52ae6ad1f3e6c4aab55a14e2564d775ac"
28
+ "gitHead": "2a5623644a00cc610219341317a92a0427d850b0"
29
29
  }
@@ -104,12 +104,9 @@ interface TopologyNodeInfo {
104
104
  position: Position;
105
105
  graphs?: TopologyNodeGraph[];
106
106
  }
107
- interface TopologyInnerNodeInfo {
108
- id: BaseObject3DInfo['id'];
109
- name?: BaseObject3DInfo['name'];
110
- position: Position;
107
+ declare type TopologyInnerNodeInfo = Omit<TopologyNodeInfo, 'graphs'> & {
111
108
  graphs: TopologyNodeGraph[];
112
- }
109
+ };
113
110
  interface TwoWaysLink {
114
111
  pointAIndex: number;
115
112
  pointBIndex: number;
@@ -3,7 +3,7 @@ import { IColor, Position, Rotation, BaseSelectOptions } from './base';
3
3
  import { AnimationOptions } from './animation';
4
4
  import { GridHelperOptions } from './manager';
5
5
  import { ControlsOptions } from './controls';
6
- export declare type ColorSpace = 'Linear' | 'sRGB';
6
+ export declare type IColorSpace = 'Linear' | 'sRGB';
7
7
  interface CameraViewpointData {
8
8
  position: Position;
9
9
  rotation: Rotation;
@@ -23,5 +23,6 @@ declare class Topology extends BaseObject3D {
23
23
  createCircle(param: CircleInfo): Circle;
24
24
  createLink(param: LinkInfo): Link;
25
25
  resetNodes(newNodes: TopologyInnerNodeInfo[]): void;
26
+ getLength(): number;
26
27
  }
27
28
  export { Topology, TopologyInfo, TopologyInnerInfo, };
@@ -25,5 +25,5 @@ declare function getSpaceAttributeFromObject(object: Object3D, isFromWorld?: boo
25
25
  * @param isFromWorld
26
26
  */
27
27
  declare function syncSpaceAttributeToObject(target: Object3D, source: Object3D, isFromWorld?: boolean): void;
28
- declare function isHideObject(object: Object3D): boolean;
29
- export { IVector3ToVector3, IVector3ToEuler, getBoundingBox, rotationAxisFix, rotationAFix, deg2Euler, euler2Deg, getSpaceAttributeFromObject, syncSpaceAttributeToObject, isHideObject, };
28
+ declare function isObjectVisible(object: Object3D): boolean;
29
+ export { IVector3ToVector3, IVector3ToEuler, getBoundingBox, rotationAxisFix, rotationAFix, deg2Euler, euler2Deg, getSpaceAttributeFromObject, syncSpaceAttributeToObject, isObjectVisible, };
@@ -9,7 +9,7 @@ import CameraManager from './CameraManager';
9
9
  import EffectManager from './EffectManager';
10
10
  import { Controls } from '../Controls';
11
11
  import { Model } from '../Library';
12
- import { ColorSpace, SkyOptions, IColor, OffsetPoint, SceneEventType, Position, ViewportOptions, ViewportState, ModelAnimationFindFunc, SignalsState, ToneMappingOptions, SSAOOptions, IntersectsOptions } from '../Interface';
12
+ import { IColorSpace, SkyOptions, IColor, OffsetPoint, SceneEventType, Position, ViewportOptions, ViewportState, ModelAnimationFindFunc, SignalsState, ToneMappingOptions, SSAOOptions, IntersectsOptions } from '../Interface';
13
13
  import Info from './Info';
14
14
  import { ViewHelper } from './ViewHelper';
15
15
  export declare const innerRenderState: {
@@ -54,7 +54,6 @@ declare class Viewport {
54
54
  constructor(options: ViewportOptions);
55
55
  _initInfo(): void;
56
56
  _initStats(): void;
57
- _initViewHelper(): void;
58
57
  /**
59
58
  ***************************** post-processing ***************************
60
59
  */
@@ -64,7 +63,7 @@ declare class Viewport {
64
63
  /**
65
64
  ***************************** renderer ***************************
66
65
  */
67
- setColorSpace(colorSpace: ColorSpace): void;
66
+ setColorSpace(colorSpace: IColorSpace): void;
68
67
  setToneMapping(options?: ToneMappingOptions): void;
69
68
  /**
70
69
  ***************************** background ***************************
package/types/index.d.ts CHANGED
@@ -6,17 +6,15 @@
6
6
  |____/ \___/ \___/|_| |_|____/| .__/ \__,_|\___\___(_)/ |___/
7
7
  |_| |__/
8
8
  */
9
- import * as THREE from 'three';
10
9
  import { TransformControls } from 'three/examples/jsm/controls/TransformControls.js';
11
- import { Lensflare, LensflareElement } from 'three/examples/jsm/objects/Lensflare.js';
12
- import { Object3D, Vector3, Euler, Box3, AnimationClip, AnimationAction, Light } from 'three';
10
+ import { Object3D, Vector3, Euler, Box3, AnimationClip, AnimationAction, Light, AmbientLight, DirectionalLight, HemisphereLight, SpotLight, PointLight, RectAreaLight } from 'three';
13
11
  import * as shared from './Shared';
14
12
  import Animation from './Animation';
15
13
  import * as library from './Library';
16
14
  import { BaseObject3D, BaseObject3DInfo, Model, ModelInfo, Poi, PoiInfo, PoiNode, PoiNodeInfo, Topology, TopologyInfo, Group, GroupInfo, Canvas3D, Canvas3DInfo, PluginObject, PluginObjectInfo } from './Library';
17
15
  import Viewport from './Viewport';
18
16
  import Manager from './Manager';
19
- import { ViewportOptions, SceneGlobalEvents, PluginsConstructor, IColor, Position, Rotation, OffsetPoint, AnimationOptions, ModelAnimationFindFunc, TopologyNodeInfo, CameraViewpointData, CameraTargetViewData, FlyToViewpoint, FlyToObjOptions, SurroundOptions, LabelOptions, EdgeSelectOptions, StrokeSelectOptions, OpacitySelectOptions, HighlightSelectOptions, EmissiveSelectOptions, FogOptions, UserDataPropertyFindFunc, AmbientLightOptions, DirectionalLightOptions, HemisphereLightOptions, SpotLightOptions, PointLightOptions, CloneModelInfo, ClonePoiInfo, ShortestPathInfo, ShortestPathByMultipleStartPoints, ShortestPathByMultipleEndPoints, TopologyInfoForGml, GridHelperOptions, AxesHelperOptions, BoxHelperOptions, PlaneHelperOptions, GroundHelperOptions, DirectionalLightHelperOptions, HemisphereLightHelperOptions, SpotLightHelperOptions, PointLightHelperOptions, SignalsState, ControlsOptions, RectAreaLightOptions, RectAreaLightHelperOptions, SkyOptions, ColorSpace, ToneMappingOptions, SSAOOptions } from './Interface';
17
+ import { ViewportOptions, SceneGlobalEvents, PluginsConstructor, IColor, Position, Rotation, OffsetPoint, AnimationOptions, ModelAnimationFindFunc, TopologyNodeInfo, CameraViewpointData, CameraTargetViewData, FlyToViewpoint, FlyToObjOptions, SurroundOptions, LabelOptions, EdgeSelectOptions, StrokeSelectOptions, OpacitySelectOptions, HighlightSelectOptions, EmissiveSelectOptions, FogOptions, UserDataPropertyFindFunc, AmbientLightOptions, DirectionalLightOptions, HemisphereLightOptions, SpotLightOptions, PointLightOptions, CloneModelInfo, ClonePoiInfo, ShortestPathInfo, ShortestPathByMultipleStartPoints, ShortestPathByMultipleEndPoints, TopologyInfoForGml, GridHelperOptions, AxesHelperOptions, BoxHelperOptions, PlaneHelperOptions, GroundHelperOptions, DirectionalLightHelperOptions, HemisphereLightHelperOptions, SpotLightHelperOptions, PointLightHelperOptions, SignalsState, ControlsOptions, RectAreaLightOptions, RectAreaLightHelperOptions, SkyOptions, IColorSpace, ToneMappingOptions, SSAOOptions } from './Interface';
20
18
  export declare type InitOptions = ViewportOptions;
21
19
  export declare type InitEvents = SceneGlobalEvents;
22
20
  export interface SoonSpaceConstructor {
@@ -24,14 +22,19 @@ export interface SoonSpaceConstructor {
24
22
  options?: InitOptions;
25
23
  events?: InitEvents;
26
24
  }
25
+ export * from 'three';
27
26
  export * from './Interface';
28
27
  declare global {
29
28
  interface Window {
30
29
  THREE: typeof THREE;
31
30
  }
31
+ interface GlobalThis {
32
+ THREE: typeof THREE;
33
+ }
32
34
  }
33
- export default class SoonSpace {
34
- static readonly THREE: typeof THREE;
35
+ export declare class SoonSpace {
36
+ static readonly THREE: typeof import("three");
37
+ readonly THREE: typeof import("three");
35
38
  static readonly TWEEN: {
36
39
  Easing: {
37
40
  Linear: {
@@ -112,13 +115,8 @@ export default class SoonSpace {
112
115
  update: (time?: number | undefined, preserve?: boolean | undefined) => boolean;
113
116
  };
114
117
  static readonly utils: typeof shared;
115
- readonly THREE: typeof THREE;
116
118
  readonly THREE_PLUGINS: {
117
119
  TransformControls: typeof TransformControls;
118
- Lensflare: {
119
- Lensflare: typeof Lensflare;
120
- LensflareElement: typeof LensflareElement;
121
- };
122
120
  };
123
121
  readonly version: string;
124
122
  readonly options: InitOptions;
@@ -203,7 +201,7 @@ export default class SoonSpace {
203
201
  * 设置场景的颜色空间
204
202
  * @param colorSpace
205
203
  */
206
- setColorSpace(colorSpace: ColorSpace): void;
204
+ setColorSpace(colorSpace: IColorSpace): void;
207
205
  setToneMapping(options?: ToneMappingOptions): void;
208
206
  /**
209
207
  * 设置开启鼠标悬浮
@@ -235,7 +233,7 @@ export default class SoonSpace {
235
233
  * 设置场景环境
236
234
  * @returns
237
235
  */
238
- setEnvironment(): THREE.Texture;
236
+ setEnvironment(): import("three").Texture;
239
237
  /**
240
238
  * 播放模型动画
241
239
  * @param model
@@ -454,7 +452,7 @@ export default class SoonSpace {
454
452
  * 创建环境关
455
453
  * @param options
456
454
  */
457
- createAmbientLight(options: AmbientLightOptions): THREE.AmbientLight;
455
+ createAmbientLight(options: AmbientLightOptions): AmbientLight;
458
456
  /**
459
457
  * 设置环境关
460
458
  * @param options
@@ -464,7 +462,7 @@ export default class SoonSpace {
464
462
  * 创建平行光
465
463
  * @param options
466
464
  */
467
- createDirectionalLight(options: DirectionalLightOptions): THREE.DirectionalLight;
465
+ createDirectionalLight(options: DirectionalLightOptions): DirectionalLight;
468
466
  /**
469
467
  * 设置平行光
470
468
  * @param options
@@ -474,7 +472,7 @@ export default class SoonSpace {
474
472
  * 创建半球光
475
473
  * @param options
476
474
  */
477
- createHemisphereLight(options: HemisphereLightOptions): THREE.HemisphereLight;
475
+ createHemisphereLight(options: HemisphereLightOptions): HemisphereLight;
478
476
  /**
479
477
  * 设置半球光
480
478
  * @param options
@@ -484,7 +482,7 @@ export default class SoonSpace {
484
482
  * 创建聚光灯
485
483
  * @param options
486
484
  */
487
- createSpotLight(options: SpotLightOptions): THREE.SpotLight;
485
+ createSpotLight(options: SpotLightOptions): SpotLight;
488
486
  /**
489
487
  * 设置聚光灯
490
488
  * @param options
@@ -494,7 +492,7 @@ export default class SoonSpace {
494
492
  * 创建点光源
495
493
  * @param options
496
494
  */
497
- createPointLight(options: PointLightOptions): THREE.PointLight;
495
+ createPointLight(options: PointLightOptions): PointLight;
498
496
  /**
499
497
  * 设置点光源
500
498
  * @param options
@@ -505,7 +503,7 @@ export default class SoonSpace {
505
503
  * @param options
506
504
  * @returns
507
505
  */
508
- createRectAreaLight(options: RectAreaLightOptions): THREE.RectAreaLight;
506
+ createRectAreaLight(options: RectAreaLightOptions): RectAreaLight;
509
507
  /**
510
508
  * 设置矩形区域光源
511
509
  * @param options
@@ -1069,17 +1067,17 @@ export default class SoonSpace {
1069
1067
  * 添加网格辅助器
1070
1068
  * @param options
1071
1069
  */
1072
- addGridHelper(options: GridHelperOptions): THREE.GridHelper;
1070
+ addGridHelper(options: GridHelperOptions): import("three").GridHelper;
1073
1071
  /**
1074
1072
  * 添加轴线辅助器
1075
1073
  * @param options
1076
1074
  */
1077
- addAxesHelper(options: AxesHelperOptions): THREE.AxesHelper;
1075
+ addAxesHelper(options: AxesHelperOptions): import("three").AxesHelper;
1078
1076
  /**
1079
1077
  * 添加包围盒辅助器
1080
1078
  * @param options
1081
1079
  */
1082
- addBoxHelper(options: BoxHelperOptions): THREE.Box3Helper;
1080
+ addBoxHelper(options: BoxHelperOptions): import("three").Box3Helper;
1083
1081
  /**
1084
1082
  * 添加面辅助器
1085
1083
  * @param options
@@ -1099,22 +1097,22 @@ export default class SoonSpace {
1099
1097
  * 添加平行光辅助器
1100
1098
  * @param options
1101
1099
  */
1102
- addDirectionalLightHelper(options: DirectionalLightHelperOptions): THREE.DirectionalLightHelper;
1100
+ addDirectionalLightHelper(options: DirectionalLightHelperOptions): import("three").DirectionalLightHelper;
1103
1101
  /**
1104
1102
  * 添加半球光辅助器
1105
1103
  * @param options
1106
1104
  */
1107
- addHemisphereLightHelper(options: HemisphereLightHelperOptions): THREE.HemisphereLightHelper;
1105
+ addHemisphereLightHelper(options: HemisphereLightHelperOptions): import("three").HemisphereLightHelper;
1108
1106
  /**
1109
1107
  * 添加聚光灯辅助器
1110
1108
  * @param options
1111
1109
  */
1112
- addSpotLightHelper(options: SpotLightHelperOptions): THREE.SpotLightHelper;
1110
+ addSpotLightHelper(options: SpotLightHelperOptions): import("three").SpotLightHelper;
1113
1111
  /**
1114
1112
  * 添加点光辅助器
1115
1113
  * @param options
1116
1114
  */
1117
- addPointLightHelper(options: PointLightHelperOptions): THREE.PointLightHelper;
1115
+ addPointLightHelper(options: PointLightHelperOptions): import("three").PointLightHelper;
1118
1116
  /**
1119
1117
  * 添加矩形区域光辅助器
1120
1118
  * @param options
@@ -1144,3 +1142,4 @@ export default class SoonSpace {
1144
1142
  */
1145
1143
  hideAllHelper(): void;
1146
1144
  }
1145
+ export default SoonSpace;