|
|
|
@ -4,7 +4,8 @@ import { ISpaceParse } from "../../../Geometry/SpaceParse/ISpaceParse";
|
|
|
|
|
import { IGrooveOption, VerticalBoardOption } from "../../../UI/Store/OptionInterface/IOptionInterface";
|
|
|
|
|
import { Factory } from "../../CADFactory";
|
|
|
|
|
import { CADFiler } from "../../CADFiler";
|
|
|
|
|
import { Entity } from "../../Entity/Entity";
|
|
|
|
|
import { Database } from "../../Database";
|
|
|
|
|
import { ObjectId } from "../../ObjectId";
|
|
|
|
|
import { TemplateBoardRecord } from "./TemplateBoard";
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
@ -32,7 +33,7 @@ export class TemplateVerticalBoard extends TemplateBoardRecord
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//空间分析缺口切割需要的板件
|
|
|
|
|
IntersectSpaceEntitys: Set<Entity> = new Set();
|
|
|
|
|
IntersectSpaceEntitys: Set<ObjectId> = new Set();
|
|
|
|
|
IntersectHighDrill: string[] = [];
|
|
|
|
|
|
|
|
|
|
GeneralBoardList(space: ISpaceParse)
|
|
|
|
@ -85,19 +86,43 @@ export class TemplateVerticalBoard extends TemplateBoardRecord
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
this.IntersectSpaceEntitys.clear();
|
|
|
|
|
if (ver > 3)
|
|
|
|
|
|
|
|
|
|
//版本4弃用ReadObject
|
|
|
|
|
if (ver === 4)
|
|
|
|
|
{
|
|
|
|
|
let size = file.Read();
|
|
|
|
|
let bakDb = file.database;
|
|
|
|
|
file.database = new Database;
|
|
|
|
|
for (let i = 0; i < size; i++)
|
|
|
|
|
this.IntersectSpaceEntitys.add(file.ReadObject());
|
|
|
|
|
{
|
|
|
|
|
let ent = file.ReadObject();
|
|
|
|
|
let id = bakDb.GetObjectId(ent.Id.Index, true);
|
|
|
|
|
this.IntersectSpaceEntitys.add(id);
|
|
|
|
|
}
|
|
|
|
|
file.database = bakDb;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
size = file.Read();
|
|
|
|
|
if (ver > 3)
|
|
|
|
|
{
|
|
|
|
|
let size = file.Read();
|
|
|
|
|
this.IntersectHighDrill = file.ReadArray(size);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (ver > 4)
|
|
|
|
|
{
|
|
|
|
|
//版本5 采用读取ID
|
|
|
|
|
let size = file.Read();
|
|
|
|
|
for (let i = 0; i < size; i++)
|
|
|
|
|
{
|
|
|
|
|
let entId = file.ReadObjectId();
|
|
|
|
|
if (entId)
|
|
|
|
|
this.IntersectSpaceEntitys.add(entId);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
WriteFile(file: CADFiler)
|
|
|
|
|
{
|
|
|
|
|
file.Write(4);
|
|
|
|
|
file.Write(5);
|
|
|
|
|
super.WriteFile(file);
|
|
|
|
|
file.Write(this._option.type);
|
|
|
|
|
file.Write(this._option.name);
|
|
|
|
@ -121,14 +146,14 @@ export class TemplateVerticalBoard extends TemplateBoardRecord
|
|
|
|
|
file.Write(this.grooveOption.grooveAddDepth);
|
|
|
|
|
file.Write(this.grooveOption.knifeRadius);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//ver4
|
|
|
|
|
file.Write(this.IntersectSpaceEntitys.size);
|
|
|
|
|
for (let ent of this.IntersectSpaceEntitys)
|
|
|
|
|
file.WriteObject(ent);
|
|
|
|
|
|
|
|
|
|
file.Write(this.IntersectHighDrill.length);
|
|
|
|
|
for (let type of this.IntersectHighDrill)
|
|
|
|
|
file.Write(type);
|
|
|
|
|
|
|
|
|
|
//ver5
|
|
|
|
|
file.Write(this.IntersectSpaceEntitys.size);
|
|
|
|
|
for (let ent of this.IntersectSpaceEntitys)
|
|
|
|
|
file.WriteObjectId(ent);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|