@vsleem-realsee-viewer/shared 1.1.4 → 2.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -2
- package/dist/index.d.ts +85 -13
- package/dist/index.mjs +310 -227
- package/dist/index.umd.js +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
# Coordinate 坐标系类
|
|
4
4
|
|
|
5
|
-
该类设计适用于建筑信息模型(
|
|
5
|
+
该类设计适用于建筑信息模型(Bim)、地理信息系统(GIS)等需要复杂空间关系管理的场景。
|
|
6
6
|
|
|
7
7
|
## 属性说明
|
|
8
8
|
|
|
@@ -63,7 +63,7 @@
|
|
|
63
63
|
|
|
64
64
|
# DataSource 数据源类
|
|
65
65
|
|
|
66
|
-
该类类用于管理
|
|
66
|
+
该类类用于管理 Bim、GIS、数字孪生的层级结构与空间关系
|
|
67
67
|
|
|
68
68
|
## 静态方法说明
|
|
69
69
|
|
package/dist/index.d.ts
CHANGED
|
@@ -35,12 +35,16 @@ export declare class AppError extends Error {
|
|
|
35
35
|
* 业务错误码枚举(扩展无返回值错误)
|
|
36
36
|
*/
|
|
37
37
|
export declare enum AppErrorCode {
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
38
|
+
GeoPointNoPlane = 9000,
|
|
39
|
+
PointUnmappedGIS = 9010,
|
|
40
|
+
PointNoXYZ = 9011,
|
|
41
|
+
PointNoPlane = 9012,
|
|
42
|
+
RelativePlaneUnmatch = 9020,
|
|
43
|
+
RelativeNoPlane = 9021,
|
|
44
|
+
RelativeJsonError = 9022,
|
|
45
|
+
RequestCodeError = 9030,
|
|
46
|
+
RequestResultError = 9031,
|
|
47
|
+
RequestUnknownError = 9032
|
|
44
48
|
}
|
|
45
49
|
|
|
46
50
|
export declare enum AppObsType {
|
|
@@ -301,6 +305,7 @@ export declare class Coordinate {
|
|
|
301
305
|
get spaceList(): Coordinate[];
|
|
302
306
|
get modelList(): Coordinate[];
|
|
303
307
|
get fullName(): string;
|
|
308
|
+
setOptions(options?: Partial<Coordinate>): void;
|
|
304
309
|
addChild(child: Partial<Coordinate> | Partial<Coordinate>[]): Promise<void>;
|
|
305
310
|
removeChild(child: Partial<Coordinate> | Partial<Coordinate>[]): Promise<void>;
|
|
306
311
|
updateChild(child: Partial<Coordinate> | Partial<Coordinate>[]): Promise<void>;
|
|
@@ -425,7 +430,7 @@ export declare type CoordinateModel = {
|
|
|
425
430
|
|
|
426
431
|
export declare enum CoordinateModelType {
|
|
427
432
|
CADModel = 5,//cad图片模型
|
|
428
|
-
|
|
433
|
+
BIMModel = 6,//bim模型
|
|
429
434
|
ForgeModel = 7,//forge模型
|
|
430
435
|
ThreeDModel = 8,//3d模型
|
|
431
436
|
SkyMapModel = 9,//天地图模型
|
|
@@ -646,6 +651,10 @@ declare type MappingRecord = {
|
|
|
646
651
|
srcCsId: number;
|
|
647
652
|
};
|
|
648
653
|
|
|
654
|
+
/**
|
|
655
|
+
* 点类,表示二维或三维空间中的点
|
|
656
|
+
* 支持直角坐标系(x,y,z)和地理坐标系(经度,纬度,高度)
|
|
657
|
+
*/
|
|
649
658
|
export declare class Point {
|
|
650
659
|
x: number;
|
|
651
660
|
y: number;
|
|
@@ -661,24 +670,87 @@ export declare class Point {
|
|
|
661
670
|
hasAngle: boolean;
|
|
662
671
|
plane: string;
|
|
663
672
|
constructor(options?: Partial<Point>);
|
|
673
|
+
/**
|
|
674
|
+
* 计算两点之间的三维距离
|
|
675
|
+
* @param p1 点1
|
|
676
|
+
* @param p2 点2
|
|
677
|
+
* @returns 距离值
|
|
678
|
+
*/
|
|
664
679
|
static dist(p1: Point, p2: Point): number;
|
|
680
|
+
/**
|
|
681
|
+
* 计算两点在XZ平面上的距离
|
|
682
|
+
* @param p1 点1
|
|
683
|
+
* @param p2 点2
|
|
684
|
+
* @returns 距离值
|
|
685
|
+
*/
|
|
665
686
|
static distXZ(p1: Point, p2: Point): number;
|
|
687
|
+
/**
|
|
688
|
+
* 计算两点在XY平面上的距离
|
|
689
|
+
* @param p1 点1
|
|
690
|
+
* @param p2 点2
|
|
691
|
+
* @returns 距离值
|
|
692
|
+
*/
|
|
666
693
|
static distXY(p1: Point, p2: Point): number;
|
|
694
|
+
/**
|
|
695
|
+
* 角度转弧度
|
|
696
|
+
* @param degrees 角度值
|
|
697
|
+
* @returns 弧度值
|
|
698
|
+
*/
|
|
667
699
|
static toRadians(degrees: number): number;
|
|
700
|
+
/**
|
|
701
|
+
* 弧度转角度
|
|
702
|
+
* @param radians 弧度值
|
|
703
|
+
* @returns 角度值
|
|
704
|
+
*/
|
|
668
705
|
static toDegrees(radians: number): number;
|
|
706
|
+
/**
|
|
707
|
+
* 计算三点在XZ平面上的夹角 (以pb为顶点)
|
|
708
|
+
* @param pa 点A
|
|
709
|
+
* @param pb 点B (顶点)
|
|
710
|
+
* @param pc 点C
|
|
711
|
+
* @returns 夹角角度 (0-180度)
|
|
712
|
+
*/
|
|
669
713
|
static angleXZ(pa: Point, pb: Point, pc: Point): number;
|
|
714
|
+
/**
|
|
715
|
+
* 从字符串解析点坐标 ("x,y,z")
|
|
716
|
+
* @param point 坐标字符串
|
|
717
|
+
* @returns Point对象
|
|
718
|
+
*/
|
|
670
719
|
static toParse(point?: string): Point | undefined;
|
|
720
|
+
/**
|
|
721
|
+
* 将点坐标序列化为字符串 ("x,y,z")
|
|
722
|
+
* @param point 点对象
|
|
723
|
+
* @returns 坐标字符串
|
|
724
|
+
*/
|
|
671
725
|
static toStringify(point?: Point): string;
|
|
672
726
|
/**
|
|
673
|
-
*
|
|
674
|
-
* @param r
|
|
675
|
-
* @param srcCoordinate
|
|
727
|
+
* 坐标投影转换
|
|
728
|
+
* @param r 映射关系
|
|
729
|
+
* @param srcCoordinate 源坐标系
|
|
676
730
|
* @param dstCoordinate 目标坐标系
|
|
731
|
+
* @returns 转换后的点
|
|
732
|
+
* @throws AppError 当转换失败时抛出异常
|
|
677
733
|
*/
|
|
678
734
|
projection(r: RelativeMap, srcCoordinate?: Coordinate, dstCoordinate?: Coordinate): Point | undefined;
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
735
|
+
/**
|
|
736
|
+
* 基础投影转换
|
|
737
|
+
* @param r 映射关系
|
|
738
|
+
* @returns 转换后的点
|
|
739
|
+
* @throws AppError 当没有坐标或平面无效时抛出异常
|
|
740
|
+
*/
|
|
741
|
+
private project;
|
|
742
|
+
/**
|
|
743
|
+
* XZ平面投影转换
|
|
744
|
+
* @param r 映射关系
|
|
745
|
+
* @returns 转换后的点
|
|
746
|
+
*/
|
|
747
|
+
private projectXZ;
|
|
748
|
+
/**
|
|
749
|
+
* XY平面投影转换
|
|
750
|
+
* @param r 映射关系
|
|
751
|
+
* @returns 转换后的点
|
|
752
|
+
*/
|
|
753
|
+
private projectXY;
|
|
682
754
|
}
|
|
683
755
|
|
|
684
756
|
export declare class Position {
|