@operato/scene-visualizer 9.2.2 → 10.0.0-beta.10
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/carrier.d.ts +263 -0
- package/dist/carrier.js +272 -0
- package/dist/carrier.js.map +1 -0
- package/dist/desk.d.ts +238 -3
- package/dist/desk.js +1 -2
- package/dist/desk.js.map +1 -1
- package/dist/editors/index.d.ts +3 -0
- package/dist/editors/index.js +15 -0
- package/dist/editors/index.js.map +1 -1
- package/dist/editors/property-editor-gltf-fill-targets.d.ts +20 -0
- package/dist/editors/property-editor-gltf-fill-targets.js +313 -0
- package/dist/editors/property-editor-gltf-fill-targets.js.map +1 -0
- package/dist/editors/property-editor-gltf-info.d.ts +25 -3
- package/dist/editors/property-editor-gltf-info.js +333 -73
- package/dist/editors/property-editor-gltf-info.js.map +1 -1
- package/dist/editors/property-editor-gltf-play-targets.d.ts +25 -0
- package/dist/editors/property-editor-gltf-play-targets.js +388 -0
- package/dist/editors/property-editor-gltf-play-targets.js.map +1 -0
- package/dist/editors/property-editor-location-increase-pattern.js +87 -95
- package/dist/editors/property-editor-location-increase-pattern.js.map +1 -1
- package/dist/editors/property-editor-stocker-location.d.ts +13 -0
- package/dist/editors/property-editor-stocker-location.js +151 -0
- package/dist/editors/property-editor-stocker-location.js.map +1 -0
- package/dist/editors/property-editor-stocker-ports.d.ts +8 -0
- package/dist/editors/property-editor-stocker-ports.js +112 -0
- package/dist/editors/property-editor-stocker-ports.js.map +1 -0
- package/dist/effects/outline.js +1 -1
- package/dist/effects/outline.js.map +1 -1
- package/dist/index.d.ts +8 -17
- package/dist/index.js +10 -17
- package/dist/index.js.map +1 -1
- package/dist/rack-table-3d.d.ts +16 -0
- package/dist/rack-table-3d.js +95 -0
- package/dist/rack-table-3d.js.map +1 -0
- package/dist/rack-table-cell.d.ts +238 -3
- package/dist/rack-table-cell.js +44 -51
- package/dist/rack-table-cell.js.map +1 -1
- package/dist/rack-table-location.d.ts +37 -0
- package/dist/rack-table-location.js +227 -0
- package/dist/rack-table-location.js.map +1 -0
- package/dist/rack-table.d.ts +13 -29
- package/dist/rack-table.js +121 -380
- package/dist/rack-table.js.map +1 -1
- package/dist/rack.d.ts +16 -5
- package/dist/rack.js +106 -19
- package/dist/rack.js.map +1 -1
- package/dist/signal-tower.d.ts +492 -0
- package/dist/signal-tower.js +275 -0
- package/dist/signal-tower.js.map +1 -0
- package/dist/stock-hub.d.ts +25 -0
- package/dist/stock-hub.js +147 -0
- package/dist/stock-hub.js.map +1 -0
- package/dist/stock.d.ts +52 -8
- package/dist/stock.js +223 -120
- package/dist/stock.js.map +1 -1
- package/dist/stocker-3d.d.ts +23 -0
- package/dist/stocker-3d.js +352 -0
- package/dist/stocker-3d.js.map +1 -0
- package/dist/stocker-port-3d.d.ts +14 -0
- package/dist/stocker-port-3d.js +80 -0
- package/dist/stocker-port-3d.js.map +1 -0
- package/dist/stocker-port.d.ts +254 -0
- package/dist/stocker-port.js +123 -0
- package/dist/stocker-port.js.map +1 -0
- package/dist/stocker.d.ts +340 -0
- package/dist/stocker.js +370 -0
- package/dist/stocker.js.map +1 -0
- package/dist/tank.d.ts +492 -0
- package/dist/tank.js +312 -0
- package/dist/tank.js.map +1 -0
- package/dist/templates/carrier.d.ts +19 -0
- package/dist/templates/carrier.js +20 -0
- package/dist/templates/carrier.js.map +1 -0
- package/dist/templates/cube.js +1 -1
- package/dist/templates/cube.js.map +1 -1
- package/dist/templates/cylinder.js +3 -3
- package/dist/templates/cylinder.js.map +1 -1
- package/dist/templates/index.d.ts +38 -38
- package/dist/templates/index.js +15 -1
- package/dist/templates/index.js.map +1 -1
- package/dist/templates/rack-table.d.ts +2 -0
- package/dist/templates/rack-table.js +4 -2
- package/dist/templates/rack-table.js.map +1 -1
- package/dist/templates/signal-tower.d.ts +21 -0
- package/dist/templates/signal-tower.js +22 -0
- package/dist/templates/signal-tower.js.map +1 -0
- package/dist/templates/sphere.d.ts +1 -0
- package/dist/templates/sphere.js +5 -4
- package/dist/templates/sphere.js.map +1 -1
- package/dist/templates/stock-hub.d.ts +14 -0
- package/dist/templates/stock-hub.js +15 -0
- package/dist/templates/stock-hub.js.map +1 -0
- package/dist/templates/stocker-port.d.ts +17 -0
- package/dist/templates/stocker-port.js +17 -0
- package/dist/templates/stocker-port.js.map +1 -0
- package/dist/templates/stocker.d.ts +27 -0
- package/dist/templates/stocker.js +38 -0
- package/dist/templates/stocker.js.map +1 -0
- package/dist/templates/tank.d.ts +21 -0
- package/dist/templates/tank.js +22 -0
- package/dist/templates/tank.js.map +1 -0
- package/dist/templates/vehicle.d.ts +19 -0
- package/dist/templates/vehicle.js +20 -0
- package/dist/templates/vehicle.js.map +1 -0
- package/dist/templates/visualizer.js +1 -1
- package/dist/templates/visualizer.js.map +1 -1
- package/dist/vehicle.d.ts +248 -0
- package/dist/vehicle.js +133 -0
- package/dist/vehicle.js.map +1 -0
- package/dist/visualizer.d.ts +5 -5
- package/dist/visualizer.js +72 -68
- package/dist/visualizer.js.map +1 -1
- package/icons/carrier.png +0 -0
- package/icons/signal-tower.png +0 -0
- package/icons/stock-hub.png +0 -0
- package/icons/tank.png +0 -0
- package/icons/vehicle.png +0 -0
- package/package.json +16 -18
- package/translations/en.json +6 -0
- package/translations/ja.json +5 -0
- package/translations/ko.json +6 -1
- package/translations/ms.json +5 -0
- package/translations/zh.json +5 -0
- package/dist/banner.d.ts +0 -15
- package/dist/banner.js +0 -76
- package/dist/banner.js.map +0 -1
- package/dist/camera.d.ts +0 -20
- package/dist/camera.js +0 -108
- package/dist/camera.js.map +0 -1
- package/dist/cube.d.ts +0 -13
- package/dist/cube.js +0 -38
- package/dist/cube.js.map +0 -1
- package/dist/cylinder.d.ts +0 -11
- package/dist/cylinder.js +0 -38
- package/dist/cylinder.js.map +0 -1
- package/dist/ellipse.d.ts +0 -5
- package/dist/ellipse.js +0 -22
- package/dist/ellipse.js.map +0 -1
- package/dist/gltf-object.d.ts +0 -20
- package/dist/gltf-object.js +0 -104
- package/dist/gltf-object.js.map +0 -1
- package/dist/html-overlay-element.d.ts +0 -1
- package/dist/html-overlay-element.js +0 -12
- package/dist/html-overlay-element.js.map +0 -1
- package/dist/light.d.ts +0 -15
- package/dist/light.js +0 -135
- package/dist/light.js.map +0 -1
- package/dist/polygon.d.ts +0 -17
- package/dist/polygon.js +0 -64
- package/dist/polygon.js.map +0 -1
- package/dist/rect.d.ts +0 -5
- package/dist/rect.js +0 -36
- package/dist/rect.js.map +0 -1
- package/dist/scene/component.d.ts +0 -1
- package/dist/scene/component.js +0 -29
- package/dist/scene/component.js.map +0 -1
- package/dist/sphere.d.ts +0 -11
- package/dist/sphere.js +0 -38
- package/dist/sphere.js.map +0 -1
- package/dist/sprite.d.ts +0 -9
- package/dist/sprite.js +0 -28
- package/dist/sprite.js.map +0 -1
- package/dist/text.d.ts +0 -1
- package/dist/text.js +0 -9
- package/dist/text.js.map +0 -1
- package/dist/three-container-editor.d.ts +0 -22
- package/dist/three-container-editor.js +0 -132
- package/dist/three-container-editor.js.map +0 -1
- package/dist/three-container.d.ts +0 -85
- package/dist/three-container.js +0 -565
- package/dist/three-container.js.map +0 -1
- package/dist/three-controls.d.ts +0 -11
- package/dist/three-controls.js +0 -616
- package/dist/three-controls.js.map +0 -1
- package/dist/three-layout.d.ts +0 -8
- package/dist/three-layout.js +0 -20
- package/dist/three-layout.js.map +0 -1
- package/dist/three-space.d.ts +0 -85
- package/dist/three-space.js +0 -570
- package/dist/three-space.js.map +0 -1
- package/dist/threed/common.d.ts +0 -22
- package/dist/threed/common.js +0 -19
- package/dist/threed/common.js.map +0 -1
- package/dist/threed/floor/floor.d.ts +0 -3
- package/dist/threed/floor/floor.js +0 -51
- package/dist/threed/floor/floor.js.map +0 -1
- package/dist/threed/html/elements.d.ts +0 -2
- package/dist/threed/html/elements.js +0 -21
- package/dist/threed/html/elements.js.map +0 -1
- package/dist/threed/index.d.ts +0 -15
- package/dist/threed/index.js +0 -16
- package/dist/threed/index.js.map +0 -1
- package/dist/threed/real-object-camera-meshed.d.ts +0 -12
- package/dist/threed/real-object-camera-meshed.js +0 -49
- package/dist/threed/real-object-camera-meshed.js.map +0 -1
- package/dist/threed/real-object-camera.d.ts +0 -9
- package/dist/threed/real-object-camera.js +0 -31
- package/dist/threed/real-object-camera.js.map +0 -1
- package/dist/threed/real-object-dom-element.d.ts +0 -9
- package/dist/threed/real-object-dom-element.js +0 -40
- package/dist/threed/real-object-dom-element.js.map +0 -1
- package/dist/threed/real-object-dummy.d.ts +0 -6
- package/dist/threed/real-object-dummy.js +0 -11
- package/dist/threed/real-object-dummy.js.map +0 -1
- package/dist/threed/real-object-extrude.d.ts +0 -21
- package/dist/threed/real-object-extrude.js +0 -173
- package/dist/threed/real-object-extrude.js.map +0 -1
- package/dist/threed/real-object-gltf.d.ts +0 -16
- package/dist/threed/real-object-gltf.js +0 -101
- package/dist/threed/real-object-gltf.js.map +0 -1
- package/dist/threed/real-object-group.d.ts +0 -5
- package/dist/threed/real-object-group.js +0 -11
- package/dist/threed/real-object-group.js.map +0 -1
- package/dist/threed/real-object-mesh.d.ts +0 -13
- package/dist/threed/real-object-mesh.js +0 -75
- package/dist/threed/real-object-mesh.js.map +0 -1
- package/dist/threed/real-object-plane.d.ts +0 -5
- package/dist/threed/real-object-plane.js +0 -22
- package/dist/threed/real-object-plane.js.map +0 -1
- package/dist/threed/real-object-scene.d.ts +0 -21
- package/dist/threed/real-object-scene.js +0 -67
- package/dist/threed/real-object-scene.js.map +0 -1
- package/dist/threed/real-object-sprite-2d.d.ts +0 -14
- package/dist/threed/real-object-sprite-2d.js +0 -45
- package/dist/threed/real-object-sprite-2d.js.map +0 -1
- package/dist/threed/real-object-sprite.d.ts +0 -11
- package/dist/threed/real-object-sprite.js +0 -50
- package/dist/threed/real-object-sprite.js.map +0 -1
- package/dist/threed/real-object-text.d.ts +0 -15
- package/dist/threed/real-object-text.js +0 -64
- package/dist/threed/real-object-text.js.map +0 -1
- package/dist/threed/real-object.d.ts +0 -64
- package/dist/threed/real-object.js +0 -260
- package/dist/threed/real-object.js.map +0 -1
- package/dist/threed/texture/canvas-texture.d.ts +0 -4
- package/dist/threed/texture/canvas-texture.js +0 -49
- package/dist/threed/texture/canvas-texture.js.map +0 -1
- package/dist/threed/texture/text-texture.d.ts +0 -8
- package/dist/threed/texture/text-texture.js +0 -79
- package/dist/threed/texture/text-texture.js.map +0 -1
- package/dist/threed/three-dimensional-container.d.ts +0 -8
- package/dist/threed/three-dimensional-container.js +0 -2
- package/dist/threed/three-dimensional-container.js.map +0 -1
- package/dist/threed/utils/bound-uv-generator.d.ts +0 -16
- package/dist/threed/utils/bound-uv-generator.js +0 -42
- package/dist/threed/utils/bound-uv-generator.js.map +0 -1
- package/dist/wall.d.ts +0 -13
- package/dist/wall.js +0 -45
- package/dist/wall.js.map +0 -1
package/dist/desk.d.ts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import { ComponentNature, Shape } from '@hatiolab/things-scene';
|
|
1
|
+
import { Component, ComponentNature, Shape, RealObject } from '@hatiolab/things-scene';
|
|
2
2
|
import * as THREE from 'three';
|
|
3
|
-
import { RealObject } from './threed/real-object.js';
|
|
4
3
|
export declare class Desk3D extends RealObject {
|
|
5
4
|
get boardThickness(): number;
|
|
6
5
|
get legThickness(): number;
|
|
@@ -9,7 +8,243 @@ export declare class Desk3D extends RealObject {
|
|
|
9
8
|
createDeskLegs(w: number, h: number, d: number): THREE.Group<THREE.Object3DEventMap>;
|
|
10
9
|
createDeskBoard(w: number, h: number): THREE.Mesh<THREE.BoxGeometry, THREE.MeshStandardMaterial, THREE.Object3DEventMap>;
|
|
11
10
|
}
|
|
12
|
-
declare const Desk_base:
|
|
11
|
+
declare const Desk_base: (new (...args: any[]) => {
|
|
12
|
+
contains(x: number, y: number): boolean;
|
|
13
|
+
get path(): {
|
|
14
|
+
x: any;
|
|
15
|
+
y: any;
|
|
16
|
+
}[];
|
|
17
|
+
set path(path: {
|
|
18
|
+
x: any;
|
|
19
|
+
y: any;
|
|
20
|
+
}[]): any;
|
|
21
|
+
get anchors(): {
|
|
22
|
+
name: string;
|
|
23
|
+
position: {
|
|
24
|
+
x: any;
|
|
25
|
+
y: any;
|
|
26
|
+
};
|
|
27
|
+
}[];
|
|
28
|
+
get bounds(): any;
|
|
29
|
+
set bounds(bounds: any): any;
|
|
30
|
+
render(ctx: CanvasRenderingContext2D): void;
|
|
31
|
+
_app: any;
|
|
32
|
+
_model: any;
|
|
33
|
+
_state: any;
|
|
34
|
+
_delta: any;
|
|
35
|
+
_animation: any;
|
|
36
|
+
_animate: any;
|
|
37
|
+
_parent: any;
|
|
38
|
+
_disposed: any;
|
|
39
|
+
_textHidden: any;
|
|
40
|
+
_text_substitutor: any;
|
|
41
|
+
_value_substitutor: any;
|
|
42
|
+
_mappings: any;
|
|
43
|
+
_realObject: import("@hatiolab/things-scene").IRealObject | undefined;
|
|
44
|
+
_cachedState: any;
|
|
45
|
+
updatedAt: any;
|
|
46
|
+
fontSize: any;
|
|
47
|
+
__cache__: any;
|
|
48
|
+
created(): void;
|
|
49
|
+
added(parent: any): void;
|
|
50
|
+
removed(parent: any): void;
|
|
51
|
+
ready(): Promise<void>;
|
|
52
|
+
touch(): void;
|
|
53
|
+
clearCache(...attrs: any[]): void;
|
|
54
|
+
removeSelf(completely: any): void;
|
|
55
|
+
resetAnimation(): void;
|
|
56
|
+
dispose(): void;
|
|
57
|
+
get nature(): import("@hatiolab/things-scene").ComponentNature;
|
|
58
|
+
get disposed(): boolean;
|
|
59
|
+
isLayer(): boolean;
|
|
60
|
+
isGroup(): boolean;
|
|
61
|
+
isContainer(): this is import("@hatiolab/things-scene/dist-types/types/component").Container;
|
|
62
|
+
isLine(): boolean;
|
|
63
|
+
isRoot(): boolean;
|
|
64
|
+
isRootModel(): boolean;
|
|
65
|
+
is3dish(): boolean;
|
|
66
|
+
get is3dMode(): boolean;
|
|
67
|
+
isIn3DSpace(): boolean;
|
|
68
|
+
isTemplate(): boolean;
|
|
69
|
+
isHTMLElement(): boolean;
|
|
70
|
+
isConnectable(): boolean;
|
|
71
|
+
isIdentifiable(): boolean;
|
|
72
|
+
isPositionable(): boolean;
|
|
73
|
+
replaceRefids(replaceMap: any): void;
|
|
74
|
+
get(property: any): any;
|
|
75
|
+
set(props: any, propval?: any): any;
|
|
76
|
+
getState(property: any): any;
|
|
77
|
+
setState(props: any, propval?: any): any;
|
|
78
|
+
get model(): any;
|
|
79
|
+
get state(): any;
|
|
80
|
+
get hierarchy(): any;
|
|
81
|
+
get volatile(): never[];
|
|
82
|
+
_applyProps(target: any, props: any, options: any): any;
|
|
83
|
+
move(offset: {
|
|
84
|
+
x: number;
|
|
85
|
+
y: number;
|
|
86
|
+
}, ...args: boolean[]): void;
|
|
87
|
+
symmetryX(x?: number): void;
|
|
88
|
+
symmetryY(y: number): void;
|
|
89
|
+
adjustResize(bounds: import("@hatiolab/things-scene").BOUNDS, origin_bounds: import("@hatiolab/things-scene").BOUNDS, diagonal: boolean): {
|
|
90
|
+
left: any;
|
|
91
|
+
top: any;
|
|
92
|
+
width: any;
|
|
93
|
+
height: any;
|
|
94
|
+
};
|
|
95
|
+
adjustRotation(rotation: number, step: boolean): number;
|
|
96
|
+
outline(progress: number): any;
|
|
97
|
+
get center(): import("@hatiolab/things-scene").POINT;
|
|
98
|
+
set center(p: import("@hatiolab/things-scene").POINT): any;
|
|
99
|
+
get location(): import("@hatiolab/things-scene").POINT;
|
|
100
|
+
set location(l: import("@hatiolab/things-scene").POINT): any;
|
|
101
|
+
get rotate(): import("@hatiolab/things-scene").POINT;
|
|
102
|
+
set rotate(r: import("@hatiolab/things-scene").POINT): any;
|
|
103
|
+
get dimension(): import("@hatiolab/things-scene").DIMENSION;
|
|
104
|
+
set dimension(d: import("@hatiolab/things-scene").DIMENSION): any;
|
|
105
|
+
get drawPath(): import("@hatiolab/things-scene").POINT[];
|
|
106
|
+
get rotatePoint(): import("@hatiolab/things-scene").POINT;
|
|
107
|
+
get mutable(): boolean;
|
|
108
|
+
get resizable(): boolean;
|
|
109
|
+
get rotatable(): boolean;
|
|
110
|
+
buildRealObject(): import("@hatiolab/things-scene").IRealObject | undefined;
|
|
111
|
+
get realObject(): import("@hatiolab/things-scene").IRealObject | undefined;
|
|
112
|
+
draw(context?: import("@hatiolab/things-scene").SceneRenderContext): void;
|
|
113
|
+
prerender(context: import("@hatiolab/things-scene").SceneRenderContext): void;
|
|
114
|
+
postrender(context: import("@hatiolab/things-scene").SceneRenderContext): void;
|
|
115
|
+
prepare(resolve: (component: Component) => void, reject: (reason: any) => void): void;
|
|
116
|
+
prepareIf(condition: boolean): void;
|
|
117
|
+
drawText(context: import("@hatiolab/things-scene").SceneRenderContext): void;
|
|
118
|
+
drawStroke(context: import("@hatiolab/things-scene").SceneRenderContext, override?: Record<string, unknown>): void;
|
|
119
|
+
drawFill(context: import("@hatiolab/things-scene").SceneRenderContext, override?: Record<string, unknown>): void;
|
|
120
|
+
get strokeStyle(): any;
|
|
121
|
+
set strokeStyle(v: any): any;
|
|
122
|
+
get fillStyle(): any;
|
|
123
|
+
set fillStyle(v: any): any;
|
|
124
|
+
get fontColor(): string;
|
|
125
|
+
set fontColor(v: string): any;
|
|
126
|
+
get rotation(): number;
|
|
127
|
+
set rotation(v: number): any;
|
|
128
|
+
get decorators(): string[];
|
|
129
|
+
get decotag(): string;
|
|
130
|
+
get hidden(): boolean;
|
|
131
|
+
set hidden(v: boolean): any;
|
|
132
|
+
get tag(): string;
|
|
133
|
+
set tag(v: string): any;
|
|
134
|
+
get appendum(): any;
|
|
135
|
+
set appendum(v: any): any;
|
|
136
|
+
defaultTextSubstitutor(): string;
|
|
137
|
+
textLines(context?: import("@hatiolab/things-scene").SceneRenderContext): any[][];
|
|
138
|
+
get font(): string;
|
|
139
|
+
get lineHeight(): number;
|
|
140
|
+
get textSubstitutor(): () => string;
|
|
141
|
+
get text(): string;
|
|
142
|
+
set text(v: string): any;
|
|
143
|
+
get textBounds(): import("@hatiolab/things-scene").BOUNDS;
|
|
144
|
+
get textRotation(): number;
|
|
145
|
+
get textHidden(): boolean;
|
|
146
|
+
set textHidden(v: boolean): any;
|
|
147
|
+
get hasTextProperty(): boolean;
|
|
148
|
+
animate(opts: import("@hatiolab/things-scene").AnimationConfig): any;
|
|
149
|
+
effect(context: import("@hatiolab/things-scene").SceneRenderContext, model: any): void;
|
|
150
|
+
serialize(...others: any[]): string;
|
|
151
|
+
trim(): void;
|
|
152
|
+
closeScene(data: any): void;
|
|
153
|
+
delta(attr?: string | object, value?: any): any;
|
|
154
|
+
invalidate(): void;
|
|
155
|
+
get value(): any;
|
|
156
|
+
set value(v: any): any;
|
|
157
|
+
get data(): any;
|
|
158
|
+
set data(v: any): any;
|
|
159
|
+
set tap(v: any): any;
|
|
160
|
+
get mappings(): any[];
|
|
161
|
+
get retention(): number;
|
|
162
|
+
get animation(): import("@hatiolab/things-scene").AnimationController | undefined;
|
|
163
|
+
get started(): boolean;
|
|
164
|
+
set started(v: boolean): any;
|
|
165
|
+
get controls(): import("@hatiolab/things-scene").Control[] | undefined;
|
|
166
|
+
findFirst(finder: string | ((c: Component) => boolean), ...others: any[]): Component | undefined;
|
|
167
|
+
findAll(s: string | ((c: Component) => boolean), ...others: any[]): any[] | undefined;
|
|
168
|
+
capture(x: number, y: number, except?: (c: Component) => boolean): any;
|
|
169
|
+
findAnchor(name: string): any;
|
|
170
|
+
isDescendible(container: Component): boolean;
|
|
171
|
+
getContext(component?: unknown): any;
|
|
172
|
+
get root(): Component;
|
|
173
|
+
get rootModel(): Component;
|
|
174
|
+
get parent(): Component;
|
|
175
|
+
set parent(v: Component): any;
|
|
176
|
+
get scalable(): boolean;
|
|
177
|
+
get stuck(): boolean;
|
|
178
|
+
get capturable(): boolean;
|
|
179
|
+
get position(): string;
|
|
180
|
+
get origin(): string;
|
|
181
|
+
get offset(): import("@hatiolab/things-scene").POINT;
|
|
182
|
+
get app(): import("@hatiolab/things-scene").ApplicationContext;
|
|
183
|
+
drawEffect(context: import("@hatiolab/things-scene").SceneRenderContext): void;
|
|
184
|
+
prepareFill(resolve: Function, reject: Function): void;
|
|
185
|
+
prepareFillIf(condition: boolean): void;
|
|
186
|
+
onchangeFill(after: Record<string, any>, before: Record<string, any>): void;
|
|
187
|
+
drawImage(context: import("@hatiolab/things-scene").SceneRenderContext, image: HTMLImageElement, left: number, top: number, width: number, height: number): void;
|
|
188
|
+
mutateBounds(logic: ((bounds: import("@hatiolab/things-scene").BOUNDS) => import("@hatiolab/things-scene").BOUNDS | void) | null, context?: any): void;
|
|
189
|
+
mutatePath(beforeLogic: ((path: import("@hatiolab/things-scene").POINT[]) => import("@hatiolab/things-scene").POINT[] | void) | null, afterLogic: ((path: import("@hatiolab/things-scene").POINT[]) => import("@hatiolab/things-scene").POINT[] | void) | null, context?: any): void;
|
|
190
|
+
access(accessor: string): any;
|
|
191
|
+
substitute(template: string, data: any): string | undefined;
|
|
192
|
+
onchangeMappings(after: Record<string, any>, before: Record<string, any>): void;
|
|
193
|
+
onchangeData(after: Record<string, any>, before: Record<string, any>): void;
|
|
194
|
+
buildMappings(): void;
|
|
195
|
+
executeMappings(force?: boolean): void;
|
|
196
|
+
disposeMappings(): void;
|
|
197
|
+
ondropfile(transfered: FileList, files: string[]): void;
|
|
198
|
+
transcoordS2P(x: number, y: number, rp?: import("@hatiolab/things-scene").POINT): import("@hatiolab/things-scene").POINT;
|
|
199
|
+
transcoordP2S(x: number, y: number, rp?: import("@hatiolab/things-scene").POINT): import("@hatiolab/things-scene").POINT;
|
|
200
|
+
transcoordS2T(x: number, y: number, top?: Component): import("@hatiolab/things-scene").POINT;
|
|
201
|
+
transcoordT2P(x: number, y: number, top?: Component): import("@hatiolab/things-scene").POINT;
|
|
202
|
+
transcoordT2S(x: number, y: number, top?: Component): import("@hatiolab/things-scene").POINT;
|
|
203
|
+
transcoordS2TR(x: number, y: number, top?: Component): import("@hatiolab/things-scene").POINT;
|
|
204
|
+
transcoordS2O(x: number, y: number, target: Component): import("@hatiolab/things-scene").POINT;
|
|
205
|
+
transcoordC2S(x: number, y: number, top?: Component): import("@hatiolab/things-scene").POINT;
|
|
206
|
+
transcoordS2C(x: number, y: number, top?: Component): import("@hatiolab/things-scene").POINT;
|
|
207
|
+
toParent(x: number, y: number, rp?: import("@hatiolab/things-scene").POINT): import("@hatiolab/things-scene").POINT;
|
|
208
|
+
fromParent(x: number, y: number, rp?: import("@hatiolab/things-scene").POINT): import("@hatiolab/things-scene").POINT;
|
|
209
|
+
toScene(x: number, y: number, top?: Component): import("@hatiolab/things-scene").POINT;
|
|
210
|
+
fromScene(x: number, y: number, top?: Component): import("@hatiolab/things-scene").POINT;
|
|
211
|
+
toLocal(x: number, y: number, top?: Component): import("@hatiolab/things-scene").POINT;
|
|
212
|
+
toGlobal(x: number, y: number, top?: Component): import("@hatiolab/things-scene").POINT;
|
|
213
|
+
toOther(x: number, y: number, target: Component): import("@hatiolab/things-scene").POINT;
|
|
214
|
+
on(name: string | object, callback: Function, context?: any): any;
|
|
215
|
+
off(name?: string | object, callback?: Function, context?: any): any;
|
|
216
|
+
once(name: string | object, callback: Function, context?: any): any;
|
|
217
|
+
trigger(name: string, ...args: any[]): any;
|
|
218
|
+
delegate_on(delegator: any): any;
|
|
219
|
+
delegate_off(delegator: any): any;
|
|
220
|
+
onchange(after: Record<string, any>, before: Record<string, any>): void;
|
|
221
|
+
calculateBounds?(): void;
|
|
222
|
+
oncreate_element?(element: HTMLElement): void;
|
|
223
|
+
removeComponent(component: Component, ghost?: boolean): void;
|
|
224
|
+
addComponent(component: Component, ghost?: boolean): void;
|
|
225
|
+
insertComponentAt(component: Component, index: number, ghost?: boolean): void;
|
|
226
|
+
getOverlay(component: Component): HTMLElement | undefined;
|
|
227
|
+
findById(id: string): Component | undefined;
|
|
228
|
+
findByRefid(ref: string | number): Component | undefined;
|
|
229
|
+
findAllById(id: string): Component[];
|
|
230
|
+
resize(): void;
|
|
231
|
+
fit(type?: string): void;
|
|
232
|
+
get components(): Component[] | undefined;
|
|
233
|
+
get layout(): any;
|
|
234
|
+
get auxOverlay(): HTMLElement | undefined;
|
|
235
|
+
get isReady(): boolean;
|
|
236
|
+
get unitScale(): number;
|
|
237
|
+
get selected(): Component[];
|
|
238
|
+
set selected(_v: Component[]): any;
|
|
239
|
+
get focused(): Component | null;
|
|
240
|
+
set focused(_v: Component | null): any;
|
|
241
|
+
get hasSameParentForAllSelected(): boolean;
|
|
242
|
+
set hasSameParentForAllSelected(_v: boolean): any;
|
|
243
|
+
get fitMode(): string | undefined;
|
|
244
|
+
set fitMode(_v: string | undefined): any;
|
|
245
|
+
get element(): HTMLElement | null;
|
|
246
|
+
set element(_v: HTMLElement | null): any;
|
|
247
|
+
}) & typeof Shape;
|
|
13
248
|
export declare class Desk extends Desk_base {
|
|
14
249
|
is3dish(): boolean;
|
|
15
250
|
buildRealObject(): RealObject | undefined;
|
package/dist/desk.js
CHANGED
|
@@ -2,9 +2,8 @@ import { __decorate } from "tslib";
|
|
|
2
2
|
/*
|
|
3
3
|
* Copyright © HatioLab Inc. All rights reserved.
|
|
4
4
|
*/
|
|
5
|
-
import { RectPath, Shape, sceneComponent } from '@hatiolab/things-scene';
|
|
5
|
+
import { RectPath, Shape, sceneComponent, RealObject } from '@hatiolab/things-scene';
|
|
6
6
|
import * as THREE from 'three';
|
|
7
|
-
import { RealObject } from './threed/real-object.js';
|
|
8
7
|
const NATURE = {
|
|
9
8
|
mutable: false,
|
|
10
9
|
resizable: true,
|
package/dist/desk.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"desk.js","sourceRoot":"","sources":["../src/desk.ts"],"names":[],"mappings":";AAAA;;GAEG;AACH,OAAO,EAA8B,QAAQ,EAAE,KAAK,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAA;
|
|
1
|
+
{"version":3,"file":"desk.js","sourceRoot":"","sources":["../src/desk.ts"],"names":[],"mappings":";AAAA;;GAEG;AACH,OAAO,EAA8B,QAAQ,EAAE,KAAK,EAAE,cAAc,EAAE,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CAAA;QACF,IAAI,aAAa,GAAG,IAAI,KAAK,CAAC,WAAW,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAA;QACxD,IAAI,KAAK,GAAG,IAAI,KAAK,CAAC,IAAI,CAAC,aAAa,EAAE,aAAa,CAAC,CAAA;QAExD,OAAO,KAAK,CAAA;IACd,CAAC;CACF;AAGM,IAAM,IAAI,GAAV,MAAM,IAAK,SAAQ,QAAQ,CAAC,KAAK,CAAC;IACvC,OAAO;QACL,OAAO,IAAI,CAAA;IACb,CAAC;IAED,eAAe;QACb,OAAO,IAAI,MAAM,CAAC,IAAW,CAAC,CAAA;IAChC,CAAC;IAED,IAAI,MAAM;QACR,OAAO,MAAM,CAAA;IACf,CAAC;CACF,CAAA;AAZY,IAAI;IADhB,cAAc,CAAC,MAAM,CAAC;GACV,IAAI,CAYhB","sourcesContent":["/*\n * Copyright © HatioLab Inc. All rights reserved.\n */\nimport { Component, ComponentNature, RectPath, Shape, sceneComponent, RealObject } from '@hatiolab/things-scene'\nimport * as THREE from 'three'\n\nconst NATURE: ComponentNature = {\n mutable: false,\n resizable: true,\n rotatable: true,\n properties: [\n {\n type: 'color',\n label: 'leg-color',\n name: 'legColor',\n property: 'legColor'\n }\n ],\n help: 'scene/component/desk'\n}\n\nexport class Desk3D extends RealObject {\n get boardThickness() {\n var { depth } = this.component.state\n\n return Math.min(10, depth / 10)\n }\n\n get legThickness() {\n var { width, height } = this.component.state\n\n var min = Math.min(width, height)\n\n return Math.min(10, min / 10)\n }\n\n get margin() {\n return Math.min(this.legThickness / 5, 2)\n }\n\n build() {\n super.build()\n\n var { width, height, depth } = this.component.state\n\n var top = (depth - this.boardThickness) / 2\n\n var legs = this.createDeskLegs(width, height, depth)\n legs.position.set(0, -this.boardThickness / 2, 0)\n legs.castShadow = true\n\n this.object3d.add(legs)\n\n let board = this.createDeskBoard(width, height)\n board.position.set(0, top, 0)\n board.rotation.x = Math.PI / 2\n board.castShadow = true\n\n this.object3d.add(board)\n }\n\n createDeskLegs(w: number, h: number, d: number) {\n var { legColor } = this.component.state\n\n var legThickness = this.legThickness\n var margin = this.margin\n d -= this.boardThickness\n\n var legs = new THREE.Group()\n\n var posX = w / 2 - legThickness / 2 - margin\n var posY = h / 2 - legThickness / 2 - margin\n var posZ = 0\n\n for (var i = 0; i < 4; i++) {\n var geometry = new THREE.BoxGeometry(legThickness, d, legThickness)\n var material = new THREE.MeshStandardMaterial({\n color: legColor || '#252525'\n })\n\n var leg = new THREE.Mesh(geometry, material)\n leg.castShadow = true\n\n switch (i) {\n case 0:\n leg.position.set(posX, posZ, posY)\n break\n case 1:\n leg.position.set(posX, posZ, -posY)\n break\n case 2:\n leg.position.set(-posX, posZ, posY)\n break\n case 3:\n leg.position.set(-posX, posZ, -posY)\n break\n }\n\n legs.add(leg)\n }\n\n return legs\n }\n\n createDeskBoard(w: number, h: number) {\n var { fillStyle } = this.component.state\n\n var d = 10\n\n var boardMaterial = new THREE.MeshStandardMaterial({\n color: fillStyle || '#ccaa76'\n })\n var boardGeometry = new THREE.BoxGeometry(w, h, d, 1, 1)\n var board = new THREE.Mesh(boardGeometry, boardMaterial)\n\n return board\n }\n}\n\n@sceneComponent('desk')\nexport class Desk extends RectPath(Shape) {\n is3dish() {\n return true\n }\n\n buildRealObject(): RealObject | undefined {\n return new Desk3D(this as any)\n }\n\n get nature() {\n return NATURE\n }\n}\n"]}
|
package/dist/editors/index.d.ts
CHANGED
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
import './property-editor-location-increase-pattern.js';
|
|
2
2
|
import './property-editor-gltf-info.js';
|
|
3
|
+
import './property-editor-gltf-fill-targets.js';
|
|
4
|
+
import './property-editor-gltf-play-targets.js';
|
|
5
|
+
import './property-editor-stocker-location.js';
|
|
3
6
|
declare const _default: {
|
|
4
7
|
type: string;
|
|
5
8
|
element: string;
|
package/dist/editors/index.js
CHANGED
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
import './property-editor-location-increase-pattern.js';
|
|
2
2
|
import './property-editor-gltf-info.js';
|
|
3
|
+
import './property-editor-gltf-fill-targets.js';
|
|
4
|
+
import './property-editor-gltf-play-targets.js';
|
|
5
|
+
import './property-editor-stocker-location.js';
|
|
3
6
|
export default [
|
|
4
7
|
{
|
|
5
8
|
type: 'location-increase-pattern',
|
|
@@ -8,6 +11,18 @@ export default [
|
|
|
8
11
|
{
|
|
9
12
|
type: 'gltf-info',
|
|
10
13
|
element: 'property-editor-gltf-info'
|
|
14
|
+
},
|
|
15
|
+
{
|
|
16
|
+
type: 'gltf-fill-targets',
|
|
17
|
+
element: 'property-editor-gltf-fill-targets'
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
type: 'gltf-play-targets',
|
|
21
|
+
element: 'property-editor-gltf-play-targets'
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
type: 'stocker-location',
|
|
25
|
+
element: 'property-editor-stocker-location'
|
|
11
26
|
}
|
|
12
27
|
];
|
|
13
28
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/editors/index.ts"],"names":[],"mappings":"AAAA,OAAO,gDAAgD,CAAA;AACvD,OAAO,gCAAgC,CAAA;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/editors/index.ts"],"names":[],"mappings":"AAAA,OAAO,gDAAgD,CAAA;AACvD,OAAO,gCAAgC,CAAA;AACvC,OAAO,wCAAwC,CAAA;AAC/C,OAAO,wCAAwC,CAAA;AAC/C,OAAO,uCAAuC,CAAA;AAE9C,eAAe;IACb;QACE,IAAI,EAAE,2BAA2B;QACjC,OAAO,EAAE,2CAA2C;KACrD;IACD;QACE,IAAI,EAAE,WAAW;QACjB,OAAO,EAAE,2BAA2B;KACrC;IACD;QACE,IAAI,EAAE,mBAAmB;QACzB,OAAO,EAAE,mCAAmC;KAC7C;IACD;QACE,IAAI,EAAE,mBAAmB;QACzB,OAAO,EAAE,mCAAmC;KAC7C;IACD;QACE,IAAI,EAAE,kBAAkB;QACxB,OAAO,EAAE,kCAAkC;KAC5C;CACF,CAAA","sourcesContent":["import './property-editor-location-increase-pattern.js'\nimport './property-editor-gltf-info.js'\nimport './property-editor-gltf-fill-targets.js'\nimport './property-editor-gltf-play-targets.js'\nimport './property-editor-stocker-location.js'\n\nexport default [\n {\n type: 'location-increase-pattern',\n element: 'property-editor-location-increase-pattern'\n },\n {\n type: 'gltf-info',\n element: 'property-editor-gltf-info'\n },\n {\n type: 'gltf-fill-targets',\n element: 'property-editor-gltf-fill-targets'\n },\n {\n type: 'gltf-play-targets',\n element: 'property-editor-gltf-play-targets'\n },\n {\n type: 'stocker-location',\n element: 'property-editor-stocker-location'\n }\n]\n"]}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import '@operato/i18n/ox-i18n.js';
|
|
2
|
+
import { PropertyValues, TemplateResult } from 'lit';
|
|
3
|
+
import { OxPropertyEditor, PropertySpec } from '@operato/property-editor';
|
|
4
|
+
export default class GLTFFillTargetsEditor extends OxPropertyEditor {
|
|
5
|
+
static styles: import("lit").CSSResult[];
|
|
6
|
+
src: string | undefined;
|
|
7
|
+
private _meshNames;
|
|
8
|
+
private _mode;
|
|
9
|
+
private _component;
|
|
10
|
+
private _lastExternalValue;
|
|
11
|
+
updated(changes: PropertyValues<this>): void;
|
|
12
|
+
private _refreshMeshNames;
|
|
13
|
+
editorTemplate(value: any, _spec: PropertySpec): TemplateResult;
|
|
14
|
+
private _setMode;
|
|
15
|
+
private _onToggle;
|
|
16
|
+
private _applyValue;
|
|
17
|
+
private _highlightNode;
|
|
18
|
+
private _clearHighlight;
|
|
19
|
+
private _getRendererManager;
|
|
20
|
+
}
|
|
@@ -0,0 +1,313 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright © HatioLab Inc. All rights reserved.
|
|
3
|
+
*
|
|
4
|
+
* GLTF fillStyle 타겟 노드 선택 에디터.
|
|
5
|
+
* All / None / Custom 모드로 명시적 설정.
|
|
6
|
+
* Custom 모드에서 개별 Mesh 체크박스 선택.
|
|
7
|
+
*/
|
|
8
|
+
import { __decorate } from "tslib";
|
|
9
|
+
import '@operato/i18n/ox-i18n.js';
|
|
10
|
+
import { css, html, nothing } from 'lit';
|
|
11
|
+
import { customElement, property, state } from 'lit/decorators.js';
|
|
12
|
+
import { OxPropertyEditor } from '@operato/property-editor';
|
|
13
|
+
import { ScrollbarStyles } from '@operato/styles/scrollbar-styles.js';
|
|
14
|
+
function getMode(value) {
|
|
15
|
+
if (value === '*')
|
|
16
|
+
return 'all';
|
|
17
|
+
if (value === 'none' || !value)
|
|
18
|
+
return 'none';
|
|
19
|
+
if (Array.isArray(value) && value.length > 0)
|
|
20
|
+
return 'custom';
|
|
21
|
+
// [] (빈 배열) = custom with nothing selected
|
|
22
|
+
if (Array.isArray(value))
|
|
23
|
+
return 'custom';
|
|
24
|
+
return 'none';
|
|
25
|
+
}
|
|
26
|
+
let GLTFFillTargetsEditor = class GLTFFillTargetsEditor extends OxPropertyEditor {
|
|
27
|
+
static styles = [
|
|
28
|
+
...OxPropertyEditor.styles,
|
|
29
|
+
ScrollbarStyles,
|
|
30
|
+
css `
|
|
31
|
+
.mode-selector {
|
|
32
|
+
display: flex;
|
|
33
|
+
gap: 0;
|
|
34
|
+
margin-bottom: 6px;
|
|
35
|
+
border: 1px solid var(--md-sys-color-outline-variant, rgba(0, 0, 0, 0.15));
|
|
36
|
+
border-radius: 6px;
|
|
37
|
+
overflow: hidden;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
.mode-btn {
|
|
41
|
+
flex: 1;
|
|
42
|
+
padding: 5px 0;
|
|
43
|
+
font-size: 11px;
|
|
44
|
+
font-weight: 500;
|
|
45
|
+
text-align: center;
|
|
46
|
+
cursor: pointer;
|
|
47
|
+
background: var(--md-sys-color-surface-container, #f3edf7);
|
|
48
|
+
color: var(--md-sys-color-on-surface, #1c1b1f);
|
|
49
|
+
border: none;
|
|
50
|
+
border-right: 1px solid var(--md-sys-color-outline-variant, rgba(0, 0, 0, 0.1));
|
|
51
|
+
transition: all 0.15s;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
.mode-btn:last-child {
|
|
55
|
+
border-right: none;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
.mode-btn:hover {
|
|
59
|
+
background: var(--md-sys-color-surface-container-highest, #e6e0e9);
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
.mode-btn[active] {
|
|
63
|
+
background: var(--md-sys-color-primary, #6750a4);
|
|
64
|
+
color: var(--md-sys-color-on-primary, #fff);
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
.node-list {
|
|
68
|
+
display: flex;
|
|
69
|
+
flex-direction: column;
|
|
70
|
+
gap: 1px;
|
|
71
|
+
max-height: 200px;
|
|
72
|
+
overflow-y: auto;
|
|
73
|
+
font-size: 12px;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
.node-item {
|
|
77
|
+
display: flex;
|
|
78
|
+
align-items: center;
|
|
79
|
+
gap: 6px;
|
|
80
|
+
padding: 4px 8px;
|
|
81
|
+
cursor: pointer;
|
|
82
|
+
border-radius: 4px;
|
|
83
|
+
transition: background 0.1s;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
.node-item:hover {
|
|
87
|
+
background: var(--md-sys-color-primary-container, rgba(103, 80, 164, 0.12));
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
.node-item input[type='checkbox'] {
|
|
91
|
+
margin: 0;
|
|
92
|
+
accent-color: var(--md-sys-color-primary, #6750a4);
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
.node-item span {
|
|
96
|
+
font-size: 12px;
|
|
97
|
+
color: var(--md-sys-color-on-surface, #1c1b1f);
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
.mode-desc {
|
|
101
|
+
font-size: 11px;
|
|
102
|
+
color: var(--md-sys-color-on-surface-variant, #666);
|
|
103
|
+
padding: 4px 0;
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
.mini-btn {
|
|
107
|
+
font-size: 10px;
|
|
108
|
+
padding: 2px 8px;
|
|
109
|
+
border: 1px solid var(--md-sys-color-outline-variant, rgba(0, 0, 0, 0.15));
|
|
110
|
+
border-radius: 4px;
|
|
111
|
+
background: var(--md-sys-color-surface-container, #f3edf7);
|
|
112
|
+
color: var(--md-sys-color-on-surface, #1c1b1f);
|
|
113
|
+
cursor: pointer;
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
.mini-btn:hover {
|
|
117
|
+
background: var(--md-sys-color-surface-container-highest, #e6e0e9);
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
.empty {
|
|
121
|
+
color: var(--md-sys-color-on-surface-variant, #999);
|
|
122
|
+
font-size: 11px;
|
|
123
|
+
padding: 8px;
|
|
124
|
+
text-align: center;
|
|
125
|
+
}
|
|
126
|
+
`
|
|
127
|
+
];
|
|
128
|
+
_component = null;
|
|
129
|
+
_lastExternalValue = undefined;
|
|
130
|
+
updated(changes) {
|
|
131
|
+
if (changes.has('src')) {
|
|
132
|
+
this.dispatchEvent(new CustomEvent('i-need-selected', {
|
|
133
|
+
bubbles: true,
|
|
134
|
+
composed: true,
|
|
135
|
+
detail: {
|
|
136
|
+
callback: (selected) => {
|
|
137
|
+
this._component = selected?.[0];
|
|
138
|
+
this._refreshMeshNames();
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
}));
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
_refreshMeshNames() {
|
|
145
|
+
if (!this._component) {
|
|
146
|
+
this._meshNames = [];
|
|
147
|
+
return;
|
|
148
|
+
}
|
|
149
|
+
const ro = this._component.realObject;
|
|
150
|
+
if (!ro?.getNode) {
|
|
151
|
+
this._meshNames = [];
|
|
152
|
+
return;
|
|
153
|
+
}
|
|
154
|
+
this._meshNames = (this._component.nodeNames ?? []).filter((name) => {
|
|
155
|
+
const node = ro.getNode(name);
|
|
156
|
+
return node?.isMesh;
|
|
157
|
+
});
|
|
158
|
+
}
|
|
159
|
+
editorTemplate(value, _spec) {
|
|
160
|
+
if (!this._meshNames?.length) {
|
|
161
|
+
this._refreshMeshNames();
|
|
162
|
+
}
|
|
163
|
+
// 외부 value가 변경되면 모드 동기화
|
|
164
|
+
if (value !== this._lastExternalValue) {
|
|
165
|
+
this._lastExternalValue = value;
|
|
166
|
+
this._mode = getMode(value);
|
|
167
|
+
}
|
|
168
|
+
const mode = this._mode;
|
|
169
|
+
const meshCount = this._meshNames?.length ?? 0;
|
|
170
|
+
const targets = Array.isArray(this.value) ? this.value : (Array.isArray(value) ? value : []);
|
|
171
|
+
return html `
|
|
172
|
+
<fieldset fullwidth>
|
|
173
|
+
${meshCount > 0
|
|
174
|
+
? html `
|
|
175
|
+
<div class="mode-selector">
|
|
176
|
+
<div class="mode-btn" ?active=${mode === 'all'} @click=${() => this._setMode('all')}>All</div>
|
|
177
|
+
<div class="mode-btn" ?active=${mode === 'none'} @click=${() => this._setMode('none')}>None</div>
|
|
178
|
+
<div class="mode-btn" ?active=${mode === 'custom'} @click=${() => this._setMode('custom')}>Custom</div>
|
|
179
|
+
</div>
|
|
180
|
+
|
|
181
|
+
${mode === 'all'
|
|
182
|
+
? html `<div class="mode-desc">${meshCount} meshes — fillStyle applies to all</div>`
|
|
183
|
+
: nothing}
|
|
184
|
+
${mode === 'none'
|
|
185
|
+
? html `<div class="mode-desc">fillStyle not applied to any mesh</div>`
|
|
186
|
+
: nothing}
|
|
187
|
+
${mode === 'custom'
|
|
188
|
+
? html `
|
|
189
|
+
<div style="display:flex;align-items:center;gap:6px">
|
|
190
|
+
<div class="mode-desc" style="flex:1">${targets.length} / ${meshCount} selected</div>
|
|
191
|
+
<button class="mini-btn" @click=${() => this._applyValue([...(this._meshNames ?? [])])}>All</button>
|
|
192
|
+
<button class="mini-btn" @click=${() => this._applyValue([])}>Clear</button>
|
|
193
|
+
</div>
|
|
194
|
+
<div class="node-list">
|
|
195
|
+
${(this._meshNames ?? []).map(name => html `
|
|
196
|
+
<label
|
|
197
|
+
class="node-item"
|
|
198
|
+
@mouseenter=${() => this._highlightNode(name)}
|
|
199
|
+
@mouseleave=${() => this._clearHighlight()}
|
|
200
|
+
>
|
|
201
|
+
<input
|
|
202
|
+
type="checkbox"
|
|
203
|
+
.checked=${targets.includes(name)}
|
|
204
|
+
@change=${(e) => {
|
|
205
|
+
e.stopPropagation();
|
|
206
|
+
this._onToggle(name, e.target.checked, targets);
|
|
207
|
+
}}
|
|
208
|
+
/>
|
|
209
|
+
<span>${name}</span>
|
|
210
|
+
</label>
|
|
211
|
+
`)}
|
|
212
|
+
</div>
|
|
213
|
+
`
|
|
214
|
+
: nothing}
|
|
215
|
+
`
|
|
216
|
+
: html `<div class="empty">
|
|
217
|
+
<ox-i18n msgid="label.no-gltf-meshes">No meshes available</ox-i18n>
|
|
218
|
+
</div>`}
|
|
219
|
+
</fieldset>
|
|
220
|
+
`;
|
|
221
|
+
}
|
|
222
|
+
_setMode(mode) {
|
|
223
|
+
const prevMode = this._mode;
|
|
224
|
+
this._mode = mode;
|
|
225
|
+
let newValue;
|
|
226
|
+
switch (mode) {
|
|
227
|
+
case 'all':
|
|
228
|
+
newValue = '*';
|
|
229
|
+
break;
|
|
230
|
+
case 'none':
|
|
231
|
+
newValue = 'none';
|
|
232
|
+
break;
|
|
233
|
+
case 'custom':
|
|
234
|
+
// 이전 상태에 따라: All → 전체 선택, None → 전체 해제
|
|
235
|
+
if (prevMode === 'all') {
|
|
236
|
+
newValue = [...(this._meshNames ?? [])];
|
|
237
|
+
}
|
|
238
|
+
else if (prevMode === 'none') {
|
|
239
|
+
newValue = [];
|
|
240
|
+
}
|
|
241
|
+
else {
|
|
242
|
+
// 이미 custom이면 현재 값 유지
|
|
243
|
+
newValue = Array.isArray(this.value) ? this.value : [];
|
|
244
|
+
}
|
|
245
|
+
break;
|
|
246
|
+
}
|
|
247
|
+
this._applyValue(newValue);
|
|
248
|
+
}
|
|
249
|
+
_onToggle(name, checked, current) {
|
|
250
|
+
const list = [...current];
|
|
251
|
+
if (checked) {
|
|
252
|
+
if (!list.includes(name))
|
|
253
|
+
list.push(name);
|
|
254
|
+
}
|
|
255
|
+
else {
|
|
256
|
+
const idx = list.indexOf(name);
|
|
257
|
+
if (idx >= 0)
|
|
258
|
+
list.splice(idx, 1);
|
|
259
|
+
}
|
|
260
|
+
this._applyValue(list);
|
|
261
|
+
}
|
|
262
|
+
_applyValue(newValue) {
|
|
263
|
+
// 로컬 value 즉시 반영 (re-render)
|
|
264
|
+
this.value = newValue;
|
|
265
|
+
this.requestUpdate();
|
|
266
|
+
this.dispatchEvent(new CustomEvent('i-need-selected', {
|
|
267
|
+
bubbles: true,
|
|
268
|
+
composed: true,
|
|
269
|
+
detail: {
|
|
270
|
+
callback: (selected) => {
|
|
271
|
+
selected[0].set('fillStyleTargets', newValue);
|
|
272
|
+
}
|
|
273
|
+
}
|
|
274
|
+
}));
|
|
275
|
+
}
|
|
276
|
+
// --- Outline 강조 ---
|
|
277
|
+
_highlightNode(name) {
|
|
278
|
+
const ro = this._component?.realObject;
|
|
279
|
+
if (!ro?.getNode)
|
|
280
|
+
return;
|
|
281
|
+
const node = ro.getNode(name);
|
|
282
|
+
if (!node)
|
|
283
|
+
return;
|
|
284
|
+
this._getRendererManager()?.setOutlineObjects([node]);
|
|
285
|
+
this._component?.invalidate();
|
|
286
|
+
}
|
|
287
|
+
_clearHighlight() {
|
|
288
|
+
const ro = this._component?.realObject;
|
|
289
|
+
if (!ro)
|
|
290
|
+
return;
|
|
291
|
+
this._getRendererManager()?.setOutlineObjects(ro.object3d ? [ro.object3d] : []);
|
|
292
|
+
this._component?.invalidate();
|
|
293
|
+
}
|
|
294
|
+
_getRendererManager() {
|
|
295
|
+
const ro = this._component?.realObject;
|
|
296
|
+
const container = ro?.threeContainer;
|
|
297
|
+
return container?._capability?.rendererManager ?? container?._threeCapability?.rendererManager ?? null;
|
|
298
|
+
}
|
|
299
|
+
};
|
|
300
|
+
__decorate([
|
|
301
|
+
property({ type: String })
|
|
302
|
+
], GLTFFillTargetsEditor.prototype, "src", void 0);
|
|
303
|
+
__decorate([
|
|
304
|
+
state()
|
|
305
|
+
], GLTFFillTargetsEditor.prototype, "_meshNames", void 0);
|
|
306
|
+
__decorate([
|
|
307
|
+
state()
|
|
308
|
+
], GLTFFillTargetsEditor.prototype, "_mode", void 0);
|
|
309
|
+
GLTFFillTargetsEditor = __decorate([
|
|
310
|
+
customElement('property-editor-gltf-fill-targets')
|
|
311
|
+
], GLTFFillTargetsEditor);
|
|
312
|
+
export default GLTFFillTargetsEditor;
|
|
313
|
+
//# sourceMappingURL=property-editor-gltf-fill-targets.js.map
|