|
|
|
@ -6,8 +6,10 @@ import { HostApplicationServices } from "../ApplicationServices/HostApplicationS
|
|
|
|
|
import { ExtrudeHole } from "../DatabaseServices/3DSolid/ExtrudeHole";
|
|
|
|
|
import { CADFiler } from "../DatabaseServices/CADFiler";
|
|
|
|
|
import { Database } from "../DatabaseServices/Database";
|
|
|
|
|
import { Board } from "../DatabaseServices/Entity/Board";
|
|
|
|
|
import { Entity } from "../DatabaseServices/Entity/Entity";
|
|
|
|
|
import { Polyline } from "../DatabaseServices/Entity/Polyline";
|
|
|
|
|
import { IdMaping } from "../DatabaseServices/IdMaping";
|
|
|
|
|
import { PhysicalMaterialRecord } from "../DatabaseServices/PhysicalMaterialRecord";
|
|
|
|
|
import { TemplateParam } from "../DatabaseServices/Template/Param/TemplateParam";
|
|
|
|
|
import { TemplateRecord } from "../DatabaseServices/Template/TemplateRecord";
|
|
|
|
@ -16,7 +18,7 @@ import { RenderType } from "../GraphicsSystem/RenderType";
|
|
|
|
|
import { userConfig } from './../Editor/UserConfig';
|
|
|
|
|
import { DisposeThreeObj } from "./Dispose";
|
|
|
|
|
import { uploadLogo } from "./Request";
|
|
|
|
|
import { DuplicateRecordCloning } from "./Status";
|
|
|
|
|
import { DuplicateRecordCloning, UpdateDraw } from "./Status";
|
|
|
|
|
import { AAType } from "./SystemEnum";
|
|
|
|
|
|
|
|
|
|
export function MaterialOut(material: PhysicalMaterialRecord): string
|
|
|
|
@ -39,13 +41,39 @@ export function MaterialIn(fileData: Object[]): PhysicalMaterialRecord
|
|
|
|
|
return db.MaterialTable.Symbols.entries().next().value[1];
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export function TemplateOut(template: TemplateRecord, tempDb = new Database(false, false, true)): string
|
|
|
|
|
export async function TemplateOut(template: TemplateRecord, tempDb = new Database(false, false, true)): Promise<string>
|
|
|
|
|
{
|
|
|
|
|
template = template.Root;
|
|
|
|
|
let idMap = new Map();
|
|
|
|
|
tempDb.WblockCloneObejcts([template], tempDb.TemplateTable, idMap, DuplicateRecordCloning.Ignore);
|
|
|
|
|
Purge(tempDb);
|
|
|
|
|
|
|
|
|
|
let idMapRev: IdMaping = new Map();
|
|
|
|
|
for (let [k, v] of idMap) idMapRev.set(v, k);
|
|
|
|
|
|
|
|
|
|
let async2DPathingPromis = [];
|
|
|
|
|
for (const ent of tempDb.ModelSpace.Entitys)
|
|
|
|
|
{
|
|
|
|
|
if (idMapRev.has(ent.Id))
|
|
|
|
|
{
|
|
|
|
|
let oldEnt = idMapRev.get(ent.Id).Object as Entity;
|
|
|
|
|
if (oldEnt instanceof Board && oldEnt.Async2DPathing)
|
|
|
|
|
{
|
|
|
|
|
async2DPathingPromis.push(
|
|
|
|
|
oldEnt.Load2DPathIng().then((res) =>
|
|
|
|
|
{
|
|
|
|
|
ent.CloneDrawObject(oldEnt);
|
|
|
|
|
})
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
ent.CloneDrawObject(oldEnt);
|
|
|
|
|
ent.NeedUpdateFlag = UpdateDraw.Matrix;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
await Promise.all(async2DPathingPromis);
|
|
|
|
|
|
|
|
|
|
let scs = template.GetTemplateRealitySpaceCS();
|
|
|
|
|
let scsInv = new Matrix4().getInverse(scs);
|
|
|
|
|
|
|
|
|
|