!2323 开发:吊顶底面材质默认使用乳胶漆

pull/2310/MERGE
林三 1 year ago committed by ChenX
parent 0523c94f5f
commit d108a50c44

@ -1,8 +1,8 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP // Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`changev 1`] = `"[11,101,1,2,1,0,0,1,\\"\\",2,2,0,0,1,\\"Line\\",10,2,100,0,1,7,0,[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],0,0,1,[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],0,0,1,1,[2,3,4],[0,0,0],2,4,0,0,4,0,2,3,0,0,4,0,0,0,0,1,0,1,\\"CommandHistoryRecord\\",1,\\"\\",2,2,1,\\"HistorycRecord\\",1,\\"RemoveObjectData\\",1,0,\\"CreateObjectData\\",1,[\\"Line\\",10,2,100,0,1,7,0,[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],0,0,1,[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],0,0,1,1,[0,0,0],[0,0,0]],\\"\\",100,1,\\"ObjectAllDataHistoryRecord\\",1,1,\\"AllObjectData\\",1,[10,2,100,0,1,7,0,[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],0,0,1,[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],0,0,1,1,[0,0,0],[0,0,0]],\\"\\",\\"\\",100,2,5,0,0,0,1,2,6,0,0,0,1,2,7,0,0,1,\\"\\",2,8,0,0,0,2,9,0,0,0,1,2,10,0,0,1,\\"\\",2,11,0,0,0,0,1,2,12,0,0,4,0,0,null]"`; exports[`changev 1`] = `"[11,101,1,2,1,0,0,1,\\"\\",2,2,0,0,1,\\"Line\\",10,2,100,0,1,7,0,[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],0,0,1,[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],0,0,1,1,[2,3,4],[0,0,0],2,4,0,0,5,0,2,3,0,0,5,0,0,0,0,0,1,0,1,\\"CommandHistoryRecord\\",1,\\"\\",2,2,1,\\"HistorycRecord\\",1,\\"RemoveObjectData\\",1,0,\\"CreateObjectData\\",1,[\\"Line\\",10,2,100,0,1,7,0,[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],0,0,1,[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],0,0,1,1,[0,0,0],[0,0,0]],\\"\\",100,1,\\"ObjectAllDataHistoryRecord\\",1,1,\\"AllObjectData\\",1,[10,2,100,0,1,7,0,[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],0,0,1,[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],0,0,1,1,[0,0,0],[0,0,0]],\\"\\",\\"\\",100,2,5,0,0,0,1,2,6,0,0,0,1,2,7,0,0,1,\\"\\",2,8,0,0,0,2,9,0,0,0,1,2,10,0,0,1,\\"\\",2,11,0,0,0,0,1,2,12,0,0,5,0,0,null]"`;
exports[`创建 修改 撤销撤销 重做重做 撤销 重做 1`] = `"[11,101,1,2,1,0,0,1,\\"\\",2,2,0,0,1,\\"Line\\",10,2,100,0,1,7,0,[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],0,0,1,[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],0,0,1,1,[1,2,3],[0,0,0],2,4,0,0,4,0,2,3,0,0,4,0,0,0,0,1,0,1,\\"CommandHistoryRecord\\",1,\\"\\",1,2,1,\\"HistorycRecord\\",1,\\"RemoveObjectData\\",1,0,\\"CreateObjectData\\",1,[\\"Line\\",10,2,100,0,1,7,0,[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],0,0,1,[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],0,0,1,1,[1,2,3],[0,0,0]],\\"\\",2,5,0,0,0,1,2,6,0,0,0,1,2,7,0,0,1,\\"\\",2,8,0,0,0,2,9,0,0,0,1,2,10,0,0,1,\\"\\",2,11,0,0,0,0,1,2,12,0,0,4,0,0,null]"`; exports[`创建 修改 撤销撤销 重做重做 撤销 重做 1`] = `"[11,101,1,2,1,0,0,1,\\"\\",2,2,0,0,1,\\"Line\\",10,2,100,0,1,7,0,[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],0,0,1,[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],0,0,1,1,[1,2,3],[0,0,0],2,4,0,0,5,0,2,3,0,0,5,0,0,0,0,0,1,0,1,\\"CommandHistoryRecord\\",1,\\"\\",1,2,1,\\"HistorycRecord\\",1,\\"RemoveObjectData\\",1,0,\\"CreateObjectData\\",1,[\\"Line\\",10,2,100,0,1,7,0,[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],0,0,1,[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],0,0,1,1,[1,2,3],[0,0,0]],\\"\\",2,5,0,0,0,1,2,6,0,0,0,1,2,7,0,0,1,\\"\\",2,8,0,0,0,2,9,0,0,0,1,2,10,0,0,1,\\"\\",2,11,0,0,0,0,1,2,12,0,0,5,0,0,null]"`;
exports[`创建 修改 撤销撤销 重做重做 撤销 重做 2`] = `"[\\"HistoricManage\\",1,0,1,\\"CommandHistoryRecord\\",1,\\"\\",1,2,1,\\"HistorycRecord\\",1,\\"RemoveObjectData\\",1,0,\\"CreateObjectData\\",1,[\\"Line\\",10,2,100,0,1,7,0,[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],0,0,1,[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],0,0,1,1,[1,2,3],[0,0,0]],\\"\\"]"`; exports[`创建 修改 撤销撤销 重做重做 撤销 重做 2`] = `"[\\"HistoricManage\\",1,0,1,\\"CommandHistoryRecord\\",1,\\"\\",1,2,1,\\"HistorycRecord\\",1,\\"RemoveObjectData\\",1,0,\\"CreateObjectData\\",1,[\\"Line\\",10,2,100,0,1,7,0,[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],0,0,1,[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],0,0,1,1,[1,2,3],[0,0,0]],\\"\\"]"`;

@ -20,7 +20,7 @@ Array [
4, 4,
0, 0,
0, 0,
4, 5,
1, 1,
"TextureTableRecord", "TextureTableRecord",
2, 2,
@ -42,7 +42,7 @@ Array [
3, 3,
0, 0,
0, 0,
4, 5,
1, 1,
"PhysicalMaterialRecord", "PhysicalMaterialRecord",
2, 2,
@ -106,6 +106,7 @@ Array [
0, 0,
0, 0,
0, 0,
0,
1, 1,
-1, -1,
0, 0,
@ -155,7 +156,7 @@ Array [
12, 12,
0, 0,
0, 0,
4, 5,
0, 0,
0, 0,
null, null,
@ -182,7 +183,7 @@ Array [
4, 4,
0, 0,
0, 0,
4, 5,
2, 2,
"TextureTableRecord", "TextureTableRecord",
2, 2,
@ -220,7 +221,7 @@ Array [
3, 3,
0, 0,
0, 0,
4, 5,
2, 2,
"PhysicalMaterialRecord", "PhysicalMaterialRecord",
2, 2,
@ -343,6 +344,7 @@ Array [
0, 0,
0, 0,
0, 0,
0,
1, 1,
-1, -1,
0, 0,
@ -392,7 +394,7 @@ Array [
12, 12,
0, 0,
0, 0,
4, 5,
0, 0,
0, 0,
null, null,
@ -419,7 +421,7 @@ Array [
4, 4,
0, 0,
0, 0,
4, 5,
1, 1,
"TextureTableRecord", "TextureTableRecord",
2, 2,
@ -441,7 +443,7 @@ Array [
3, 3,
0, 0,
0, 0,
4, 5,
1, 1,
"PhysicalMaterialRecord", "PhysicalMaterialRecord",
2, 2,
@ -505,6 +507,7 @@ Array [
0, 0,
0, 0,
0, 0,
0,
1, 1,
-1, -1,
0, 0,
@ -554,7 +557,7 @@ Array [
12, 12,
0, 0,
0, 0,
4, 5,
0, 0,
0, 0,
null, null,

@ -10,6 +10,7 @@ export class IHostApplicationServices
DefaultMeshMaterial?: MeshBasicMaterial | MeshStandardMaterial; DefaultMeshMaterial?: MeshBasicMaterial | MeshStandardMaterial;
DefaultFloorMaterial?: MeshBasicMaterial | MeshStandardMaterial; DefaultFloorMaterial?: MeshBasicMaterial | MeshStandardMaterial;
DefaultWallMaterial?: MeshBasicMaterial | MeshStandardMaterial; DefaultWallMaterial?: MeshBasicMaterial | MeshStandardMaterial;
DefaultBulkheadCeilingMaterial?: MeshBasicMaterial | MeshStandardMaterial;
IsRoomEntityVisible = true;//室内实体可见 IsRoomEntityVisible = true;//室内实体可见
@ -86,7 +87,6 @@ export class IHostApplicationServices
checkSealType: "1", checkSealType: "1",
sealMaxValue: 10,//封边最大值 sealMaxValue: 10,//封边最大值
sealValues: ''//封边值列表 sealValues: ''//封边值列表
}; };
@ProxyValue viewSize = { @ProxyValue viewSize = {

@ -158,6 +158,7 @@ export class Database
HostApplicationServices.DefaultMeshMaterial = (this.MaterialTable.CurBoardMtl?.Object as PhysicalMaterialRecord)?.Material ?? this.DefaultMaterial.Material; HostApplicationServices.DefaultMeshMaterial = (this.MaterialTable.CurBoardMtl?.Object as PhysicalMaterialRecord)?.Material ?? this.DefaultMaterial.Material;
HostApplicationServices.DefaultWallMaterial = (this.MaterialTable.CurWallMtl?.Object as PhysicalMaterialRecord)?.Material ?? this.DefaultMaterial.Material; HostApplicationServices.DefaultWallMaterial = (this.MaterialTable.CurWallMtl?.Object as PhysicalMaterialRecord)?.Material ?? this.DefaultMaterial.Material;
HostApplicationServices.DefaultFloorMaterial = (this.MaterialTable.CurFloorMtl?.Object as PhysicalMaterialRecord)?.Material ?? this.DefaultMaterial.Material; HostApplicationServices.DefaultFloorMaterial = (this.MaterialTable.CurFloorMtl?.Object as PhysicalMaterialRecord)?.Material ?? this.DefaultMaterial.Material;
HostApplicationServices.DefaultBulkheadCeilingMaterial = (this.MaterialTable.CurBulkCeilingFaceMaterial?.Object as PhysicalMaterialRecord)?.Material ?? this.DefaultMaterial.Material;
HostApplicationServices.CurrentDimStyle = this.DimStyleTable.Current; HostApplicationServices.CurrentDimStyle = this.DimStyleTable.Current;
} }

@ -10,11 +10,12 @@ export class MaterialTable extends SymbolTable
@observable protected _CurFloorMtl: ObjectId;//默认地板材质 @observable protected _CurFloorMtl: ObjectId;//默认地板材质
@observable protected _CurWallMtl: ObjectId;//默认墙体材质 @observable protected _CurWallMtl: ObjectId;//默认墙体材质
@observable protected _CurDrawMtl: ObjectId;//默认实体材质 @observable protected _CurDrawMtl: ObjectId;//默认实体材质
@observable protected _CurBulkCeilingFaceMaterial: ObjectId;//吊顶底面默认材质
get CurFloorMtl() { return this._CurFloorMtl; } get CurFloorMtl() { return this._CurFloorMtl; }
get CurWallMtl() { return this._CurWallMtl; } get CurWallMtl() { return this._CurWallMtl; }
get CurBoardMtl() { return this._CurDrawMtl; } get CurBoardMtl() { return this._CurDrawMtl; }
get CurBulkCeilingFaceMaterial() { return this._CurBulkCeilingFaceMaterial; }
set CurFloorMtl(id) set CurFloorMtl(id)
{ {
@ -45,6 +46,16 @@ export class MaterialTable extends SymbolTable
HostApplicationServices.DefaultMeshMaterial = (id.Object as PhysicalMaterialRecord).Material; HostApplicationServices.DefaultMeshMaterial = (id.Object as PhysicalMaterialRecord).Material;
} }
set CurBulkCeilingFaceMaterial(id)
{
if (id === this._CurBulkCeilingFaceMaterial) return;
this.WriteAllObjectRecord();
this._CurBulkCeilingFaceMaterial = id;
if (this._db && this._db.IsDefaultDatabase)
HostApplicationServices.DefaultBulkheadCeilingMaterial = (id.Object as PhysicalMaterialRecord).Material;
}
get Materials() get Materials()
{ {
return this.Symbols as Map<string, PhysicalMaterialRecord>; return this.Symbols as Map<string, PhysicalMaterialRecord>;
@ -90,7 +101,10 @@ export class MaterialTable extends SymbolTable
} }
if (this._FileVer > 3) if (this._FileVer > 3)
this._CurDrawMtl = file.ReadHardObjectId(); this._CurDrawMtl = file.ReadObjectId();
if (this._FileVer > 4)
this._CurBulkCeilingFaceMaterial = file.ReadObjectId();
} }
//对象将自身数据写入到文件. //对象将自身数据写入到文件.
@ -100,8 +114,8 @@ export class MaterialTable extends SymbolTable
file.WriteObjectId(this._CurFloorMtl); file.WriteObjectId(this._CurFloorMtl);
file.WriteObjectId(this._CurWallMtl); file.WriteObjectId(this._CurWallMtl);
file.WriteObjectId(this._CurDrawMtl); file.WriteObjectId(this._CurDrawMtl);
file.WriteObjectId(this._CurBulkCeilingFaceMaterial);
} }
//#endregion //#endregion
} }

@ -1,6 +1,7 @@
import { BufferAttribute, BufferGeometry, Float32BufferAttribute, InstancedInterleavedBuffer, InterleavedBufferAttribute, Intersection, LineSegments, Material, Mesh, Object3D, ShapeBufferGeometry, Vector3 } from "three"; import { BufferAttribute, BufferGeometry, Float32BufferAttribute, InstancedInterleavedBuffer, InterleavedBufferAttribute, Intersection, LineSegments, Material, Mesh, Object3D, ShapeBufferGeometry, Vector3 } from "three";
import { Line2 } from "three/examples/jsm/lines/Line2"; import { Line2 } from "three/examples/jsm/lines/Line2";
import { LineGeometry } from "three/examples/jsm/lines/LineGeometry"; import { LineGeometry } from "three/examples/jsm/lines/LineGeometry";
import { HostApplicationServices } from "../../../../ApplicationServices/HostApplicationServices";
import { ColorMaterial } from "../../../../Common/ColorPalette"; import { ColorMaterial } from "../../../../Common/ColorPalette";
import { DisposeThreeObj, Object3DRemoveAll } from "../../../../Common/Dispose"; import { DisposeThreeObj, Object3DRemoveAll } from "../../../../Common/Dispose";
import { BufferGeometryUtils } from "../../../../Geometry/BufferGeometryUtils"; import { BufferGeometryUtils } from "../../../../Geometry/BufferGeometryUtils";
@ -79,6 +80,13 @@ export class BulkheadCeiling extends Entity
@AutoRecord RelativeRoomFlatTop: ObjectId<RoomFlatBase>; @AutoRecord RelativeRoomFlatTop: ObjectId<RoomFlatBase>;
get MeshMaterial(): Material
{
if (this._MaterialId && this._MaterialId.Object)
return (<PhysicalMaterialRecord>this._MaterialId.Object).Material;
return HostApplicationServices.DefaultBulkheadCeilingMaterial;
}
private _EdgeGeometrys: BufferGeometry[]; private _EdgeGeometrys: BufferGeometry[];
get EdgeGeometrys(): BufferGeometry[] get EdgeGeometrys(): BufferGeometry[]
{ {
@ -303,7 +311,7 @@ export class BulkheadCeiling extends Entity
// 单一绘制对象 TODO:因为没有实现材质槽 所以暂时不用这个 // 单一绘制对象 TODO:因为没有实现材质槽 所以暂时不用这个
// obj.add(new Mesh(this.MeshGeomtry2, this.Materials2)); // obj.add(new Mesh(this.MeshGeomtry2, this.Materials2));
obj.add(new Mesh(this.FaceGeometry, (this.Material?.Object as PhysicalMaterialRecord)?.Material ?? this.MeshMaterial)); obj.add(new Mesh(this.FaceGeometry, this.MeshMaterial));
for (let meshGeo of this.MeshGeometry) for (let meshGeo of this.MeshGeometry)
obj.add(new Mesh(meshGeo, this.GetMaterials(this._GemoIdMap.get(meshGeo.id)))); obj.add(new Mesh(meshGeo, this.GetMaterials(this._GemoIdMap.get(meshGeo.id))));

@ -106,7 +106,7 @@ export class SymbolTable extends CADObject
WriteFile(file: CADFiler) WriteFile(file: CADFiler)
{ {
super.WriteFile(file); super.WriteFile(file);
file.Write(4); file.Write(5);
file.Write(this.Symbols.size); file.Write(this.Symbols.size);
for (let [key, record] of this.Symbols) for (let [key, record] of this.Symbols)
{ {

@ -5,6 +5,7 @@ import { Matrix4, Vector3 } from "three";
import { SelectExtrudeContour, selectOutlinePosition } from "../../../../Add-on/DrawBoard/DrawSpecialShapeBoardTool"; import { SelectExtrudeContour, selectOutlinePosition } from "../../../../Add-on/DrawBoard/DrawSpecialShapeBoardTool";
import { ViewChange } from "../../../../Add-on/ViewChange"; import { ViewChange } from "../../../../Add-on/ViewChange";
import { app } from "../../../../ApplicationServices/Application"; import { app } from "../../../../ApplicationServices/Application";
import { HostApplicationServices } from "../../../../ApplicationServices/HostApplicationServices";
import { MaterialUrls } from "../../../../Common/HostUrl"; import { MaterialUrls } from "../../../../Common/HostUrl";
import { NormalMatrix } from "../../../../Common/Matrix4Utils"; import { NormalMatrix } from "../../../../Common/Matrix4Utils";
import { DirectoryId, PostJson, RequestStatus } from "../../../../Common/Request"; import { DirectoryId, PostJson, RequestStatus } from "../../../../Common/Request";
@ -16,6 +17,7 @@ import { Contour } from "../../../../DatabaseServices/Contour";
import { Database } from "../../../../DatabaseServices/Database"; import { Database } from "../../../../DatabaseServices/Database";
import { Curve } from "../../../../DatabaseServices/Entity/Curve"; import { Curve } from "../../../../DatabaseServices/Entity/Curve";
import { Polyline } from "../../../../DatabaseServices/Entity/Polyline"; import { Polyline } from "../../../../DatabaseServices/Entity/Polyline";
import { DefaultParamMap, SetMaterialParams } from "../../../../DatabaseServices/IMaterialDefaultParam";
import { ObjectId } from "../../../../DatabaseServices/ObjectId"; import { ObjectId } from "../../../../DatabaseServices/ObjectId";
import { PhysicalMaterialRecord } from "../../../../DatabaseServices/PhysicalMaterialRecord"; import { PhysicalMaterialRecord } from "../../../../DatabaseServices/PhysicalMaterialRecord";
import { BulkheadCeiling, BulkheadCeiling_ContourType } from "../../../../DatabaseServices/Room/Entity/Ceiling/BulkheadCeiling"; import { BulkheadCeiling, BulkheadCeiling_ContourType } from "../../../../DatabaseServices/Room/Entity/Ceiling/BulkheadCeiling";
@ -51,6 +53,34 @@ interface ContourData
@observer @observer
export default class RoomFlatTopParams extends Component<RoomBaseParamsProps, {}> export default class RoomFlatTopParams extends Component<RoomBaseParamsProps, {}>
{ {
//获取吊顶地面面材质 默认乳胶漆
SetBulkCeilingFaceDefaultMaterial()
{
if (!app.Database.MaterialTable.CurBulkCeilingFaceMaterial)
{
for (let [, mtl] of app.Database.MaterialTable.Materials)
{
if (mtl.type === "乳胶漆")
{
app.Database.MaterialTable.CurBulkCeilingFaceMaterial = mtl.Id;
break;
}
}
if (!app.Database.MaterialTable.CurBulkCeilingFaceMaterial)
{
let mtl = new PhysicalMaterialRecord;
SetMaterialParams(mtl, DefaultParamMap.);
mtl.type = "乳胶漆";
mtl.Name = "乳胶漆";
mtl.Update();
app.Database.MaterialTable.Add(mtl);
app.Database.MaterialTable.CurBulkCeilingFaceMaterial = mtl.Id;
HostApplicationServices.DefaultBulkheadCeilingMaterial = mtl.Material;
}
}
}
//提取天花板轮廓 //提取天花板轮廓
_PickUpModelingOnFlatTop = async () => _PickUpModelingOnFlatTop = async () =>
{ {
@ -172,7 +202,9 @@ export default class RoomFlatTopParams extends Component<RoomBaseParamsProps, {}
let config = new DialogUserConfig(contourStore, BoardModalType.BulkheadCeilingContour); let config = new DialogUserConfig(contourStore, BoardModalType.BulkheadCeilingContour);
await config.LoadAndInitConfig(); await config.LoadAndInitConfig();
this.SetBulkCeilingFaceDefaultMaterial();
let bulkheadCeiling = new BulkheadCeiling(); let bulkheadCeiling = new BulkheadCeiling();
bulkheadCeiling.SetMaterialAtSlot(app.Database.MaterialTable.CurBulkCeilingFaceMaterial, 0);
let matrix = new Matrix4().setPosition(this.props.roomFlatTopEnt.BoundingBox.min.sub(useCurves[0].BoundingBox.min)); let matrix = new Matrix4().setPosition(this.props.roomFlatTopEnt.BoundingBox.min.sub(useCurves[0].BoundingBox.min));
matrix.multiply(new Matrix4().setPosition(0, 0, -bulkheadCeiling.Height)); matrix.multiply(new Matrix4().setPosition(0, 0, -bulkheadCeiling.Height));

Loading…
Cancel
Save