|
|
5 anos atrás | |
|---|---|---|
| .. | ||
| README.md | 5 anos atrás | |
export interface FloorData {
Columns: Column[]; //所有柱子数据
Doors: Door[]; //所有门数据
Spaces: Space[]; //所有空间数据
VirtualWalls: VirtualWall[]; //所有虚拟墙数据
Walls: Wall[]; //所有墙数据
Windows: Casement[]; //所有窗户数据
} // Interface FloorData
export interface Column {
/** 名称 */
Name: string;
/** 轮廓线 */
OutLine: Point[][];
/** 房间边界 */
RoomBoundary: boolean;
/** 位置 */
Location: Place;
/** 模型id(外键) */
ModelId: string;
/** 对应Revit模型id */
SourceId: string;
} // Interface Column
export interface Door {
/** 面朝方向 */
FaceDirection: Point;
/** 把手方向 */
HandDirection: Point;
/** 位置 */
Location: Place;
/** 模型id(外键) */
ModelId: string;
/** 名称 */
Name: string;
/** 轮廓线 */
OutLine: Point[][];
/** 拥有者的RevitId */
Owner: string;
/** 对应Revit模型id */
SourceId: string;
/** 厚度 */
Thick: number;
/** 所属墙 */
WallId: string;
/** 宽度 */
Width: string;
} // Interface Door
export interface Space {
/** 轮廓线段 */
BoundarySegments: string[];
/** 位置 */
Location: Place;
/** 高度 */
Height: number;
/** 模型id(外键) */
ModelId: string;
/** 名称 */
Name: string;
/** 轮廓线 */
OutLine: Point[][];
/** 对应Revit模型id */
SourceId: string;
/** 补充信息 */
Tag: string;
} // Interface Space
export interface VirtualWall {
/** 位置 */
Location: Place;
/** 模型id(外键) */
ModelId: string;
/** 名称 */
Name: string;
/** 轮廓线 */
OutLine: Point[][];
/** 对应Revit模型id */
SourceId: string;
} // interface VirtualWall
export interface Wall {
/** 层id */
LevelId: string;
/** 位置 */
Location: Place;
/** 模型id(外键) */
ModelId: string;
/** 名称 */
Name: string;
/** 轮廓线 */
OutLine: Point[][];
/** 对应Revit模型id */
SourceId: string;
/** 厚度 */
Width: number;
} // Interface Wall
export interface Casement {
/** 位置 */
Location: Place;
/** 模型id(外键) */
ModelId: string;
/** 名称 */
Name: string;
/** 轮廓线 */
OutLine: Point[][];
/** 拥有者的RevitId */
Owner: string;
/** 对应Revit模型id */
SourceId: string;
/** 厚度 */
Thick: number;
/** 所属墙 */
WallId: string;
/** 宽度 */
Width: string;
} // interface Casement
引擎中已封装好函数loadUrl,直接传入文件服务器路径即可;并且会将压缩数据自动解压
loadUrl(url: string): Promise<void> {}
引擎中已封装好函数getFloorData,直接传入模型id,url为接口地址
getFloorData(url: string, data: { ModelId: string }) {}
引擎中会读取下载好的数据,按数据将不同的对象分发到引擎中各个添加对象的方法中
private addBaseMapItem(data: FloorData): void {
if (data.Walls) {
data.Walls.forEach((t: Wall): void => {
this.addWall(t);
});
}
if (data.Columns) {
data.Columns.forEach((t: Column): void => {
this.addColumn(t);
});
}
if (data.Windows) {
data.Windows.forEach((t: Casement): void => {
this.addCasement(t);
});
}
if (data.VirtualWalls) {
data.VirtualWalls.forEach((t: VirtualWall): void => {
this.addVirtualWall(t);
});
}
if (data.Doors) {
data.Doors.forEach((t: Door): void => {
this.addDoor(t);
});
}
if (data.Spaces) {
data.Spaces.forEach((t: Space): void => {
this.addSpace(t);
});
}
} // Function addBaseMapItem()
当视图监听到需要刷新时,就会触发update()方法,刷新视图,用户就可以在页面中看到相应的楼层平面图了