archgine 1.0.51 → 1.0.55
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/README.md +7 -0
- package/lib/applications/app-cvs.d.ts +18 -1
- package/lib/applications/app-offscreen.d.ts +3 -0
- package/lib/applications/application.d.ts +4 -2
- package/lib/controls/orbit-controller.d.ts +1 -0
- package/lib/core/queue.d.ts +6 -0
- package/lib/core/tic.d.ts +9 -0
- package/lib/effects/debounce-pass.d.ts +13 -0
- package/lib/effects/output-pass.d.ts +10 -0
- package/lib/effects/render-cached-pass.d.ts +2 -0
- package/lib/effects/save-pass.d.ts +11 -0
- package/lib/environment.worker.js +13 -2
- package/lib/extras/adapter.d.ts +11 -32
- package/lib/geometries/geo2.d.ts +2 -0
- package/lib/helpers/canvas-helper.d.ts +2 -2
- package/lib/helpers/geo-helper.d.ts +3 -2
- package/lib/helpers/merge-helper.d.ts +2 -2
- package/lib/helpers/svg-helper.d.ts +43 -0
- package/lib/helpers/texture-helper.d.ts +9 -9
- package/lib/index.mjs +6523 -6123
- package/lib/index.umd.js +27 -27
- package/lib/interfaces.d.ts +18 -4
- package/lib/materials/mat2.d.ts +3 -1
- package/lib/math/box2.d.ts +1 -1
- package/lib/math/matrix3.d.ts +2 -1
- package/lib/objects/shape2.d.ts +1 -0
- package/lib/renderer.worker.js +6878 -6233
- package/lib/renderers/binding-states.d.ts +2 -0
- package/lib/renderers/buffer-renderer.d.ts +2 -1
- package/lib/renderers/cvs-renderer.d.ts +5 -0
- package/lib/renderers/render-target.d.ts +3 -3
- package/lib/renderers/renderer.d.ts +6 -5
- package/lib/renders/renderer2.d.ts +2 -1
- package/lib/renders/svg-renderer.d.ts +2 -1
- package/lib/scenes/loading-scene.d.ts +1 -0
- package/lib/shapes2/dummy.d.ts +19 -0
- package/lib/shapes2/svg.d.ts +18 -0
- package/lib/utils/svg.d.ts +2 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,16 +1,33 @@
|
|
|
1
1
|
import { Application, IApplicationConfig } from './application';
|
|
2
2
|
import { MainScene } from '../scenes/main-scene';
|
|
3
|
-
import { ITree } from '../interfaces';
|
|
3
|
+
import { IEvent, IObject2, ITree } from '../interfaces';
|
|
4
4
|
import { Adapter } from '../extras/adapter';
|
|
5
5
|
export declare class AppCvs<Config extends IApplicationConfig> extends Application<Config> {
|
|
6
6
|
params: Config;
|
|
7
7
|
adapter: Adapter;
|
|
8
|
+
private dynamicLoadedHandler;
|
|
9
|
+
private initializationCompleteHandler;
|
|
8
10
|
mainScene: MainScene<Config>;
|
|
11
|
+
private _url?;
|
|
12
|
+
private _layers?;
|
|
13
|
+
private _tic?;
|
|
14
|
+
private _t;
|
|
9
15
|
constructor(config?: Config);
|
|
10
16
|
destroy(): void;
|
|
17
|
+
trans2LoadingScene(): Promise<void>;
|
|
11
18
|
load(url?: string, layers?: string[]): Promise<void>;
|
|
19
|
+
pushResources2Scene(res?: IObject2[]): void;
|
|
20
|
+
reload(): Promise<void>;
|
|
21
|
+
/** overwrite */
|
|
22
|
+
usedCacheChanged(v?: boolean): Promise<void>;
|
|
12
23
|
getLayers(lv?: number): ITree[];
|
|
13
24
|
trans2MainScene(): void;
|
|
25
|
+
bindAdapterEvents(): void;
|
|
26
|
+
unbindAdapterEvents(): void;
|
|
27
|
+
handleDynamicLoaded(e: IEvent): void;
|
|
28
|
+
handleInitializationComplete(e: IEvent): void;
|
|
14
29
|
fullScreen(): void;
|
|
15
30
|
updateLayersVisibility(ids: string | string[], visible?: boolean): void;
|
|
31
|
+
/** overwrite */
|
|
32
|
+
running(time: DOMHighResTimeStamp): void;
|
|
16
33
|
}
|
|
@@ -22,6 +22,9 @@ export declare class AppOffscreen<Config extends IApplicationConfig> extends Eve
|
|
|
22
22
|
resize(): void;
|
|
23
23
|
load(url: string, layers?: string[]): Promise<void>;
|
|
24
24
|
getLayers(lv?: number): Promise<ITree[]>;
|
|
25
|
+
usedCacheChanged(v?: boolean): void;
|
|
26
|
+
debounceCacheChanged(v?: boolean): void;
|
|
27
|
+
wireframeChanged(v?: boolean): void;
|
|
25
28
|
fullscreen(): Promise<void>;
|
|
26
29
|
saveCameraPosition(id?: string): void;
|
|
27
30
|
restoreCameraPosition(id?: string): void;
|
|
@@ -33,7 +33,7 @@ export declare abstract class Application<Config extends IApplicationConfig> ext
|
|
|
33
33
|
scenes: Scene[];
|
|
34
34
|
nextScenes: Scene[];
|
|
35
35
|
nextBoundingBox: Box2;
|
|
36
|
-
loadingScene
|
|
36
|
+
loadingScene?: Scene;
|
|
37
37
|
composer: EffectComposer;
|
|
38
38
|
renderer: IRenderer2;
|
|
39
39
|
view: View<any>;
|
|
@@ -41,7 +41,9 @@ export declare abstract class Application<Config extends IApplicationConfig> ext
|
|
|
41
41
|
protected constructor(config?: Config);
|
|
42
42
|
get isLoadingScene(): boolean;
|
|
43
43
|
destroy(): void;
|
|
44
|
-
|
|
44
|
+
usedCacheChanged(v?: boolean): Promise<void>;
|
|
45
|
+
wireframeChanged(v?: boolean): void;
|
|
46
|
+
trans2LoadingScene(): Promise<void>;
|
|
45
47
|
hasScene(scene: Scene): boolean;
|
|
46
48
|
pushScene(scene: Scene): void;
|
|
47
49
|
clearScenes(): void;
|
|
@@ -52,6 +52,7 @@ export declare class OrbitController extends EventDispatcher implements IOrbitCo
|
|
|
52
52
|
private readonly hammerInputHandler;
|
|
53
53
|
constructor(dom: HTMLElement, camera: ICamera2, isSvg?: boolean);
|
|
54
54
|
destroy(): void;
|
|
55
|
+
resize(): void;
|
|
55
56
|
update(): void;
|
|
56
57
|
bindEvents(): void;
|
|
57
58
|
unbindEvents(): void;
|
package/lib/core/queue.d.ts
CHANGED
|
@@ -8,6 +8,7 @@ export interface IQueue<T = any> {
|
|
|
8
8
|
getByIndex(index: number): T | undefined;
|
|
9
9
|
setByIndex(index: number, item: T): boolean;
|
|
10
10
|
sort(comparator?: (a: (T | undefined), b: (T | undefined)) => number): void;
|
|
11
|
+
getAll(): T[] | undefined;
|
|
11
12
|
}
|
|
12
13
|
export declare class OQueue<T = any> implements IQueue<T> {
|
|
13
14
|
private count;
|
|
@@ -24,6 +25,7 @@ export declare class OQueue<T = any> implements IQueue<T> {
|
|
|
24
25
|
getByIndex(index: number): T | undefined;
|
|
25
26
|
setByIndex(index: number, item: T): boolean;
|
|
26
27
|
sort(comparator?: (a: (T | undefined), b: (T | undefined)) => number): void;
|
|
28
|
+
getAll(): T[] | undefined;
|
|
27
29
|
}
|
|
28
30
|
export declare class AQueue<T = any> implements IQueue<T> {
|
|
29
31
|
private items;
|
|
@@ -39,6 +41,7 @@ export declare class AQueue<T = any> implements IQueue<T> {
|
|
|
39
41
|
setByIndex(index: number, item: T): boolean;
|
|
40
42
|
sort(comparator?: (a: (T | undefined), b: (T | undefined)) => number): void;
|
|
41
43
|
toString(): string;
|
|
44
|
+
getAll(): T[] | undefined;
|
|
42
45
|
}
|
|
43
46
|
export declare class ABQueue<T = any> implements IQueue<T> {
|
|
44
47
|
cellCapacity: number;
|
|
@@ -58,6 +61,7 @@ export declare class ABQueue<T = any> implements IQueue<T> {
|
|
|
58
61
|
getByIndex(index: number): T | undefined;
|
|
59
62
|
setByIndex(index: number, item: T): boolean;
|
|
60
63
|
sort(comparator?: (a: (T | undefined), b: (T | undefined)) => number): void;
|
|
64
|
+
getAll(): T[] | undefined;
|
|
61
65
|
}
|
|
62
66
|
export declare class LQueue<T = any> implements IQueue<T> {
|
|
63
67
|
private head;
|
|
@@ -75,6 +79,7 @@ export declare class LQueue<T = any> implements IQueue<T> {
|
|
|
75
79
|
isEmpty(): boolean;
|
|
76
80
|
sort(comparator?: (a: (T | undefined), b: (T | undefined)) => number): void;
|
|
77
81
|
toString(): string;
|
|
82
|
+
getAll(): T[] | undefined;
|
|
78
83
|
}
|
|
79
84
|
export declare class Queue<T = any> implements IQueue<T> {
|
|
80
85
|
private items;
|
|
@@ -92,4 +97,5 @@ export declare class Queue<T = any> implements IQueue<T> {
|
|
|
92
97
|
setByIndex(index: number, item: T): boolean;
|
|
93
98
|
sort(comparator?: (a: T | undefined, b: T | undefined) => number): void;
|
|
94
99
|
toString(): string;
|
|
100
|
+
getAll(): T[] | undefined;
|
|
95
101
|
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export declare class Tic {
|
|
2
|
+
duration: number;
|
|
3
|
+
generator?: Generator<undefined, void, unknown>;
|
|
4
|
+
t: number | null;
|
|
5
|
+
constructor(list: number | any[], callback: Function, duration?: number);
|
|
6
|
+
next(): void;
|
|
7
|
+
queue(len: number, callback: Function): Generator<undefined, void, unknown>;
|
|
8
|
+
clear(): void;
|
|
9
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { FullScreenQuad, Pass } from './pass';
|
|
2
|
+
import { default as Scene } from '../scenes/scene';
|
|
3
|
+
import { ICamera2, IRenderer2, IRenderTarget } from '../interfaces';
|
|
4
|
+
export declare class DebouncePass extends Pass {
|
|
5
|
+
name: string;
|
|
6
|
+
scene: Scene;
|
|
7
|
+
camera: ICamera2 | undefined;
|
|
8
|
+
fsQuad: FullScreenQuad;
|
|
9
|
+
version: number;
|
|
10
|
+
constructor(scene: Scene, camera?: ICamera2, clear?: boolean, needsSwap?: boolean);
|
|
11
|
+
get currentVersion(): number;
|
|
12
|
+
render(renderer: IRenderer2, writeBuffer: IRenderTarget, readBuffer: IRenderTarget): void;
|
|
13
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { FullScreenQuad, Pass } from './pass';
|
|
2
|
+
import { IRenderer2, IRenderTarget, ITexture } from '../interfaces';
|
|
3
|
+
export declare class OutputPass extends Pass {
|
|
4
|
+
name: string;
|
|
5
|
+
texture: ITexture;
|
|
6
|
+
fsQuad: FullScreenQuad;
|
|
7
|
+
constructor();
|
|
8
|
+
destroy(): void;
|
|
9
|
+
render(renderer: IRenderer2, writeBuffer: IRenderTarget, readBuffer: IRenderTarget): void;
|
|
10
|
+
}
|
|
@@ -7,7 +7,9 @@ export declare class RenderCachedPass extends Pass {
|
|
|
7
7
|
camera: ICamera2 | undefined;
|
|
8
8
|
fsQuad: FullScreenQuad;
|
|
9
9
|
version: number;
|
|
10
|
+
private debounceRenderHandler;
|
|
10
11
|
constructor(scene: Scene, camera?: ICamera2, clear?: boolean, needsSwap?: boolean);
|
|
11
12
|
get currentVersion(): number;
|
|
12
13
|
render(renderer: IRenderer2, writeBuffer: IRenderTarget, readBuffer: IRenderTarget): void;
|
|
14
|
+
handleDebounceRender(renderer: IRenderer2, writeBuffer: IRenderTarget, readBuffer: IRenderTarget): void;
|
|
13
15
|
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { FullScreenQuad, Pass } from './pass';
|
|
2
|
+
import { ITexture } from '../interfaces';
|
|
3
|
+
export declare class SavePass extends Pass {
|
|
4
|
+
name: string;
|
|
5
|
+
fsQuad: FullScreenQuad;
|
|
6
|
+
texture: ITexture;
|
|
7
|
+
ctx: OffscreenCanvasRenderingContext2D;
|
|
8
|
+
constructor();
|
|
9
|
+
destroy(): void;
|
|
10
|
+
render(renderer: IRenderer2, writeBuffer: IRenderTarget, readBuffer: IRenderTarget): void;
|
|
11
|
+
}
|
|
@@ -12,8 +12,19 @@ var Pe = {
|
|
|
12
12
|
syncDelay: 800,
|
|
13
13
|
animateDuration: 600,
|
|
14
14
|
mergeRendering: !1,
|
|
15
|
-
//
|
|
15
|
+
// 合并渲染,相同材质合并渲染;
|
|
16
|
+
sliceRendering: !0,
|
|
17
|
+
// 切片渲染
|
|
18
|
+
sliceDuration: 15,
|
|
19
|
+
// 切片渲染间隔:1 ~ 40
|
|
16
20
|
usedCache: !1,
|
|
21
|
+
// 开启缓存,相同 featureKey 的图形使用 texture,绘制时需先进行画布TRS
|
|
22
|
+
separateCache: !1,
|
|
23
|
+
// 独立缓存,对于需要TRS的,保存独立 texture,渲染时直接 drawImage
|
|
24
|
+
debounceCache: !0,
|
|
25
|
+
// 防抖缓存,交互过程中使用缓存渲染,最后一帧生成缓存
|
|
26
|
+
dynamicLoading: !0,
|
|
27
|
+
// 动态加载,处理大文件时,海量数据动态加入到 scene 中,避免loading时间超长
|
|
17
28
|
showPoints: !1,
|
|
18
29
|
wireframe: !1,
|
|
19
30
|
castShadow: !1,
|
|
@@ -3997,7 +4008,7 @@ Fu.__DOMHandler = Eu;
|
|
|
3997
4008
|
Fu.normalizeLineEndings = Le;
|
|
3998
4009
|
Fu.DOMParser = Ie;
|
|
3999
4010
|
var gr = Fu.DOMParser;
|
|
4000
|
-
const Er = "1.0.
|
|
4011
|
+
const Er = "1.0.55";
|
|
4001
4012
|
function vr() {
|
|
4002
4013
|
return typeof window < "u" && ({}.toString.call(window) === "[object Window]" || {}.toString.call(window) === "[object global]");
|
|
4003
4014
|
}
|
package/lib/extras/adapter.d.ts
CHANGED
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
import { default as EventDispatcher } from '../core/event-dispatcher';
|
|
2
2
|
import { default as Box2 } from '../math/box2';
|
|
3
|
-
import { IObject2, ITree } from '../interfaces';
|
|
3
|
+
import { IEvent, IObject2, ITree } from '../interfaces';
|
|
4
4
|
import { IApplicationConfig } from '../applications/application';
|
|
5
|
+
import { default as Vector2 } from '../math/vector2';
|
|
5
6
|
export declare class Adapter extends EventDispatcher {
|
|
6
7
|
name: string;
|
|
7
8
|
params: IApplicationConfig;
|
|
8
9
|
boundingBox: Box2;
|
|
10
|
+
offset: Vector2;
|
|
9
11
|
resources: Record<string, IObject2[]>;
|
|
10
12
|
_resourcesMap: Record<string, IObject2>;
|
|
11
13
|
_resourcesTree: ITree[];
|
|
@@ -13,42 +15,23 @@ export declare class Adapter extends EventDispatcher {
|
|
|
13
15
|
private _svgRoot?;
|
|
14
16
|
private _viewBox;
|
|
15
17
|
private _elementsMap;
|
|
18
|
+
private _svgHelper;
|
|
19
|
+
private dynamicLoadedHandler;
|
|
20
|
+
private initializationCompleteHandler;
|
|
16
21
|
constructor(config?: IApplicationConfig);
|
|
17
22
|
destroy(): void;
|
|
18
23
|
clear(): void;
|
|
19
24
|
load(url: string, layers?: string[]): Promise<void>;
|
|
20
|
-
init(str?: string): void
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
* gros
|
|
26
|
-
* rm
|
|
27
|
-
* ...
|
|
28
|
-
* gros-labels
|
|
29
|
-
* rm-labels
|
|
30
|
-
* ...
|
|
31
|
-
*/
|
|
32
|
-
initResources(): void;
|
|
25
|
+
init(str?: string): Promise<void>;
|
|
26
|
+
bindSvgHelperEvents(): void;
|
|
27
|
+
unbindSvgHelperEvents(): void;
|
|
28
|
+
handleDynamicLoaded(e: IEvent): void;
|
|
29
|
+
handleInitializationComplete(e: IEvent): void;
|
|
33
30
|
initResourcesTree(): void;
|
|
34
|
-
initResource(id: string): void;
|
|
35
31
|
getResources(): IObject2[] | undefined;
|
|
36
32
|
getLayers(lv?: number): ITree[];
|
|
37
33
|
getElementById(id?: string): Element | undefined;
|
|
38
34
|
getSymbolElement(el?: Element): Element | undefined;
|
|
39
|
-
trans2Shape(el?: Element, flipY?: boolean): IObject2 | undefined;
|
|
40
|
-
transG(el?: Element, flipY?: boolean): IObject2 | undefined;
|
|
41
|
-
transSymbol(el?: Element, flipY?: boolean): IObject2 | undefined;
|
|
42
|
-
transPath(el?: Element, flipY?: boolean): IObject2 | undefined;
|
|
43
|
-
transUse(el?: Element, flipY?: boolean): IObject2 | undefined;
|
|
44
|
-
transCircle(el?: Element, flipY?: boolean): IObject2 | undefined;
|
|
45
|
-
/**
|
|
46
|
-
* test linked to asset
|
|
47
|
-
* 1、old version: split with ';', use first;
|
|
48
|
-
* 2、new version: use 'aid' attribute;
|
|
49
|
-
* 3、use 'assetId' + SPLITTER + LABEL_TAG save to elementsMap;
|
|
50
|
-
*/
|
|
51
|
-
transText(el?: Element, flipY?: boolean): IObject2 | undefined;
|
|
52
35
|
getAssetLabelId(assetId: string): string;
|
|
53
36
|
getResourceById(id?: string): IObject2 | undefined;
|
|
54
37
|
getResourceTreeById(t: ITree | ITree[], id?: string): ITree | undefined;
|
|
@@ -56,7 +39,3 @@ export declare class Adapter extends EventDispatcher {
|
|
|
56
39
|
_updateAllLayersVisibility(visible?: boolean): void;
|
|
57
40
|
_updateLayersVisibility(t: ITree, visible?: boolean): void;
|
|
58
41
|
}
|
|
59
|
-
export declare enum AdapterEnum {
|
|
60
|
-
INITIALIZATION_START = "INITIALIZATION_START",
|
|
61
|
-
INITIALIZATION_COMPLETE = "INITIALIZATION_COMPLETE"
|
|
62
|
-
}
|
package/lib/geometries/geo2.d.ts
CHANGED
|
@@ -8,9 +8,11 @@ export interface IGeo2Config {
|
|
|
8
8
|
}
|
|
9
9
|
export declare class Geo2<Config extends IGeo2Config> extends SVGPathData implements IGeo2 {
|
|
10
10
|
name: string;
|
|
11
|
+
id: number;
|
|
11
12
|
params: Config;
|
|
12
13
|
viewMatrix: Matrix3;
|
|
13
14
|
boundingBox: IBox2;
|
|
15
|
+
flipY: boolean;
|
|
14
16
|
constructor(config?: Config);
|
|
15
17
|
_version: number;
|
|
16
18
|
get version(): number;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ICanvas,
|
|
1
|
+
import { ICanvas, IShape2 } from '../interfaces';
|
|
2
2
|
import { default as Vector2 } from '../math/vector2';
|
|
3
3
|
interface ICanvasConfig {
|
|
4
4
|
containerId?: string;
|
|
@@ -17,7 +17,7 @@ export default class CanvasHelper {
|
|
|
17
17
|
/**
|
|
18
18
|
* @todo: cvs.getContext('bitmaprenderer') => ImageBitmapRenderingContext.transferFromImageBitmap()
|
|
19
19
|
*/
|
|
20
|
-
static getContext2D(cvs:
|
|
20
|
+
static getContext2D(cvs: HTMLCanvasElement | OffscreenCanvas, params?: any): CanvasRenderingContext2D | OffscreenCanvasRenderingContext2D;
|
|
21
21
|
static resizeCanvas(cvs: ICanvas, w: number, h: number, r?: number): void;
|
|
22
22
|
static getImageBitmapByCanvasAsync(cvs?: ICanvas): Promise<ImageBitmap | undefined>;
|
|
23
23
|
static get(k: string, w: number, h: number, dpr?: number): OffscreenCanvas;
|
|
@@ -3,10 +3,11 @@ import { SVGCommand } from 'svg-pathdata/src/types';
|
|
|
3
3
|
import { IShape2Config } from '../objects/shape2';
|
|
4
4
|
export declare class GeoHelper {
|
|
5
5
|
params: IShape2Config;
|
|
6
|
+
static splitLimit: number;
|
|
6
7
|
constructor(config?: IShape2Config);
|
|
7
8
|
destroy(): void;
|
|
8
|
-
static getInstanceByElement(o: Element, flipY?: boolean): Geo2<any> | undefined;
|
|
9
|
-
static getInstanceByPath(o: Element, flipY?: boolean): Geo2<any> | undefined;
|
|
9
|
+
static getInstanceByElement(o: Element, flipY?: boolean): Geo2<any> | Geo2<any>[] | undefined;
|
|
10
|
+
static getInstanceByPath(o: Element, flipY?: boolean): Geo2<any> | Geo2<any>[] | undefined;
|
|
10
11
|
static getInstanceByCircle(o: Element, flipY?: boolean): Geo2<any> | undefined;
|
|
11
12
|
static getInstance(cmd: string | SVGCommand[], flipY?: boolean): Geo2<any> | undefined;
|
|
12
13
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { IShape2 } from '../interfaces';
|
|
1
|
+
import { IGroup2, IShape2 } from '../interfaces';
|
|
2
2
|
import { IShape2Config } from '../objects/shape2';
|
|
3
3
|
import { ITextConfig } from '../shapes2/text';
|
|
4
4
|
export declare class MergeHelper {
|
|
5
|
-
static getShapeByElement(el: Element, config: IShape2Config, flipY?: boolean): IShape2;
|
|
5
|
+
static getShapeByElement(el: Element, config: IShape2Config, flipY?: boolean): IShape2 | IGroup2;
|
|
6
6
|
static getText(config: ITextConfig): IShape2;
|
|
7
7
|
}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { IObject2 } from '../interfaces';
|
|
2
|
+
import { default as Vector2 } from '../math/vector2';
|
|
3
|
+
import { default as Box2 } from '../math/box2';
|
|
4
|
+
import { default as EventDispatcher } from '../core/event-dispatcher';
|
|
5
|
+
export declare class SvgHelper extends EventDispatcher {
|
|
6
|
+
svg: Element | undefined;
|
|
7
|
+
resources: IObject2[];
|
|
8
|
+
resourcesMap: Record<string, IObject2>;
|
|
9
|
+
boundingBox: Box2;
|
|
10
|
+
private _traverseMap;
|
|
11
|
+
private _elementsMap;
|
|
12
|
+
private _tic?;
|
|
13
|
+
private constructor();
|
|
14
|
+
private static _instance;
|
|
15
|
+
static get instance(): SvgHelper;
|
|
16
|
+
static parse(str: string): SvgHelper;
|
|
17
|
+
static init(svg: Element): SvgHelper;
|
|
18
|
+
initResources(): SvgHelper;
|
|
19
|
+
initResource(el: Element): IObject2 | undefined;
|
|
20
|
+
initResourcesSlice(): Promise<void>;
|
|
21
|
+
computeBoundingBox(o?: IObject2): Box2;
|
|
22
|
+
getBoundingBox(): Box2;
|
|
23
|
+
getOffset(): Vector2;
|
|
24
|
+
alignCoordinateCenter(): void;
|
|
25
|
+
setTexture(el: Element, o: IObject2): void;
|
|
26
|
+
getElementsMap(): Record<string, Element>;
|
|
27
|
+
getResourceById(id?: string): IObject2 | undefined;
|
|
28
|
+
getResourcesMap(): Record<string, IObject2>;
|
|
29
|
+
getResources(): IObject2[];
|
|
30
|
+
trans2Shape(el?: Element, flipY?: boolean): IObject2 | undefined;
|
|
31
|
+
transG(el?: Element, flipY?: boolean): IObject2 | undefined;
|
|
32
|
+
transSymbol(el?: Element, flipY?: boolean): IObject2 | undefined;
|
|
33
|
+
transPath(el?: Element, flipY?: boolean): IObject2 | undefined;
|
|
34
|
+
transUse(el?: Element, flipY?: boolean): IObject2 | undefined;
|
|
35
|
+
transCircle(el?: Element, flipY?: boolean): IObject2 | undefined;
|
|
36
|
+
/**
|
|
37
|
+
* test linked to asset
|
|
38
|
+
* 1、old version: split with ';', use first;
|
|
39
|
+
* 2、new version: use 'aid' attribute;
|
|
40
|
+
* 3、use 'assetId' + SPLITTER + LABEL_TAG save to elementsMap;
|
|
41
|
+
*/
|
|
42
|
+
transText(el?: Element, flipY?: boolean): IObject2 | undefined;
|
|
43
|
+
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { default as Vector2 } from '../math/vector2';
|
|
2
|
-
import { IGroup2, ILight, IPoint2,
|
|
2
|
+
import { IGroup2, ILight, IPoint2, IShape2, ITexture } from '../interfaces';
|
|
3
3
|
import { ITextureConfig, Texture } from '../textures/texture';
|
|
4
4
|
import { default as _ } from 'lodash';
|
|
5
5
|
/**
|
|
@@ -13,6 +13,7 @@ export declare class TextureHelper {
|
|
|
13
13
|
static precisionOptimizeLevels: number[];
|
|
14
14
|
static initialized: boolean;
|
|
15
15
|
static textureMaxSize: Vector2;
|
|
16
|
+
static DEBUG_DisplayCachedTexture: _.DebouncedFuncLeading<(width?: number, opacity?: number) => void>;
|
|
16
17
|
static destroy(): void;
|
|
17
18
|
static has(k: string): boolean;
|
|
18
19
|
static get(k: string | undefined, threshold?: number): ITexture | undefined;
|
|
@@ -21,12 +22,11 @@ export declare class TextureHelper {
|
|
|
21
22
|
static clear(): void;
|
|
22
23
|
static setTextureMaxSize(): void;
|
|
23
24
|
static getTextureMaxSize(): Vector2;
|
|
24
|
-
static getTextureByShape(obj:
|
|
25
|
-
static setPrecisionOptimizeTextures(key: string, obj:
|
|
26
|
-
static renderShapeTexture(obj:
|
|
27
|
-
static setByShape(key: string, obj:
|
|
28
|
-
static setShadowByShape(key: string, obj:
|
|
29
|
-
static setPointsByShape(key: string, obj:
|
|
30
|
-
static setWireframeByShape(key: string, obj:
|
|
31
|
-
static DEBUG_DisplayCachedTexture: _.DebouncedFuncLeading<(width?: number, opacity?: number) => void>;
|
|
25
|
+
static getTextureByShape(obj: IShape2 | IGroup2, originSize?: IPoint2, finalSize?: IPoint2, light?: ILight): Texture<ITextureConfig>;
|
|
26
|
+
static setPrecisionOptimizeTextures(key: string, obj: IShape2 | IGroup2, texture: ITexture, originSize?: IPoint2, light?: ILight): void;
|
|
27
|
+
static renderShapeTexture(obj: IShape2 | IGroup2, texture: ITexture, light?: ILight): void;
|
|
28
|
+
static setByShape(key: string, obj: IShape2 | IGroup2, originSize?: IPoint2, finalSize?: IPoint2): ITexture;
|
|
29
|
+
static setShadowByShape(key: string, obj: IShape2, light?: ILight): ITexture;
|
|
30
|
+
static setPointsByShape(key: string, obj: IShape2 | IGroup2): ITexture;
|
|
31
|
+
static setWireframeByShape(key: string, obj: IShape2): ITexture;
|
|
32
32
|
}
|