|
|
|
@ -1,3 +1,4 @@
|
|
|
|
|
import { Intent } from "@blueprintjs/core";
|
|
|
|
|
import { Color, Face3, Geometry, InstancedInterleavedBuffer, InterleavedBufferAttribute, LineSegments, Material, Matrix3, Mesh, MeshStandardMaterial, Object3D, ShapeUtils, Vector2, Vector3 } from "three";
|
|
|
|
|
import { Line2 } from "three/examples/jsm/lines/Line2";
|
|
|
|
|
import { LineGeometry } from "three/examples/jsm/lines/LineGeometry";
|
|
|
|
@ -12,6 +13,7 @@ import { CreatePolylinePath } from "../../../../../Geometry/CreatePolylinePath";
|
|
|
|
|
import { AsVector3, ZAxis, equalv2 } from "../../../../../Geometry/GeUtils";
|
|
|
|
|
import { IntersectOption } from "../../../../../GraphicsSystem/IntersectWith";
|
|
|
|
|
import { RenderType } from "../../../../../GraphicsSystem/RenderType";
|
|
|
|
|
import { AppToaster } from "../../../../../UI/Components/Toaster";
|
|
|
|
|
import { Factory } from "../../../../CADFactory";
|
|
|
|
|
import { CADFiler } from "../../../../CADFiler";
|
|
|
|
|
import { CADObject } from "../../../../CADObject";
|
|
|
|
@ -512,7 +514,15 @@ export class RoomHolePolyline extends RoomHoleBase
|
|
|
|
|
SetMaterialAtSlot(mtl: ObjectId<PhysicalMaterialRecord>, slotIndex: number)
|
|
|
|
|
{
|
|
|
|
|
let curMtl = this._OverWriteMaterial.get(slotIndex);
|
|
|
|
|
if ((curMtl.Object as PhysicalMaterialRecord).IsMaterialLock) return;
|
|
|
|
|
if ((curMtl.Object as PhysicalMaterialRecord).IsMaterialLock)
|
|
|
|
|
{
|
|
|
|
|
AppToaster.show({
|
|
|
|
|
message: "该模型材质已锁定,无法更换!",
|
|
|
|
|
timeout: 5000,
|
|
|
|
|
intent: Intent.WARNING,
|
|
|
|
|
}, "material_lock");
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (this._OverWriteMaterial.get(slotIndex) !== mtl)
|
|
|
|
|
{
|
|
|
|
@ -533,7 +543,15 @@ export class RoomHolePolyline extends RoomHoleBase
|
|
|
|
|
for (let i = 0; i < o.material.length; i++)
|
|
|
|
|
{
|
|
|
|
|
let curMtl = this._OverWriteMaterial.get(i);
|
|
|
|
|
if (curMtl && (curMtl.Object as PhysicalMaterialRecord).IsMaterialLock) continue;
|
|
|
|
|
if (curMtl && (curMtl.Object as PhysicalMaterialRecord).IsMaterialLock)
|
|
|
|
|
{
|
|
|
|
|
AppToaster.show({
|
|
|
|
|
message: "部分模型材质已锁定,无法更换!",
|
|
|
|
|
timeout: 5000,
|
|
|
|
|
intent: Intent.WARNING,
|
|
|
|
|
}, "material_lock");
|
|
|
|
|
continue;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
this.WriteAllObjectRecord();
|
|
|
|
|
this._OverWriteMaterial.set(i, mtl);
|
|
|
|
|