@soonspacejs/plugin-cps-soonmanager 2.15.13 → 2.15.15

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.
@@ -0,0 +1 @@
1
+ export declare function appendRetryQuery(url: string): string;
@@ -0,0 +1,7 @@
1
+ import { default as SoonSpace } from 'soonspacejs';
2
+ import { SemanticObject } from './semantic.types';
3
+ import { IDetachedSemanticBatchResult, ISemanticCanvasBatch } from './semantic-worker.types';
4
+ export declare function createImmediateSemanticBatches(ssp: SoonSpace, semanticData: SemanticObject, shouldContinue: () => boolean): IDetachedSemanticBatchResult;
5
+ export declare function createDetachedSemanticBatches(ssp: SoonSpace, semanticBatches: ISemanticCanvasBatch[], shouldContinue?: () => boolean): IDetachedSemanticBatchResult;
6
+ export declare function commitDetachedSemanticBatches(ssp: SoonSpace, result: IDetachedSemanticBatchResult): void;
7
+ export declare function disposeDetachedSemanticBatches(ssp: SoonSpace, result: IDetachedSemanticBatchResult): void;
@@ -0,0 +1,10 @@
1
+ import { ISemanticWorkerConfig } from './semantic-worker.config';
2
+ import { IPreparedSemanticData } from './semantic-worker.types';
3
+ export interface IPrepareSemanticDataInWorkerOptions {
4
+ sourceUrl?: string;
5
+ semanticData?: IPreparedSemanticData['semanticData'];
6
+ config?: ISemanticWorkerConfig;
7
+ signal?: AbortSignal;
8
+ workerFactory?: () => Worker;
9
+ }
10
+ export declare function prepareSemanticDataInWorker({ sourceUrl, semanticData, config, signal, workerFactory, }: IPrepareSemanticDataInWorkerOptions): Promise<IPreparedSemanticData>;
@@ -0,0 +1,28 @@
1
+ export type SemanticCanvasRenderType = 'WALL' | 'COLUMN' | 'WINDOW';
2
+ export declare const SEMANTIC_ROOM_COLOR = "#d9dde3";
3
+ export declare const SEMANTIC_ROOM_OPACITY = 0.18;
4
+ export declare const SEMANTIC_WALL_COLOR = "#64748b";
5
+ export declare const SEMANTIC_WALL_OPACITY = 0.72;
6
+ export declare const SEMANTIC_COLUMN_COLOR = "#52606d";
7
+ export declare const SEMANTIC_COLUMN_OPACITY = 0.78;
8
+ export declare const SEMANTIC_WINDOW_COLOR = "#9bb6c9";
9
+ export declare const SEMANTIC_WINDOW_OPACITY = 0.4;
10
+ export declare const SEMANTIC_WORKER_TRANSPARENT_OPACITY = 0;
11
+ export declare const SEMANTIC_CANVAS_DEPTH_WRITE = true;
12
+ export declare const SEMANTIC_WORKER_TRANSPARENT_DEPTH_WRITE = false;
13
+ export interface ISemanticExteriorRule {
14
+ maxAdjacentSpaces: number;
15
+ excludeVirtual?: boolean;
16
+ }
17
+ export interface ISemanticTypeConfig {
18
+ storyField: string;
19
+ dataField: string;
20
+ renderType: SemanticCanvasRenderType;
21
+ statField: string;
22
+ exteriorRule?: ISemanticExteriorRule;
23
+ }
24
+ export interface ISemanticWorkerConfig {
25
+ immediateTypes: ISemanticTypeConfig[];
26
+ canvasTypes: ISemanticTypeConfig[];
27
+ }
28
+ export declare const DEFAULT_SEMANTIC_WORKER_CONFIG: ISemanticWorkerConfig;
@@ -0,0 +1,4 @@
1
+ import { SemanticObject } from './semantic.types';
2
+ import { ISemanticWorkerConfig } from './semantic-worker.config';
3
+ import { IPreparedSemanticData } from './semantic-worker.types';
4
+ export declare function prepareSemanticData(semanticData?: SemanticObject, config?: ISemanticWorkerConfig): IPreparedSemanticData;
@@ -0,0 +1,2 @@
1
+ export declare function createSemanticAbortError(reason?: unknown, message?: string): Error;
2
+ export declare function getSemanticErrorMessage(error: unknown): string;
@@ -0,0 +1,56 @@
1
+ import { SemanticObject } from './semantic.types';
2
+ import { ISemanticWorkerConfig, SemanticCanvasRenderType } from './semantic-worker.config';
3
+ import { BaseObject3D, Canvas3D } from 'soonspacejs';
4
+ export interface ISemanticCanvasDescriptor {
5
+ id: string;
6
+ parentId: string;
7
+ points: Array<{
8
+ x: number;
9
+ z: number;
10
+ }>;
11
+ yHeight?: number;
12
+ depth?: number;
13
+ renderType: SemanticCanvasRenderType;
14
+ isVirtualWall?: boolean;
15
+ }
16
+ export interface ISemanticCanvasBatch {
17
+ parentId: string;
18
+ renderType: SemanticCanvasRenderType;
19
+ descriptors: ISemanticCanvasDescriptor[];
20
+ }
21
+ export interface ISemanticWorkerStats {
22
+ walls: number;
23
+ columns: number;
24
+ windows: number;
25
+ exteriorWalls: number;
26
+ duplicates: number;
27
+ skipped: number;
28
+ [key: string]: number;
29
+ }
30
+ export interface IPreparedSemanticData {
31
+ semanticData: SemanticObject;
32
+ immediateSemanticData: SemanticObject;
33
+ semanticBatches: ISemanticCanvasBatch[];
34
+ stats: ISemanticWorkerStats;
35
+ }
36
+ export interface ISemanticWorkerRequest {
37
+ requestId: number;
38
+ sourceUrl?: string;
39
+ semanticData?: SemanticObject;
40
+ config?: ISemanticWorkerConfig;
41
+ }
42
+ export interface ISemanticWorkerResponse {
43
+ requestId: number;
44
+ result?: IPreparedSemanticData;
45
+ error?: string;
46
+ }
47
+ export interface IDetachedSemanticBatchResult {
48
+ batches: IDetachedSemanticBatch[];
49
+ created: number;
50
+ skipped: number;
51
+ cancelled: boolean;
52
+ }
53
+ export interface IDetachedSemanticBatch {
54
+ parent: BaseObject3D;
55
+ objects: Canvas3D[];
56
+ }
@@ -0,0 +1 @@
1
+ export {};
package/dist/types.d.ts CHANGED
@@ -1,6 +1,9 @@
1
1
  import { PlotTextAlign, PlotTextLayoutDirection } from '@soonspacejs/plugin-tiles';
2
2
  import { AnimationModeType, BaseObjectInfo, IVector3, PoiNodeType } from 'soonspacejs';
3
3
  import { TTweenSource, TTweenType } from 'umanager-animation-parser';
4
+ import { SemanticObject } from './semantic.types';
5
+ import { ISemanticWorkerConfig } from './semantic-worker.config';
6
+ import { ISemanticWorkerStats } from './semantic-worker.types';
4
7
  export type BaseTreeNode<T> = T & {
5
8
  id: string;
6
9
  sid: string;
@@ -10,6 +13,14 @@ export interface IWorkIdMapValue {
10
13
  work_id?: string | number | null;
11
14
  }
12
15
  export type IWorkIdMap = Record<string, IWorkIdMapValue> | Map<string, IWorkIdMapValue>;
16
+ export interface IApplyWorkIdMapResult {
17
+ received: number;
18
+ accepted: number;
19
+ applied: number;
20
+ pending: number;
21
+ invalid: number;
22
+ duplicates: number;
23
+ }
13
24
  export interface IGisSettings {
14
25
  enabled: boolean;
15
26
  longitude: number;
@@ -78,6 +89,31 @@ export interface IProgressEventMap {
78
89
  progress: IProgress;
79
90
  };
80
91
  }
92
+ export type SemanticWorkerStage = 'scene-resource-load' | 'worker-semantic' | 'semantic-fallback-fetch' | 'semantic-fallback-worker-prepare' | 'semantic-fallback-main-prepare' | 'semantic-detached-build' | 'semantic-atomic-commit' | 'scene-paint' | 'scene-matrix-freeze';
93
+ export interface ISemanticWorkerStageEvent {
94
+ stage: SemanticWorkerStage;
95
+ status?: 'success' | 'failed' | 'cancelled';
96
+ [key: string]: unknown;
97
+ }
98
+ export interface ILoadSceneAndSemanticInWorkerOptions {
99
+ signal?: AbortSignal;
100
+ shouldContinue?: () => boolean;
101
+ workerFactory?: () => Worker;
102
+ semanticConfig?: ISemanticWorkerConfig;
103
+ freezeSceneWorldMatrix?: boolean;
104
+ onStage?: (event: ISemanticWorkerStageEvent) => void;
105
+ }
106
+ export interface ILoadSceneAndSemanticInWorkerResult {
107
+ semanticData: SemanticObject;
108
+ stats: ISemanticWorkerStats;
109
+ render: {
110
+ [key: string]: unknown;
111
+ renderMode: 'atomic-replacement';
112
+ progressive: false;
113
+ hierarchyMode: 'direct-story-child';
114
+ exteriorFirst: boolean;
115
+ };
116
+ }
81
117
  export interface PoiMedia {
82
118
  assetId?: string | null;
83
119
  url?: string;
package/dist/utils.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { default as SoonSpace, BaseObject3D } from 'soonspacejs';
1
+ import { default as SoonSpace, BaseObject3D, Canvas3D } from 'soonspacejs';
2
2
  import { TAnimationFrame } from 'umanager-animation-parser';
3
3
  import { BaseTreeNode, IKeyframe, ITreeData } from './types';
4
4
  import { default as CpsSoonmanagerPlugin } from '.';
@@ -10,9 +10,9 @@ import { default as CpsSoonmanagerPlugin } from '.';
10
10
  export declare function decodeString(encodedStr: string): string;
11
11
  export declare const mapTreeNodeByKey: <T, K extends keyof BaseTreeNode<T>, V>(tree: BaseTreeNode<T>[], key: K, map?: Map<V, BaseTreeNode<T>>) => Map<V, BaseTreeNode<T>>;
12
12
  export declare function isSpace(renderType: ITreeData['renderType']): renderType is "AREA" | "FLOOR" | "ROOM" | "OUTSIDE" | "BUILDING";
13
- export declare function createSpace(ssp: SoonSpace, node: ITreeData, objectId: string): import('soonspacejs').Canvas3D;
14
- export declare function createDoor(ssp: SoonSpace, node: ITreeData, objectId: string): import('soonspacejs').Canvas3D;
15
- export declare function createWindow(ssp: SoonSpace, node: ITreeData, objectId: string): import('soonspacejs').Canvas3D;
13
+ export declare function createSpace(ssp: SoonSpace, node: ITreeData, objectId: string, transparentSemanticPolygons?: boolean): Canvas3D;
14
+ export declare function createDoor(ssp: SoonSpace, node: ITreeData, objectId: string, transparentSemanticPolygons?: boolean): Canvas3D;
15
+ export declare function createWindow(ssp: SoonSpace, node: ITreeData, objectId: string, transparentSemanticPolygons?: boolean): Canvas3D;
16
16
  /**
17
17
  * 创建楼梯
18
18
  * @param ssp
@@ -20,7 +20,7 @@ export declare function createWindow(ssp: SoonSpace, node: ITreeData, objectId:
20
20
  * @param objectId
21
21
  * @returns
22
22
  */
23
- export declare function createStaircase(ssp: SoonSpace, node: ITreeData, objectId: string): import('soonspacejs').Canvas3D;
23
+ export declare function createStaircase(ssp: SoonSpace, node: ITreeData, objectId: string, transparentSemanticPolygons?: boolean): Canvas3D;
24
24
  /**
25
25
  * 创建电梯
26
26
  * @param ssp
@@ -28,7 +28,7 @@ export declare function createStaircase(ssp: SoonSpace, node: ITreeData, objectI
28
28
  * @param objectId
29
29
  * @returns
30
30
  */
31
- export declare function createElevator(ssp: SoonSpace, node: ITreeData, objectId: string): import('soonspacejs').Canvas3D;
31
+ export declare function createElevator(ssp: SoonSpace, node: ITreeData, objectId: string, transparentSemanticPolygons?: boolean): Canvas3D;
32
32
  export declare function createWaterSurface(cpsPlugin: CpsSoonmanagerPlugin, node: ITreeData, objectId: string): import('soonspacejs').PluginObject | null;
33
33
  export declare function createDecal(ssp: SoonSpace, node: ITreeData, objectId: string, path: string | null): Promise<import('soonspacejs').Decal | null>;
34
34
  export declare function createGs3d(ssp: SoonSpace, node: ITreeData, path: string | null): Promise<BaseObject3D>;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@soonspacejs/plugin-cps-soonmanager",
3
3
  "pluginName": "CpsSoonmanagerPlugin",
4
- "version": "2.15.13",
4
+ "version": "2.15.15",
5
5
  "description": "Sync cps soonmanager data plugin for SoonSpace.js",
6
6
  "main": "dist/index.esm.js",
7
7
  "module": "dist/index.esm.js",
@@ -37,14 +37,14 @@
37
37
  "socket.io-client": "^4.7.2"
38
38
  },
39
39
  "peerDependencies": {
40
- "@soonspacejs/plugin-atmosphere": "2.15.13",
41
- "@soonspacejs/plugin-effect": "2.15.13",
42
- "@soonspacejs/plugin-flow": "2.15.13",
43
- "@soonspacejs/plugin-gs3d-loader": "2.15.13",
44
- "@soonspacejs/plugin-poi-renderer": "2.15.13",
45
- "@soonspacejs/plugin-tiles": "2.15.13",
46
- "soonspacejs": "2.15.13",
40
+ "@soonspacejs/plugin-atmosphere": "2.15.15",
41
+ "@soonspacejs/plugin-effect": "2.15.15",
42
+ "@soonspacejs/plugin-flow": "2.15.15",
43
+ "@soonspacejs/plugin-gs3d-loader": "2.15.15",
44
+ "@soonspacejs/plugin-poi-renderer": "2.15.15",
45
+ "@soonspacejs/plugin-tiles": "2.15.15",
46
+ "soonspacejs": "2.15.15",
47
47
  "umanager-animation-parser": "^0.0.6",
48
- "@soonspacejs/plugin-fds": "2.15.13"
48
+ "@soonspacejs/plugin-fds": "2.15.15"
49
49
  }
50
50
  }