@soonspacejs/plugin-cps-soonmanager 2.15.14 → 2.15.16

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
+ }
@@ -74,6 +74,64 @@ export interface Asset {
74
74
  Version: string;
75
75
  UBuilder?: any;
76
76
  }
77
+ export interface Site {
78
+ ID?: string;
79
+ Name?: string;
80
+ Polygon?: Polygon;
81
+ Elevation?: number;
82
+ Coordinates?: number[];
83
+ }
84
+ export interface Zone {
85
+ ID: string;
86
+ Name?: string;
87
+ Polygon?: Polygon;
88
+ Elevation?: number;
89
+ Facilities?: number[];
90
+ }
91
+ export interface WaterSource {
92
+ ID: string;
93
+ Name?: string;
94
+ Polygon?: Polygon;
95
+ Elevation?: number;
96
+ }
97
+ export interface Entrance {
98
+ ID: string;
99
+ Name?: string;
100
+ Width?: number;
101
+ Thickness?: number;
102
+ Height?: number;
103
+ Open?: boolean;
104
+ RoadEdges?: number[];
105
+ Polygon?: Polygon;
106
+ Orientation?: number[];
107
+ RotationY?: number;
108
+ Elevation?: number;
109
+ OutDoor?: boolean;
110
+ }
111
+ export interface RoadName {
112
+ ID?: string;
113
+ Name?: string;
114
+ }
115
+ export interface RoadNode {
116
+ ID: string;
117
+ Point: number[];
118
+ }
119
+ export interface RoadLane {
120
+ Width?: number;
121
+ }
122
+ export interface RoadEdge {
123
+ ID: string;
124
+ Name: number;
125
+ Nodes: number[];
126
+ UpLanes?: RoadLane[];
127
+ DownLanes?: RoadLane[];
128
+ Length?: number;
129
+ }
130
+ export interface Roads {
131
+ Names?: RoadName[];
132
+ Nodes?: RoadNode[];
133
+ Edges?: RoadEdge[];
134
+ }
77
135
  export interface SemanticObject {
78
136
  Buildings?: Building[];
79
137
  Doors?: Door[];
@@ -83,5 +141,11 @@ export interface SemanticObject {
83
141
  Walls?: Wall[];
84
142
  Windows?: Window[];
85
143
  Columns?: Column[];
144
+ Site?: Site;
145
+ Zones?: Zone[];
146
+ WaterSources?: WaterSource[];
147
+ Entrances?: Entrance[];
148
+ Roads?: Roads;
86
149
  Asset?: Asset;
150
+ asset?: Asset;
87
151
  }
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,8 @@
1
+ import { default as SoonSpace, BaseObject3D } from 'soonspacejs';
2
+ import { Object3D } from 'three';
3
+ import { IRoadsData, ITreeData } from './types';
4
+ export type SiteRoadRenderResult = {
5
+ objects: BaseObject3D[];
6
+ };
7
+ export declare function renderSiteAndRoads(ssp: SoonSpace, treeData: ITreeData[], roadsData: IRoadsData, parent: Object3D | null, resolveObjectId: (node: ITreeData) => string): SiteRoadRenderResult;
8
+ export declare function disposeSiteAndRoads(ssp: SoonSpace, result: SiteRoadRenderResult | null): void;
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;
@@ -42,7 +53,7 @@ export interface ITreeData {
42
53
  pid: string | null;
43
54
  sid: string;
44
55
  name: string;
45
- renderType: 'GROUP' | '3D' | 'STUB' | 'POLYGON' | 'CIRCLE' | 'WATER_SURFACE' | 'DECAL' | 'AREA' | 'FLOOR' | 'ROOM' | 'DOOR' | 'OUTSIDE' | 'BUILDING' | 'STAIRCASE' | 'ELEVATOR' | 'VENT' | 'WINDOW' | 'GS';
56
+ renderType: 'GROUP' | '3D' | 'STUB' | 'POLYGON' | 'CIRCLE' | 'WATER_SURFACE' | 'DECAL' | 'AREA' | 'FLOOR' | 'ROOM' | 'DOOR' | 'OUTSIDE' | 'BUILDING' | 'STAIRCASE' | 'ELEVATOR' | 'VENT' | 'WINDOW' | 'ZONE' | 'WATER_SOURCE' | 'ENTRANCE' | 'ROAD' | 'GS';
46
57
  deviceCode: string | null;
47
58
  matrix: number[];
48
59
  familyId: string | null;
@@ -63,6 +74,34 @@ export interface IInnerTreeData extends ITreeData {
63
74
  path: string | null;
64
75
  children: IInnerTreeData[];
65
76
  }
77
+ export interface IRoadLane {
78
+ width?: number;
79
+ }
80
+ export interface IRoadNode {
81
+ id: string;
82
+ sid: string;
83
+ roadId: string;
84
+ name?: string;
85
+ x: number;
86
+ y: number;
87
+ z: number;
88
+ order?: number;
89
+ }
90
+ export interface IRoadEdge {
91
+ id: string;
92
+ sid: string;
93
+ roadId: string;
94
+ name?: string;
95
+ startNodeId: string;
96
+ endNodeId: string;
97
+ upLanes?: IRoadLane[];
98
+ downLanes?: IRoadLane[];
99
+ length?: number;
100
+ }
101
+ export interface IRoadsData {
102
+ nodes: IRoadNode[];
103
+ edges: IRoadEdge[];
104
+ }
66
105
  export type IFlatData = Pick<ITreeData, 'id' | 'pid' | 'sid' | 'name' | 'renderType' | 'deviceCode' | 'familyId'>;
67
106
  export declare enum PoiContentTypeEnum {
68
107
  PANEL = "PANEL",
@@ -78,6 +117,31 @@ export interface IProgressEventMap {
78
117
  progress: IProgress;
79
118
  };
80
119
  }
120
+ 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';
121
+ export interface ISemanticWorkerStageEvent {
122
+ stage: SemanticWorkerStage;
123
+ status?: 'success' | 'failed' | 'cancelled';
124
+ [key: string]: unknown;
125
+ }
126
+ export interface ILoadSceneAndSemanticInWorkerOptions {
127
+ signal?: AbortSignal;
128
+ shouldContinue?: () => boolean;
129
+ workerFactory?: () => Worker;
130
+ semanticConfig?: ISemanticWorkerConfig;
131
+ freezeSceneWorldMatrix?: boolean;
132
+ onStage?: (event: ISemanticWorkerStageEvent) => void;
133
+ }
134
+ export interface ILoadSceneAndSemanticInWorkerResult {
135
+ semanticData: SemanticObject;
136
+ stats: ISemanticWorkerStats;
137
+ render: {
138
+ [key: string]: unknown;
139
+ renderMode: 'atomic-replacement';
140
+ progressive: false;
141
+ hierarchyMode: 'direct-story-child';
142
+ exteriorFirst: boolean;
143
+ };
144
+ }
81
145
  export interface PoiMedia {
82
146
  assetId?: string | null;
83
147
  url?: string;
@@ -446,8 +510,12 @@ export interface IGisPlotProperties {
446
510
  fillColor: string;
447
511
  fillOpacity: number;
448
512
  strokeStyle: string;
449
- pointStyle: 'circle' | 'square';
513
+ pointStyle: 'circle' | 'square' | 'image';
450
514
  size: number;
515
+ ontologyId?: string;
516
+ imageUrl?: string;
517
+ imageWidth?: number;
518
+ imageHeight?: number;
451
519
  startArrowStyle: string | null;
452
520
  endArrowStyle: string | null;
453
521
  radius: number;
package/dist/utils.d.ts CHANGED
@@ -1,4 +1,5 @@
1
- import { default as SoonSpace, BaseObject3D } from 'soonspacejs';
1
+ import { default as SoonSpace, BaseObject3D, Canvas3D, PlaneIVector2 } from 'soonspacejs';
2
+ import { Object3D } from 'three';
2
3
  import { TAnimationFrame } from 'umanager-animation-parser';
3
4
  import { BaseTreeNode, IKeyframe, ITreeData } from './types';
4
5
  import { default as CpsSoonmanagerPlugin } from '.';
@@ -10,9 +11,9 @@ import { default as CpsSoonmanagerPlugin } from '.';
10
11
  export declare function decodeString(encodedStr: string): string;
11
12
  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
13
  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;
14
+ export declare function createSpace(ssp: SoonSpace, node: ITreeData, objectId: string, transparentSemanticPolygons?: boolean): Canvas3D;
15
+ export declare function createDoor(ssp: SoonSpace, node: ITreeData, objectId: string, transparentSemanticPolygons?: boolean): Canvas3D;
16
+ export declare function createWindow(ssp: SoonSpace, node: ITreeData, objectId: string, transparentSemanticPolygons?: boolean): Canvas3D;
16
17
  /**
17
18
  * 创建楼梯
18
19
  * @param ssp
@@ -20,7 +21,7 @@ export declare function createWindow(ssp: SoonSpace, node: ITreeData, objectId:
20
21
  * @param objectId
21
22
  * @returns
22
23
  */
23
- export declare function createStaircase(ssp: SoonSpace, node: ITreeData, objectId: string): import('soonspacejs').Canvas3D;
24
+ export declare function createStaircase(ssp: SoonSpace, node: ITreeData, objectId: string, transparentSemanticPolygons?: boolean): Canvas3D;
24
25
  /**
25
26
  * 创建电梯
26
27
  * @param ssp
@@ -28,8 +29,12 @@ export declare function createStaircase(ssp: SoonSpace, node: ITreeData, objectI
28
29
  * @param objectId
29
30
  * @returns
30
31
  */
31
- export declare function createElevator(ssp: SoonSpace, node: ITreeData, objectId: string): import('soonspacejs').Canvas3D;
32
+ export declare function createElevator(ssp: SoonSpace, node: ITreeData, objectId: string, transparentSemanticPolygons?: boolean): Canvas3D;
32
33
  export declare function createWaterSurface(cpsPlugin: CpsSoonmanagerPlugin, node: ITreeData, objectId: string): import('soonspacejs').PluginObject | null;
33
34
  export declare function createDecal(ssp: SoonSpace, node: ITreeData, objectId: string, path: string | null): Promise<import('soonspacejs').Decal | null>;
34
35
  export declare function createGs3d(ssp: SoonSpace, node: ITreeData, path: string | null): Promise<BaseObject3D>;
35
36
  export declare function transformKeyframes(keyframes: IKeyframe[]): TAnimationFrame[];
37
+ export declare function addPolygonOutline(parent: Object3D, name: string, points: PlaneIVector2[], yHeight: number, color: string, lineWidth: number): void;
38
+ export declare function createZone(ssp: SoonSpace, node: ITreeData, objectId: string): Canvas3D;
39
+ export declare function createWaterSource(ssp: SoonSpace, node: ITreeData, objectId: string): Canvas3D;
40
+ export declare function createEntrance(ssp: SoonSpace, node: ITreeData, objectId: string): Canvas3D;
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.14",
4
+ "version": "2.15.16",
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.14",
41
- "@soonspacejs/plugin-effect": "2.15.14",
42
- "@soonspacejs/plugin-flow": "2.15.14",
43
- "@soonspacejs/plugin-gs3d-loader": "2.15.14",
44
- "@soonspacejs/plugin-poi-renderer": "2.15.14",
45
- "@soonspacejs/plugin-tiles": "2.15.14",
46
- "soonspacejs": "2.15.14",
40
+ "@soonspacejs/plugin-atmosphere": "2.15.16",
41
+ "@soonspacejs/plugin-effect": "2.15.16",
42
+ "@soonspacejs/plugin-flow": "2.15.16",
43
+ "@soonspacejs/plugin-gs3d-loader": "2.15.16",
44
+ "@soonspacejs/plugin-poi-renderer": "2.15.16",
45
+ "@soonspacejs/plugin-tiles": "2.15.16",
46
+ "soonspacejs": "2.15.16",
47
47
  "umanager-animation-parser": "^0.0.6",
48
- "@soonspacejs/plugin-fds": "2.15.14"
48
+ "@soonspacejs/plugin-fds": "2.15.16"
49
49
  }
50
50
  }