|
|
|
@ -1,6 +1,7 @@
|
|
|
|
|
import { Object3D, Vector2, Vector3 } from "three";
|
|
|
|
|
import { BufferGeometry, Line, Object3D, Vector2, Vector3 } from "three";
|
|
|
|
|
import { AddEntityDrawObject } from "../../../../Common/AddEntityDrawObject";
|
|
|
|
|
import { FixedNotZero } from "../../../../Common/Utils";
|
|
|
|
|
import { BufferGeometryUtils } from "../../../../Geometry/BufferGeometryUtils";
|
|
|
|
|
import { AsVector3, equaln } from "../../../../Geometry/GeUtils";
|
|
|
|
|
import { RenderType } from "../../../../GraphicsSystem/RenderType";
|
|
|
|
|
import { Factory } from "../../../CADFactory";
|
|
|
|
@ -98,8 +99,7 @@ export class RoomRegion extends RoomBase
|
|
|
|
|
InitDrawObject(renderType: RenderType = RenderType.Wireframe): Object3D
|
|
|
|
|
{
|
|
|
|
|
let obj = new Object3D;
|
|
|
|
|
if (renderType === RenderType.Wireframe || renderType === RenderType.Conceptual)
|
|
|
|
|
this.UpdateDrawObject(renderType, obj);
|
|
|
|
|
this.UpdateDrawObject(renderType, obj);
|
|
|
|
|
return obj;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -110,13 +110,27 @@ export class RoomRegion extends RoomBase
|
|
|
|
|
*/
|
|
|
|
|
UpdateDrawObject(renderType: RenderType, obj: Object3D)
|
|
|
|
|
{
|
|
|
|
|
obj.remove(...obj.children.slice(0));
|
|
|
|
|
if (renderType === RenderType.Wireframe || renderType === RenderType.Conceptual)
|
|
|
|
|
{
|
|
|
|
|
obj.remove(...obj.children.slice(0));
|
|
|
|
|
this.Text.TextAligen = TextAligen.Mid;
|
|
|
|
|
this._Text.TextString = `${this.TextString || "未命名"} ${FixedNotZero(this._Area * 1e-6, 2)}m²`;
|
|
|
|
|
AddEntityDrawObject(obj, this._Text, renderType);
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
//避免在真实视图无法选中!
|
|
|
|
|
let line = obj.children[0] as Line<BufferGeometry>;
|
|
|
|
|
let pts = this.GetGripPoints();
|
|
|
|
|
if (pts.length)
|
|
|
|
|
{
|
|
|
|
|
let p = pts[0].applyMatrix4(this.OCSInv);
|
|
|
|
|
if (!line)
|
|
|
|
|
obj.add(new Line(BufferGeometryUtils.CreateFromPts([p, p])));
|
|
|
|
|
else
|
|
|
|
|
BufferGeometryUtils.UpdatePts(line.geometry, [p, p]);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//#region -----------------------------File-----------------------------
|
|
|
|
|