soonspacejs 2.8.11 → 2.8.13
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/index.esm.js +2 -2
- package/package.json +2 -2
- package/types/Interface/base.d.ts +11 -9
- package/types/Interface/manager.d.ts +10 -10
- package/types/Interface/viewport.d.ts +1 -0
- package/types/Library/BaseMesh.d.ts +3 -5
- package/types/Library/BaseObject3D.d.ts +6 -8
- package/types/Library/Canvas3D.d.ts +6 -5
- package/types/Library/Circle.d.ts +4 -4
- package/types/Library/Ground.d.ts +4 -3
- package/types/Library/Group.d.ts +4 -3
- package/types/Library/Icon.d.ts +1 -1
- package/types/Library/Line.d.ts +5 -5
- package/types/Library/Link.d.ts +5 -5
- package/types/Library/Model.d.ts +6 -5
- package/types/Library/Node.d.ts +1 -1
- package/types/Library/PluginObject.d.ts +4 -3
- package/types/Library/Poi.d.ts +17 -25
- package/types/Library/PoiNode.d.ts +10 -10
- package/types/Library/Point.d.ts +4 -4
- package/types/Library/Polygon.d.ts +4 -4
- package/types/Library/Topology.d.ts +5 -5
- package/types/Manager/DefaultManage.d.ts +4 -3
- package/types/Manager/PoiManage.d.ts +11 -5
- package/types/Manager/index.d.ts +4 -0
- package/types/Math/dijkstra/index.d.ts +2 -2
- package/types/Shared/MinHeap.d.ts +2 -2
- package/types/Shared/viewport.d.ts +2 -2
- package/types/index.d.ts +6 -6
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "soonspacejs",
|
|
3
|
-
"version": "2.8.
|
|
3
|
+
"version": "2.8.13",
|
|
4
4
|
"homepage": "http://www.xwbuilders.com:8800/",
|
|
5
5
|
"description": "soonspacejs 2.x",
|
|
6
6
|
"module": "./dist/index.esm.js",
|
|
@@ -28,5 +28,5 @@
|
|
|
28
28
|
"peerDependencies": {
|
|
29
29
|
"three": ">=0.152.2"
|
|
30
30
|
},
|
|
31
|
-
"gitHead": "
|
|
31
|
+
"gitHead": "d5982117927d8f1eccf32efbe1fec6238b7517e6"
|
|
32
32
|
}
|
|
@@ -38,7 +38,7 @@ interface BaseSelectOptions {
|
|
|
38
38
|
color?: IColor;
|
|
39
39
|
opacity?: number;
|
|
40
40
|
}
|
|
41
|
-
interface BaseObjectInfo
|
|
41
|
+
interface BaseObjectInfo {
|
|
42
42
|
id: string | number;
|
|
43
43
|
name?: string;
|
|
44
44
|
level?: Level;
|
|
@@ -48,13 +48,15 @@ interface BaseObjectInfo<ObjectType = Object3D> extends BaseObjectEvents<ObjectT
|
|
|
48
48
|
scale?: Scale;
|
|
49
49
|
userData?: any;
|
|
50
50
|
}
|
|
51
|
-
interface
|
|
52
|
-
onLoad?: ((object:
|
|
53
|
-
onClick?: ((object:
|
|
54
|
-
onDblClick?: ((object:
|
|
55
|
-
onRightClick?: ((object:
|
|
51
|
+
interface BaseObject3DInfo extends BaseObjectInfo {
|
|
52
|
+
onLoad?: ((object: Object3D) => void) | null;
|
|
53
|
+
onClick?: ((object: Object3D) => void) | null;
|
|
54
|
+
onDblClick?: ((object: Object3D) => void) | null;
|
|
55
|
+
onRightClick?: ((object: Object3D) => void) | null;
|
|
56
56
|
}
|
|
57
|
-
interface
|
|
58
|
-
|
|
57
|
+
interface ScaleFixed {
|
|
58
|
+
originScale: number;
|
|
59
|
+
fixedScale: number;
|
|
60
|
+
distance: number;
|
|
59
61
|
}
|
|
60
|
-
export { Interpolate, IVector2, IVector3, Position, Rotation, Scale, IColor, PlaneIVector2, Level, OffsetPoint, FlyToViewpoint, AxisType, SceneEventType, SceneEventTypeUppercase, PoiType, PoiNodeType, BaseSelectOptions,
|
|
62
|
+
export { Interpolate, IVector2, IVector3, Position, Rotation, Scale, IColor, PlaneIVector2, Level, OffsetPoint, FlyToViewpoint, AxisType, SceneEventType, SceneEventTypeUppercase, PoiType, PoiNodeType, BaseSelectOptions, BaseObject3DInfo, BaseObjectInfo, ScaleFixed, };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Box3, DirectionalLight, HemisphereLight, SpotLight, PointLight, RectAreaLight, Object3D, Light } from 'three';
|
|
2
|
-
import { IColor, IVector2, Position, Rotation, Scale } from './base';
|
|
3
|
-
import { BaseObject3D,
|
|
2
|
+
import { BaseObjectInfo, IColor, IVector2, Position, Rotation, Scale } from './base';
|
|
3
|
+
import { BaseObject3D, Canvas3D, Group, Model, ModelInfo, PluginObject, Poi, PoiInfo, PoiNode, Topology } from '../Library';
|
|
4
4
|
import { AnimationOptions } from './animation';
|
|
5
5
|
export type ManageCache = {
|
|
6
6
|
objects: Map<BaseObject3D['sid'], Object3D>;
|
|
@@ -72,7 +72,7 @@ interface GroupProgressCallback {
|
|
|
72
72
|
}
|
|
73
73
|
type CloneModelInfo = Omit<ModelInfo, 'url'>;
|
|
74
74
|
type ClonePoiInfo = Omit<PoiInfo, 'url'>;
|
|
75
|
-
interface TopologyInfoForGml extends
|
|
75
|
+
interface TopologyInfoForGml extends BaseObjectInfo {
|
|
76
76
|
url: string;
|
|
77
77
|
linkWidth?: number;
|
|
78
78
|
linkColor?: IColor;
|
|
@@ -90,21 +90,21 @@ interface TopologyEffectInfo {
|
|
|
90
90
|
imgUrl?: string;
|
|
91
91
|
animation?: boolean | AnimationOptions;
|
|
92
92
|
}
|
|
93
|
-
interface ShortestPathInfo extends
|
|
93
|
+
interface ShortestPathInfo extends BaseObjectInfo, TopologyEffectInfo {
|
|
94
94
|
start: Position;
|
|
95
95
|
end: Position;
|
|
96
96
|
}
|
|
97
|
-
interface ShortestPathByMultipleStartPoints extends
|
|
97
|
+
interface ShortestPathByMultipleStartPoints extends BaseObjectInfo, TopologyEffectInfo {
|
|
98
98
|
start: Position[];
|
|
99
99
|
end: Position;
|
|
100
100
|
}
|
|
101
|
-
interface ShortestPathByMultipleEndPoints extends
|
|
101
|
+
interface ShortestPathByMultipleEndPoints extends BaseObjectInfo, TopologyEffectInfo {
|
|
102
102
|
start: Position;
|
|
103
103
|
end: Position[];
|
|
104
104
|
}
|
|
105
105
|
interface TopologyPassableInfo {
|
|
106
|
-
sourceNodeId:
|
|
107
|
-
targetNodeId:
|
|
106
|
+
sourceNodeId: BaseObjectInfo['id'];
|
|
107
|
+
targetNodeId: BaseObjectInfo['id'];
|
|
108
108
|
passable: number;
|
|
109
109
|
}
|
|
110
110
|
interface TopologyNodeGraph {
|
|
@@ -116,8 +116,8 @@ interface TopologyNodeGraph {
|
|
|
116
116
|
passable: number;
|
|
117
117
|
}
|
|
118
118
|
interface TopologyNodeInfo {
|
|
119
|
-
id:
|
|
120
|
-
name?:
|
|
119
|
+
id: BaseObjectInfo['id'];
|
|
120
|
+
name?: BaseObjectInfo['name'];
|
|
121
121
|
position: Position;
|
|
122
122
|
graphs?: TopologyNodeGraph[];
|
|
123
123
|
}
|
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
import { Box3, Vector3, Euler, Mesh, BufferGeometry, Material } from 'three';
|
|
2
2
|
import { Tween } from '@tweenjs/tween.js';
|
|
3
3
|
import { Position, Rotation, Scale, Level, BaseObjectInfo, AnimationOptions } from '../Interface';
|
|
4
|
-
type BaseMeshInfo = BaseObjectInfo<BaseMesh>;
|
|
5
4
|
declare class BaseMesh extends Mesh {
|
|
6
5
|
sid: string | number;
|
|
7
6
|
stype: string;
|
|
8
7
|
handleHide: boolean;
|
|
9
8
|
level: Level;
|
|
10
9
|
isEventPropagation: boolean;
|
|
11
|
-
constructor(params
|
|
10
|
+
constructor(params?: BaseObjectInfo, geometry?: BufferGeometry, material?: Material | Material[]);
|
|
12
11
|
show(): void;
|
|
13
12
|
hide(): void;
|
|
14
13
|
setMove(position: Position | Vector3, options?: AnimationOptions, onUpdate?: (source: Position, tween: Tween<Position>) => void, onStart?: (tween: Tween<Position>) => void): Promise<void>;
|
|
@@ -16,7 +15,6 @@ declare class BaseMesh extends Mesh {
|
|
|
16
15
|
setScale(scale: Scale | Vector3, options?: AnimationOptions, onUpdate?: (source: Scale, tween: Tween<Scale>) => void, onStart?: (tween: Tween<Scale>) => void): Promise<void>;
|
|
17
16
|
getBoundingBox(): Box3;
|
|
18
17
|
eventPropagation(): void;
|
|
19
|
-
|
|
20
|
-
sCopy(source: BaseMesh, recursive?: boolean): BaseMesh;
|
|
18
|
+
copy(source: this, recursive?: boolean): this;
|
|
21
19
|
}
|
|
22
|
-
export { BaseMesh,
|
|
20
|
+
export { BaseMesh, };
|
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
import { Object3D, Vector3, Euler,
|
|
1
|
+
import { Object3D, Vector3, Euler, Box3 } from 'three';
|
|
2
2
|
import { Tween } from '@tweenjs/tween.js';
|
|
3
|
-
import { Position, Rotation, Scale, Level,
|
|
4
|
-
|
|
5
|
-
declare class BaseObject3D<Event extends BaseEvent = BaseObjectEventsListener> extends Object3D<Event> implements BaseObjectEvents<BaseObject3D> {
|
|
3
|
+
import { Position, Rotation, Scale, Level, BaseObject3DInfo, AnimationOptions } from '../Interface';
|
|
4
|
+
declare class BaseObject3D extends Object3D {
|
|
6
5
|
sid: string | number;
|
|
7
6
|
stype: string;
|
|
8
7
|
level: Level;
|
|
@@ -12,15 +11,13 @@ declare class BaseObject3D<Event extends BaseEvent = BaseObjectEventsListener> e
|
|
|
12
11
|
onClick: ((object: any) => void) | null;
|
|
13
12
|
onDblClick: ((object: any) => void) | null;
|
|
14
13
|
onRightClick: ((object: any) => void) | null;
|
|
15
|
-
constructor(params
|
|
14
|
+
constructor(params?: BaseObject3DInfo);
|
|
16
15
|
eventPropagation(): void;
|
|
17
16
|
show(): void;
|
|
18
17
|
hide(): void;
|
|
19
18
|
setMove(position: Position | Vector3, options?: AnimationOptions, onUpdate?: (source: Position, tween: Tween<Position>) => void, onStart?: (tween: Tween<Position>) => void): Promise<void>;
|
|
20
19
|
setRotate(rotation: Rotation | Euler, options?: AnimationOptions, onUpdate?: (source: Rotation, tween: Tween<Rotation>) => void, onStart?: (tween: Tween<Rotation>) => void): Promise<void>;
|
|
21
20
|
setScale(scale: Scale | Vector3, options?: AnimationOptions, onUpdate?: (source: Scale, tween: Tween<Scale>) => void, onStart?: (tween: Tween<Scale>) => void): Promise<void>;
|
|
22
|
-
sClone<T extends BaseObject3D>(recursive?: boolean): T;
|
|
23
|
-
sCopy<T extends BaseObject3D>(source: BaseObject3D, recursive?: boolean): T;
|
|
24
21
|
getBoundingBox(): Box3;
|
|
25
22
|
getSpaceAttribute(isFromWorld?: boolean): {
|
|
26
23
|
position: Vector3;
|
|
@@ -28,5 +25,6 @@ declare class BaseObject3D<Event extends BaseEvent = BaseObjectEventsListener> e
|
|
|
28
25
|
scale: Vector3;
|
|
29
26
|
};
|
|
30
27
|
syncSpaceAttribute(object: Object3D, isFromWorld?: boolean): void;
|
|
28
|
+
copy(source: this, recursive?: boolean): this;
|
|
31
29
|
}
|
|
32
|
-
export { BaseObject3D,
|
|
30
|
+
export { BaseObject3D, };
|
|
@@ -1,18 +1,19 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { BaseObjectInfo } from '../Interface';
|
|
2
|
+
import { BaseObject3D } from './BaseObject3D';
|
|
2
3
|
import { BaseMesh } from './BaseMesh';
|
|
3
4
|
import { Point, PointInfo } from './Point';
|
|
4
5
|
import { Line, LineInfo } from './Line';
|
|
5
6
|
import { Polygon, PolygonInfo } from './Polygon';
|
|
6
7
|
import { Circle, CircleInfo } from './Circle';
|
|
7
|
-
interface Canvas3DInfo extends
|
|
8
|
+
interface Canvas3DInfo extends BaseObjectInfo {
|
|
8
9
|
points?: PointInfo[];
|
|
9
10
|
lines?: LineInfo[];
|
|
10
11
|
polygons?: PolygonInfo[];
|
|
11
12
|
circles?: CircleInfo[];
|
|
12
13
|
}
|
|
13
14
|
declare class Canvas3D extends BaseObject3D {
|
|
14
|
-
constructor(params
|
|
15
|
-
create(params
|
|
15
|
+
constructor(params?: Canvas3DInfo);
|
|
16
|
+
create(params?: Canvas3DInfo): void;
|
|
16
17
|
createPoint(params: PointInfo): Point;
|
|
17
18
|
getPoint(id: PointInfo['id']): Point | null;
|
|
18
19
|
removePoint(id: PointInfo['id']): void;
|
|
@@ -25,6 +26,6 @@ declare class Canvas3D extends BaseObject3D {
|
|
|
25
26
|
createCircle(params: CircleInfo): Circle;
|
|
26
27
|
getCircle(id: CircleInfo['id']): Circle | null;
|
|
27
28
|
removeCircle(id: CircleInfo['id']): void;
|
|
28
|
-
getChildForType<Type extends BaseMesh>(type: Type['stype'], id:
|
|
29
|
+
getChildForType<Type extends BaseMesh>(type: Type['stype'], id: PointInfo['id']): Type | null;
|
|
29
30
|
}
|
|
30
31
|
export { Canvas3D, Canvas3DInfo, };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { IColor } from '../Interface';
|
|
2
|
-
import { BaseMesh
|
|
1
|
+
import { BaseObjectInfo, IColor } from '../Interface';
|
|
2
|
+
import { BaseMesh } from './BaseMesh';
|
|
3
3
|
import { GradientTextureOptions } from '../Shared';
|
|
4
|
-
interface CircleInfo extends
|
|
4
|
+
interface CircleInfo extends BaseObjectInfo {
|
|
5
5
|
radius?: number;
|
|
6
6
|
color?: IColor;
|
|
7
7
|
opacity?: number;
|
|
@@ -9,7 +9,7 @@ interface CircleInfo extends BaseMeshInfo {
|
|
|
9
9
|
}
|
|
10
10
|
type SetOptionsCircleInfo = Omit<CircleInfo, 'id'>;
|
|
11
11
|
declare class Circle extends BaseMesh {
|
|
12
|
-
constructor(params
|
|
12
|
+
constructor(params?: CircleInfo);
|
|
13
13
|
setOptions(params: SetOptionsCircleInfo): void;
|
|
14
14
|
}
|
|
15
15
|
export { Circle, CircleInfo, SetOptionsCircleInfo, };
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import { BaseMesh, BaseMeshInfo } from './BaseMesh';
|
|
2
1
|
import { BufferGeometry, Material } from 'three';
|
|
3
|
-
|
|
2
|
+
import { BaseObjectInfo } from '../Interface';
|
|
3
|
+
import { BaseMesh } from './BaseMesh';
|
|
4
|
+
type GroundInfo = BaseObjectInfo;
|
|
4
5
|
declare class Ground extends BaseMesh {
|
|
5
|
-
constructor(params
|
|
6
|
+
constructor(params?: BaseObjectInfo, geometry?: BufferGeometry, material?: Material);
|
|
6
7
|
}
|
|
7
8
|
export { Ground, GroundInfo, };
|
package/types/Library/Group.d.ts
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
1
|
+
import { BaseObjectInfo } from '../Interface';
|
|
2
|
+
import { BaseObject3D } from './BaseObject3D';
|
|
3
|
+
type GroupInfo = BaseObjectInfo;
|
|
3
4
|
declare class Group extends BaseObject3D {
|
|
4
|
-
constructor(params
|
|
5
|
+
constructor(params?: GroupInfo);
|
|
5
6
|
showAllChild(): void;
|
|
6
7
|
hideAllChild(): void;
|
|
7
8
|
}
|
package/types/Library/Icon.d.ts
CHANGED
package/types/Library/Line.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { GradientTextureOptions } from '../Shared';
|
|
2
|
-
import { Position, IColor } from '../Interface';
|
|
3
|
-
import { BaseMesh
|
|
4
|
-
interface LineInfo extends
|
|
2
|
+
import { Position, IColor, BaseObjectInfo } from '../Interface';
|
|
3
|
+
import { BaseMesh } from './BaseMesh';
|
|
4
|
+
interface LineInfo extends BaseObjectInfo {
|
|
5
5
|
points: Position[];
|
|
6
6
|
width?: number;
|
|
7
7
|
color?: IColor;
|
|
@@ -11,8 +11,8 @@ interface LineInfo extends BaseMeshInfo {
|
|
|
11
11
|
type SetOptionsLineInfo = Omit<LineInfo, 'id'>;
|
|
12
12
|
declare class Line extends BaseMesh {
|
|
13
13
|
points: Position[];
|
|
14
|
-
params
|
|
15
|
-
constructor(params
|
|
14
|
+
params?: LineInfo;
|
|
15
|
+
constructor(params?: LineInfo);
|
|
16
16
|
setOptions(params: SetOptionsLineInfo): void;
|
|
17
17
|
}
|
|
18
18
|
export { Line, LineInfo, SetOptionsLineInfo, };
|
package/types/Library/Link.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { BufferGeometry, MeshStandardMaterial, Vector3, Texture } from 'three';
|
|
2
|
-
import { Position, IColor } from '../Interface';
|
|
3
|
-
import { BaseMesh
|
|
4
|
-
interface LinkInfo extends
|
|
2
|
+
import { Position, IColor, BaseObjectInfo } from '../Interface';
|
|
3
|
+
import { BaseMesh } from './BaseMesh';
|
|
4
|
+
interface LinkInfo extends BaseObjectInfo {
|
|
5
5
|
passable?: number;
|
|
6
6
|
start: Position;
|
|
7
7
|
end: Position;
|
|
@@ -11,11 +11,11 @@ interface LinkInfo extends BaseMeshInfo {
|
|
|
11
11
|
imgUrl?: string;
|
|
12
12
|
}
|
|
13
13
|
declare class Link extends BaseMesh {
|
|
14
|
-
readonly params
|
|
14
|
+
readonly params?: LinkInfo | undefined;
|
|
15
15
|
geometry: BufferGeometry<import("three").NormalBufferAttributes>;
|
|
16
16
|
material: MeshStandardMaterial;
|
|
17
17
|
passable: number;
|
|
18
|
-
constructor(params
|
|
18
|
+
constructor(params?: LinkInfo | undefined);
|
|
19
19
|
updateGeometry(params: Pick<LinkInfo, 'start' | 'end'>): void;
|
|
20
20
|
computeVertex(up?: Vector3): void;
|
|
21
21
|
computeTextureRepeat(texture: Texture): void;
|
package/types/Library/Model.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { BaseObject3D, BaseObject3DInfo } from './BaseObject3D';
|
|
2
1
|
import { ModelFormat } from '../Constants';
|
|
2
|
+
import { BaseObject3DInfo } from '../Interface';
|
|
3
|
+
import { BaseObject3D } from './BaseObject3D';
|
|
3
4
|
interface ModelInfo extends BaseObject3DInfo {
|
|
4
5
|
url: string;
|
|
5
6
|
format?: ModelFormat;
|
|
@@ -8,12 +9,12 @@ interface ModelInnerInfo extends ModelInfo {
|
|
|
8
9
|
format: ModelFormat;
|
|
9
10
|
}
|
|
10
11
|
declare class Model extends BaseObject3D {
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
constructor(params
|
|
12
|
+
formatType?: ModelFormat;
|
|
13
|
+
url?: string;
|
|
14
|
+
constructor(params?: ModelInnerInfo);
|
|
14
15
|
setEnvMap(dirPath: string, fileNames?: string[], options?: {
|
|
15
16
|
reflectivity?: number;
|
|
16
17
|
}): void;
|
|
17
|
-
|
|
18
|
+
copy(source: this, recursive?: boolean): this;
|
|
18
19
|
}
|
|
19
20
|
export { Model, ModelInfo, ModelInnerInfo, };
|
package/types/Library/Node.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
1
|
+
import { BaseObjectInfo } from '../Interface';
|
|
2
|
+
import { BaseObject3D } from './BaseObject3D';
|
|
3
|
+
type PluginObjectInfo = BaseObjectInfo;
|
|
3
4
|
declare class PluginObject extends BaseObject3D {
|
|
4
|
-
constructor(params
|
|
5
|
+
constructor(params?: PluginObjectInfo);
|
|
5
6
|
}
|
|
6
7
|
export { PluginObject, PluginObjectInfo, };
|
package/types/Library/Poi.d.ts
CHANGED
|
@@ -1,41 +1,33 @@
|
|
|
1
|
-
import { BaseObject3D
|
|
2
|
-
import { Icon
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
1
|
+
import { BaseObject3D } from './BaseObject3D';
|
|
2
|
+
import { Icon } from './Icon';
|
|
3
|
+
import { Box3 } from 'three';
|
|
4
|
+
import { BaseObject3DInfo, IVector3, PoiType, ScaleFixed } from '../Interface';
|
|
5
5
|
interface PoiInfo extends BaseObject3DInfo {
|
|
6
6
|
url: string;
|
|
7
7
|
type?: PoiType;
|
|
8
8
|
namePosition?: IVector3;
|
|
9
9
|
nameScale?: IVector3;
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
distance: number;
|
|
14
|
-
};
|
|
10
|
+
nameCanvasInfo?: NameCanvasInfo;
|
|
11
|
+
iconScale?: IVector3;
|
|
12
|
+
scaleFixed?: ScaleFixed;
|
|
15
13
|
}
|
|
16
|
-
interface
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
14
|
+
interface NameCanvasInfo {
|
|
15
|
+
font?: string;
|
|
16
|
+
fillStyle?: CanvasFillStrokeStyles['fillStyle'];
|
|
17
|
+
strokeStyle?: CanvasFillStrokeStyles['strokeStyle'];
|
|
20
18
|
textAlign?: CanvasTextAlign;
|
|
21
19
|
textBaseline?: CanvasTextBaseline;
|
|
22
20
|
}
|
|
23
21
|
declare class Poi extends BaseObject3D {
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
text: Icon | null;
|
|
22
|
+
icon?: Icon;
|
|
23
|
+
text?: Icon;
|
|
24
|
+
iconType?: PoiType;
|
|
28
25
|
/**
|
|
29
26
|
* scale 锁定
|
|
30
27
|
*/
|
|
31
28
|
scaleFixed: PoiInfo['scaleFixed'];
|
|
32
|
-
constructor(
|
|
29
|
+
constructor(params?: PoiInfo);
|
|
33
30
|
getBoundingBox(padding?: number): Box3;
|
|
34
|
-
|
|
35
|
-
_createIcon(material: SpriteMaterial): Icon;
|
|
36
|
-
_createText(info: IconInfo): Icon;
|
|
37
|
-
_createTextMaterial(info: IconInfo): SpriteMaterial;
|
|
38
|
-
_createTextCanvas(text: string, info?: CanvasTextInfo): HTMLCanvasElement;
|
|
39
|
-
_computeMaterialSizeAttenuation(material: SpriteMaterial): SpriteMaterial;
|
|
31
|
+
copy(source: this, recursive?: boolean): this;
|
|
40
32
|
}
|
|
41
|
-
export { Poi, PoiInfo,
|
|
33
|
+
export { Poi, PoiInfo, NameCanvasInfo, };
|
|
@@ -1,23 +1,23 @@
|
|
|
1
1
|
import { Box3 } from 'three';
|
|
2
|
-
import { BaseObject3D
|
|
3
|
-
import { PoiNodeType } from '../Interface';
|
|
2
|
+
import { BaseObject3D } from './BaseObject3D';
|
|
3
|
+
import { BaseObject3DInfo, PoiNodeType, ScaleFixed } from '../Interface';
|
|
4
4
|
interface PoiNodeInfo extends BaseObject3DInfo {
|
|
5
5
|
type: PoiNodeType;
|
|
6
6
|
element: HTMLElement;
|
|
7
7
|
elementAutoDisplay?: boolean;
|
|
8
8
|
occlude?: boolean;
|
|
9
9
|
onChange?: (visible: boolean) => void;
|
|
10
|
+
scaleFixed?: ScaleFixed;
|
|
10
11
|
}
|
|
11
12
|
declare class PoiNode extends BaseObject3D {
|
|
12
|
-
readonly elementType
|
|
13
|
-
readonly element
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
13
|
+
readonly elementType?: PoiNodeInfo['type'];
|
|
14
|
+
readonly element?: PoiNodeInfo['element'];
|
|
15
|
+
elementAutoDisplay: PoiNodeInfo['elementAutoDisplay'];
|
|
16
|
+
occlude: PoiNodeInfo['occlude'];
|
|
17
|
+
onChange: PoiNodeInfo['onChange'];
|
|
18
|
+
scaleFixed: PoiNodeInfo['scaleFixed'];
|
|
19
|
+
constructor(params?: PoiNodeInfo);
|
|
18
20
|
create(type: PoiNodeInfo['type']): void;
|
|
19
|
-
show(): void;
|
|
20
|
-
hide(): void;
|
|
21
21
|
getBoundingBox(padding?: number): Box3;
|
|
22
22
|
_create2D(): void;
|
|
23
23
|
_create2DHalf(): void;
|
package/types/Library/Point.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { BaseMesh
|
|
2
|
-
import { IColor } from '../Interface';
|
|
1
|
+
import { BaseMesh } from './BaseMesh';
|
|
2
|
+
import { BaseObjectInfo, IColor } from '../Interface';
|
|
3
3
|
import { GradientTextureOptions } from '../Shared';
|
|
4
|
-
interface PointInfo extends
|
|
4
|
+
interface PointInfo extends BaseObjectInfo {
|
|
5
5
|
radius?: number;
|
|
6
6
|
color?: IColor;
|
|
7
7
|
opacity?: number;
|
|
@@ -9,7 +9,7 @@ interface PointInfo extends BaseMeshInfo {
|
|
|
9
9
|
}
|
|
10
10
|
type SetOptionsPointInfo = Omit<PointInfo, 'id'>;
|
|
11
11
|
declare class Point extends BaseMesh {
|
|
12
|
-
constructor(params
|
|
12
|
+
constructor(params?: PointInfo);
|
|
13
13
|
setOptions(params: SetOptionsPointInfo): void;
|
|
14
14
|
}
|
|
15
15
|
export { Point, PointInfo, SetOptionsPointInfo, };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { IColor, PlaneIVector2 } from '../Interface';
|
|
2
|
-
import { BaseMesh
|
|
1
|
+
import { BaseObjectInfo, IColor, PlaneIVector2 } from '../Interface';
|
|
2
|
+
import { BaseMesh } from './BaseMesh';
|
|
3
3
|
import { GradientTextureOptions } from '../Shared';
|
|
4
|
-
interface PolygonInfo extends
|
|
4
|
+
interface PolygonInfo extends BaseObjectInfo {
|
|
5
5
|
yHeight: number;
|
|
6
6
|
points: PlaneIVector2[];
|
|
7
7
|
color?: IColor;
|
|
@@ -11,7 +11,7 @@ interface PolygonInfo extends BaseMeshInfo {
|
|
|
11
11
|
type SetOptionsPolygonInfo = Omit<PolygonInfo, 'id'>;
|
|
12
12
|
declare class Polygon extends BaseMesh {
|
|
13
13
|
points: PlaneIVector2[];
|
|
14
|
-
constructor(params
|
|
14
|
+
constructor(params?: PolygonInfo);
|
|
15
15
|
setOptions(params: SetOptionsPolygonInfo): void;
|
|
16
16
|
}
|
|
17
17
|
export { Polygon, PolygonInfo, SetOptionsPolygonInfo, };
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import { Tween } from '@tweenjs/tween.js';
|
|
2
|
-
import { BaseObject3D
|
|
2
|
+
import { BaseObject3D } from './BaseObject3D';
|
|
3
3
|
import { Node, NodeInfo } from './Node';
|
|
4
4
|
import { Circle, CircleInfo } from './Circle';
|
|
5
5
|
import { Link, LinkInfo } from './Link';
|
|
6
|
-
import { TopologyNodeInfo, TopologyEffectInfo, TopologyInnerNodeInfo, IVector2, TopologyNodeGraph } from '../Interface';
|
|
6
|
+
import { TopologyNodeInfo, TopologyEffectInfo, TopologyInnerNodeInfo, IVector2, BaseObjectInfo, TopologyNodeGraph } from '../Interface';
|
|
7
7
|
type TopologyType = 'line' | 'network';
|
|
8
|
-
interface TopologyInfo extends
|
|
8
|
+
interface TopologyInfo extends BaseObjectInfo, TopologyEffectInfo {
|
|
9
9
|
nodes: TopologyNodeInfo[];
|
|
10
10
|
type: TopologyType;
|
|
11
11
|
}
|
|
12
|
-
interface TopologyInnerInfo extends
|
|
12
|
+
interface TopologyInnerInfo extends BaseObjectInfo, TopologyEffectInfo {
|
|
13
13
|
nodes: TopologyInnerNodeInfo[];
|
|
14
14
|
type: TopologyType;
|
|
15
15
|
}
|
|
@@ -20,7 +20,7 @@ declare class Topology extends BaseObject3D {
|
|
|
20
20
|
links: Link[];
|
|
21
21
|
linksImgAnimation: Tween<IVector2> | null;
|
|
22
22
|
info: TopologyInnerInfo;
|
|
23
|
-
constructor(params
|
|
23
|
+
constructor(params?: TopologyInnerInfo);
|
|
24
24
|
create(): void;
|
|
25
25
|
createNode(params: NodeInfo): Node;
|
|
26
26
|
createCircle(params: CircleInfo): Circle;
|
|
@@ -1,11 +1,12 @@
|
|
|
1
|
-
import { Object3D
|
|
1
|
+
import { Object3D } from 'three';
|
|
2
2
|
import Viewport from '../Viewport';
|
|
3
3
|
import { Group, GroupInfo, BaseObject3D } from '../Library';
|
|
4
4
|
declare class DefaultManage {
|
|
5
5
|
readonly type: string;
|
|
6
6
|
readonly viewport: Viewport;
|
|
7
|
-
readonly
|
|
8
|
-
|
|
7
|
+
readonly objectsCache: Set<Object3D>;
|
|
8
|
+
readonly scene: import("three").Scene;
|
|
9
|
+
constructor(type: string, viewport: Viewport, objectsCache: Set<Object3D>);
|
|
9
10
|
/***
|
|
10
11
|
* group
|
|
11
12
|
*/
|
|
@@ -1,18 +1,24 @@
|
|
|
1
|
-
import { SpriteMaterial } from 'three';
|
|
1
|
+
import { SpriteMaterial, Texture } from 'three';
|
|
2
2
|
import DefaultManage from './DefaultManage';
|
|
3
|
-
import { Poi, PoiInfo, Group, GroupInfo, BaseObject3D } from '../Library';
|
|
4
|
-
import { ClonePoiInfo, ManageCache } from '../Interface';
|
|
3
|
+
import { Poi, PoiInfo, Group, GroupInfo, BaseObject3D, Icon, NameCanvasInfo } from '../Library';
|
|
4
|
+
import { ClonePoiInfo, ManageCache, PoiType } from '../Interface';
|
|
5
5
|
import Viewport from '../Viewport';
|
|
6
6
|
declare class PoiManage extends DefaultManage {
|
|
7
7
|
readonly viewport: Viewport;
|
|
8
8
|
readonly cache: ManageCache;
|
|
9
|
-
|
|
9
|
+
textures: Map<string, Texture>;
|
|
10
10
|
constructor(viewport: Viewport, cache: ManageCache);
|
|
11
|
+
_createIcon(info: PoiInfo): Icon;
|
|
12
|
+
_createText(info: ClonePoiInfo): Icon;
|
|
13
|
+
_createTextMaterial(info: ClonePoiInfo): SpriteMaterial;
|
|
14
|
+
_createTextCanvas(text: string, info?: NameCanvasInfo): HTMLCanvasElement;
|
|
15
|
+
_computeMaterialSizeAttenuation(material: SpriteMaterial, iconType?: PoiType): SpriteMaterial;
|
|
16
|
+
protected _create(info: PoiInfo): Poi;
|
|
11
17
|
create(info: PoiInfo): Poi;
|
|
12
18
|
clone(poi: Poi, poiInfo: ClonePoiInfo, parent?: BaseObject3D | null): Poi | void;
|
|
13
19
|
createToGroup(groupInfo: GroupInfo, poiInfo: PoiInfo[]): Group;
|
|
14
20
|
addForGroup(group: Group | null, poiInfo: PoiInfo[]): Group | null;
|
|
15
|
-
|
|
21
|
+
_createIconMaterial({ url, type, }: PoiInfo): SpriteMaterial;
|
|
16
22
|
private _copyMaterial;
|
|
17
23
|
}
|
|
18
24
|
export default PoiManage;
|
package/types/Manager/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { BaseObjectInfo } from '../../Interface';
|
|
2
2
|
import { MinHeap } from '../../Shared';
|
|
3
3
|
/**
|
|
4
4
|
* Javascript implementation of Dijkstra's algorithm
|
|
@@ -19,7 +19,7 @@ import { MinHeap } from '../../Shared';
|
|
|
19
19
|
* const path = d.getPath('A', 'D');
|
|
20
20
|
*
|
|
21
21
|
*/
|
|
22
|
-
type BaseId =
|
|
22
|
+
type BaseId = BaseObjectInfo['id'];
|
|
23
23
|
type Graph = Map<BaseId, Map<BaseId, number>>;
|
|
24
24
|
type InputGraph = [BaseId, [BaseId, number][]][];
|
|
25
25
|
declare class Dijkstras {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Vector3, Euler, Box3, Object3D, Vector2 } from 'three';
|
|
1
|
+
import { Vector3, Euler, Box3, Object3D, Vector2, Camera } from 'three';
|
|
2
2
|
import { IVector3, AxisType } from '../Interface';
|
|
3
3
|
declare function IVector3ToVector3(val: IVector3 | Vector3): Vector3;
|
|
4
4
|
declare function IVector3ToEuler(val: IVector3 | Euler): Euler;
|
|
@@ -31,5 +31,5 @@ declare function getSpaceAttributeFromObject(object: Object3D, isFromWorld?: boo
|
|
|
31
31
|
*/
|
|
32
32
|
declare function syncSpaceAttributeToObject(target: Object3D, source: Object3D, isFromWorld?: boolean): void;
|
|
33
33
|
declare function isObjectVisible(object: Object3D): boolean;
|
|
34
|
-
declare const calculateScaleFactor: (point3:
|
|
34
|
+
declare const calculateScaleFactor: (point3: Vector3, radiusPx: number, camera: Camera, size: Vector2) => number;
|
|
35
35
|
export { IVector3ToVector3, IVector3ToEuler, getBoundingBox, rotationAxisFix, rotationAFix, deg2Euler, euler2Deg, getSpaceAttributeFromObject, syncSpaceAttributeToObject, isObjectVisible, calculateScaleFactor, };
|