@operato/scene-visualizer 9.1.1 → 10.0.0-beta.1
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/banner.d.ts +232 -3
- package/dist/banner.js +1 -2
- package/dist/banner.js.map +1 -1
- package/dist/camera.d.ts +232 -3
- package/dist/camera.js +1 -2
- package/dist/camera.js.map +1 -1
- package/dist/carrier.d.ts +263 -0
- package/dist/carrier.js +272 -0
- package/dist/carrier.js.map +1 -0
- package/dist/cube.d.ts +232 -4
- package/dist/cube.js +1 -2
- package/dist/cube.js.map +1 -1
- package/dist/cylinder.d.ts +1 -3
- package/dist/cylinder.js +1 -2
- package/dist/cylinder.js.map +1 -1
- 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 +1 -0
- package/dist/editors/index.js +5 -0
- package/dist/editors/index.js.map +1 -1
- package/dist/editors/property-editor-gltf-fill-targets.d.ts +17 -0
- package/dist/editors/property-editor-gltf-fill-targets.js +211 -0
- package/dist/editors/property-editor-gltf-fill-targets.js.map +1 -0
- package/dist/editors/property-editor-gltf-info.js +38 -29
- package/dist/editors/property-editor-gltf-info.js.map +1 -1
- package/dist/editors/property-editor-location-increase-pattern.js +91 -95
- package/dist/editors/property-editor-location-increase-pattern.js.map +1 -1
- package/dist/effects/outline.js +1 -1
- package/dist/effects/outline.js.map +1 -1
- package/dist/ellipse.js +2 -4
- package/dist/ellipse.js.map +1 -1
- package/dist/gltf-object.d.ts +232 -3
- package/dist/gltf-object.js +1 -2
- package/dist/gltf-object.js.map +1 -1
- package/dist/html-overlay-element.js +3 -7
- package/dist/html-overlay-element.js.map +1 -1
- package/dist/index.d.ts +5 -17
- package/dist/index.js +7 -17
- package/dist/index.js.map +1 -1
- package/dist/light.d.ts +1 -2
- package/dist/light.js +1 -2
- package/dist/light.js.map +1 -1
- package/dist/polygon.js +2 -4
- package/dist/polygon.js.map +1 -1
- package/dist/rack-table-3d.d.ts +16 -0
- package/dist/rack-table-3d.js +94 -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 +108 -380
- package/dist/rack-table.js.map +1 -1
- package/dist/rack.d.ts +3 -5
- package/dist/rack.js +7 -9
- package/dist/rack.js.map +1 -1
- package/dist/rect.js +2 -4
- package/dist/rect.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/sphere.d.ts +1 -3
- package/dist/sphere.js +1 -2
- package/dist/sphere.js.map +1 -1
- package/dist/sprite.d.ts +232 -3
- package/dist/sprite.js +1 -2
- package/dist/sprite.js.map +1 -1
- package/dist/stock.d.ts +22 -10
- package/dist/stock.js +130 -109
- package/dist/stock.js.map +1 -1
- 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 +1 -0
- package/dist/templates/index.js +9 -1
- package/dist/templates/index.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/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/text.js +2 -4
- package/dist/text.js.map +1 -1
- package/dist/three-container.d.ts +11 -35
- package/dist/three-container.js +128 -322
- package/dist/three-container.js.map +1 -1
- package/dist/three-controls.d.ts +101 -1
- package/dist/three-controls.js +339 -541
- package/dist/three-controls.js.map +1 -1
- package/dist/three-space.d.ts +6 -83
- package/dist/three-space.js +25 -537
- package/dist/three-space.js.map +1 -1
- package/dist/threed/index.d.ts +1 -0
- package/dist/threed/index.js +1 -0
- package/dist/threed/index.js.map +1 -1
- package/dist/threed/interfaces.d.ts +15 -0
- package/dist/threed/interfaces.js +5 -0
- package/dist/threed/interfaces.js.map +1 -0
- package/dist/threed/managers/camera-manager.d.ts +14 -0
- package/dist/threed/managers/camera-manager.js +60 -0
- package/dist/threed/managers/camera-manager.js.map +1 -0
- package/dist/threed/managers/controls-manager.d.ts +50 -0
- package/dist/threed/managers/controls-manager.js +249 -0
- package/dist/threed/managers/controls-manager.js.map +1 -0
- package/dist/threed/managers/event-manager3d.d.ts +19 -0
- package/dist/threed/managers/event-manager3d.js +76 -0
- package/dist/threed/managers/event-manager3d.js.map +1 -0
- package/dist/threed/managers/index.d.ts +7 -0
- package/dist/threed/managers/index.js +7 -0
- package/dist/threed/managers/index.js.map +1 -0
- package/dist/threed/managers/light-manager.d.ts +7 -0
- package/dist/threed/managers/light-manager.js +37 -0
- package/dist/threed/managers/light-manager.js.map +1 -0
- package/dist/threed/managers/renderer-manager.d.ts +30 -0
- package/dist/threed/managers/renderer-manager.js +120 -0
- package/dist/threed/managers/renderer-manager.js.map +1 -0
- package/dist/threed/managers/scene-manager.d.ts +15 -0
- package/dist/threed/managers/scene-manager.js +48 -0
- package/dist/threed/managers/scene-manager.js.map +1 -0
- package/dist/threed/managers/types.d.ts +36 -0
- package/dist/threed/managers/types.js +2 -0
- package/dist/threed/managers/types.js.map +1 -0
- package/dist/threed/real-object-dom-element.js +11 -3
- package/dist/threed/real-object-dom-element.js.map +1 -1
- package/dist/threed/real-object-extrude.d.ts +1 -0
- package/dist/threed/real-object-extrude.js +7 -0
- package/dist/threed/real-object-extrude.js.map +1 -1
- package/dist/threed/real-object-gltf.js +6 -2
- package/dist/threed/real-object-gltf.js.map +1 -1
- package/dist/threed/real-object-mesh.js +4 -6
- package/dist/threed/real-object-mesh.js.map +1 -1
- package/dist/threed/real-object-registry.d.ts +7 -0
- package/dist/threed/real-object-registry.js +32 -0
- package/dist/threed/real-object-registry.js.map +1 -0
- package/dist/threed/real-object-scene.js +10 -5
- package/dist/threed/real-object-scene.js.map +1 -1
- package/dist/threed/real-object-sprite-2d.js.map +1 -1
- package/dist/threed/real-object-sprite.js +2 -0
- package/dist/threed/real-object-sprite.js.map +1 -1
- package/dist/threed/real-object-text.js +2 -0
- package/dist/threed/real-object-text.js.map +1 -1
- package/dist/threed/real-object.d.ts +3 -2
- package/dist/threed/real-object.js +7 -16
- package/dist/threed/real-object.js.map +1 -1
- package/dist/threed/three-dimensional-container.d.ts +1 -2
- package/dist/threed/three-dimensional-container.js.map +1 -1
- package/dist/threed/utils/dispose.d.ts +2 -0
- package/dist/threed/utils/dispose.js +32 -0
- package/dist/threed/utils/dispose.js.map +1 -0
- 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 +4 -5
- package/dist/visualizer.js +15 -28
- package/dist/visualizer.js.map +1 -1
- package/dist/wall.d.ts +232 -4
- package/dist/wall.js +1 -2
- package/dist/wall.js.map +1 -1
- package/icons/carrier.png +0 -0
- package/icons/signal-tower.png +0 -0
- package/icons/tank.png +0 -0
- package/icons/vehicle.png +0 -0
- package/package.json +16 -18
package/dist/banner.d.ts
CHANGED
|
@@ -1,12 +1,241 @@
|
|
|
1
1
|
import * as THREE from 'three';
|
|
2
|
-
import { ComponentNature, Shape } from '@hatiolab/things-scene';
|
|
3
|
-
import { RealObject } from './threed/real-object.js';
|
|
2
|
+
import { Component, ComponentNature, Shape, RealObject } from '@hatiolab/things-scene';
|
|
4
3
|
export declare class Banner3D extends RealObject {
|
|
5
4
|
build(): void;
|
|
6
5
|
createCube(w: number, h: number, d: number): THREE.Mesh<THREE.BoxGeometry, THREE.MeshStandardMaterial, THREE.Object3DEventMap>;
|
|
7
6
|
createTextureBoard(w: number, h: number): THREE.Mesh<THREE.PlaneGeometry, THREE.MeshStandardMaterial, THREE.Object3DEventMap>;
|
|
8
7
|
}
|
|
9
|
-
declare const Banner_base:
|
|
8
|
+
declare const Banner_base: (new (...args: any[]) => {
|
|
9
|
+
contains(x: any, y: any): boolean;
|
|
10
|
+
get path(): {
|
|
11
|
+
x: any;
|
|
12
|
+
y: any;
|
|
13
|
+
}[];
|
|
14
|
+
set path(path: {
|
|
15
|
+
x: any;
|
|
16
|
+
y: any;
|
|
17
|
+
}[]): any;
|
|
18
|
+
get anchors(): {
|
|
19
|
+
name: string;
|
|
20
|
+
position: {
|
|
21
|
+
x: any;
|
|
22
|
+
y: any;
|
|
23
|
+
};
|
|
24
|
+
}[];
|
|
25
|
+
get bounds(): any;
|
|
26
|
+
set bounds(bounds: any): any;
|
|
27
|
+
render(ctx: any): void;
|
|
28
|
+
_app: any;
|
|
29
|
+
_model: any;
|
|
30
|
+
_state: any;
|
|
31
|
+
_delta: any;
|
|
32
|
+
_animation: any;
|
|
33
|
+
_animate: any;
|
|
34
|
+
_parent: any;
|
|
35
|
+
_disposed: any;
|
|
36
|
+
_textHidden: any;
|
|
37
|
+
_text_substitutor: any;
|
|
38
|
+
_value_substitutor: any;
|
|
39
|
+
_mappings: any;
|
|
40
|
+
_realObject: import("@hatiolab/things-scene").IRealObject | undefined;
|
|
41
|
+
_cachedState: any;
|
|
42
|
+
updatedAt: any;
|
|
43
|
+
fontSize: any;
|
|
44
|
+
__cache__: any;
|
|
45
|
+
created(): void;
|
|
46
|
+
added(parent: any): void;
|
|
47
|
+
removed(parent: any): void;
|
|
48
|
+
ready(): Promise<void>;
|
|
49
|
+
touch(): void;
|
|
50
|
+
clearCache(...attrs: any[]): void;
|
|
51
|
+
removeSelf(completely: any): void;
|
|
52
|
+
resetAnimation(): void;
|
|
53
|
+
dispose(): void;
|
|
54
|
+
get nature(): import("@hatiolab/things-scene").ComponentNature;
|
|
55
|
+
get disposed(): boolean;
|
|
56
|
+
isLayer(): boolean;
|
|
57
|
+
isGroup(): boolean;
|
|
58
|
+
isContainer(): this is import("@hatiolab/things-scene/dist-types/types/component").Container;
|
|
59
|
+
isLine(): boolean;
|
|
60
|
+
isRoot(): boolean;
|
|
61
|
+
isRootModel(): boolean;
|
|
62
|
+
is3dish(): boolean;
|
|
63
|
+
isIn3DSpace(): boolean;
|
|
64
|
+
isTemplate(): boolean;
|
|
65
|
+
isHTMLElement(): boolean;
|
|
66
|
+
isConnectable(): boolean;
|
|
67
|
+
isIdentifiable(): boolean;
|
|
68
|
+
isPositionable(): boolean;
|
|
69
|
+
replaceRefids(replaceMap: any): void;
|
|
70
|
+
get(property: any): any;
|
|
71
|
+
set(props: any, propval?: any): any;
|
|
72
|
+
getState(property: any): any;
|
|
73
|
+
setState(props: any, propval?: any): any;
|
|
74
|
+
get model(): any;
|
|
75
|
+
get state(): any;
|
|
76
|
+
get hierarchy(): any;
|
|
77
|
+
get volatile(): never[];
|
|
78
|
+
_applyProps(target: any, props: any, options: any): any;
|
|
79
|
+
move(offset: {
|
|
80
|
+
x: number;
|
|
81
|
+
y: number;
|
|
82
|
+
}, ...args: boolean[]): void;
|
|
83
|
+
symmetryX(x?: number): void;
|
|
84
|
+
symmetryY(y: number): void;
|
|
85
|
+
adjustResize(bounds: import("@hatiolab/things-scene").BOUNDS, origin_bounds: import("@hatiolab/things-scene").BOUNDS, diagonal: boolean): any;
|
|
86
|
+
adjustRotation(rotation: number, step: boolean): any;
|
|
87
|
+
outline(progress: number): any;
|
|
88
|
+
get center(): import("@hatiolab/things-scene").POINT;
|
|
89
|
+
set center(p: import("@hatiolab/things-scene").POINT): any;
|
|
90
|
+
get location(): import("@hatiolab/things-scene").POINT;
|
|
91
|
+
set location(l: import("@hatiolab/things-scene").POINT): any;
|
|
92
|
+
get rotate(): import("@hatiolab/things-scene").POINT;
|
|
93
|
+
set rotate(r: import("@hatiolab/things-scene").POINT): any;
|
|
94
|
+
get dimension(): import("@hatiolab/things-scene").DIMENSION;
|
|
95
|
+
set dimension(d: import("@hatiolab/things-scene").DIMENSION): any;
|
|
96
|
+
get drawPath(): import("@hatiolab/things-scene").POINT[];
|
|
97
|
+
get rotatePoint(): import("@hatiolab/things-scene").POINT;
|
|
98
|
+
get mutable(): boolean;
|
|
99
|
+
get resizable(): boolean;
|
|
100
|
+
get rotatable(): boolean;
|
|
101
|
+
buildRealObject(): import("@hatiolab/things-scene").IRealObject | undefined;
|
|
102
|
+
get realObject(): import("@hatiolab/things-scene").IRealObject | undefined;
|
|
103
|
+
draw(context?: import("@hatiolab/things-scene").SceneRenderContext): void;
|
|
104
|
+
prerender(context: import("@hatiolab/things-scene").SceneRenderContext): void;
|
|
105
|
+
postrender(context: import("@hatiolab/things-scene").SceneRenderContext): void;
|
|
106
|
+
prepare(resolve: (component: Component) => void, reject: (reason: any) => void): void;
|
|
107
|
+
prepareIf(condition: boolean): void;
|
|
108
|
+
drawText(context: import("@hatiolab/things-scene").SceneRenderContext): void;
|
|
109
|
+
drawStroke(context: import("@hatiolab/things-scene").SceneRenderContext, override?: Record<string, unknown>): void;
|
|
110
|
+
drawFill(context: import("@hatiolab/things-scene").SceneRenderContext, override?: Record<string, unknown>): void;
|
|
111
|
+
get strokeStyle(): any;
|
|
112
|
+
set strokeStyle(v: any): any;
|
|
113
|
+
get fillStyle(): any;
|
|
114
|
+
set fillStyle(v: any): any;
|
|
115
|
+
get fontColor(): string;
|
|
116
|
+
set fontColor(v: string): any;
|
|
117
|
+
get rotation(): number;
|
|
118
|
+
set rotation(v: number): any;
|
|
119
|
+
get decorators(): string[];
|
|
120
|
+
get decotag(): string;
|
|
121
|
+
get hidden(): boolean;
|
|
122
|
+
set hidden(v: boolean): any;
|
|
123
|
+
get tag(): string;
|
|
124
|
+
set tag(v: string): any;
|
|
125
|
+
get appendum(): any;
|
|
126
|
+
set appendum(v: any): any;
|
|
127
|
+
defaultTextSubstitutor(): any;
|
|
128
|
+
textLines(context?: import("@hatiolab/things-scene").SceneRenderContext): any;
|
|
129
|
+
get font(): string;
|
|
130
|
+
get lineHeight(): number;
|
|
131
|
+
get textSubstitutor(): () => string;
|
|
132
|
+
get text(): string;
|
|
133
|
+
set text(v: string): any;
|
|
134
|
+
get textBounds(): import("@hatiolab/things-scene").BOUNDS;
|
|
135
|
+
get textRotation(): number;
|
|
136
|
+
get textHidden(): boolean;
|
|
137
|
+
set textHidden(v: boolean): any;
|
|
138
|
+
get hasTextProperty(): boolean;
|
|
139
|
+
animate(opts: import("@hatiolab/things-scene/dist-types/animation/interfaces").AnimationConfig): any;
|
|
140
|
+
effect(context: import("@hatiolab/things-scene").SceneRenderContext, model: any): any;
|
|
141
|
+
serialize(...others: any[]): any;
|
|
142
|
+
trim(): void;
|
|
143
|
+
closeScene(data: any): void;
|
|
144
|
+
delta(attr?: string | object, value?: any): any;
|
|
145
|
+
invalidate(): void;
|
|
146
|
+
get value(): any;
|
|
147
|
+
set value(v: any): any;
|
|
148
|
+
get data(): any;
|
|
149
|
+
set data(v: any): any;
|
|
150
|
+
set tap(v: any): any;
|
|
151
|
+
get mappings(): any[];
|
|
152
|
+
get retention(): number;
|
|
153
|
+
get animation(): import("@hatiolab/things-scene/dist-types/animation/interfaces").AnimationController | undefined;
|
|
154
|
+
get started(): boolean;
|
|
155
|
+
set started(v: boolean): any;
|
|
156
|
+
get controls(): import("@hatiolab/things-scene").Control[] | undefined;
|
|
157
|
+
findFirst(finder: string | ((c: Component) => boolean), ...others: any[]): any;
|
|
158
|
+
findAll(s: string | ((c: Component) => boolean), ...others: any[]): any;
|
|
159
|
+
capture(x: number, y: number, except?: (c: Component) => boolean): any;
|
|
160
|
+
findAnchor(name: string): any;
|
|
161
|
+
isDescendible(container: Component): any;
|
|
162
|
+
getContext(component?: unknown): any;
|
|
163
|
+
get root(): Component;
|
|
164
|
+
get rootModel(): Component;
|
|
165
|
+
get parent(): Component;
|
|
166
|
+
set parent(v: Component): any;
|
|
167
|
+
get scalable(): boolean;
|
|
168
|
+
get stuck(): boolean;
|
|
169
|
+
get capturable(): boolean;
|
|
170
|
+
get position(): string;
|
|
171
|
+
get origin(): string;
|
|
172
|
+
get offset(): import("@hatiolab/things-scene").POINT;
|
|
173
|
+
get app(): import("@hatiolab/things-scene").ApplicationContext;
|
|
174
|
+
drawEffect(context: import("@hatiolab/things-scene").SceneRenderContext): void;
|
|
175
|
+
prepareFill(resolve: Function, reject: Function): void;
|
|
176
|
+
prepareFillIf(condition: boolean): void;
|
|
177
|
+
onchangeFill(after: Record<string, any>, before: Record<string, any>): void;
|
|
178
|
+
drawImage(context: import("@hatiolab/things-scene").SceneRenderContext, image: HTMLImageElement, left: number, top: number, width: number, height: number): void;
|
|
179
|
+
mutateBounds(logic: ((bounds: import("@hatiolab/things-scene").BOUNDS) => import("@hatiolab/things-scene").BOUNDS | void) | null, context?: any): void;
|
|
180
|
+
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;
|
|
181
|
+
access(accessor: string, data: any): any;
|
|
182
|
+
substitute(template: string, data: any): any;
|
|
183
|
+
onchangeMappings(after: Record<string, any>, before: Record<string, any>): void;
|
|
184
|
+
onchangeData(after: Record<string, any>, before: Record<string, any>): void;
|
|
185
|
+
buildMappings(): void;
|
|
186
|
+
executeMappings(force?: boolean): void;
|
|
187
|
+
disposeMappings(): void;
|
|
188
|
+
ondropfile(transfered: FileList, files: string[]): void;
|
|
189
|
+
transcoordS2P(x: number, y: number, rp?: import("@hatiolab/things-scene").POINT): import("@hatiolab/things-scene").POINT;
|
|
190
|
+
transcoordP2S(x: number, y: number, rp?: import("@hatiolab/things-scene").POINT): import("@hatiolab/things-scene").POINT;
|
|
191
|
+
transcoordS2T(x: number, y: number, top?: Component): import("@hatiolab/things-scene").POINT;
|
|
192
|
+
transcoordT2P(x: number, y: number, top?: Component): import("@hatiolab/things-scene").POINT;
|
|
193
|
+
transcoordT2S(x: number, y: number, top?: Component): import("@hatiolab/things-scene").POINT;
|
|
194
|
+
transcoordS2TR(x: number, y: number, top?: Component): import("@hatiolab/things-scene").POINT;
|
|
195
|
+
transcoordS2O(x: number, y: number, target: Component): import("@hatiolab/things-scene").POINT;
|
|
196
|
+
transcoordC2S(x: number, y: number, top?: Component): import("@hatiolab/things-scene").POINT;
|
|
197
|
+
transcoordS2C(x: number, y: number, top?: Component): import("@hatiolab/things-scene").POINT;
|
|
198
|
+
toParent(x: number, y: number, rp?: import("@hatiolab/things-scene").POINT): import("@hatiolab/things-scene").POINT;
|
|
199
|
+
fromParent(x: number, y: number, rp?: import("@hatiolab/things-scene").POINT): import("@hatiolab/things-scene").POINT;
|
|
200
|
+
toScene(x: number, y: number, top?: Component): import("@hatiolab/things-scene").POINT;
|
|
201
|
+
fromScene(x: number, y: number, top?: Component): import("@hatiolab/things-scene").POINT;
|
|
202
|
+
toLocal(x: number, y: number, top?: Component): import("@hatiolab/things-scene").POINT;
|
|
203
|
+
toGlobal(x: number, y: number, top?: Component): import("@hatiolab/things-scene").POINT;
|
|
204
|
+
toOther(x: number, y: number, target: Component): import("@hatiolab/things-scene").POINT;
|
|
205
|
+
on(name: string | object, callback: Function, context?: any): any;
|
|
206
|
+
off(name?: string | object, callback?: Function, context?: any): any;
|
|
207
|
+
once(name: string | object, callback: Function, context?: any): any;
|
|
208
|
+
trigger(name: string, ...args: any[]): any;
|
|
209
|
+
delegate_on(delegator: any): any;
|
|
210
|
+
delegate_off(delegator: any): any;
|
|
211
|
+
onchange(after: Record<string, any>, before: Record<string, any>): void;
|
|
212
|
+
calculateBounds?(): void;
|
|
213
|
+
oncreate_element?(element: HTMLElement): void;
|
|
214
|
+
removeComponent(component: Component, ghost?: boolean): void;
|
|
215
|
+
addComponent(component: Component, ghost?: boolean): void;
|
|
216
|
+
insertComponentAt(component: Component, index: number, ghost?: boolean): void;
|
|
217
|
+
getOverlay(component: Component): HTMLElement | undefined;
|
|
218
|
+
findById(id: string): Component | undefined;
|
|
219
|
+
findByRefid(ref: string | number): Component | undefined;
|
|
220
|
+
findAllById(id: string): Component[];
|
|
221
|
+
resize(): void;
|
|
222
|
+
fit(type?: string): void;
|
|
223
|
+
get components(): Component[] | undefined;
|
|
224
|
+
get layout(): any;
|
|
225
|
+
get auxOverlay(): HTMLElement | undefined;
|
|
226
|
+
get isReady(): boolean;
|
|
227
|
+
get unitScale(): number;
|
|
228
|
+
get selected(): Component[];
|
|
229
|
+
set selected(_v: Component[]): any;
|
|
230
|
+
get focused(): Component | null;
|
|
231
|
+
set focused(_v: Component | null): any;
|
|
232
|
+
get hasSameParentForAllSelected(): boolean;
|
|
233
|
+
set hasSameParentForAllSelected(_v: boolean): any;
|
|
234
|
+
get fitMode(): string | undefined;
|
|
235
|
+
set fitMode(_v: string | undefined): any;
|
|
236
|
+
get element(): HTMLElement | null;
|
|
237
|
+
set element(_v: HTMLElement | null): any;
|
|
238
|
+
}) & typeof Shape;
|
|
10
239
|
export declare class Banner extends Banner_base {
|
|
11
240
|
is3dish(): boolean;
|
|
12
241
|
get nature(): ComponentNature;
|
package/dist/banner.js
CHANGED
|
@@ -3,8 +3,7 @@ import { __decorate } from "tslib";
|
|
|
3
3
|
* Copyright © HatioLab Inc. All rights reserved.
|
|
4
4
|
*/
|
|
5
5
|
import * as THREE from 'three';
|
|
6
|
-
import { RectPath, Shape, sceneComponent } from '@hatiolab/things-scene';
|
|
7
|
-
import { RealObject } from './threed/real-object.js';
|
|
6
|
+
import { RectPath, Shape, sceneComponent, RealObject } from '@hatiolab/things-scene';
|
|
8
7
|
const NATURE = {
|
|
9
8
|
mutable: false,
|
|
10
9
|
resizable: true,
|
package/dist/banner.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"banner.js","sourceRoot":"","sources":["../src/banner.ts"],"names":[],"mappings":";AAAA;;GAEG;AACH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,EAA8B,QAAQ,EAAE,KAAK,EAAE,cAAc,EAAE,
|
|
1
|
+
{"version":3,"file":"banner.js","sourceRoot":"","sources":["../src/banner.ts"],"names":[],"mappings":";AAAA;;GAEG;AACH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,EAA8B,QAAQ,EAAE,KAAK,EAAE,cAAc,EAAE,UAAU,EAAkB,MAAM,wBAAwB,CAAA;AAEhI,MAAM,MAAM,GAAoB;IAC9B,OAAO,EAAE,KAAK;IACd,SAAS,EAAE,IAAI;IACf,SAAS,EAAE,IAAI;IACf,UAAU,EAAE;QACV;YACE,IAAI,EAAE,OAAO;YACb,KAAK,EAAE,WAAW;YAClB,IAAI,EAAE,UAAU;YAChB,QAAQ,EAAE,UAAU;SACrB;KACF;IACD,IAAI,EAAE,wBAAwB;CAC/B,CAAA;AAED,MAAM,OAAO,QAAS,SAAQ,UAAU;IACtC,KAAK;QACH,KAAK,CAAC,KAAK,EAAE,CAAA;QAEb,IAAI,EAAE,KAAK,GAAG,CAAC,EAAE,MAAM,GAAG,CAAC,EAAE,KAAK,GAAG,CAAC,EAAE,GAAG,IAAI,CAAC,SAAS,CAAC,KAAK,CAAA;QAE/D,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,IAAI,CAAC,UAAU,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,CAAC,CAAC,CAAA;QAExD,IAAI,YAAY,GAAG,IAAI,CAAC,kBAAkB,CAAC,KAAK,EAAE,KAAK,CAAC,CAAA;QACxD,YAAY,CAAC,QAAQ,CAAC,GAAG,CAAC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AAI,KAAK,CAAC,aAAa,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAA;QACvD,IAAI,SAAS,GAAG,IAAI,KAAK,CAAC,IAAI,CAAC,aAAa,EAAE,aAAa,CAAC,CAAA;QAC5D,SAAS,CAAC,UAAU,GAAG,IAAI,CAAA;QAE3B,OAAO,SAAS,CAAA;IAClB,CAAC;CACF;AAGM,IAAM,MAAM,GAAZ,MAAM,MAAO,SAAQ,QAAQ,CAAC,KAAK,CAAC;IACzC,OAAO;QACL,OAAO,IAAI,CAAA;IACb,CAAC;IAED,IAAI,MAAM;QACR,OAAO,MAAM,CAAA;IACf,CAAC;IAED,eAAe;QACb,OAAO,IAAI,QAAQ,CAAC,IAAW,CAAC,CAAA;IAClC,CAAC;CACF,CAAA;AAZY,MAAM;IADlB,cAAc,CAAC,QAAQ,CAAC;GACZ,MAAM,CAYlB","sourcesContent":["/*\n * Copyright © HatioLab Inc. All rights reserved.\n */\nimport * as THREE from 'three'\nimport { Component, ComponentNature, RectPath, Shape, sceneComponent, RealObject, RealObjectMesh } from '@hatiolab/things-scene'\n\nconst NATURE: ComponentNature = {\n mutable: false,\n resizable: true,\n rotatable: true,\n properties: [\n {\n type: 'color',\n label: 'box-color',\n name: 'boxColor',\n property: 'boxColor'\n }\n ],\n help: 'scene/component/banner'\n}\n\nexport class Banner3D extends RealObject {\n build() {\n super.build()\n\n var { width = 1, height = 1, depth = 1 } = this.component.state\n\n this.object3d.add(this.createCube(width, height, depth))\n\n let textureBoard = this.createTextureBoard(width, depth)\n textureBoard.position.set(0, 0, 0.5 * height + 1)\n this.object3d.add(textureBoard)\n }\n\n createCube(w: number, h: number, d: number) {\n var { boxColor = '#ccaa76' } = this.component.state\n\n var geometry = new THREE.BoxGeometry(w, d, h)\n var material = new THREE.MeshStandardMaterial({\n color: boxColor,\n side: THREE.FrontSide\n })\n\n var cube = new THREE.Mesh(geometry, material)\n cube.castShadow = true\n\n return cube\n }\n\n createTextureBoard(w: number, h: number) {\n var boardMaterial\n\n let { fillStyle = '#ccaa76' } = this.component.state\n const texture = RealObject.buildFillStyleTexture(this.component)\n\n if (texture) {\n boardMaterial = new THREE.MeshStandardMaterial({ map: texture })\n } else {\n boardMaterial = new THREE.MeshStandardMaterial({\n color: fillStyle || '#ccaa76',\n side: THREE.FrontSide\n })\n }\n\n var boardGeometry = new THREE.PlaneGeometry(w, h, 1, 1)\n var boardMesh = new THREE.Mesh(boardGeometry, boardMaterial)\n boardMesh.castShadow = true\n\n return boardMesh\n }\n}\n\n@sceneComponent('banner')\nexport class Banner extends RectPath(Shape) {\n is3dish() {\n return true\n }\n\n get nature() {\n return NATURE\n }\n\n buildRealObject(): RealObject | undefined {\n return new Banner3D(this as any)\n }\n}\n"]}
|
package/dist/camera.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 Camera3D extends RealObject<THREE.Mesh> {
|
|
5
4
|
camera?: THREE.PerspectiveCamera;
|
|
6
5
|
helper?: THREE.CameraHelper;
|
|
@@ -8,7 +7,237 @@ export declare class Camera3D extends RealObject<THREE.Mesh> {
|
|
|
8
7
|
updateCamera(): void;
|
|
9
8
|
build(): void;
|
|
10
9
|
}
|
|
11
|
-
declare const Camera_base:
|
|
10
|
+
declare const Camera_base: (new (...args: any[]) => {
|
|
11
|
+
contains(x: any, y: any): boolean;
|
|
12
|
+
get path(): {
|
|
13
|
+
x: any;
|
|
14
|
+
y: any;
|
|
15
|
+
}[];
|
|
16
|
+
set path(path: {
|
|
17
|
+
x: any;
|
|
18
|
+
y: any;
|
|
19
|
+
}[]): any;
|
|
20
|
+
get anchors(): {
|
|
21
|
+
name: string;
|
|
22
|
+
position: {
|
|
23
|
+
x: any;
|
|
24
|
+
y: any;
|
|
25
|
+
};
|
|
26
|
+
}[];
|
|
27
|
+
get bounds(): any;
|
|
28
|
+
set bounds(bounds: any): any;
|
|
29
|
+
render(ctx: any): void;
|
|
30
|
+
_app: any;
|
|
31
|
+
_model: any;
|
|
32
|
+
_state: any;
|
|
33
|
+
_delta: any;
|
|
34
|
+
_animation: any;
|
|
35
|
+
_animate: any;
|
|
36
|
+
_parent: any;
|
|
37
|
+
_disposed: any;
|
|
38
|
+
_textHidden: any;
|
|
39
|
+
_text_substitutor: any;
|
|
40
|
+
_value_substitutor: any;
|
|
41
|
+
_mappings: any;
|
|
42
|
+
_realObject: import("@hatiolab/things-scene").IRealObject | undefined;
|
|
43
|
+
_cachedState: any;
|
|
44
|
+
updatedAt: any;
|
|
45
|
+
fontSize: any;
|
|
46
|
+
__cache__: any;
|
|
47
|
+
created(): void;
|
|
48
|
+
added(parent: any): void;
|
|
49
|
+
removed(parent: any): void;
|
|
50
|
+
ready(): Promise<void>;
|
|
51
|
+
touch(): void;
|
|
52
|
+
clearCache(...attrs: any[]): void;
|
|
53
|
+
removeSelf(completely: any): void;
|
|
54
|
+
resetAnimation(): void;
|
|
55
|
+
dispose(): void;
|
|
56
|
+
get nature(): import("@hatiolab/things-scene").ComponentNature;
|
|
57
|
+
get disposed(): boolean;
|
|
58
|
+
isLayer(): boolean;
|
|
59
|
+
isGroup(): boolean;
|
|
60
|
+
isContainer(): this is import("@hatiolab/things-scene/dist-types/types/component").Container;
|
|
61
|
+
isLine(): boolean;
|
|
62
|
+
isRoot(): boolean;
|
|
63
|
+
isRootModel(): boolean;
|
|
64
|
+
is3dish(): boolean;
|
|
65
|
+
isIn3DSpace(): boolean;
|
|
66
|
+
isTemplate(): boolean;
|
|
67
|
+
isHTMLElement(): boolean;
|
|
68
|
+
isConnectable(): boolean;
|
|
69
|
+
isIdentifiable(): boolean;
|
|
70
|
+
isPositionable(): boolean;
|
|
71
|
+
replaceRefids(replaceMap: any): void;
|
|
72
|
+
get(property: any): any;
|
|
73
|
+
set(props: any, propval?: any): any;
|
|
74
|
+
getState(property: any): any;
|
|
75
|
+
setState(props: any, propval?: any): any;
|
|
76
|
+
get model(): any;
|
|
77
|
+
get state(): any;
|
|
78
|
+
get hierarchy(): any;
|
|
79
|
+
get volatile(): never[];
|
|
80
|
+
_applyProps(target: any, props: any, options: any): any;
|
|
81
|
+
move(offset: {
|
|
82
|
+
x: number;
|
|
83
|
+
y: number;
|
|
84
|
+
}, ...args: boolean[]): void;
|
|
85
|
+
symmetryX(x?: number): void;
|
|
86
|
+
symmetryY(y: number): void;
|
|
87
|
+
adjustResize(bounds: import("@hatiolab/things-scene").BOUNDS, origin_bounds: import("@hatiolab/things-scene").BOUNDS, diagonal: boolean): any;
|
|
88
|
+
adjustRotation(rotation: number, step: boolean): any;
|
|
89
|
+
outline(progress: number): any;
|
|
90
|
+
get center(): import("@hatiolab/things-scene").POINT;
|
|
91
|
+
set center(p: import("@hatiolab/things-scene").POINT): any;
|
|
92
|
+
get location(): import("@hatiolab/things-scene").POINT;
|
|
93
|
+
set location(l: import("@hatiolab/things-scene").POINT): any;
|
|
94
|
+
get rotate(): import("@hatiolab/things-scene").POINT;
|
|
95
|
+
set rotate(r: import("@hatiolab/things-scene").POINT): any;
|
|
96
|
+
get dimension(): import("@hatiolab/things-scene").DIMENSION;
|
|
97
|
+
set dimension(d: import("@hatiolab/things-scene").DIMENSION): any;
|
|
98
|
+
get drawPath(): import("@hatiolab/things-scene").POINT[];
|
|
99
|
+
get rotatePoint(): import("@hatiolab/things-scene").POINT;
|
|
100
|
+
get mutable(): boolean;
|
|
101
|
+
get resizable(): boolean;
|
|
102
|
+
get rotatable(): boolean;
|
|
103
|
+
buildRealObject(): import("@hatiolab/things-scene").IRealObject | undefined;
|
|
104
|
+
get realObject(): import("@hatiolab/things-scene").IRealObject | undefined;
|
|
105
|
+
draw(context?: import("@hatiolab/things-scene").SceneRenderContext): void;
|
|
106
|
+
prerender(context: import("@hatiolab/things-scene").SceneRenderContext): void;
|
|
107
|
+
postrender(context: import("@hatiolab/things-scene").SceneRenderContext): void;
|
|
108
|
+
prepare(resolve: (component: Component) => void, reject: (reason: any) => void): void;
|
|
109
|
+
prepareIf(condition: boolean): void;
|
|
110
|
+
drawText(context: import("@hatiolab/things-scene").SceneRenderContext): void;
|
|
111
|
+
drawStroke(context: import("@hatiolab/things-scene").SceneRenderContext, override?: Record<string, unknown>): void;
|
|
112
|
+
drawFill(context: import("@hatiolab/things-scene").SceneRenderContext, override?: Record<string, unknown>): void;
|
|
113
|
+
get strokeStyle(): any;
|
|
114
|
+
set strokeStyle(v: any): any;
|
|
115
|
+
get fillStyle(): any;
|
|
116
|
+
set fillStyle(v: any): any;
|
|
117
|
+
get fontColor(): string;
|
|
118
|
+
set fontColor(v: string): any;
|
|
119
|
+
get rotation(): number;
|
|
120
|
+
set rotation(v: number): any;
|
|
121
|
+
get decorators(): string[];
|
|
122
|
+
get decotag(): string;
|
|
123
|
+
get hidden(): boolean;
|
|
124
|
+
set hidden(v: boolean): any;
|
|
125
|
+
get tag(): string;
|
|
126
|
+
set tag(v: string): any;
|
|
127
|
+
get appendum(): any;
|
|
128
|
+
set appendum(v: any): any;
|
|
129
|
+
defaultTextSubstitutor(): any;
|
|
130
|
+
textLines(context?: import("@hatiolab/things-scene").SceneRenderContext): any;
|
|
131
|
+
get font(): string;
|
|
132
|
+
get lineHeight(): number;
|
|
133
|
+
get textSubstitutor(): () => string;
|
|
134
|
+
get text(): string;
|
|
135
|
+
set text(v: string): any;
|
|
136
|
+
get textBounds(): import("@hatiolab/things-scene").BOUNDS;
|
|
137
|
+
get textRotation(): number;
|
|
138
|
+
get textHidden(): boolean;
|
|
139
|
+
set textHidden(v: boolean): any;
|
|
140
|
+
get hasTextProperty(): boolean;
|
|
141
|
+
animate(opts: import("@hatiolab/things-scene/dist-types/animation/interfaces").AnimationConfig): any;
|
|
142
|
+
effect(context: import("@hatiolab/things-scene").SceneRenderContext, model: any): any;
|
|
143
|
+
serialize(...others: any[]): any;
|
|
144
|
+
trim(): void;
|
|
145
|
+
closeScene(data: any): void;
|
|
146
|
+
delta(attr?: string | object, value?: any): any;
|
|
147
|
+
invalidate(): void;
|
|
148
|
+
get value(): any;
|
|
149
|
+
set value(v: any): any;
|
|
150
|
+
get data(): any;
|
|
151
|
+
set data(v: any): any;
|
|
152
|
+
set tap(v: any): any;
|
|
153
|
+
get mappings(): any[];
|
|
154
|
+
get retention(): number;
|
|
155
|
+
get animation(): import("@hatiolab/things-scene/dist-types/animation/interfaces").AnimationController | undefined;
|
|
156
|
+
get started(): boolean;
|
|
157
|
+
set started(v: boolean): any;
|
|
158
|
+
get controls(): import("@hatiolab/things-scene").Control[] | undefined;
|
|
159
|
+
findFirst(finder: string | ((c: Component) => boolean), ...others: any[]): any;
|
|
160
|
+
findAll(s: string | ((c: Component) => boolean), ...others: any[]): any;
|
|
161
|
+
capture(x: number, y: number, except?: (c: Component) => boolean): any;
|
|
162
|
+
findAnchor(name: string): any;
|
|
163
|
+
isDescendible(container: Component): any;
|
|
164
|
+
getContext(component?: unknown): any;
|
|
165
|
+
get root(): Component;
|
|
166
|
+
get rootModel(): Component;
|
|
167
|
+
get parent(): Component;
|
|
168
|
+
set parent(v: Component): any;
|
|
169
|
+
get scalable(): boolean;
|
|
170
|
+
get stuck(): boolean;
|
|
171
|
+
get capturable(): boolean;
|
|
172
|
+
get position(): string;
|
|
173
|
+
get origin(): string;
|
|
174
|
+
get offset(): import("@hatiolab/things-scene").POINT;
|
|
175
|
+
get app(): import("@hatiolab/things-scene").ApplicationContext;
|
|
176
|
+
drawEffect(context: import("@hatiolab/things-scene").SceneRenderContext): void;
|
|
177
|
+
prepareFill(resolve: Function, reject: Function): void;
|
|
178
|
+
prepareFillIf(condition: boolean): void;
|
|
179
|
+
onchangeFill(after: Record<string, any>, before: Record<string, any>): void;
|
|
180
|
+
drawImage(context: import("@hatiolab/things-scene").SceneRenderContext, image: HTMLImageElement, left: number, top: number, width: number, height: number): void;
|
|
181
|
+
mutateBounds(logic: ((bounds: import("@hatiolab/things-scene").BOUNDS) => import("@hatiolab/things-scene").BOUNDS | void) | null, context?: any): void;
|
|
182
|
+
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;
|
|
183
|
+
access(accessor: string, data: any): any;
|
|
184
|
+
substitute(template: string, data: any): any;
|
|
185
|
+
onchangeMappings(after: Record<string, any>, before: Record<string, any>): void;
|
|
186
|
+
onchangeData(after: Record<string, any>, before: Record<string, any>): void;
|
|
187
|
+
buildMappings(): void;
|
|
188
|
+
executeMappings(force?: boolean): void;
|
|
189
|
+
disposeMappings(): void;
|
|
190
|
+
ondropfile(transfered: FileList, files: string[]): void;
|
|
191
|
+
transcoordS2P(x: number, y: number, rp?: import("@hatiolab/things-scene").POINT): import("@hatiolab/things-scene").POINT;
|
|
192
|
+
transcoordP2S(x: number, y: number, rp?: import("@hatiolab/things-scene").POINT): import("@hatiolab/things-scene").POINT;
|
|
193
|
+
transcoordS2T(x: number, y: number, top?: Component): import("@hatiolab/things-scene").POINT;
|
|
194
|
+
transcoordT2P(x: number, y: number, top?: Component): import("@hatiolab/things-scene").POINT;
|
|
195
|
+
transcoordT2S(x: number, y: number, top?: Component): import("@hatiolab/things-scene").POINT;
|
|
196
|
+
transcoordS2TR(x: number, y: number, top?: Component): import("@hatiolab/things-scene").POINT;
|
|
197
|
+
transcoordS2O(x: number, y: number, target: Component): import("@hatiolab/things-scene").POINT;
|
|
198
|
+
transcoordC2S(x: number, y: number, top?: Component): import("@hatiolab/things-scene").POINT;
|
|
199
|
+
transcoordS2C(x: number, y: number, top?: Component): import("@hatiolab/things-scene").POINT;
|
|
200
|
+
toParent(x: number, y: number, rp?: import("@hatiolab/things-scene").POINT): import("@hatiolab/things-scene").POINT;
|
|
201
|
+
fromParent(x: number, y: number, rp?: import("@hatiolab/things-scene").POINT): import("@hatiolab/things-scene").POINT;
|
|
202
|
+
toScene(x: number, y: number, top?: Component): import("@hatiolab/things-scene").POINT;
|
|
203
|
+
fromScene(x: number, y: number, top?: Component): import("@hatiolab/things-scene").POINT;
|
|
204
|
+
toLocal(x: number, y: number, top?: Component): import("@hatiolab/things-scene").POINT;
|
|
205
|
+
toGlobal(x: number, y: number, top?: Component): import("@hatiolab/things-scene").POINT;
|
|
206
|
+
toOther(x: number, y: number, target: Component): import("@hatiolab/things-scene").POINT;
|
|
207
|
+
on(name: string | object, callback: Function, context?: any): any;
|
|
208
|
+
off(name?: string | object, callback?: Function, context?: any): any;
|
|
209
|
+
once(name: string | object, callback: Function, context?: any): any;
|
|
210
|
+
trigger(name: string, ...args: any[]): any;
|
|
211
|
+
delegate_on(delegator: any): any;
|
|
212
|
+
delegate_off(delegator: any): any;
|
|
213
|
+
onchange(after: Record<string, any>, before: Record<string, any>): void;
|
|
214
|
+
calculateBounds?(): void;
|
|
215
|
+
oncreate_element?(element: HTMLElement): void;
|
|
216
|
+
removeComponent(component: Component, ghost?: boolean): void;
|
|
217
|
+
addComponent(component: Component, ghost?: boolean): void;
|
|
218
|
+
insertComponentAt(component: Component, index: number, ghost?: boolean): void;
|
|
219
|
+
getOverlay(component: Component): HTMLElement | undefined;
|
|
220
|
+
findById(id: string): Component | undefined;
|
|
221
|
+
findByRefid(ref: string | number): Component | undefined;
|
|
222
|
+
findAllById(id: string): Component[];
|
|
223
|
+
resize(): void;
|
|
224
|
+
fit(type?: string): void;
|
|
225
|
+
get components(): Component[] | undefined;
|
|
226
|
+
get layout(): any;
|
|
227
|
+
get auxOverlay(): HTMLElement | undefined;
|
|
228
|
+
get isReady(): boolean;
|
|
229
|
+
get unitScale(): number;
|
|
230
|
+
get selected(): Component[];
|
|
231
|
+
set selected(_v: Component[]): any;
|
|
232
|
+
get focused(): Component | null;
|
|
233
|
+
set focused(_v: Component | null): any;
|
|
234
|
+
get hasSameParentForAllSelected(): boolean;
|
|
235
|
+
set hasSameParentForAllSelected(_v: boolean): any;
|
|
236
|
+
get fitMode(): string | undefined;
|
|
237
|
+
set fitMode(_v: string | undefined): any;
|
|
238
|
+
get element(): HTMLElement | null;
|
|
239
|
+
set element(_v: HTMLElement | null): any;
|
|
240
|
+
}) & typeof Shape;
|
|
12
241
|
export declare class Camera extends Camera_base {
|
|
13
242
|
static _image: HTMLImageElement;
|
|
14
243
|
is3dish(): boolean;
|
package/dist/camera.js
CHANGED
|
@@ -3,9 +3,8 @@ import { __decorate } from "tslib";
|
|
|
3
3
|
/*
|
|
4
4
|
* Copyright © HatioLab Inc. All rights reserved.
|
|
5
5
|
*/
|
|
6
|
-
import { RectPath, Shape, sceneComponent } from '@hatiolab/things-scene';
|
|
6
|
+
import { RectPath, Shape, sceneComponent, RealObject } from '@hatiolab/things-scene';
|
|
7
7
|
import * as THREE from 'three';
|
|
8
|
-
import { RealObject } from './threed/real-object.js';
|
|
9
8
|
const DEFAULT = {
|
|
10
9
|
far: 100000,
|
|
11
10
|
fov: 80,
|
package/dist/camera.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"camera.js","sourceRoot":"","sources":["../src/camera.ts"],"names":[],"mappings":";;AAAA;;GAEG;AACH,OAAO,EAA8B,QAAQ,EAAE,KAAK,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAA;
|
|
1
|
+
{"version":3,"file":"camera.js","sourceRoot":"","sources":["../src/camera.ts"],"names":[],"mappings":";;AAAA;;GAEG;AACH,OAAO,EAA8B,QAAQ,EAAE,KAAK,EAAE,cAAc,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAA;AAChH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAE9B,MAAM,OAAO,GAAG;IACd,GAAG,EAAE,MAAM;IACX,GAAG,EAAE,EAAE;IACP,IAAI,EAAE,CAAC;IACP,IAAI,EAAE,CAAC;CACR,CAAA;AAED,MAAM,MAAM,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;IAGzC,OAAO;QACL,OAAO,IAAI,CAAA;IACb,CAAC;IAED,MAAM,KAAK,KAAK;QACd,IAAI,CAAC,QAAM,CAAC,MAAM,EAAE,CAAC;YACnB,QAAM,CAAC,MAAM,GAAG,IAAI,KAAK,EAAE,CAAA;YAC3B,QAAM,CAAC,MAAM,CAAC,GAAG,GAAG,IAAI,GAAG,CAAC,yBAAyB,EAAE,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,IAAI,CAAA;QAC9E,CAAC;QAED,OAAO,QAAM,CAAC,MAAM,CAAA;IACtB,CAAC;IAED,MAAM,CAAC,OAAiC;QACtC,IAAI,EAAE,IAAI,EAAE,GAAG,EAAE,KAAK,EAAE,MAAM,EAAE,GAAG,IAAI,CAAC,MAAM,CAAA;QAE9C,OAAO,CAAC,SAAS,EAAE,CAAA;QACnB,IAAI,CAAC,SAAS,CAAC,OAAO,EAAE,QAAM,CAAC,KAAK,EAAE,IAAI,EAAE,GAAG,EAAE,KAAK,EAAE,MAAM,CAAC,CAAA;IACjE,CAAC;IAED,eAAe;QACb,OAAO,IAAI,QAAQ,CAAC,IAAW,CAAC,CAAA;IAClC,CAAC;IAED,IAAI,MAAM;QACR,OAAO,MAAM,CAAA;IACf,CAAC;CACF,CAAA;AA9BY,MAAM;IADlB,cAAc,CAAC,QAAQ,CAAC;GACZ,MAAM,CA8BlB","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 DEFAULT = {\n far: 100000,\n fov: 80,\n near: 1,\n zoom: 1\n}\n\nconst NATURE: ComponentNature = {\n mutable: false,\n resizable: true,\n rotatable: true,\n properties: [\n {\n type: 'number',\n label: 'near',\n name: 'near'\n },\n {\n type: 'number',\n label: 'far',\n name: 'far'\n },\n {\n type: 'number',\n label: 'fov',\n name: 'fov'\n },\n {\n type: 'number',\n label: 'zoom',\n name: 'zoom'\n },\n {\n type: 'checkbox',\n label: 'show-helper',\n name: 'showHelper'\n }\n ],\n help: 'scene/component/camera'\n}\n\nexport class Camera3D extends RealObject<THREE.Mesh> {\n camera?: THREE.PerspectiveCamera\n helper?: THREE.CameraHelper\n\n protected getObject3dInstance() {\n return new THREE.Mesh()\n }\n\n updateCamera() {\n var {\n near = DEFAULT.near,\n far = DEFAULT.far,\n fov = DEFAULT.fov,\n zoom = DEFAULT.zoom,\n showHelper\n } = this.component.state\n\n this.camera!.far = far\n this.camera!.fov = fov\n this.camera!.near = near\n this.camera!.zoom = zoom\n\n if (showHelper) {\n if (!this.helper) {\n this.helper = new THREE.CameraHelper(this.camera!)\n this.object3d.add(this.helper)\n }\n } else if (this.helper) {\n this.object3d.remove(this.helper)\n delete this.helper\n }\n }\n\n build() {\n super.build()\n\n var { width = 0, height = 0, depth = 0, fillStyle = 'lightgray' } = this.component.state\n\n this.object3d.geometry = new THREE.BoxGeometry(width, depth, height)\n this.object3d.material = new THREE.MeshStandardMaterial({ color: fillStyle, side: THREE.FrontSide })\n\n this.camera = new THREE.PerspectiveCamera()\n this.camera.position.set(0, 0, 0)\n\n this.object3d.add(this.camera)\n this.object3d.lookAt(0, 0, 0)\n\n this.updateCamera()\n }\n}\n\n@sceneComponent('camera')\nexport class Camera extends RectPath(Shape) {\n static _image: HTMLImageElement\n\n is3dish() {\n return true\n }\n\n static get image() {\n if (!Camera._image) {\n Camera._image = new Image()\n Camera._image.src = new URL('../icons/camera-big.png', import.meta.url).href\n }\n\n return Camera._image\n }\n\n render(context: CanvasRenderingContext2D) {\n var { left, top, width, height } = this.bounds\n\n context.beginPath()\n this.drawImage(context, Camera.image, left, top, width, height)\n }\n\n buildRealObject(): RealObject | undefined {\n return new Camera3D(this as any)\n }\n\n get nature(): ComponentNature {\n return NATURE\n }\n}\n"]}
|