@soonspacejs/plugin-cps-soonmanager 2.6.18
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/README.md +5 -0
- package/dist/License/encryptInfo.d.ts +16 -0
- package/dist/License/index.d.ts +9 -0
- package/dist/License/types.d.ts +5 -0
- package/dist/WaterMark/index.d.ts +26 -0
- package/dist/constant.d.ts +32 -0
- package/dist/index.d.ts +87 -0
- package/dist/index.esm.js +3 -0
- package/dist/types.d.ts +157 -0
- package/package.json +20 -0
package/README.md
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { Object3D, OrthographicCamera, Vector4, Vector2 } from 'three';
|
|
2
|
+
import Viewport from 'soonspacejs/types/Viewport';
|
|
3
|
+
declare class WaterMark extends Object3D {
|
|
4
|
+
readonly viewport: Viewport;
|
|
5
|
+
fontSize: number;
|
|
6
|
+
imageWidth: number;
|
|
7
|
+
protected _size?: Vector2 | null;
|
|
8
|
+
get size(): Vector2;
|
|
9
|
+
set size(value: Vector2);
|
|
10
|
+
camera: OrthographicCamera;
|
|
11
|
+
direction: Vector2;
|
|
12
|
+
speed: number;
|
|
13
|
+
protected _velocity?: Vector2 | null;
|
|
14
|
+
get velocity(): Vector2;
|
|
15
|
+
set velocity(value: Vector2);
|
|
16
|
+
currViewport: Vector4;
|
|
17
|
+
constructor(viewport: Viewport);
|
|
18
|
+
lastRenderTime: number;
|
|
19
|
+
autoRender: (time: number) => void;
|
|
20
|
+
_generateMark(str?: number[] | string): void;
|
|
21
|
+
_generateMarkForString(str?: number[] | string): void;
|
|
22
|
+
_generateMarkForImage(url?: string, width?: number, height?: number): void;
|
|
23
|
+
render(): void;
|
|
24
|
+
renderToViewport(): void;
|
|
25
|
+
}
|
|
26
|
+
export { WaterMark, };
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 场景元数据
|
|
3
|
+
*/
|
|
4
|
+
export declare const META_DATA_FILE_PATH = "/SceneMetadata.json";
|
|
5
|
+
/**
|
|
6
|
+
* 签名文件
|
|
7
|
+
*/
|
|
8
|
+
export declare const SIGN_PATH = "/db/sign";
|
|
9
|
+
/**
|
|
10
|
+
* 模型树
|
|
11
|
+
*/
|
|
12
|
+
export declare const TREE_DATA_FILE_PATH = "/db/tree_models.json";
|
|
13
|
+
/**
|
|
14
|
+
* 拓扑路径
|
|
15
|
+
*/
|
|
16
|
+
export declare const TOPOLOGY_DATA_FILE_PATH = "/db/topology_paths.json";
|
|
17
|
+
/**
|
|
18
|
+
* 自定义属性
|
|
19
|
+
*/
|
|
20
|
+
export declare const PROPERTIES_DATA_FLEE_PATH = "/db/properties.json";
|
|
21
|
+
/**
|
|
22
|
+
* 帧动画
|
|
23
|
+
*/
|
|
24
|
+
export declare const ANIMATIONS_DATA_FILE_PATH = "/db/animations.json";
|
|
25
|
+
/**
|
|
26
|
+
* 模型视角
|
|
27
|
+
*/
|
|
28
|
+
export declare const MODEL_VISIONS_DATA_FILE_PATH = "/db/model_visions.json";
|
|
29
|
+
/**
|
|
30
|
+
* 自定义属性 key
|
|
31
|
+
*/
|
|
32
|
+
export declare const PROPERTIES_KEY = "properties";
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import SoonSpace from 'soonspacejs';
|
|
2
|
+
import type { TopologyInfo } from 'soonspacejs/types/Library';
|
|
3
|
+
import { IMetadata, ITreeData, ITopologyPath, ILoadSceneOptions, TPropertiesMap, TAnimationsMap, IPlayAnimationByIdOptions, TModelVisionsMap } from './types';
|
|
4
|
+
import { License } from './License';
|
|
5
|
+
declare class CpsSoonmanagerPlugin {
|
|
6
|
+
#private;
|
|
7
|
+
readonly ssp: SoonSpace;
|
|
8
|
+
_path: string;
|
|
9
|
+
get path(): string;
|
|
10
|
+
set path(val: string);
|
|
11
|
+
/**
|
|
12
|
+
* 场景元数据
|
|
13
|
+
*/
|
|
14
|
+
metaData: IMetadata | null;
|
|
15
|
+
/**
|
|
16
|
+
* 模型树
|
|
17
|
+
*/
|
|
18
|
+
treeData: ITreeData[] | null;
|
|
19
|
+
/**
|
|
20
|
+
* 拓扑路径
|
|
21
|
+
*/
|
|
22
|
+
topologyData: TopologyInfo[] | null;
|
|
23
|
+
/**
|
|
24
|
+
* 自定义属性
|
|
25
|
+
*/
|
|
26
|
+
propertiesData: TPropertiesMap | null;
|
|
27
|
+
/**
|
|
28
|
+
* 动画
|
|
29
|
+
*/
|
|
30
|
+
animationsData: TAnimationsMap | null;
|
|
31
|
+
/**
|
|
32
|
+
* 模型视角
|
|
33
|
+
*/
|
|
34
|
+
modelVisionsData: TModelVisionsMap | null;
|
|
35
|
+
license: License;
|
|
36
|
+
constructor(ssp: SoonSpace);
|
|
37
|
+
private _resolvePath;
|
|
38
|
+
private _fetchData;
|
|
39
|
+
/**
|
|
40
|
+
* 获取场景元数据
|
|
41
|
+
*/
|
|
42
|
+
fetchMetaData(): Promise<IMetadata>;
|
|
43
|
+
/**
|
|
44
|
+
* 获取拓扑路径
|
|
45
|
+
* @returns
|
|
46
|
+
*/
|
|
47
|
+
fetchTopologyData(): Promise<ITopologyPath[]>;
|
|
48
|
+
/**
|
|
49
|
+
* 获取自定义属性
|
|
50
|
+
* @returns
|
|
51
|
+
*/
|
|
52
|
+
fetchPropertiesData(): Promise<TPropertiesMap>;
|
|
53
|
+
/**
|
|
54
|
+
* 获取动画
|
|
55
|
+
* @returns
|
|
56
|
+
*/
|
|
57
|
+
fetchAnimationsData(): Promise<TAnimationsMap>;
|
|
58
|
+
/**
|
|
59
|
+
* 获取模型视角
|
|
60
|
+
* @returns
|
|
61
|
+
*/
|
|
62
|
+
fetchModelVisionsData(): Promise<TModelVisionsMap>;
|
|
63
|
+
/**
|
|
64
|
+
* 加载场景树中的对象
|
|
65
|
+
*/
|
|
66
|
+
private loadObjects;
|
|
67
|
+
/**
|
|
68
|
+
* 设置 path
|
|
69
|
+
* @param path
|
|
70
|
+
*/
|
|
71
|
+
setPath(path: string): void;
|
|
72
|
+
/**
|
|
73
|
+
* 同步场景树
|
|
74
|
+
*/
|
|
75
|
+
loadScene(options?: ILoadSceneOptions): Promise<void>;
|
|
76
|
+
/**
|
|
77
|
+
* 获取拓扑路径列表
|
|
78
|
+
*/
|
|
79
|
+
getTopologies(): Promise<TopologyInfo[]>;
|
|
80
|
+
/**
|
|
81
|
+
* 播放动画
|
|
82
|
+
*/
|
|
83
|
+
playAnimationById(id: string, animationIndex?: number, options?: IPlayAnimationByIdOptions): Promise<void>;
|
|
84
|
+
}
|
|
85
|
+
export * from './types';
|
|
86
|
+
export * from './constant';
|
|
87
|
+
export default CpsSoonmanagerPlugin;
|