1 | import { DIRECTION } from '../constant';
|
2 | import { Padding, Point, Region } from '../interface';
|
3 | import { BBox as BBoxObject } from '../dependents';
|
4 |
|
5 |
|
6 |
|
7 | export declare class BBox {
|
8 |
|
9 | x: number;
|
10 |
|
11 | y: number;
|
12 |
|
13 | height: number;
|
14 |
|
15 | width: number;
|
16 | static fromRange(minX: number, minY: number, maxX: number, maxY: number): BBox;
|
17 | static fromObject(bbox: BBoxObject): BBox;
|
18 | constructor(x?: number, y?: number, width?: number, height?: number);
|
19 | get minX(): number;
|
20 | get maxX(): number;
|
21 | get minY(): number;
|
22 | get maxY(): number;
|
23 | get tl(): Point;
|
24 | get tr(): Point;
|
25 | get bl(): Point;
|
26 | get br(): Point;
|
27 | get top(): Point;
|
28 | get right(): Point;
|
29 | get bottom(): Point;
|
30 | get left(): Point;
|
31 | /**
|
32 | * 包围盒是否相等
|
33 | * @param {BBox} bbox 包围盒
|
34 | * @returns 包围盒是否相等
|
35 | */
|
36 | isEqual(bbox: BBox): boolean;
|
37 | |
38 |
|
39 |
|
40 |
|
41 | contains(child: BBox): boolean;
|
42 | |
43 |
|
44 |
|
45 |
|
46 | clone(): BBox;
|
47 | |
48 |
|
49 |
|
50 |
|
51 | add(...subBBox: BBox[]): BBox;
|
52 | |
53 |
|
54 |
|
55 |
|
56 | merge(...subBBox: BBox[]): BBox;
|
57 | |
58 |
|
59 |
|
60 |
|
61 |
|
62 | cut(subBBox: BBox, direction: DIRECTION): BBox;
|
63 | |
64 |
|
65 |
|
66 |
|
67 | shrink(gap: Padding): BBox;
|
68 | |
69 |
|
70 |
|
71 |
|
72 | expand(gap: Padding): BBox;
|
73 | |
74 |
|
75 |
|
76 |
|
77 |
|
78 | exceed(bbox: BBox): Padding;
|
79 | |
80 |
|
81 |
|
82 |
|
83 | collide(bbox: BBox): boolean;
|
84 | |
85 |
|
86 |
|
87 |
|
88 | size(): number;
|
89 | |
90 |
|
91 |
|
92 |
|
93 | isPointIn(p: Point): boolean;
|
94 | }
|
95 |
|
96 |
|
97 |
|
98 |
|
99 |
|
100 | export declare const getRegionBBox: (bbox: BBox, region: Region) => BBox;
|
101 |
|
102 |
|
103 |
|
104 |
|
105 | export declare function toPoints(bbox: Partial<BBox>): any[];
|