@wovvmap/renderer-three 0.0.0-stage → 1.2.0

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.
Files changed (116) hide show
  1. package/dist/controllers/ImageController.d.ts +95 -0
  2. package/dist/controllers/ImageController.d.ts.map +1 -0
  3. package/dist/controllers/ImageController.js +129 -0
  4. package/dist/controllers/ShapeController.d.ts +95 -0
  5. package/dist/controllers/ShapeController.d.ts.map +1 -0
  6. package/dist/controllers/ShapeController.js +139 -0
  7. package/dist/controllers/TextController.d.ts +120 -0
  8. package/dist/controllers/TextController.d.ts.map +1 -0
  9. package/dist/controllers/TextController.js +161 -0
  10. package/dist/controllers/ViewerElementsController.d.ts +254 -0
  11. package/dist/controllers/ViewerElementsController.d.ts.map +1 -0
  12. package/dist/controllers/ViewerElementsController.js +490 -0
  13. package/dist/engine/CameraFollow.d.ts +13 -0
  14. package/dist/engine/CameraFollow.d.ts.map +1 -0
  15. package/dist/engine/CameraFollow.js +52 -0
  16. package/dist/engine/CameraManager.d.ts +143 -0
  17. package/dist/engine/CameraManager.d.ts.map +1 -0
  18. package/dist/engine/CameraManager.js +566 -0
  19. package/dist/engine/ControlsManager.d.ts +123 -0
  20. package/dist/engine/ControlsManager.d.ts.map +1 -0
  21. package/dist/engine/ControlsManager.js +604 -0
  22. package/dist/engine/InteractionManager.d.ts +45 -0
  23. package/dist/engine/InteractionManager.d.ts.map +1 -0
  24. package/dist/engine/InteractionManager.js +99 -0
  25. package/dist/engine/LightingManager.d.ts +25 -0
  26. package/dist/engine/LightingManager.d.ts.map +1 -0
  27. package/dist/engine/LightingManager.js +74 -0
  28. package/dist/engine/MapViewerEngine.d.ts +350 -0
  29. package/dist/engine/MapViewerEngine.d.ts.map +1 -0
  30. package/dist/engine/MapViewerEngine.js +1041 -0
  31. package/dist/engine/RendererManager.d.ts +77 -0
  32. package/dist/engine/RendererManager.d.ts.map +1 -0
  33. package/dist/engine/RendererManager.js +243 -0
  34. package/dist/index.d.ts +40 -0
  35. package/dist/index.d.ts.map +1 -0
  36. package/dist/index.js +39 -0
  37. package/dist/services/image-services/ImageCacheService.d.ts +49 -0
  38. package/dist/services/image-services/ImageCacheService.d.ts.map +1 -0
  39. package/dist/services/image-services/ImageCacheService.js +121 -0
  40. package/dist/services/image-services/ImagePlaneService.d.ts +29 -0
  41. package/dist/services/image-services/ImagePlaneService.d.ts.map +1 -0
  42. package/dist/services/image-services/ImagePlaneService.js +82 -0
  43. package/dist/services/image-services/ImageService.d.ts +170 -0
  44. package/dist/services/image-services/ImageService.d.ts.map +1 -0
  45. package/dist/services/image-services/ImageService.js +537 -0
  46. package/dist/services/image-services/ImageSpriteService.d.ts +39 -0
  47. package/dist/services/image-services/ImageSpriteService.d.ts.map +1 -0
  48. package/dist/services/image-services/ImageSpriteService.js +135 -0
  49. package/dist/services/routes/RouteArrows.d.ts +34 -0
  50. package/dist/services/routes/RouteArrows.d.ts.map +1 -0
  51. package/dist/services/routes/RouteArrows.js +157 -0
  52. package/dist/services/routes/RouteCursor.d.ts +19 -0
  53. package/dist/services/routes/RouteCursor.d.ts.map +1 -0
  54. package/dist/services/routes/RouteCursor.js +68 -0
  55. package/dist/services/routes/RouteMotion.d.ts +31 -0
  56. package/dist/services/routes/RouteMotion.d.ts.map +1 -0
  57. package/dist/services/routes/RouteMotion.js +132 -0
  58. package/dist/services/routes/RouteRenderer.d.ts +52 -0
  59. package/dist/services/routes/RouteRenderer.d.ts.map +1 -0
  60. package/dist/services/routes/RouteRenderer.js +445 -0
  61. package/dist/services/routes/RouteStepHighlight.d.ts +22 -0
  62. package/dist/services/routes/RouteStepHighlight.d.ts.map +1 -0
  63. package/dist/services/routes/RouteStepHighlight.js +84 -0
  64. package/dist/services/routes/routeMarkers.d.ts +6 -0
  65. package/dist/services/routes/routeMarkers.d.ts.map +1 -0
  66. package/dist/services/routes/routeMarkers.js +41 -0
  67. package/dist/services/selectionPaint.d.ts +12 -0
  68. package/dist/services/selectionPaint.d.ts.map +1 -0
  69. package/dist/services/selectionPaint.js +8 -0
  70. package/dist/services/shape-services/ExtrudeShapeService.d.ts +54 -0
  71. package/dist/services/shape-services/ExtrudeShapeService.d.ts.map +1 -0
  72. package/dist/services/shape-services/ExtrudeShapeService.js +204 -0
  73. package/dist/services/shape-services/FlatShapeService.d.ts +25 -0
  74. package/dist/services/shape-services/FlatShapeService.d.ts.map +1 -0
  75. package/dist/services/shape-services/FlatShapeService.js +49 -0
  76. package/dist/services/shape-services/IShapeService.d.ts +24 -0
  77. package/dist/services/shape-services/IShapeService.d.ts.map +1 -0
  78. package/dist/services/shape-services/IShapeService.js +6 -0
  79. package/dist/services/shape-services/MaterialUtils.d.ts +15 -0
  80. package/dist/services/shape-services/MaterialUtils.d.ts.map +1 -0
  81. package/dist/services/shape-services/MaterialUtils.js +71 -0
  82. package/dist/services/shape-services/ShapeFactory.d.ts +20 -0
  83. package/dist/services/shape-services/ShapeFactory.d.ts.map +1 -0
  84. package/dist/services/shape-services/ShapeFactory.js +28 -0
  85. package/dist/services/shape-services/ShapeHighlightService.d.ts +13 -0
  86. package/dist/services/shape-services/ShapeHighlightService.d.ts.map +1 -0
  87. package/dist/services/shape-services/ShapeHighlightService.js +57 -0
  88. package/dist/services/shape-services/ShapeService.d.ts +129 -0
  89. package/dist/services/shape-services/ShapeService.d.ts.map +1 -0
  90. package/dist/services/shape-services/ShapeService.js +480 -0
  91. package/dist/services/shape-services/preparedGeometry.d.ts +13 -0
  92. package/dist/services/shape-services/preparedGeometry.d.ts.map +1 -0
  93. package/dist/services/shape-services/preparedGeometry.js +37 -0
  94. package/dist/services/text-services/ITextRenderStrategy.d.ts +79 -0
  95. package/dist/services/text-services/ITextRenderStrategy.d.ts.map +1 -0
  96. package/dist/services/text-services/ITextRenderStrategy.js +7 -0
  97. package/dist/services/text-services/Text2DService.d.ts +66 -0
  98. package/dist/services/text-services/Text2DService.d.ts.map +1 -0
  99. package/dist/services/text-services/Text2DService.js +483 -0
  100. package/dist/services/text-services/Text3DService.d.ts +51 -0
  101. package/dist/services/text-services/Text3DService.d.ts.map +1 -0
  102. package/dist/services/text-services/Text3DService.js +246 -0
  103. package/dist/services/text-services/TextCollisionService.d.ts +29 -0
  104. package/dist/services/text-services/TextCollisionService.d.ts.map +1 -0
  105. package/dist/services/text-services/TextCollisionService.js +117 -0
  106. package/dist/services/text-services/TextService.d.ts +159 -0
  107. package/dist/services/text-services/TextService.d.ts.map +1 -0
  108. package/dist/services/text-services/TextService.js +398 -0
  109. package/dist/services/text-services/TextStrategyRegistry.d.ts +36 -0
  110. package/dist/services/text-services/TextStrategyRegistry.d.ts.map +1 -0
  111. package/dist/services/text-services/TextStrategyRegistry.js +44 -0
  112. package/dist/services/threeDisposeHelper.d.ts +12 -0
  113. package/dist/services/threeDisposeHelper.d.ts.map +1 -0
  114. package/dist/services/threeDisposeHelper.js +57 -0
  115. package/package.json +40 -3
  116. package/README.md +0 -3
@@ -0,0 +1,95 @@
1
+ import type { SelectionPaintMap } from '../services/selectionPaint.js'; /**
2
+ * @file ImageController.ts
3
+ * @description High-level controller facade for 2D plane logos and 3D transit sprites.
4
+ * Logo planes aur transit sprites ko control karne wala facade controller.
5
+ */
6
+ import type * as THREE from 'three';
7
+ import type { NodePoint, DynamicDepthConfig, MapViewMode } from '@wovvmap/contracts';
8
+ import { ImageService, type ImageCreateOptions } from '../services/image-services/ImageService.js';
9
+ /**
10
+ * Controller facade managing Three.js brand logos and transit icon sprites across floors.
11
+ * Maintains symmetric method signatures with ShapeController and TextController.
12
+ *
13
+ * Three.js brand logos aur icon sprites ko manage karne wala controller facade.
14
+ */
15
+ export declare class ImageController {
16
+ private readonly imageService;
17
+ constructor(imageService?: ImageService);
18
+ /**
19
+ * Constructs an image plane or transit icon sprite for a node point.
20
+ * Node point ke liye image mesh ya sprite create karein.
21
+ */
22
+ createImage(node: NodePoint, options?: ImageCreateOptions): THREE.Object3D | null;
23
+ /**
24
+ * Retrieves floor-level container group for images.
25
+ * Floor level ke sabhi images ka container group prapt karein.
26
+ */
27
+ getFloorImages(z: number): THREE.Group | undefined;
28
+ /**
29
+ * Convenience alias matching getFloorWiseShapes convention.
30
+ * getFloorImages ka alias method.
31
+ */
32
+ getFloorWiseImages(z: number): THREE.Group | undefined;
33
+ /**
34
+ * Returns all image objects across all floors.
35
+ * Sabhi active image objects ki array prapt karein.
36
+ */
37
+ getAllImages(): THREE.Object3D[];
38
+ /**
39
+ * Looks up an image object by node key.
40
+ * Unique key se specific image object dhoondein.
41
+ */
42
+ getImageByKey(key: string): THREE.Object3D | undefined;
43
+ /** Delegate selected badge paint; the image service keeps texture and visibility ownership.
44
+ * Hinglish: Badge ka highlight image service lagaye; texture/visibility ka flow wahi rahe. */
45
+ setSelectionKeys(keys: readonly string[], color: string): void;
46
+ /** Delegate resolved renderer paint to its existing feature owner.
47
+ * Hinglish: Resolved paint existing image service lagaye; role logic repeat nahi. */
48
+ setSelectionPaint(paint: SelectionPaintMap): void;
49
+ /**
50
+ * Removes an image and safely releases WebGL memory.
51
+ * Image ko remove karke WebGL memory dispose karein.
52
+ */
53
+ removeImage(key: string): boolean;
54
+ /**
55
+ * Sets floor height scale across view modes (2D, 3D, or future custom modes).
56
+ * Mode ke aadhar par floor images ki vertical height set karein.
57
+ */
58
+ setFloorScale(z: number, mode?: MapViewMode, depthConfig?: Partial<DynamicDepthConfig>, animate?: boolean, onUpdate?: () => void, durationMs?: number, onComplete?: () => void): void;
59
+ /**
60
+ * Updates theme tint color on all active transit/amenity icon badges.
61
+ * Sabhi icon sprites ke badge ka theme color update karein.
62
+ */
63
+ updateAllThemes(tintColor?: string): void;
64
+ /**
65
+ * Updates theme tint color on active transit/amenity sprite badges (single color or per-type map).
66
+ * Sabhi icon sprites ke background badge ka color update karein (global ya per-type).
67
+ */
68
+ /**
69
+ * Sets base theme sprite background colors.
70
+ * English: Configures base theme sprite default and per-type background colors.
71
+ * Hinglish: Base theme ke default aur per-type sprite colors ko configure karein.
72
+ */
73
+ setThemeSpriteColors(defaultColor?: string, perTypeColors?: Record<string, string>): void;
74
+ updateSpriteThemes(colorOrMap?: string | Record<string, string>): void;
75
+ /**
76
+ * Toggles visibility of images and sprites with optional fine-grained filtering.
77
+ * Images aur sprites ki visibility aur filters ko toggle karein.
78
+ */
79
+ toggleImages(visible: boolean, filter?: {
80
+ showSprites?: boolean;
81
+ showLogos?: boolean;
82
+ filterTypes?: string[];
83
+ }): void;
84
+ /**
85
+ * Flips planar roof logos horizontally when camera rotation is inverted to keep text readable.
86
+ * Camera rotation ke according store logos ko flip karein.
87
+ */
88
+ updateImageRotation(rotation: number, activeFloor?: number): void;
89
+ /**
90
+ * Cleans and disposes all images, groups, and WebGL resources.
91
+ * Sabhi images aur memory resources clear karein.
92
+ */
93
+ clear(): void;
94
+ }
95
+ //# sourceMappingURL=ImageController.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ImageController.d.ts","sourceRoot":"","sources":["../../src/controllers/ImageController.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAA,CAAC;;;;GAIjE;AACH,OAAO,KAAK,KAAK,KAAK,MAAM,OAAO,CAAA;AACnC,OAAO,KAAK,EAAE,SAAS,EAAE,kBAAkB,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAA;AACpF,OAAO,EAAE,YAAY,EAAE,KAAK,kBAAkB,EAAE,MAAM,yCAAyC,CAAA;AAE/F;;;;;GAKG;AACH,qBAAa,eAAe;IAC1B,OAAO,CAAC,QAAQ,CAAC,YAAY,CAAc;gBAE/B,YAAY,CAAC,EAAE,YAAY;IAIvC;;;OAGG;IACI,WAAW,CAAC,IAAI,EAAE,SAAS,EAAE,OAAO,CAAC,EAAE,kBAAkB,GAAG,KAAK,CAAC,QAAQ,GAAG,IAAI;IAIxF;;;OAGG;IACI,cAAc,CAAC,CAAC,EAAE,MAAM,GAAG,KAAK,CAAC,KAAK,GAAG,SAAS;IAIzD;;;OAGG;IACI,kBAAkB,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G;IACI,mBAAmB,CAAC,QAAQ,EAAE,MAAM,EAAE,WAAW,CAAC,EAAE,MAAM,GAAG,IAAI;IAIxE;;;OAGG;IACI,KAAK,IAAI,IAAI;CAGrB"}
@@ -0,0 +1,129 @@
1
+ import { ImageService } from '../services/image-services/ImageService.js';
2
+ /**
3
+ * Controller facade managing Three.js brand logos and transit icon sprites across floors.
4
+ * Maintains symmetric method signatures with ShapeController and TextController.
5
+ *
6
+ * Three.js brand logos aur icon sprites ko manage karne wala controller facade.
7
+ */
8
+ export class ImageController {
9
+ imageService;
10
+ constructor(imageService) {
11
+ this.imageService = imageService || new ImageService();
12
+ }
13
+ /**
14
+ * Constructs an image plane or transit icon sprite for a node point.
15
+ * Node point ke liye image mesh ya sprite create karein.
16
+ */
17
+ createImage(node, options) {
18
+ return this.imageService.createImage(node, options);
19
+ }
20
+ /**
21
+ * Retrieves floor-level container group for images.
22
+ * Floor level ke sabhi images ka container group prapt karein.
23
+ */
24
+ getFloorImages(z) {
25
+ return this.imageService.getFloorImages(z);
26
+ }
27
+ /**
28
+ * Convenience alias matching getFloorWiseShapes convention.
29
+ * getFloorImages ka alias method.
30
+ */
31
+ getFloorWiseImages(z) {
32
+ return this.imageService.getFloorWiseImages(z);
33
+ }
34
+ /**
35
+ * Returns all image objects across all floors.
36
+ * Sabhi active image objects ki array prapt karein.
37
+ */
38
+ getAllImages() {
39
+ return this.imageService.getAllImages();
40
+ }
41
+ /**
42
+ * Looks up an image object by node key.
43
+ * Unique key se specific image object dhoondein.
44
+ */
45
+ getImageByKey(key) {
46
+ return this.imageService.getImageByKey(key);
47
+ }
48
+ /** Delegate selected badge paint; the image service keeps texture and visibility ownership.
49
+ * Hinglish: Badge ka highlight image service lagaye; texture/visibility ka flow wahi rahe. */
50
+ setSelectionKeys(keys, color) {
51
+ this.imageService.setSelectionKeys(keys, color);
52
+ }
53
+ /** Delegate resolved renderer paint to its existing feature owner.
54
+ * Hinglish: Resolved paint existing image service lagaye; role logic repeat nahi. */
55
+ setSelectionPaint(paint) {
56
+ this.imageService.setSelectionPaint(paint);
57
+ }
58
+ /**
59
+ * Removes an image and safely releases WebGL memory.
60
+ * Image ko remove karke WebGL memory dispose karein.
61
+ */
62
+ removeImage(key) {
63
+ return this.imageService.removeImage(key);
64
+ }
65
+ /**
66
+ * Sets floor height scale across view modes (2D, 3D, or future custom modes).
67
+ * Mode ke aadhar par floor images ki vertical height set karein.
68
+ */
69
+ setFloorScale(z, mode = '3D', depthConfig, animate = false, onUpdate, durationMs = 400, onComplete) {
70
+ const group = this.getFloorImages(z);
71
+ if (group) {
72
+ if (animate) {
73
+ this.imageService.animateViewModeToGroup(group, mode, depthConfig, onUpdate, durationMs, onComplete);
74
+ }
75
+ else {
76
+ this.imageService.applyViewModeToGroup(group, mode, depthConfig);
77
+ if (onComplete)
78
+ onComplete();
79
+ }
80
+ }
81
+ else {
82
+ if (onComplete)
83
+ onComplete();
84
+ }
85
+ }
86
+ /**
87
+ * Updates theme tint color on all active transit/amenity icon badges.
88
+ * Sabhi icon sprites ke badge ka theme color update karein.
89
+ */
90
+ updateAllThemes(tintColor) {
91
+ this.imageService.updateAllThemes(tintColor);
92
+ }
93
+ /**
94
+ * Updates theme tint color on active transit/amenity sprite badges (single color or per-type map).
95
+ * Sabhi icon sprites ke background badge ka color update karein (global ya per-type).
96
+ */
97
+ /**
98
+ * Sets base theme sprite background colors.
99
+ * English: Configures base theme sprite default and per-type background colors.
100
+ * Hinglish: Base theme ke default aur per-type sprite colors ko configure karein.
101
+ */
102
+ setThemeSpriteColors(defaultColor, perTypeColors) {
103
+ this.imageService.setThemeSpriteColors(defaultColor, perTypeColors);
104
+ }
105
+ updateSpriteThemes(colorOrMap) {
106
+ this.imageService.updateSpriteThemes(colorOrMap);
107
+ }
108
+ /**
109
+ * Toggles visibility of images and sprites with optional fine-grained filtering.
110
+ * Images aur sprites ki visibility aur filters ko toggle karein.
111
+ */
112
+ toggleImages(visible, filter) {
113
+ this.imageService.toggleImages(visible, filter);
114
+ }
115
+ /**
116
+ * Flips planar roof logos horizontally when camera rotation is inverted to keep text readable.
117
+ * Camera rotation ke according store logos ko flip karein.
118
+ */
119
+ updateImageRotation(rotation, activeFloor) {
120
+ this.imageService.updateImageRotation(rotation, activeFloor);
121
+ }
122
+ /**
123
+ * Cleans and disposes all images, groups, and WebGL resources.
124
+ * Sabhi images aur memory resources clear karein.
125
+ */
126
+ clear() {
127
+ this.imageService.clear();
128
+ }
129
+ }
@@ -0,0 +1,95 @@
1
+ import type { SelectionPaintMap } from '../services/selectionPaint.js'; /**
2
+ * @file ShapeController.ts
3
+ * @description High-level controller facade for shape rendering lifecycle.
4
+ * Shape creation, theme update aur floor-wise shape access ke liye main controller.
5
+ */
6
+ import type * as THREE from 'three';
7
+ import type { shapeDetail } from '@wovvmap/contracts';
8
+ import { ShapeService } from '../services/shape-services/ShapeService.js';
9
+ import type { ShapeType } from '../services/shape-services/ShapeFactory.js';
10
+ /**
11
+ * Controller facade managing Three.js unit shapes across floors.
12
+ * Matches architecture and method signatures with ImageController and TextController.
13
+ *
14
+ * Three.js unit shapes ko manage karne wala controller facade.
15
+ */
16
+ export declare class ShapeController {
17
+ private readonly shapeService;
18
+ constructor(shapeService?: ShapeService);
19
+ /**
20
+ * Constructs a 3D unit shape or 2D floor footprint.
21
+ * Shape detail se Three.js shape mesh create karein.
22
+ */
23
+ createShape(shapeDetail: shapeDetail, id: string, type?: ShapeType): THREE.Object3D;
24
+ /**
25
+ * Handles safe creation from raw node data, verifying shape coordinates exist.
26
+ * Valid coordinates hone par shape create karein.
27
+ */
28
+ handleShapeCreation(shapeDetail: Partial<shapeDetail> | null | undefined, id: string, type?: ShapeType): THREE.Object3D | null;
29
+ /**
30
+ * Returns all shape objects generated across all floors.
31
+ * Sabhi shapes ki list return karein.
32
+ */
33
+ getAllShapes(): THREE.Object3D[];
34
+ /**
35
+ * Retrieves container group for shapes on a specific floor level.
36
+ * Kisi specific floor ke sabhi shapes ka container group prapt karein.
37
+ */
38
+ getFloorWiseShapes(z: number): THREE.Group | undefined;
39
+ /**
40
+ * Convenience alias matching getFloorImages / getFloorTexts controller convention.
41
+ * Image/Text controller naming symmetry ke liye getFloorWiseShapes ka alias.
42
+ */
43
+ getFloorShapes(z: number): THREE.Group | undefined;
44
+ /**
45
+ * Looks up a specific 3D shape mesh via its unique key (e.g. "x,y,z").
46
+ * Unique key se specific store shape dhoondein.
47
+ */
48
+ getShapeByKey(key: string): THREE.Object3D | undefined;
49
+ /** Projects one selected key onto shape materials without changing the stored base style.
50
+ * Hinglish: Selected key ka paint lagayein; shape ka asli style alag safe rahe. */
51
+ setSelection(key: string | null, color: string): void;
52
+ /** Project canonical selected members through the same keyed material owner as single selection.
53
+ * Hinglish: Group ki asli keys bhi single selection wale same material owner se paint hon. */
54
+ setSelectionKeys(keys: readonly string[], color: string): void;
55
+ /** Delegate resolved renderer paint to its existing feature owner.
56
+ * Hinglish: Resolved paint existing shape service lagaye; role logic repeat nahi. */
57
+ setSelectionPaint(paint: SelectionPaintMap): void;
58
+ /**
59
+ * Removes a specific shape and cleans its WebGL memory.
60
+ * Shape ko delete aur memory free karein.
61
+ */
62
+ removeShape(id: string): boolean;
63
+ /**
64
+ * Updates visual material and theme colors of an existing shape.
65
+ * Shape mesh ka material aur theme update karein.
66
+ */
67
+ updateTheme(mesh: THREE.Object3D, shapeDetail: shapeDetail, type?: ShapeType): void;
68
+ /**
69
+ * Sets floor height scale between 2D planar mode and 3D extruded mode.
70
+ * 2D aur 3D view modes ke bich floor height set karein.
71
+ */
72
+ setFloorScale(z: number, mode: '2D' | '3D', depth2D?: number, depth3D?: number, floorBaseDepth?: number, animate?: boolean, onUpdate?: () => void, durationMs?: number, onComplete?: () => void): void;
73
+ /**
74
+ * Cleans and disposes all shapes, groups, and WebGL resources.
75
+ * Sabhi shapes aur memory resources clear karein.
76
+ */
77
+ /**
78
+ * Updates vertical gradient palette across all anchor store meshes.
79
+ * Sabhi anchor store meshes ka gradient update karein.
80
+ */
81
+ updateAnchorGradient(gradient?: [string, string]): void;
82
+ /**
83
+ * Toggles visibility of all floor shapes.
84
+ * Sabhi floor shapes ki visibility toggle karein.
85
+ */
86
+ toggleShapes(visible: boolean): void;
87
+ /**
88
+ * Updates edge line colors on all active unit shapes.
89
+ * Sabhi unit shapes ki boundary edge lines ka color update karein.
90
+ */
91
+ updateShapeColors(colorsMap?: Record<string, string>): void;
92
+ updateEdgeColor(color?: string): void;
93
+ clear(): void;
94
+ }
95
+ //# sourceMappingURL=ShapeController.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ShapeController.d.ts","sourceRoot":"","sources":["../../src/controllers/ShapeController.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAA,CAAC;;;;GAIjE;AACH,OAAO,KAAK,KAAK,KAAK,MAAM,OAAO,CAAA;AACnC,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAA;AACrD,OAAO,EAAE,YAAY,EAAE,MAAM,yCAAyC,CAAA;AACtE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAA;AAExE;;;;;GAKG;AACH,qBAAa,eAAe;IAC1B,OAAO,CAAC,QAAQ,CAAC,YAAY,CAAc;gBAE/B,YAAY,CAAC,EAAE,YAAY;IAIvC;;;OAGG;IACI,WAAW,CAChB,WAAW,EAAE,WAAW,EACxB,EAAE,EAAE,MAAM,EACV,IAAI,GAAE,SAAsB,GAC3B,KAAK,CAAC,QAAQ;IAIjB;;;OAGG;IACI,mBAAmB,CACxB,WAAW,EAAE,OAAO,CAAC,WAAW,CAAC,GAAG,IAAI,GAAG,SAAS,EACpD,EAAE,EAAE,MAAM,EACV,IAAI,GAAE,SAAsB,GAC3B,KAAK,CAAC,QAAQ,GAAG,IAAI;IAOxB;;;OAGG;IACI,YAAY,IAAI,KAAK,CAAC,QAAQ,EAAE;IAIvC;;;OAGG;IACI,kBAAkB,CAAC,CAAC,EAAE,MAA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AG,IAAI;IAI3D,eAAe,CAAC,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI;IAIrC,KAAK,IAAI,IAAI;CAGrB"}
@@ -0,0 +1,139 @@
1
+ import { ShapeService } from '../services/shape-services/ShapeService.js';
2
+ /**
3
+ * Controller facade managing Three.js unit shapes across floors.
4
+ * Matches architecture and method signatures with ImageController and TextController.
5
+ *
6
+ * Three.js unit shapes ko manage karne wala controller facade.
7
+ */
8
+ export class ShapeController {
9
+ shapeService;
10
+ constructor(shapeService) {
11
+ this.shapeService = shapeService || new ShapeService();
12
+ }
13
+ /**
14
+ * Constructs a 3D unit shape or 2D floor footprint.
15
+ * Shape detail se Three.js shape mesh create karein.
16
+ */
17
+ createShape(shapeDetail, id, type = 'extruded') {
18
+ return this.shapeService.createShape(type, shapeDetail, id);
19
+ }
20
+ /**
21
+ * Handles safe creation from raw node data, verifying shape coordinates exist.
22
+ * Valid coordinates hone par shape create karein.
23
+ */
24
+ handleShapeCreation(shapeDetail, id, type = 'extruded') {
25
+ if (!shapeDetail?.prepared) {
26
+ return null;
27
+ }
28
+ return this.createShape(shapeDetail, id, shapeDetail.prepared.type ?? type);
29
+ }
30
+ /**
31
+ * Returns all shape objects generated across all floors.
32
+ * Sabhi shapes ki list return karein.
33
+ */
34
+ getAllShapes() {
35
+ return this.shapeService.getAllShapes();
36
+ }
37
+ /**
38
+ * Retrieves container group for shapes on a specific floor level.
39
+ * Kisi specific floor ke sabhi shapes ka container group prapt karein.
40
+ */
41
+ getFloorWiseShapes(z) {
42
+ return this.shapeService.getFloorWiseShapes(z);
43
+ }
44
+ /**
45
+ * Convenience alias matching getFloorImages / getFloorTexts controller convention.
46
+ * Image/Text controller naming symmetry ke liye getFloorWiseShapes ka alias.
47
+ */
48
+ getFloorShapes(z) {
49
+ return this.shapeService.getFloorWiseShapes(z);
50
+ }
51
+ /**
52
+ * Looks up a specific 3D shape mesh via its unique key (e.g. "x,y,z").
53
+ * Unique key se specific store shape dhoondein.
54
+ */
55
+ getShapeByKey(key) {
56
+ return this.shapeService.getShapeByKey(key);
57
+ }
58
+ /** Projects one selected key onto shape materials without changing the stored base style.
59
+ * Hinglish: Selected key ka paint lagayein; shape ka asli style alag safe rahe. */
60
+ setSelection(key, color) {
61
+ this.shapeService.setSelection(key, color);
62
+ }
63
+ /** Project canonical selected members through the same keyed material owner as single selection.
64
+ * Hinglish: Group ki asli keys bhi single selection wale same material owner se paint hon. */
65
+ setSelectionKeys(keys, color) {
66
+ this.shapeService.setSelectionKeys(keys, color);
67
+ }
68
+ /** Delegate resolved renderer paint to its existing feature owner.
69
+ * Hinglish: Resolved paint existing shape service lagaye; role logic repeat nahi. */
70
+ setSelectionPaint(paint) {
71
+ this.shapeService.setSelectionPaint(paint);
72
+ }
73
+ /**
74
+ * Removes a specific shape and cleans its WebGL memory.
75
+ * Shape ko delete aur memory free karein.
76
+ */
77
+ removeShape(id) {
78
+ return this.shapeService.removeShape(id);
79
+ }
80
+ /**
81
+ * Updates visual material and theme colors of an existing shape.
82
+ * Shape mesh ka material aur theme update karein.
83
+ */
84
+ updateTheme(mesh, shapeDetail, type = 'extruded') {
85
+ this.shapeService.updateTheme(type, mesh, shapeDetail);
86
+ }
87
+ /**
88
+ * Sets floor height scale between 2D planar mode and 3D extruded mode.
89
+ * 2D aur 3D view modes ke bich floor height set karein.
90
+ */
91
+ setFloorScale(z, mode, depth2D = 0.1, depth3D = 6, floorBaseDepth, animate = false, onUpdate, durationMs = 400, onComplete) {
92
+ const group = this.getFloorWiseShapes(z);
93
+ if (group) {
94
+ if (animate) {
95
+ this.shapeService.animateViewModeToGroup(group, mode, depth2D, depth3D, floorBaseDepth, onUpdate, durationMs, onComplete);
96
+ }
97
+ else {
98
+ this.shapeService.applyViewModeToGroup(group, mode, depth2D, depth3D, floorBaseDepth);
99
+ if (onComplete)
100
+ onComplete();
101
+ }
102
+ }
103
+ else {
104
+ if (onComplete)
105
+ onComplete();
106
+ }
107
+ }
108
+ /**
109
+ * Cleans and disposes all shapes, groups, and WebGL resources.
110
+ * Sabhi shapes aur memory resources clear karein.
111
+ */
112
+ /**
113
+ * Updates vertical gradient palette across all anchor store meshes.
114
+ * Sabhi anchor store meshes ka gradient update karein.
115
+ */
116
+ updateAnchorGradient(gradient) {
117
+ this.shapeService.updateAnchorGradient(gradient);
118
+ }
119
+ /**
120
+ * Toggles visibility of all floor shapes.
121
+ * Sabhi floor shapes ki visibility toggle karein.
122
+ */
123
+ toggleShapes(visible) {
124
+ this.shapeService.toggleShapes(visible);
125
+ }
126
+ /**
127
+ * Updates edge line colors on all active unit shapes.
128
+ * Sabhi unit shapes ki boundary edge lines ka color update karein.
129
+ */
130
+ updateShapeColors(colorsMap) {
131
+ this.shapeService.updateShapeColors(colorsMap);
132
+ }
133
+ updateEdgeColor(color) {
134
+ this.shapeService.updateEdgeColor(color);
135
+ }
136
+ clear() {
137
+ this.shapeService.clear();
138
+ }
139
+ }
@@ -0,0 +1,120 @@
1
+ import type { SelectionPaintMap } from '../services/selectionPaint.js';
2
+ /**
3
+ * @file TextController.ts
4
+ * @description High-level controller facade for 2D/3D store labels, rotation sync, and collision culling.
5
+ * Store labels, camera rotation sync aur collision resolution ko control karne wala facade controller.
6
+ */
7
+ import type * as THREE from 'three';
8
+ import type { NodePoint, DynamicDepthConfig, MapViewMode } from '@wovvmap/contracts';
9
+ import type { TextType } from '../services/text-services/ITextRenderStrategy.js';
10
+ import { TextService, type TextCreateOptions } from '../services/text-services/TextService.js';
11
+ export type { TextType };
12
+ /**
13
+ * Controller facade managing Three.js text labels (2D DOM / 3D Troika mesh) and camera collision decluttering.
14
+ * Maintains symmetric method signatures with ShapeController and ImageController.
15
+ *
16
+ * Three.js 2D/3D text labels aur collision ko manage karne wala controller facade.
17
+ */
18
+ export declare class TextController {
19
+ private readonly textService;
20
+ constructor(textService?: TextService);
21
+ /**
22
+ * Sets callback to trigger redraw when asynchronous text assets or flips occur.
23
+ * Asynchronous text assets sync hone par redraw trigger karne wala callback.
24
+ */
25
+ setOnInvalidate(callback?: () => void): void;
26
+ /**
27
+ * Returns currently active text rendering type ('2D' or '3D').
28
+ * Active text type ('2D' ya '3D') prapt karein.
29
+ */
30
+ getTextType(): TextType;
31
+ /**
32
+ * Switches active text rendering type ('2D' or '3D').
33
+ * Active text type ('2D' ya '3D') set karein.
34
+ */
35
+ setTextType(type: TextType): void;
36
+ /**
37
+ * Constructs a text label for a node point.
38
+ * Node point ke liye text label create karein.
39
+ */
40
+ createText(node: NodePoint, options?: TextCreateOptions): THREE.Object3D | null;
41
+ /**
42
+ * Retrieves floor-level container group for text labels.
43
+ * Floor level ke sabhi text labels ka container group prapt karein.
44
+ */
45
+ getFloorTexts(z: number): THREE.Group | undefined;
46
+ /**
47
+ * Convenience alias matching getFloorWiseShapes / getFloorWiseImages.
48
+ * getFloorTexts ka alias method.
49
+ */
50
+ getFloorWiseTexts(z: number): THREE.Group | undefined;
51
+ /**
52
+ * Returns all text label objects across all floors.
53
+ * Sabhi active text label objects ki array prapt karein.
54
+ */
55
+ getAllTexts(): THREE.Object3D[];
56
+ /**
57
+ * Looks up a text label object by node key.
58
+ * Unique key se specific text label dhoondein.
59
+ */
60
+ getTextByKey(key: string): THREE.Object3D | undefined;
61
+ /**
62
+ * Removes a text label and safely disposes its resources.
63
+ * Text label ko remove aur clean karein.
64
+ */
65
+ removeText(key: string): boolean;
66
+ /**
67
+ * Sets floor height scale across view modes (2D, 3D, or future custom modes).
68
+ * Mode ke aadhar par floor text labels ki vertical height set karein.
69
+ */
70
+ setFloorScale(z: number, mode?: MapViewMode, depthConfig?: Partial<DynamicDepthConfig>, animate?: boolean, onUpdate?: () => void, durationMs?: number, onComplete?: () => void): void;
71
+ /**
72
+ * Updates camera-driven label collision culling and auto-decluttering.
73
+ * Camera position ke mutabik labels ko auto-declutter karein.
74
+ */
75
+ updateCollision(camera: THREE.Camera, activeFloor?: number): void;
76
+ /**
77
+ * Toggles visibility across all floor-level text label groups.
78
+ * Sabhi floor text label groups ki visibility toggle karein.
79
+ */
80
+ toggleLabels(visible: boolean): void;
81
+ /**
82
+ * Updates text colors across active 3D Troika mesh labels.
83
+ * 3D text labels ka color update karein.
84
+ */
85
+ updateTextColors(colorOrMap?: string | number | Record<string, string | number>): void;
86
+ /** Paint one selected label without rebuilding its text or changing visibility.
87
+ * Hinglish: Sirf purana/naya selected label badle; text geometry aur visibility same rahe. */
88
+ setSelection(key: string | null, colors: {
89
+ text2D: string;
90
+ text3D: string;
91
+ }): void;
92
+ /** Project canonical selected keys without changing text geometry or layer visibility.
93
+ * Hinglish: Selected keys ka rang lagayein; text geometry aur hidden layers same rahein. */
94
+ setSelectionKeys(keys: readonly string[], colors: {
95
+ text2D: string;
96
+ text3D: string;
97
+ }): void;
98
+ /** Delegate resolved renderer paint to its existing feature owner.
99
+ * Hinglish: Resolved paint existing text service lagaye; role logic repeat nahi. */
100
+ setSelectionPaint(paint: SelectionPaintMap): void;
101
+ updateTextRotation(rotation: number, activeFloor?: number): void;
102
+ /**
103
+ * Schedules or executes text collision check.
104
+ * Compatibility facade delegating directly to updateCollision.
105
+ *
106
+ * Collision resolution execute karne wala facade method jo direct updateCollision ko delegate karta hai.
107
+ */
108
+ scheduleCollision(camera: THREE.Camera | undefined, activeFloor?: number): void;
109
+ /**
110
+ * Cleans and disposes all text labels, floor groups, and DOM elements.
111
+ * Sabhi labels aur DOM elements clear karein.
112
+ */
113
+ clear(): void;
114
+ /**
115
+ * Cleans up orphaned DOM elements from the document tree.
116
+ * DOM tree se orphaned label elements remove karein.
117
+ */
118
+ cleanupTextDOM(): void;
119
+ }
120
+ //# sourceMappingURL=TextController.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TextController.d.ts","sourceRoot":"","sources":["../../src/controllers/TextController.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAA;AACnE;;;;GAIG;AAEH,OAAO,KAAK,KAAK,KAAK,MAAM,OAAO,CAAA;AACnC,OAAO,KAAK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