!2566 功能:对纹组 命令:ALIGNLINEGROUP

pull/2337/MERGE
林三 5 months ago committed by ChenX
parent b072fbb931
commit efdc70f1ec

@ -137,7 +137,7 @@ Array [
1,
0,
0,
19,
20,
0,
"晨丰顶板",
"未命名",
@ -190,6 +190,7 @@ Array [
false,
0,
"",
0,
]
`;
@ -354,7 +355,7 @@ Array [
0,
0,
0,
19,
20,
0,
"辅助条(上收口)",
"",
@ -411,5 +412,6 @@ Array [
false,
0,
"",
0,
]
`;

@ -1,14 +1,14 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`晨丰导入CAD解析 1`] = `"[11,103,1,2,1,0,0,1,\\"\\",2,2,0,0,3,\\"Board\\",10,2,100,0,1,2,0,[0,6.123233995736766e-17,1,0,0,-1,6.123233995736766e-17,0,1,0,0,0,20,0,0,1],0,0,1,[1,0,0,0,0,6.123233995736766e-17,1,0,0,-1,6.123233995736766e-17,0,20,0,0,1],0,0,1,3,100,80,18,true,\\"Polyline\\",10,2,0,0,0,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,2,4,[0,0],0,[0,100],0,[80,100],0,[80,0],0,true,1,3,20,10,1,true,\\"Polyline\\",10,2,0,0,0,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,2,4,[0,0],0,[0,20],0,[10,20],0,[10,0],0,true,0,3,0,0,0,0,0,[0,6.123233995736766e-17,1,0,0,-1,6.123233995736766e-17,0,1,0,0,0,20,6.123233995736766e-16,10,1],3,0,0,0,0,0,19,1,\\"层板\\",\\"板主卧\\",\\"板标准柜\\",\\"默认板材5厘\\",\\"生态板\\",\\"经典檀木\\",0,0,\\"不排\\",2,0,\\"1.5\\",\\"1.5\\",\\"1.5\\",\\"1.5\\",\\"\\",\\"\\",\\"\\",4,\\"三合一\\",\\"三合一\\",\\"三合一\\",\\"三合一\\",true,true,2,\\"备注1\\",\\"434\\",\\"备注2\\",\\"434\\",0,0,0,0,0,0,0,true,0,0,null,0,0,\\"\\",\\"\\",\\"\\",\\"\\",0,false,0,\\"\\",\\"HardwareCompositeEntity\\",1,10,2,101,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,\\"Board\\",10,2,0,0,0,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,3,30,50,60,true,\\"Polyline\\",10,2,0,0,0,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,2,4,[0,0],0,[50,0],0,[50,30],0,[0,30],0,true,0,3,0,0,0,0,0,19,null,\\"\\",\\"\\",\\"\\",\\"\\",\\"\\",\\"\\",0,0,\\"\\",2,0,\\"1\\",\\"1\\",\\"1\\",\\"1\\",\\"\\",\\"\\",\\"\\",4,\\"不排\\",\\"不排\\",\\"不排\\",\\"不排\\",true,true,0,0,0,0,0,0,0,0,true,0,0,null,0,0,\\"\\",\\"\\",\\"\\",\\"\\",0,false,0,\\"\\",5,\\"五金\\",false,false,\\"五金颜色\\",\\"五金材质\\",\\"五金\\",\\"五金主卧\\",\\"五金标准柜\\",\\"L*W*H*100\\",\\"L*W*H\\",\\"X-1\\",\\"厂家晨丰\\",\\"品牌晨丰\\",\\"{L*2}\\",\\"1\\",\\"五金备注\\",\\"个\\",0,true,0,0,0,\\"HardwareTopline\\",10,2,102,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,2,\\"\\",1,\\"\\",1,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,3,\\"HistorycRecord\\",2,\\"RemoveObjectData\\",1,0,\\"CreateObjectData\\",1,[],\\"HistorycRecord\\",2,\\"RemoveObjectData\\",1,1,\\"CreateObjectData\\",1,[],\\"HistorycRecord\\",2,\\"RemoveObjectData\\",1,2,\\"CreateObjectData\\",1,[],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[`晨丰导入CAD解析 1`] = `"[12,103,1,2,1,0,0,1,\\"\\",2,2,0,0,3,\\"Board\\",10,2,100,0,1,2,0,[0,6.123233995736766e-17,1,0,0,-1,6.123233995736766e-17,0,1,0,0,0,20,0,0,1],0,0,1,[1,0,0,0,0,6.123233995736766e-17,1,0,0,-1,6.123233995736766e-17,0,20,0,0,1],0,0,1,3,100,80,18,true,\\"Polyline\\",10,2,0,0,0,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,2,4,[0,0],0,[0,100],0,[80,100],0,[80,0],0,true,1,3,20,10,1,true,\\"Polyline\\",10,2,0,0,0,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,2,4,[0,0],0,[0,20],0,[10,20],0,[10,0],0,true,0,3,0,0,0,0,0,[0,6.123233995736766e-17,1,0,0,-1,6.123233995736766e-17,0,1,0,0,0,20,6.123233995736766e-16,10,1],3,0,0,0,0,0,20,1,\\"层板\\",\\"板主卧\\",\\"板标准柜\\",\\"默认板材5厘\\",\\"生态板\\",\\"经典檀木\\",0,0,\\"不排\\",2,0,\\"1.5\\",\\"1.5\\",\\"1.5\\",\\"1.5\\",\\"\\",\\"\\",\\"\\",4,\\"三合一\\",\\"三合一\\",\\"三合一\\",\\"三合一\\",true,true,2,\\"备注1\\",\\"434\\",\\"备注2\\",\\"434\\",0,0,0,0,0,0,0,true,0,0,null,0,0,\\"\\",\\"\\",\\"\\",\\"\\",0,false,0,\\"\\",0,\\"HardwareCompositeEntity\\",1,10,2,101,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,\\"Board\\",10,2,0,0,0,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,3,30,50,60,true,\\"Polyline\\",10,2,0,0,0,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,2,4,[0,0],0,[50,0],0,[50,30],0,[0,30],0,true,0,3,0,0,0,0,0,20,null,\\"\\",\\"\\",\\"\\",\\"\\",\\"\\",\\"\\",0,0,\\"\\",2,0,\\"1\\",\\"1\\",\\"1\\",\\"1\\",\\"\\",\\"\\",\\"\\",4,\\"不排\\",\\"不排\\",\\"不排\\",\\"不排\\",true,true,0,0,0,0,0,0,0,0,true,0,0,null,0,0,\\"\\",\\"\\",\\"\\",\\"\\",0,false,0,\\"\\",0,5,\\"五金\\",false,false,\\"五金颜色\\",\\"五金材质\\",\\"五金\\",\\"五金主卧\\",\\"五金标准柜\\",\\"L*W*H*100\\",\\"L*W*H\\",\\"X-1\\",\\"厂家晨丰\\",\\"品牌晨丰\\",\\"{L*2}\\",\\"1\\",\\"五金备注\\",\\"个\\",0,true,0,0,0,\\"HardwareTopline\\",10,2,102,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,2,\\"\\",1,\\"\\",1,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,3,\\"HistorycRecord\\",2,\\"RemoveObjectData\\",1,0,\\"CreateObjectData\\",1,[],\\"HistorycRecord\\",2,\\"RemoveObjectData\\",1,1,\\"CreateObjectData\\",1,[],\\"HistorycRecord\\",2,\\"RemoveObjectData\\",1,2,\\"CreateObjectData\\",1,[],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,11,0,0,1,\\"\\",2,12,0,0,0,0,1,2,13,0,0,5,0,0,null,2,10,0,0,0]"`;
exports[`晨丰导入五金解析 1`] = `"[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,\\"Board\\",10,2,0,0,0,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,3,30,50,60,true,\\"Polyline\\",10,2,0,0,0,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,2,4,[0,0],0,[50,0],0,[50,30],0,[0,30],0,true,0,3,0,0,0,0,0,19,null,\\"\\",\\"\\",\\"\\",\\"\\",\\"\\",\\"\\",0,0,\\"\\",2,0,\\"1\\",\\"1\\",\\"1\\",\\"1\\",\\"\\",\\"\\",\\"\\",4,\\"不排\\",\\"不排\\",\\"不排\\",\\"不排\\",true,true,0,0,0,0,0,0,0,0,true,0,0,null,0,0,\\"\\",\\"\\",\\"\\",\\"\\",0,false,0,\\"\\",5,\\"五金\\",false,false,\\"五金颜色\\",\\"五金材质\\",\\"五金\\",\\"五金主卧\\",\\"五金标准柜\\",\\"L*W*H*100\\",\\"L*W*H\\",\\"X-1\\",\\"厂家晨丰\\",\\"品牌晨丰\\",\\"{L*2}\\",\\"1\\",\\"五金备注\\",\\"个\\",0,true,0,0,0]"`;
exports[`晨丰导入五金解析 1`] = `"[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,\\"Board\\",10,2,0,0,0,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,3,30,50,60,true,\\"Polyline\\",10,2,0,0,0,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,2,4,[0,0],0,[50,0],0,[50,30],0,[0,30],0,true,0,3,0,0,0,0,0,20,null,\\"\\",\\"\\",\\"\\",\\"\\",\\"\\",\\"\\",0,0,\\"\\",2,0,\\"1\\",\\"1\\",\\"1\\",\\"1\\",\\"\\",\\"\\",\\"\\",4,\\"不排\\",\\"不排\\",\\"不排\\",\\"不排\\",true,true,0,0,0,0,0,0,0,0,true,0,0,null,0,0,\\"\\",\\"\\",\\"\\",\\"\\",0,false,0,\\"\\",0,5,\\"五金\\",false,false,\\"五金颜色\\",\\"五金材质\\",\\"五金\\",\\"五金主卧\\",\\"五金标准柜\\",\\"L*W*H*100\\",\\"L*W*H\\",\\"X-1\\",\\"厂家晨丰\\",\\"品牌晨丰\\",\\"{L*2}\\",\\"1\\",\\"五金备注\\",\\"个\\",0,true,0,0,0]"`;
exports[`晨丰导入五金解析 2`] = `"[11,102,1,2,1,0,0,1,\\"\\",2,2,0,0,2,\\"HardwareCompositeEntity\\",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,\\"Board\\",10,2,101,0,1,2,0,[0,1,0,0,-1,0,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,3,100,100,100,true,\\"Polyline\\",10,2,0,0,0,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,2,4,[0,0],0,[100,0],0,[100,100],0,[0,100],0,true,0,3,0,0,0,0,0,19,0,\\"层板\\",\\"五金主卧\\",\\"五金标准柜\\",\\"\\",\\"\\",\\"\\",0,0,\\"不排\\",2,0,\\"1\\",\\"1\\",\\"1\\",\\"1\\",\\"\\",\\"\\",\\"\\",4,\\"不排\\",\\"不排\\",\\"不排\\",\\"不排\\",true,true,0,0,0,0,0,0,0,0,true,0,0,null,0,0,\\"\\",\\"\\",\\"\\",\\"\\",0,false,0,\\"\\",5,\\"五金\\",false,false,\\"五金颜色\\",\\"五金材质\\",\\"五金\\",\\"五金主卧\\",\\"五金标准柜\\",\\"L*W*H*100\\",\\"L*W*H\\",\\"X-1\\",\\"厂家晨丰\\",\\"品牌晨丰\\",\\"{L*2}\\",\\"1\\",\\"五金备注\\",\\"个\\",0,true,0,0,0,\\"Board\\",10,2,101,0,1,2,0,[0,1,0,0,-1,0,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,3,100,100,100,true,\\"Polyline\\",10,2,0,0,0,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,2,4,[0,0],0,[100,0],0,[100,100],0,[0,100],0,true,0,3,0,0,0,0,0,19,0,\\"层板\\",\\"五金主卧\\",\\"五金标准柜\\",\\"\\",\\"\\",\\"\\",0,0,\\"不排\\",2,0,\\"1\\",\\"1\\",\\"1\\",\\"1\\",\\"\\",\\"\\",\\"\\",4,\\"不排\\",\\"不排\\",\\"不排\\",\\"不排\\",true,true,0,0,0,0,0,0,0,0,true,0,0,null,0,0,\\"\\",\\"\\",\\"\\",\\"\\",0,false,0,\\"\\",2,4,0,0,5,0,2,3,0,0,5,0,0,0,0,0,1,0,1,\\"CommandHistoryRecord\\",1,\\"\\",1,2,2,\\"HistorycRecord\\",2,\\"RemoveObjectData\\",1,0,\\"CreateObjectData\\",1,[],\\"HistorycRecord\\",2,\\"RemoveObjectData\\",1,1,\\"CreateObjectData\\",1,[],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`] = `"[12,102,1,2,1,0,0,1,\\"\\",2,2,0,0,2,\\"HardwareCompositeEntity\\",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,\\"Board\\",10,2,101,0,1,2,0,[0,1,0,0,-1,0,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,3,100,100,100,true,\\"Polyline\\",10,2,0,0,0,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,2,4,[0,0],0,[100,0],0,[100,100],0,[0,100],0,true,0,3,0,0,0,0,0,20,0,\\"层板\\",\\"五金主卧\\",\\"五金标准柜\\",\\"\\",\\"\\",\\"\\",0,0,\\"不排\\",2,0,\\"1\\",\\"1\\",\\"1\\",\\"1\\",\\"\\",\\"\\",\\"\\",4,\\"不排\\",\\"不排\\",\\"不排\\",\\"不排\\",true,true,0,0,0,0,0,0,0,0,true,0,0,null,0,0,\\"\\",\\"\\",\\"\\",\\"\\",0,false,0,\\"\\",0,5,\\"五金\\",false,false,\\"五金颜色\\",\\"五金材质\\",\\"五金\\",\\"五金主卧\\",\\"五金标准柜\\",\\"L*W*H*100\\",\\"L*W*H\\",\\"X-1\\",\\"厂家晨丰\\",\\"品牌晨丰\\",\\"{L*2}\\",\\"1\\",\\"五金备注\\",\\"个\\",0,true,0,0,0,\\"Board\\",10,2,101,0,1,2,0,[0,1,0,0,-1,0,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,3,100,100,100,true,\\"Polyline\\",10,2,0,0,0,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,2,4,[0,0],0,[100,0],0,[100,100],0,[0,100],0,true,0,3,0,0,0,0,0,20,0,\\"层板\\",\\"五金主卧\\",\\"五金标准柜\\",\\"\\",\\"\\",\\"\\",0,0,\\"不排\\",2,0,\\"1\\",\\"1\\",\\"1\\",\\"1\\",\\"\\",\\"\\",\\"\\",4,\\"不排\\",\\"不排\\",\\"不排\\",\\"不排\\",true,true,0,0,0,0,0,0,0,0,true,0,0,null,0,0,\\"\\",\\"\\",\\"\\",\\"\\",0,false,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,2,\\"HistorycRecord\\",2,\\"RemoveObjectData\\",1,0,\\"CreateObjectData\\",1,[],\\"HistorycRecord\\",2,\\"RemoveObjectData\\",1,1,\\"CreateObjectData\\",1,[],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,11,0,0,1,\\"\\",2,12,0,0,0,0,1,2,13,0,0,5,0,0,null,2,10,0,0,0]"`;
exports[`晨丰导入板解析 1`] = `"[10,2,0,0,0,2,0,[0,6.123233995736766e-17,1,0,0,-1,6.123233995736766e-17,0,1,0,0,0,20,0,0,1],0,0,1,[1,0,0,0,0,6.123233995736766e-17,1,0,0,-1,6.123233995736766e-17,0,20,0,0,1],0,0,1,3,100,80,18,true,\\"Polyline\\",10,2,0,0,0,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,2,4,[0,0],0,[0,100],0,[80,100],0,[80,0],0,true,1,3,20,10,1,true,\\"Polyline\\",10,2,0,0,0,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,2,4,[0,0],0,[0,20],0,[10,20],0,[10,0],0,true,0,3,0,0,0,0,0,[0,6.123233995736766e-17,1,0,0,-1,6.123233995736766e-17,0,1,0,0,0,20,6.123233995736766e-16,10,1],3,0,0,0,0,0,19,1,\\"层板\\",\\"板主卧\\",\\"板标准柜\\",\\"默认板材5厘\\",\\"生态板\\",\\"经典檀木\\",0,0,\\"不排\\",2,0,\\"1.5\\",\\"1.5\\",\\"1.5\\",\\"1.5\\",\\"\\",\\"\\",\\"\\",4,\\"三合一\\",\\"三合一\\",\\"三合一\\",\\"三合一\\",true,true,2,\\"备注1\\",\\"434\\",\\"备注2\\",\\"434\\",0,0,0,0,0,0,0,true,0,0,null,0,0,\\"\\",\\"\\",\\"\\",\\"\\",0,false,0,\\"\\"]"`;
exports[`晨丰导入板解析 1`] = `"[10,2,0,0,0,2,0,[0,6.123233995736766e-17,1,0,0,-1,6.123233995736766e-17,0,1,0,0,0,20,0,0,1],0,0,1,[1,0,0,0,0,6.123233995736766e-17,1,0,0,-1,6.123233995736766e-17,0,20,0,0,1],0,0,1,3,100,80,18,true,\\"Polyline\\",10,2,0,0,0,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,2,4,[0,0],0,[0,100],0,[80,100],0,[80,0],0,true,1,3,20,10,1,true,\\"Polyline\\",10,2,0,0,0,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,2,4,[0,0],0,[0,20],0,[10,20],0,[10,0],0,true,0,3,0,0,0,0,0,[0,6.123233995736766e-17,1,0,0,-1,6.123233995736766e-17,0,1,0,0,0,20,6.123233995736766e-16,10,1],3,0,0,0,0,0,20,1,\\"层板\\",\\"板主卧\\",\\"板标准柜\\",\\"默认板材5厘\\",\\"生态板\\",\\"经典檀木\\",0,0,\\"不排\\",2,0,\\"1.5\\",\\"1.5\\",\\"1.5\\",\\"1.5\\",\\"\\",\\"\\",\\"\\",4,\\"三合一\\",\\"三合一\\",\\"三合一\\",\\"三合一\\",true,true,2,\\"备注1\\",\\"434\\",\\"备注2\\",\\"434\\",0,0,0,0,0,0,0,true,0,0,null,0,0,\\"\\",\\"\\",\\"\\",\\"\\",0,false,0,\\"\\",0]"`;
exports[`晨丰导入模板解析 1`] = `"[11,102,1,2,1,0,0,1,\\"\\",2,2,0,0,2,\\"HardwareCompositeEntity\\",1,10,2,100,0,1,7,0,[1,0,0,0,0,6.123233995736766e-17,1,0,0,-1,6.123233995736766e-17,0,400,0,0,1],0,0,1,[1,0,0,0,0,6.123233995736766e-17,1,0,0,-1,6.123233995736766e-17,0,400,0,0,1],0,0,1,1,\\"Board\\",10,2,101,0,1,2,0,[0,6.123233995736766e-17,1,0,-1,0,0,0,0,-1,6.123233995736766e-17,0,400,0,0,1],0,0,1,[1,0,0,0,0,6.123233995736766e-17,1,0,0,-1,6.123233995736766e-17,0,400,0,0,1],0,0,1,3,100,100,100,true,\\"Polyline\\",10,2,0,0,0,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,2,4,[0,0],0,[100,0],0,[100,100],0,[0,100],0,true,0,3,0,0,0,0,0,19,0,\\"层板\\",\\"模板主卧\\",\\"模板标准柜\\",\\"\\",\\"\\",\\"\\",0,0,\\"不排\\",2,0,\\"1\\",\\"1\\",\\"1\\",\\"1\\",\\"\\",\\"\\",\\"\\",4,\\"不排\\",\\"不排\\",\\"不排\\",\\"不排\\",true,true,0,0,0,0,0,0,0,0,true,0,0,null,0,0,\\"\\",\\"\\",\\"\\",\\"\\",0,false,0,\\"\\",5,\\"五金\\",false,false,\\"\\",\\"\\",\\"复合实体\\",\\"模板主卧\\",\\"模板标准柜\\",\\"L*W*H*100\\",\\"L*W*H*300\\",\\"X-1\\",\\"晨丰\\",\\"晨丰\\",\\"个\\",\\"1\\",\\"\\",\\"\\",0,true,0,0,0,\\"Board\\",10,2,101,0,1,2,0,[0,6.123233995736766e-17,1,0,-1,0,0,0,0,-1,6.123233995736766e-17,0,400,0,0,1],0,0,1,[1,0,0,0,0,6.123233995736766e-17,1,0,0,-1,6.123233995736766e-17,0,400,0,0,1],0,0,1,3,100,100,100,true,\\"Polyline\\",10,2,0,0,0,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,2,4,[0,0],0,[100,0],0,[100,100],0,[0,100],0,true,0,3,0,0,0,0,0,19,0,\\"层板\\",\\"模板主卧\\",\\"模板标准柜\\",\\"\\",\\"\\",\\"\\",0,0,\\"不排\\",2,0,\\"1\\",\\"1\\",\\"1\\",\\"1\\",\\"\\",\\"\\",\\"\\",4,\\"不排\\",\\"不排\\",\\"不排\\",\\"不排\\",true,true,0,0,0,0,0,0,0,0,true,0,0,null,0,0,\\"\\",\\"\\",\\"\\",\\"\\",0,false,0,\\"\\",2,4,0,0,5,0,2,3,0,0,5,0,0,0,0,0,1,0,1,\\"CommandHistoryRecord\\",1,\\"\\",1,2,2,\\"HistorycRecord\\",2,\\"RemoveObjectData\\",1,0,\\"CreateObjectData\\",1,[],\\"HistorycRecord\\",2,\\"RemoveObjectData\\",1,1,\\"CreateObjectData\\",1,[],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`] = `"[12,102,1,2,1,0,0,1,\\"\\",2,2,0,0,2,\\"HardwareCompositeEntity\\",1,10,2,100,0,1,7,0,[1,0,0,0,0,6.123233995736766e-17,1,0,0,-1,6.123233995736766e-17,0,400,0,0,1],0,0,1,[1,0,0,0,0,6.123233995736766e-17,1,0,0,-1,6.123233995736766e-17,0,400,0,0,1],0,0,1,1,\\"Board\\",10,2,101,0,1,2,0,[0,6.123233995736766e-17,1,0,-1,0,0,0,0,-1,6.123233995736766e-17,0,400,0,0,1],0,0,1,[1,0,0,0,0,6.123233995736766e-17,1,0,0,-1,6.123233995736766e-17,0,400,0,0,1],0,0,1,3,100,100,100,true,\\"Polyline\\",10,2,0,0,0,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,2,4,[0,0],0,[100,0],0,[100,100],0,[0,100],0,true,0,3,0,0,0,0,0,20,0,\\"层板\\",\\"模板主卧\\",\\"模板标准柜\\",\\"\\",\\"\\",\\"\\",0,0,\\"不排\\",2,0,\\"1\\",\\"1\\",\\"1\\",\\"1\\",\\"\\",\\"\\",\\"\\",4,\\"不排\\",\\"不排\\",\\"不排\\",\\"不排\\",true,true,0,0,0,0,0,0,0,0,true,0,0,null,0,0,\\"\\",\\"\\",\\"\\",\\"\\",0,false,0,\\"\\",0,5,\\"五金\\",false,false,\\"\\",\\"\\",\\"复合实体\\",\\"模板主卧\\",\\"模板标准柜\\",\\"L*W*H*100\\",\\"L*W*H*300\\",\\"X-1\\",\\"晨丰\\",\\"晨丰\\",\\"个\\",\\"1\\",\\"\\",\\"\\",0,true,0,0,0,\\"Board\\",10,2,101,0,1,2,0,[0,6.123233995736766e-17,1,0,-1,0,0,0,0,-1,6.123233995736766e-17,0,400,0,0,1],0,0,1,[1,0,0,0,0,6.123233995736766e-17,1,0,0,-1,6.123233995736766e-17,0,400,0,0,1],0,0,1,3,100,100,100,true,\\"Polyline\\",10,2,0,0,0,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,2,4,[0,0],0,[100,0],0,[100,100],0,[0,100],0,true,0,3,0,0,0,0,0,20,0,\\"层板\\",\\"模板主卧\\",\\"模板标准柜\\",\\"\\",\\"\\",\\"\\",0,0,\\"不排\\",2,0,\\"1\\",\\"1\\",\\"1\\",\\"1\\",\\"\\",\\"\\",\\"\\",4,\\"不排\\",\\"不排\\",\\"不排\\",\\"不排\\",true,true,0,0,0,0,0,0,0,0,true,0,0,null,0,0,\\"\\",\\"\\",\\"\\",\\"\\",0,false,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,2,\\"HistorycRecord\\",2,\\"RemoveObjectData\\",1,0,\\"CreateObjectData\\",1,[],\\"HistorycRecord\\",2,\\"RemoveObjectData\\",1,1,\\"CreateObjectData\\",1,[],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,11,0,0,1,\\"\\",2,12,0,0,0,0,1,2,13,0,0,5,0,0,null,2,10,0,0,0]"`;
exports[`晨丰导入顶线解析 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,2,\\"Polyline\\",10,2,0,0,0,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,2,5,[0,0],0,[0,20],0,[20,20],0,[20,0],0,[0,0],0,false,1,\\"Polyline\\",10,2,0,0,0,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,2,5,[0,0],0,[0,100],0,[100,100],0,[100,0],0,[0,0],0,true,1,0,\\"0\\",\\"顶线\\",\\"顶线主卧\\",\\"顶线标准柜\\",\\"\\",\\"L*W*H\\",\\"X-1\\",\\"厂家晨丰\\",\\"品牌晨丰\\",\\"{L*2}\\",\\"顶线备注\\",0]"`;

@ -1,8 +1,8 @@
// 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,5,0,2,3,0,0,5,0,0,0,0,0,1,0,1,\\"CommandHistoryRecord\\",1,\\"\\",2,2,1,\\"HistorycRecord\\",2,\\"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,2,\\"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[`changev 1`] = `"[12,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\\",2,\\"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,2,\\"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,11,0,0,1,\\"\\",2,12,0,0,0,0,1,2,13,0,0,5,0,0,null,2,10,0,0,0]"`;
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,1,2,\\"CommandHistoryRecord\\",1,\\"\\",1,2,1,\\"HistorycRecord\\",2,\\"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]],\\"CommandHistoryRecord\\",1,\\"\\",1,100,1,\\"ObjectAllDataHistoryRecord\\",1,2,\\"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]],\\"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,[1,2,3],[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`] = `"[12,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,1,2,\\"CommandHistoryRecord\\",1,\\"\\",1,2,1,\\"HistorycRecord\\",2,\\"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]],\\"CommandHistoryRecord\\",1,\\"\\",1,100,1,\\"ObjectAllDataHistoryRecord\\",1,2,\\"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]],\\"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,[1,2,3],[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,11,0,0,1,\\"\\",2,12,0,0,0,0,1,2,13,0,0,5,0,0,null,2,10,0,0,0]"`;
exports[`创建 修改 撤销撤销 重做重做 撤销 重做 2`] = `"[\\"HistoricManage\\",1,1,2,\\"CommandHistoryRecord\\",1,\\"\\",1,2,1,\\"HistorycRecord\\",2,\\"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]],\\"CommandHistoryRecord\\",1,\\"\\",1,100,1,\\"ObjectAllDataHistoryRecord\\",1,2,\\"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]],\\"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,[1,2,3],[0,0,0]],100]"`;

@ -2,7 +2,7 @@
exports[`wblockClone 1`] = `
Array [
11,
12,
102,
1,
2,
@ -140,32 +140,37 @@ Array [
0,
1,
2,
10,
11,
0,
0,
1,
"",
2,
11,
12,
0,
0,
0,
0,
1,
2,
12,
13,
0,
0,
5,
0,
0,
null,
2,
10,
0,
0,
0,
]
`;
exports[`wblockClone 2`] = `
Array [
11,
12,
104,
1,
2,
@ -378,32 +383,37 @@ Array [
0,
1,
2,
10,
11,
0,
0,
1,
"",
2,
11,
12,
0,
0,
0,
0,
1,
2,
12,
13,
0,
0,
5,
0,
0,
null,
2,
10,
0,
0,
0,
]
`;
exports[`wblockClone 3`] = `
Array [
11,
12,
102,
1,
2,
@ -541,25 +551,30 @@ Array [
0,
1,
2,
10,
11,
0,
0,
1,
"",
2,
11,
12,
0,
0,
0,
0,
1,
2,
12,
13,
0,
0,
5,
0,
0,
null,
2,
10,
0,
0,
0,
]
`;

@ -0,0 +1,6 @@
#AlignLineGroup {
.bp3-dialog-body {
width: 30rem;
height: 20rem;
}
}

@ -0,0 +1,785 @@
import { Alert, Button, Classes, ITreeNode, Intent, Tree } from "@blueprintjs/core";
import { observable } from "mobx";
import { observer } from "mobx-react";
import React from "react";
import { Vector3 } from "three";
import { begin } from "xaop";
import { app } from "../../ApplicationServices/Application";
import { arrayRemove } from "../../Common/ArrayExt";
import { CommandNames } from "../../Common/CommandNames";
import { GroupEntitysByBox } from "../../Common/GroupEntitysByBox";
import { KeyBoard } from "../../Common/KeyEnum";
import { AlignLineGroupRecord } from "../../DatabaseServices/AlignLine/AlignLineGroupRecord";
import { Board } from "../../DatabaseServices/Entity/Board";
import { CommandWrap } from "../../Editor/CommandMachine";
import { PromptStatus } from "../../Editor/PromptResult";
import { SelectSetBase } from "../../Editor/SelectBase";
import { userConfig } from "../../Editor/UserConfig";
import { equaln, isParallelTo } from "../../Geometry/GeUtils";
import { BoardModalType } from "../../UI/Components/Board/BoardModalType";
import { GetCompoentObjectIdString } from "../../UI/Components/ComponentObjectId";
import { ModalHeader } from "../../UI/Components/Modal/ModalContainer";
import { HandleDirComponent } from "../../UI/Components/SourceManage/HandleDirComponent";
import { AppToaster } from "../../UI/Components/Toaster";
import { ECompareType } from "../../UI/Store/BoardFindInterface";
import { userConfigStore } from "../../UI/Store/UserConfigStore";
import { CompareIsEqual } from "../BoardFindModify";
import "./AlignLineGroupCSS.less";
import { AlignLineGroupModalStore, AlignLineNodeData } from "./AlignLineGroupStore";
interface AlignLineGroupModalState
{
nodes: ITreeNode[];
rightNodes: ITreeNode[];
canAlertOpen1: boolean;
alertType: number;
}
class NodeIDGenerator
{
protected _nextID: number = 0;
get nextID()
{
return this._nextID++;
}
}
@observer
export class AlignLineGroupPanel extends React.Component<{ store: AlignLineGroupModalStore; }, AlignLineGroupModalState>
{
_RemoveFuncs: Function[] = [];
_CanCreateGroup = observable.box(false);
_CategoryMap: Map<string, number> = new Map();//储存对纹组id
_SearchTypeInputRef = React.createRef<HTMLInputElement>(); //加工类型搜索框
_SearchGroupInputRef = React.createRef<HTMLInputElement>(); //加工组搜索框
_GetNodeID: NodeIDGenerator = new NodeIDGenerator();//树节点id生成器
_NeedUpdate = false;
constructor(props)
{
super(props);
this.state = {
nodes: [],
rightNodes: [],
canAlertOpen1: false,
alertType: 0,
};
this.props.store.m_Option.alignLineGroupCategory.forEach((obj) => { this._CategoryMap.set(obj, this._GetNodeID.nextID); });
}
componentDidMount()
{
//初始化列表
//如有选择实体 则添加
this.setState({ nodes: this.ParseNodes() });
this._RemoveFuncs.push(
begin(app.Editor.ModalManage, app.Editor.ModalManage.OnKeyDown, (e: KeyboardEvent) =>
{
if (GetCompoentObjectIdString(AlignLineGroupPanel) !== app.Editor.ModalManage.CurrentModalKey) return;
if (e.keyCode === KeyBoard.Escape)
this.props.store.ResetData();
e.stopPropagation();
return true;
})
);
}
componentWillUnmount()
{
for (let f of this._RemoveFuncs)
f();
this._RemoveFuncs.length = 0;
if (this._NeedUpdate)
userConfigStore.SaveConfig(BoardModalType.AlignLineGroupStore, this.props.store, { toaster: false });
}
ParseNodes = () =>
{
this.props.store.tempPgs = [];
const GetRightNode = (gname: string) =>
{
let rn = rightNodes.find((n) => n.nodeData === gname);
if (!rn)
{
let id = this._GetNodeID.nextID;
let tn: ITreeNode = {
id: id,
label: `${gname}`,
childNodes: [],
nodeData: gname,
};
rightNodes.push(tn);
rn = tn;
}
return rn;
};
const AddToRightNode = (nodeid, nodeData, childs: ITreeNode[], name: string) =>
{
if (childs.length > 0)
{
let id = nodeid ?? this._GetNodeID.nextID;
let node: ITreeNode = { //加工组节点
id: id,
label: name,
hasCaret: childs.length > 0,
childNodes: childs,
nodeData: nodeData,
isExpanded: this.props.store.expandedNodesId.includes(id)
};
let rightNode = GetRightNode(name);
rightNode.childNodes.push(node);
if (node.label.toString().match(/\</g))//添加索引序号 形如: <1>格子抽
node.label = node.label.toString().replace(/\<(.*?)\>/g, "<" + (rightNode.childNodes.length).toString() + ">"); //移动端ios不支持零宽断言换一种查询
else
node.label = `<${rightNode.childNodes.length}> ${node.label}`;
if (rightNode.label.toString().match(/\(/g))//添加数目 形如: 抽屉(5)
rightNode.label = rightNode.label.toString().replace(/\((.*?)\)/g, "(" + rightNode.childNodes.length.toString() + "个)");
else
rightNode.label += `(${rightNode.childNodes.length}个)`;
if (nodeData instanceof Array)
this.props.store.tempPgs.push({ nodeName: node.label as string, brarr: nodeData });
}
};
let rightNodes: ITreeNode[] = [];//右侧节点
let leftNodes: ITreeNode[] = [];//左侧节点
//搜索加工组类型内容
let newCategoryMap: Map<string, number> = new Map();
if (this._SearchTypeInputRef?.current?.value)
for (let category of this._CategoryMap)
{
if (CompareIsEqual(category[0], this._SearchTypeInputRef.current.value, ECompareType.Include))
newCategoryMap.set(category[0], category[1]);
}
else
newCategoryMap = this._CategoryMap;
//为每个组类别创建节点
for (let [als, pgnum] of newCategoryMap)
{
let leftTN: ITreeNode = {
id: this._GetNodeID.nextID,
label: <span title={als}> {als}</span>,
childNodes: [],
nodeData: "p" + als,
hasCaret: false
};
leftNodes.push(leftTN);
}
for (let g of app.Database.AlignLineGroupTable.Objects)
{
if (!g || g.IsErase || g.Objects.length === 0)
continue;
if (this.props.store.flag === 2 && this.props.store.selectedLeftNode !== g.Name)
continue;
let childs: ITreeNode[] = []; //板件(实体)节点
for (let obj of g.Objects)
{
if (!obj || obj.IsErase)
continue;
let childnode: ITreeNode;
let ent = obj.Object as any;
//查看/添加
if (this.props.store.flag)
if (!this.props.store.checkEnts?.find((ent) => { return ent.Id.Index === obj.Index; }))//如果该ent不需要被查看
continue;
childnode = {
id: parseInt(obj.Index.toString() + g.Id.Index.toString()),
label: '(板)' + ent.Name,
nodeData: { self: ent, parent: g } as AlignLineNodeData
};
childs.push(childnode);
}
if (childs.length === 0)
continue;
AddToRightNode(g.Id.Index, g, childs, g.Name);
}
// 按加工组id排序 避免和bbs的加工组索引顺序不对应
for (let rn of rightNodes)
{
rn.childNodes.sort((a, b) => (a.nodeData as AlignLineGroupRecord).Id.Index - (b.nodeData as AlignLineGroupRecord).Id.Index);
}
//搜索加工组搜索框内容
let searchGroupInputRefValue = this._SearchGroupInputRef?.current?.value;
if (searchGroupInputRefValue)
rightNodes = rightNodes.filter(node => CompareIsEqual(node.nodeData as string, searchGroupInputRefValue, ECompareType.Include));
this.setState({ rightNodes: rightNodes.filter(n => n.childNodes.length > 0) });
this.RecoverSelectedNode(rightNodes, leftNodes);
return leftNodes;
};
//恢复节点选中 (删除节点后, 添加/查看再呼出需要)
RecoverSelectedNode = (nodes: ITreeNode[], leftNodes: ITreeNode[]) =>
{
if (!(nodes && leftNodes))
return;
const { expandedNodesId, selectedRightNodeSet: selectedCategorySet, selectedLeftNode } = this.props.store;
this.ForEachNode([...nodes, ...leftNodes], n =>
{
if (typeof (n.nodeData) === "string")
{
if (n.nodeData[0] === "p")
{
if (selectedLeftNode === (n.nodeData.slice(1)))
n.isSelected = true;
}
else
if (selectedCategorySet.size > 0)
if (selectedCategorySet.has(n.nodeData))
n.isSelected = true;
}
n.isExpanded = expandedNodesId.includes(n.id);
});
};
//遍历树UI节点
ForEachNode(nodes: ITreeNode[], callback: (node: ITreeNode) => void)
{
if (nodes === null)
return;
for (const node of nodes)
{
callback(node);
if (node.childNodes && node.childNodes.length > 0)
this.ForEachNode(node.childNodes, callback);
}
}
//展开折叠节点
HandleNodeCollapse = (nodeData: ITreeNode, isCollapse: boolean) =>
{
const { expandedNodesId } = this.props.store;
nodeData.isExpanded = !isCollapse;
if (nodeData.isExpanded)
{
if (!expandedNodesId.includes(nodeData.id))
expandedNodesId.push(nodeData.id);
}
else
arrayRemove(expandedNodesId, nodeData.id);
this.setState(this.state);
};
//点击节点的处理: 令节点变成选中状态(蓝色)
HandleNodeSelect = (node: ITreeNode, _nodePath: number[], e: React.MouseEvent<HTMLElement> | MouseEvent) =>
{
const { selectedGroupSet, selectedObjectSet, selectedRightNodeSet: selectedCategorySet, selectedLeftNode } = this.props.store;
if (!e.ctrlKey || node.nodeData[0] === "p") //单选
{
this.ForEachNode([...this.state.nodes, ...this.state.rightNodes], n =>
{
if (typeof (n.nodeData) === "string" && n.nodeData[0] === "p" && !(typeof (node.nodeData) === "string" && node.nodeData[0] === "p"))
{
n.isSelected = selectedLeftNode === n.nodeData.slice(1);
return;
}
n.isSelected = n.id === node.id;
});
selectedGroupSet.clear();
selectedObjectSet.clear();
selectedCategorySet.clear();
this.props.store.selectedTempPgs = [];
if (typeof (node.nodeData) === "string")
{
if (node.nodeData[0] === "p")//左边
this.props.store.selectedLeftNode = node.nodeData.slice(1);
else
selectedCategorySet.add(node.nodeData);
this.setState(this.state);
}
else if (node.nodeData instanceof Array)
{
this.props.store.selectedTempPgs.push({ nodeName: node.label as string, brarr: node.nodeData });
this.setState(this.state);
}
else
{
if (node.nodeData instanceof AlignLineGroupRecord)
selectedGroupSet.add(node.nodeData);
else//单选 选择实体时
selectedObjectSet.add(node.nodeData as AlignLineNodeData);
this.setState(this.state);
}
}
else //多选
{
let orgins = node.isSelected;
node.isSelected = !orgins;
this.setState(this.state);
if (typeof (node.nodeData) === "string")
{
if (node.nodeData[0] !== "p")
node.isSelected ?
selectedCategorySet.add(node.nodeData) : selectedCategorySet.delete(node.nodeData);
}
else if (node.nodeData instanceof AlignLineGroupRecord)
node.isSelected ?
selectedGroupSet.add(node.nodeData) : selectedGroupSet.delete(node.nodeData);
else if (node.nodeData instanceof Array)
this.props.store.selectedTempPgs.push({ nodeName: node.label as string, brarr: node.nodeData });
else
node.isSelected ?
selectedObjectSet.add(node.nodeData as AlignLineNodeData) : selectedObjectSet.delete(node.nodeData as AlignLineNodeData);
}
this.ShowGroups();
};
//清除当前所有选中实体的亮显
ClearSelect = () =>
{
app.Editor.SelectCtrl.SelectSet.Clear();
app.Viewer.GripScene.Clear();
app.Editor.SelectCtrl.UpdateView();
};
//使选中的实体亮显
ShowGroups = () =>
{
const { selectedGroupSet, selectedObjectSet, selectedRightNodeSet: selectedCategorySet, selectedTempPgs: selectedNoDeletePg } = this.props.store;
this.ClearSelect();
let selectData = new SelectSetBase(app.Viewer);
for (let c of selectedCategorySet)
{
for (let alignLine of app.Database.AlignLineGroupTable.Objects)
{
if (alignLine.IsErase)
continue;
if (alignLine.Name === c)
for (let obj of alignLine.Objects)
{
if (!obj || obj.IsErase)
continue;
if (this.props.store.flag && !(this.props.store.checkEnts.includes(obj.Object as Board)))
continue;
selectData._SelectList.add((obj.Object as Board).DrawObject);
}
}
for (let ndpg of this.props.store.tempPgs)
{
let title = ndpg.nodeName.match(/\>(.*)/g)[0].trim().slice(2);
if (selectedCategorySet.has(title))
{
for (let en of ndpg.brarr)
{
if (this.props.store.flag)
{
if (!this.props.store.checkEnts.includes(en))
continue;
}
selectData._SelectList.add(en.DrawObject);
}
}
}
}
for (let g of selectedGroupSet)
if (!selectedCategorySet.has(g.Name))
for (let obj of g.Objects)
if (obj?.Object instanceof Board && !obj.Object.IsErase)
selectData._SelectList.add(obj.Object.DrawObject);
for (let b of selectedObjectSet)
if (!b.parent || !(selectedGroupSet.has(b.parent) || selectedCategorySet.has(b.parent.Name)))
if (b.self instanceof Board)
selectData._SelectList.add(b.self.DrawObject);
for (let data of selectedNoDeletePg)
{
let title = data.nodeName.match(/(\>)(.*)/g)[0].trim().slice(2);
if (!selectedCategorySet.has(title))
for (let br of data.brarr)
{
if (this.props.store.flag)
{
if (!this.props.store.checkEnts.includes(br))
continue;
}
selectData._SelectList.add(br.DrawObject);
}
}
if (selectData._SelectList.size > 0)
{
app.Editor.SelectCtrl.AddSelect(selectData, true);
app.Editor.SelectCtrl.UpdateView();
}
};
AddAlignLineGroup = async () =>
{
if (!this.props.store.selectedLeftNode)
return;
//初始化搜索内容
app.Editor.ModalManage.ToggleShow();
app.Editor.MaskManage.Clear();
await CommandWrap(async () =>
{
let ssRes = await app.Editor.GetSelection({
Msg: `请选择需要加入对纹组的实体`,
Filter: { filterTypes: [Board] }
});
if (ssRes.Status === PromptStatus.OK)
{
let brs = ssRes.SelectSet.SelectEntityList as Board[];
if (!brs.every(br => isParallelTo(br.Normal, brs[0].Normal)))
{
AppToaster.show({
message: "所选的板件不在同一平面上",
timeout: 5000,
intent: Intent.WARNING,
});
return;
}
let invalidBoard = brs.filter(br => br.AlignLineObject);
if (invalidBoard.length)
{
AppToaster.show({
message: "存在已经组合的板!",
timeout: 5000,
intent: Intent.WARNING,
}, "hasInvalidBoard");
app.Editor.SetSelection(invalidBoard);
return;
}
let brBoxMap = GroupEntitysByBox(brs);
let name = this.props.store.selectedLeftNode;
for (let [box, brs] of brBoxMap)
{
if (brs.length < 2)
{
AppToaster.show({
message: "存在无效的对纹组合!",
timeout: 5000,
intent: Intent.WARNING,
}, "notGroupAlignLine");
continue;
}
const FirstBr = brs[0];
const LineType = FirstBr.BoardProcessOption.lines;
const Material = FirstBr.BoardProcessOption.material;
const Color = FirstBr.BoardProcessOption.color;
const MatName = FirstBr.BoardProcessOption.boardName;
const Thickness = FirstBr.Thickness;
let canAdd = brs.every(
br => br.BoardProcessOption.material === Material &&
br.BoardProcessOption.color === Color &&
br.BoardProcessOption.boardName === MatName &&
br.BoardProcessOption.lines === LineType &&
equaln(br.Thickness, Thickness)
);
if (!canAdd)
{
AppToaster.show({
message: "所选板块中,板材料、板材颜色、板材名、板厚或者板纹路不一致,无法组成对纹组!",
timeout: 5000,
intent: Intent.WARNING,
});
continue;
}
{
//超长板件
let ocsInv = brs[0].OCSInv;
let spliteSize = box.applyMatrix4(ocsInv).getSize(new Vector3);
if (spliteSize.y > userConfig.maxSize.height + 1e-5 || spliteSize.x > userConfig.maxSize.width + 1e-5)
{
AppToaster.show({
message: "组合的对纹组尺寸超长!",
timeout: 5000,
intent: Intent.DANGER,
});
continue;
}
}
let al = new AlignLineGroupRecord;
al.Name = name || "未命名";
app.Database.AlignLineGroupTable.Add(al);
for (let br of brs)
{
br.AlignLineObject = al.Id;
al.Objects.push(br.Id);
}
}
}
}, CommandNames.AddAlignLineGroup);
this.ParseNodes();
this.props.store.expandedNodesId = [];
app.Editor.ModalManage.ToggleShow();
app.Editor.MaskManage.ShowMask();
};
//增加组类别
AddProcessGroup = (name: string) =>
{
let groupname = name.trim();
if (!groupname)
{
AppToaster.show({
message: "名称不能为空",
timeout: 1000
});
return;
}
if (!this._CategoryMap.has(groupname))
{
this._CategoryMap.set(groupname, this._GetNodeID.nextID);
this.props.store.m_Option.alignLineGroupCategory.push(groupname);
this._CanCreateGroup.set(false);
this.setState({ nodes: this.ParseNodes() });
this._NeedUpdate = true;
}
else
{
AppToaster.show({
intent: Intent.DANGER,
message: `名称 ${groupname} 已存在!`,
timeout: 1000
});
}
};
//删除对纹组
DelGroup = (alignLineGroup: AlignLineGroupRecord) =>
{
for (let obj of alignLineGroup.Objects)
{
let board = obj?.Object as Board;
if (board) board.AlignLineObject = undefined;
}
alignLineGroup.Erase();
};
//删除对纹组(确认删除)
DelAlertConfirm = () =>
{
CommandWrap(() =>
{
//为了保持节点展开 删除完毕后将父节点选中
let needSelectedCategory: string[] = [];
//只选中左边的项时 删除左边选中的
if (this.props.store.selectedRightNodeSet.size === 0 && this.props.store.selectedGroupSet.size === 0 && this.props.store.selectedObjectSet.size === 0 && this.props.store.selectedLeftNode)
{
{
this._CategoryMap.delete(this.props.store.selectedLeftNode);
}
this.props.store.m_Option.alignLineGroupCategory = this.props.store.m_Option.alignLineGroupCategory.filter((g) => this.props.store.selectedLeftNode !== g);
this.setState({ nodes: this.ParseNodes() });
this.props.store.selectedLeftNode = "";
}
//删除对纹组
for (let g of this.props.store.selectedGroupSet)
{
this.DelGroup(g);
needSelectedCategory.push(g.Name);
}
this.props.store.selectedGroupSet.clear();
//删除组类别
for (let c of this.props.store.selectedRightNodeSet)
{
for (let g of app.Database.AlignLineGroupTable.Objects)
{
if (g.IsErase)
continue;
if (g.Name === c)
this.DelGroup(g);
}
}
//检查组类别下的模块对纹组
for (let ndpg of this.props.store.tempPgs)
{
let title = ndpg.nodeName.match(/\>(.*)/g)[0].trim().slice(2); //">"后面还有一个空格
if (this.props.store.selectedRightNodeSet.has(title))
{
AppToaster.show({
message: `对纹组${ndpg.nodeName}跟随模块生成,无法删除!`,
intent: Intent.WARNING,
timeout: 1000,
});
}
}
for (let nd of this.props.store.selectedTempPgs)
{
let title = nd.nodeName.match(/\>(.*)/g)[0].trim().slice(2);
if (!this.props.store.selectedRightNodeSet.has(title))
AppToaster.show({
message: `对纹组${nd.nodeName}跟随模块生成,无法删除!`,
intent: Intent.WARNING,
timeout: 1000,
});
}
this.props.store.selectedTempPgs = [];
this.props.store.selectedRightNodeSet.clear();
for (let c of needSelectedCategory)
this.props.store.selectedRightNodeSet.add(c);
this.setState({ nodes: this.ParseNodes(), canAlertOpen1: false });
this._NeedUpdate = true;
}, CommandNames.DeleteAlignLineGroup);
};
ShowSelectBoards = async () =>
{
//初始化搜索内容
this._SearchGroupInputRef.current.value = "";
this.ClearSelect();
app.Editor.ModalManage.ToggleShow();
app.Editor.MaskManage.Clear();
await CommandWrap(async () =>
{
const store = this.props.store;
let ents: Board[];
let getEnts = await app.Editor.GetSelection({
Msg: "请选择实体查看对纹组(空格选择全部)",
Filter: { filterTypes: [Board] },
AllowNone: true,
});
if (getEnts.Status === PromptStatus.Cancel)
return;
ents = getEnts.SelectSet.SelectEntityList as Board[];
if (!ents.length)
{
for (let ent of app.Database.ModelSpace.Entitys)
{
if (!ent.IsErase && ent instanceof Board)
ents.push(ent);
}
}
store.checkEnts = ents;
}, "lookAlignLineBoard");
this.props.store.flag = 1;
this.setState({ nodes: this.ParseNodes() });
this.props.store.expandedNodesId = [];
app.Editor.ModalManage.ToggleShow();
app.Editor.MaskManage.ShowMask();
};
_Return = () =>
{
this.props.store.ResetData();
app.Editor.ModalManage.Destory();
};
render()
{
const { selectedGroupSet, selectedLeftNode, selectedRightNodeSet: selectedCategorySet, selectedTempPgs } = this.props.store;
return (
<>
<div
className={Classes.DIALOG_CONTAINER}
id="processingGroup"
>
<div className={Classes.DIALOG}>
<ModalHeader title={"对纹组"} close={this._Return} logo={false} />
<div className={Classes.DIALOG_BODY + " " + Classes.CARD} >
<div>
<div className="left">
<div className="processingGroupTitle">
<div className="titleText"> </div>
<input className="searchInput"
ref={this._SearchTypeInputRef}
placeholder="搜索..."
onChange={() => { this.setState({ nodes: this.ParseNodes() }); }}
/>
</div>
<div className="list">
<Tree
contents={this.state.nodes}
className={Classes.ELEVATION_0}
onNodeCollapse={(node) => this.HandleNodeCollapse(node, true)}
onNodeExpand={(node) => this.HandleNodeCollapse(node, false)}
onNodeClick={this.HandleNodeSelect}
/>
</div>
<div className="add-del-btn">
<Button text="增加对纹种类" onClick={() => { this._CanCreateGroup.set(true); }} />
<Button text="移除对纹种类" onClick={() => { this.setState({ alertType: 0, canAlertOpen1: true }); }} />
</div>
</div>
<div className="right">
<div className="left">
<div className="processingGroupTitle">
<div className="titleText"> </div>
<input className="searchInput"
ref={this._SearchGroupInputRef}
placeholder="搜索..."
onChange={() => { this.ParseNodes(); }}
/>
</div>
<div className="list">
<Tree
contents={this.state.rightNodes}
className={Classes.ELEVATION_0}
onNodeCollapse={(node) => this.HandleNodeCollapse(node, true)}
onNodeExpand={(node) => this.HandleNodeCollapse(node, false)}
onNodeClick={this.HandleNodeSelect}
/>
</div>
</div>
<div className="right">
<Button text="查看选中" onClick={this.ShowSelectBoards} />
<Button text="添加对纹组" disabled={!(selectedLeftNode)} onClick={this.AddAlignLineGroup} />
<Button text="移除对纹组" disabled={!(selectedGroupSet.size > 0 || selectedCategorySet.size > 0 || selectedTempPgs.length > 0)} onClick={() => this.setState({ alertType: 1, canAlertOpen1: true })} />
<Alert
className={"processGroup-alert"}
cancelButtonText="取消"
confirmButtonText="确定"
icon="trash"
intent={Intent.DANGER}
isOpen={this.state.canAlertOpen1}
onCancel={() => { this.setState({ canAlertOpen1: false }); }}
onConfirm={() => { this.DelAlertConfirm(); }}
canEscapeKeyCancel={true}
canOutsideClickCancel={true}
>
<p style={{ marginBottom: 0 }}>{this.state.alertType ? "确定移除选中的对纹组吗? " : "确定移除选中的对纹种类吗? "}</p>
</Alert>
</div>
</div>
</div>
</div>
</div>
</div>
{
this._CanCreateGroup.get() && <HandleDirComponent
className={"style2"}
defualtValue={""}
isReset={false}
isOpen={this._CanCreateGroup}
handleFunc={this.AddProcessGroup}
title="输入对纹类别名称"
/>
}
</>
);
}
}

@ -0,0 +1,77 @@
import { observable, toJS } from "mobx";
import { Singleton } from "../../Common/Singleton";
import { AlignLineGroupRecord } from "../../DatabaseServices/AlignLine/AlignLineGroupRecord";
import { CADObject } from "../../DatabaseServices/CADObject";
import { Board } from "../../DatabaseServices/Entity/Board";
import { Entity } from "../../DatabaseServices/Entity/Entity";
import { IConfigOption } from "../../UI/Components/Board/UserConfigComponent";
import { IConfigStore } from "../../UI/Store/BoardStore";
export interface AlignLineNodeData
{
self: CADObject,
parent: AlignLineGroupRecord;
}
interface TemplatePgData //跟随模块自动识别的对纹组的数据
{
nodeName: string;
brarr: Board[];
}
export interface AlignLineGroupOption
{
alignLineGroupCategory: string[];
}
const DefaultAlingnLineOption: AlignLineGroupOption = {
alignLineGroupCategory: ["门板"],
};
export class AlignLineGroupModalStore extends Singleton implements IConfigStore
{
configName: string = "默认";
configsNames: string[];
@observable m_Option: AlignLineGroupOption = { ...DefaultAlingnLineOption };
flag: number = 0;//是否点击过查看 0 无, 1 查看, 2 添加
checkEnts: Entity[];
//选择的组类别 值为组类别名称
selectedLeftNode: string = "";
selectedRightNodeSet: Set<string> = new Set();
//选择的加工组
selectedGroupSet: Set<AlignLineGroupRecord> = new Set();
//选择的实体数据(加工组的子元素)
selectedObjectSet: Set<AlignLineNodeData> = new Set();
selectedTempPgs: TemplatePgData[] = [];//已选择的 跟随模块自动识别的加工组的数据
tempPgs: TemplatePgData[] = [];//所有 跟随模块自动识别的加工组的数据 (在删除提示和亮显时有用)
expandedNodesId = [];
InitOption = () =>
{
Object.assign(this.m_Option, DefaultAlingnLineOption);
};
UpdateOption = (config: IConfigOption<AlignLineGroupOption>) =>
{
Object.assign(this.m_Option, config.option);
};
SaveConfig = () =>
{
let newConfig: IConfigOption<AlignLineGroupOption> = {};
newConfig.option = toJS(this.m_Option);
return newConfig;
};
ResetData = () =>
{
this.checkEnts = undefined;
this.flag = 0;
this.selectedLeftNode = "";
this.selectedRightNodeSet = new Set();
this.selectedGroupSet = new Set();
this.selectedObjectSet = new Set();
this.selectedTempPgs = [];
this.expandedNodesId = [];
};
}

@ -0,0 +1,26 @@
import { app } from "../../ApplicationServices/Application";
import { Command } from "../../Editor/CommandMachine";
import { BoardModalType } from "../../UI/Components/Board/BoardModalType";
import { IConfigOption } from "../../UI/Components/Board/UserConfigComponent";
import { userConfigStore } from "../../UI/Store/UserConfigStore";
import { AlignLineGroupPanel } from "./AlignLineGroupPanel";
import { AlignLineGroupModalStore, AlignLineGroupOption } from "./AlignLineGroupStore";
//设置对纹组
export class Command_AlignLineGroup implements Command
{
NoHistory = true;//呼出时,我们没有任何的操作记录
async exec()
{
let store = AlignLineGroupModalStore.GetInstance();
let config = await userConfigStore.GetConfig(BoardModalType.AlignLineGroupStore) as IConfigOption<AlignLineGroupOption>;
if (!config)
{
store.InitOption();
userConfigStore.SaveConfig(BoardModalType.AlignLineGroupStore, store, { isInit: true, toaster: false });
}
else
store.UpdateOption(config);
app.Editor.ModalManage.RenderModeless(AlignLineGroupPanel, { store }, { canMinimize: false });
}
}

@ -2,6 +2,7 @@ import { Intent } from "@blueprintjs/core";
import { Line3, Matrix4, Vector3 } from "three";
import { app } from "../../ApplicationServices/Application";
import { arrayLast, arrayRemoveIf } from "../../Common/ArrayExt";
import { AlignLineGroupRecord } from "../../DatabaseServices/AlignLine/AlignLineGroupRecord";
import { Contour } from "../../DatabaseServices/Contour";
import { Board, I2DModeling } from "../../DatabaseServices/Entity/Board";
import { ExtrudeContourCurve } from "../../DatabaseServices/Entity/Extrude";
@ -162,6 +163,9 @@ export class LinearCutting implements Command
let fixPath = new FixBoard2dPath(br);
//对纹组
let alignLineGroup = br.AlignLineObject?.Object as AlignLineGroupRecord;
//造型应用
for (let i = 1; i < cus.length; i++)
{
@ -183,6 +187,9 @@ export class LinearCutting implements Command
spliteEnts.push(br2);
fixPath.SetBoardPath2d(br2);
if (alignLineGroup) //加入对纹组
alignLineGroup.Objects.push(br2.objectId);
}
br.ContourCurve = cus[0];

@ -43,6 +43,11 @@ const ForbidReactorCmd = new Set([
//封边
CommandNames.,
//对纹组
CommandNames.AlignLineGroup,
CommandNames.AddAlignLineGroup,
CommandNames.DeleteAlignLineGroup
]);
export class DrillingReactor

@ -9,7 +9,7 @@ import { AppToaster } from "../../UI/Components/Toaster";
import { BoardStore } from "../../UI/Store/BoardStore";
import { ErpURL } from "./HostURL";
import { OrderDataBlock } from "./Models/CadBlock";
import { OrderDataObject, ProcessGroupObject } from "./Models/CadObject";
import { AlignLineGroupObject, OrderDataObject, ProcessGroupObject } from "./Models/CadObject";
import { ErpRouteInfo } from "./Models/ErpRouteInfo";
import { ErpRoutes } from "./Models/ErpRoutes";
interface ErpViewProp
@ -17,7 +17,7 @@ interface ErpViewProp
erpRoute: ErpRouteInfo;
session: string;
token: string;
cadData: { blockList: OrderDataBlock[], objectList: OrderDataObject[]; processGroupList: ProcessGroupObject[]; };
cadData: { blockList: OrderDataBlock[], objectList: OrderDataObject[]; processGroupList: ProcessGroupObject[]; AlignLineList: AlignLineGroupObject[]; };
store: BoardStore;
selectEntityIDs: number[];
}

@ -1,3 +1,5 @@
import { Vector2 } from "three";
export class OrderDataObject
{
ID: number;
@ -52,3 +54,14 @@ export class ProcessGroupProjObject
//加工组id
groupID: number;
}
export interface AlignLineGroupObject
{
groupId: string;
objects: AlignLineBoardObject[];
}
export interface AlignLineBoardObject
{
brId: number;
position: Vector2;
}

@ -33,14 +33,22 @@ import { GetArray, GetPointInfoArray } from "./Models/ArrayHelper";
import { CadType, OrderDataBlock, WaveType } from "./Models/CadBlock";
import { BasePosition, CadBlockHoles, CadBlockInfo, CadBlockModel, CadBlockModelPoint, CadBlockPoint, FaceType, HoleType, ModelOffSetData } from "./Models/CadBlockInfo";
import { CADDbBoard } from "./Models/CadModel";
import { OrderDataObject, ProcessGroupObject, ProcessGroupProjObject } from "./Models/CadObject";
import { AlignLineGroupObject, OrderDataObject, ProcessGroupObject, ProcessGroupProjObject } from "./Models/CadObject";
import { DealAlignLineGroup, ParseAlignLine } from "./ParseDataFunction";
import { parseParts } from "./ParseParts";
enum FrontOrSide
{
= 0,
= 1,
}
export type MesParsedDataType = { blockList: OrderDataBlock[]; objectList: OrderDataObject[]; processGroupObjectList: ProcessGroupObject[]; };
export type MesParsedDataType = {
blockList: OrderDataBlock[];
objectList: OrderDataObject[];
processGroupObjectList: ProcessGroupObject[];
alignLineGroupList: AlignLineGroupObject[];
};
export class ErpParseData
{
async GetCadData(boardList: Board[], metalsList: IHardwareType[]): Promise<MesParsedDataType>
@ -48,8 +56,10 @@ export class ErpParseData
let blockList: OrderDataBlock[] = [];
let objectList: OrderDataObject[] = [];
let processGroupObjectList: ProcessGroupObject[] = [];//加工组拆单信息
let alignLineGroupList: AlignLineGroupObject[] = []; //对纹组信息
let pgMap_pg: Map<string, ProcessingGroupRecord[]> = new Map();//加工组map
let pgMap_template: Map<string, TemplateRecord[]> = new Map();//需要识别为加工组的模块map 如:酒格/格子抽
let alignLineMap: Map<string, Board[]> = new Map();//对纹拆单信息
let entityIDMap: Map<number, number> = new Map();//cad objectID到mes板材,五金id对应关系
let blockIndex: number = 0;
let boxSizeList = Production.GetCabSize(boardList);
@ -67,7 +77,7 @@ export class ErpParseData
}
};
//更新加工组字典方法:pgMap_pg
const processGroupMapFun = (entity: Entity) =>
const ProcessGroupMapFun = (entity: Entity) =>
{
/*归类板件加工组-开始*/
let temp = entity.Template?.Object;
@ -97,7 +107,7 @@ export class ErpParseData
}
};
//生成加工组信息processGroupObjectList的方法
const dealProcessGroupFun = () =>
const DealProcessGroupFun = () =>
{
//获取加工组板件和五金信息brids, objids, size
const getProcessInfo = (g: ProcessingGroupRecord) =>
@ -181,7 +191,9 @@ export class ErpParseData
{
if (entity instanceof Board)
{
processGroupMapFun(entity);
ProcessGroupMapFun(entity);
//解析对纹信息
ParseAlignLine(entity, alignLineMap);
//房间名
let roomName = entity.BoardProcessOption.roomName || "未命名";
//柜体
@ -234,7 +246,8 @@ export class ErpParseData
block.Width = block.SpliteWidth;
block.Height = block.SpliteHeight;
block.Thickness = block.SpliteThickness;
} else
}
else
{
block.Width = this.GetNumberBit(entity.Width, 3);
block.Height = this.GetNumberBit(entity.Height, 3);
@ -299,15 +312,18 @@ export class ErpParseData
for (const entity of noTopLineObjects)
{
let spliteData = Production.GetHardwareCompositeData(entity as HardwareCompositeEntity);
parseParts(entity, spliteData, objectList, null, entityIDMap, processGroupMapFun);
parseParts(entity, spliteData, objectList, null, entityIDMap, ProcessGroupMapFun);
}
//封边和排钻处理转换为OrderDataObject[]
arrayPushArray(objectList, this.GetSealingAndDrills(boardList));
//处理顶线转换为OrderDataObject[]
arrayPushArray(objectList, this.GetOrderTopLines(topLines, objectList.length + 1, entityIDMap, processGroupMapFun));
arrayPushArray(objectList, this.GetOrderTopLines(topLines, objectList.length + 1, entityIDMap, ProcessGroupMapFun));
//生成加工组信息processGroupObjectList的方法
dealProcessGroupFun();
return { blockList, objectList, processGroupObjectList };
DealProcessGroupFun();
//生成对纹组alignLineGroupList信息
DealAlignLineGroup(alignLineMap, alignLineGroupList, entityIDMap);
return { blockList, objectList, processGroupObjectList, alignLineGroupList };
}
DecomposeObject(metalsList: IHardwareType[])
{

@ -0,0 +1,48 @@
import { Box3, Vector2 } from "three";
import { AlignLineGroupRecord } from "../../DatabaseServices/AlignLine/AlignLineGroupRecord";
import { Board } from "../../DatabaseServices/Entity/Board";
import { equalv2 } from "../../Geometry/GeUtils";
import { AlignLineBoardObject, AlignLineGroupObject } from "./Models/CadObject";
//解析对纹信息
export function ParseAlignLine(br: Board, alignLineMap: Map<string, Board[]>)
{
let alignLineGroupRecord = br.AlignLineObject?.Object as AlignLineGroupRecord;
if (!alignLineGroupRecord) return;
const ID = alignLineGroupRecord.Id.Index.toFixed();
if (alignLineMap.has(ID))
{
let brs = alignLineMap.get(ID);
brs.push(br);
alignLineMap.set(ID, brs);
}
else
alignLineMap.set(ID, [br]);
};
//生成对纹组alignLineGroupList信息
export function DealAlignLineGroup(alignLineMap: Map<string, Board[]>, alignLineGroupList: AlignLineGroupObject[], entityIDMap: Map<number, number>)
{
for (let [n, brs] of alignLineMap)
{
let alignLineBoardObject: AlignLineBoardObject[] = [];
if (!brs.length) continue;
const Box = new Box3();
for (let br of brs)
{
let id = entityIDMap.get(br.Id.Index);
let brBox = br.GetBoundingBoxInMtx(brs[0].OCSInv);
Box.union(brBox);
let min = brBox.min;
alignLineBoardObject.push({ brId: id, position: new Vector2(min.x, min.y) });
}
let v2Box = new Vector2(Box.min.x, Box.min.y);
if (!equalv2(v2Box, new Vector2))
alignLineBoardObject.forEach((al) => al.position = al.position.sub(v2Box));
alignLineGroupList.push({ groupId: n, objects: alignLineBoardObject });
}
}

@ -83,6 +83,14 @@ export function Purge(db: Database): void
e.Purge();
return e.Objects.length === 0;
});
arrayRemoveIf(db.AlignLineGroupTable.Objects, e =>
{
if (!e || e.IsErase) return true;
e.Purge();
return e.Objects.length === 0;
});
db.hm.Enable = bakEnable;
}

@ -392,7 +392,10 @@ export enum CommandNames
Hide2DPathObject = "HIDE2DPATHOBJECT",//隐藏二维刀路差集
PickUp2DModelCsgs = "PICKUP2DMODELCSGS",//提取二维刀路的刀具轮廓
TemplateGroup = "TEMPLATEGROUP", //模块组合
Modeling = "MODELING", //一键建模
Curved = "CURVED", // 弯曲成曲面板
DrawArcBoard = "DRAWARCBOARD" //绘制圆弧板
DrawArcBoard = "DRAWARCBOARD",//绘制圆弧板
Modeling = "MODELING",//一键建模
AlignLineGroup = "ALIGNLINEGROUP",//呼出对纹组
AddAlignLineGroup = "ADDALIGNLINEGROUP",//添加对纹组
DeleteAlignLineGroup = "DELETEALIGNLINEGROUP",//删除对纹组
}

@ -0,0 +1,63 @@
import { arrayRemoveIf } from "../../Common/ArrayExt";
import { AutoRecord } from "../AutoRecord";
import { Factory } from "../CADFactory";
import { CADFiler } from "../CADFiler";
import { ObjectId } from "../ObjectId";
import { SymbolTableRecord } from "../SymbolTableRecord";
/**
* .
*/
@Factory
export class AlignLineGroupRecord extends SymbolTableRecord
{
@AutoRecord Objects: ObjectId[] = [];
constructor()
{
super();
}
get Name()
{
return this.name;
}
set Name(name: string)
{
if (name !== this.name)
{
this.WriteAllObjectRecord();
this.name = name;
}
}
Purge()
{
arrayRemoveIf(this.Objects, id => !id || id.IsErase);
}
//#region -------------------------File-------------------------
//对象从文件中读取数据,初始化自身
ReadFile(file: CADFiler)
{
let ver = file.Read();
super.ReadFile(file);
let count = file.Read();
this.Objects.length = 0;
for (let i = 0; i < count; i++)
{
let id = file.ReadObjectId();
if (id) this.Objects.push(id);
}
}
//对象将自身数据写入到文件
WriteFile(file: CADFiler)
{
file.Write(1);
super.WriteFile(file);
file.Write(this.Objects.length);
for (let id of this.Objects)
file.WriteObjectId(id);
}
//#endregion
}

@ -0,0 +1,32 @@
import { Status } from "../../Common/Status";
import { Factory } from "../CADFactory";
import { ObjectCollection } from "../ObjectCollection";
import { AlignLineGroupRecord } from "./AlignLineGroupRecord";
@Factory
export class AlignLineGroupTable extends ObjectCollection<AlignLineGroupRecord>
{
Append(object: AlignLineGroupRecord, isCheckObjectCleanly = true)
{
let id = super.Append(object, isCheckObjectCleanly);
if (id)
object.Owner = this.Id;
return id;
}
Add(record: AlignLineGroupRecord, isCheckObjectCleanly = true): Status
{
let id = this.Append(record, isCheckObjectCleanly);
if (id)
return Status.True;
else
return Status.False;
}
Remove(record: AlignLineGroupRecord)
{
return super.Remove(record);
}
}

@ -22,6 +22,11 @@ const ForbidReactorCmd = new Set([
CommandNames.ShowProcessingGroupModal,
CommandNames.,
CommandNames.,
//对纹组
CommandNames.AlignLineGroup,
CommandNames.AddAlignLineGroup,
CommandNames.DeleteAlignLineGroup
]);
export class BoardLinesReactor

@ -1,6 +1,7 @@
import { MirroredRepeatWrapping, Vector3 } from 'three';
import { HostApplicationServices } from '../ApplicationServices/HostApplicationServices';
import { DuplicateRecordCloning } from '../Common/Status';
import { AlignLineGroupTable } from './AlignLine/AlignLineGroupTable';
import { BlockTableRecord } from './BlockTableRecord';
import { Factory } from './CADFactory';
import { CADFiler } from './CADFiler';
@ -43,6 +44,7 @@ export class Database
TemplateTable: TemplateTable;
GroupTable: GroupTable;
ProcessingGroupTable: ProcessingGroupTable;
AlignLineGroupTable: AlignLineGroupTable;
DimStyleTable: DimStyleTable;
//模型空间(里面有模型空间的实体列表)
@ -79,6 +81,7 @@ export class Database
this.GroupTable = new GroupTable().SetOwnerDatabase(this);
this.Lights = new BlockTableRecord().SetOwnerDatabase(this);
this.ProcessingGroupTable = new ProcessingGroupTable().SetOwnerDatabase(this);
this.AlignLineGroupTable = new AlignLineGroupTable().SetOwnerDatabase(this);
this.hm = new HistoricManage().SetDefaultDb(this);
this.hm.Enable = false;
this.LayoutSpace = new BlockTableRecord().SetOwnerDatabase(this);
@ -178,6 +181,7 @@ export class Database
this.GroupTable.Destroy();
this.Lights.Destroy();
this.ProcessingGroupTable.Destroy();
this.AlignLineGroupTable.Destroy();
this.DimStyleTable.Destroy();
this.hm.Destroy();
this.CameraSnapshoots.length = 0;
@ -191,6 +195,7 @@ export class Database
this.GroupTable.SetOwnerDatabase(this);
this.Lights.SetOwnerDatabase(this);
this.ProcessingGroupTable.SetOwnerDatabase(this);
this.AlignLineGroupTable.SetOwnerDatabase(this);
this.hm.SetDefaultDb(this);
this.LayoutSpace.SetOwnerDatabase(this);
this.DimStyleTable.SetOwnerDatabase(this);
@ -201,7 +206,7 @@ export class Database
FileWrite(file = new CADFiler): CADFiler
{
file.Write(11);//ver;
file.Write(12);//ver;
file.Write(this.idIndex);
this.ModelSpace.WriteFile(file);
this.TextureTable.WriteFile(file);
@ -221,6 +226,8 @@ export class Database
this.DimStyleTable.WriteFile(file);
file.Write(this.ExtendedData);
this.AlignLineGroupTable.WriteFile(file);
return file;
}
FileRead(file: CADFiler)
@ -296,6 +303,9 @@ export class Database
if (ver > 10)
this.ExtendedData = file.Read();
if (ver > 11)
this.AlignLineGroupTable.ReadFile(file);
this.SettingDefaultStyleAndMaterial();
this.hm.doing = false;

@ -132,6 +132,7 @@ export class Board extends ExtrudeSolid
private _CustomNumber: number = null;//自定义编号
private _DrillLock = false; //排钻独立锁
private _DrillAssociationLock = new Set<ObjectId>(); //排钻关联锁
@AutoRecord AlignLineObject: ObjectId; //对纹组
//放样路径 基于OPt X Z -Y 坐标系为基准的路径
private _SweepPath: Polyline = undefined;
@ -2983,6 +2984,9 @@ export class Board extends ExtrudeSolid
}
}
}
if (ver > 19)
this.AlignLineObject = file.ReadHardObjectId();
}
WriteFile(file: CADFiler)
@ -3082,6 +3086,9 @@ export class Board extends ExtrudeSolid
file.Write(v.arcExtension);
}
}
//ver 20
file.WriteHardObjectId(this.AlignLineObject);
}
}

@ -211,6 +211,7 @@ import { Command_GroovesModify } from "../Add-on/showModal/GroovesModify";
import { ShowEditorBBS } from "../Add-on/showModal/ShowModal";
// import { DrawFloor } from '../Add-on/DrawFloor';
// import { RevTarget, SaveTarget } from '../Add-on/RenderTarget';
import { Command_AlignLineGroup } from "../Add-on/AlignLine/Command_AlignLineGroup";
import { Command_DrawArcBoard } from "../Add-on/ArcBoard/DrawArcBoard";
import { OneClickInspection } from "../Add-on/BoardInspection/OneClickInspection";
import { ImportCFData } from "../Add-on/CF/Import/CFImport";
@ -747,8 +748,8 @@ export function registerCommand()
//加工组
commandMachine.RegisterCommand(CommandNames.ShowProcessingGroupModal, new Command_ShowProcessingGroupModal());
//对纹组
commandMachine.RegisterCommand(CommandNames.AlignLineGroup, new Command_AlignLineGroup());
commandMachine.RegisterCommand(CommandNames.Text2Curve, new Text2Curve());

@ -199,6 +199,11 @@ export class RelevanceCuttingReactor
//封边
CommandNames.,
CommandNames.,
//对纹组
CommandNames.AlignLineGroup,
CommandNames.AddAlignLineGroup,
CommandNames.DeleteAlignLineGroup
]);
app.CommandReactor.OnCommandEnd(async (cmdName, changeObjects, createObjects) =>
{

@ -75,4 +75,5 @@ export enum BoardModalType
DrawWallStore = "DrawWallStore",//画墙时使用的配置
BoardInfoDim = "BoardInfoDim", //板件信息标注
FastDim = "FastDim",//自由标注
AlignLineGroupStore = "AlignLineGroupStore",//对纹组
}

@ -3002,6 +3002,15 @@ export const CommandList: ICommand[] = [
chName: "加工组",
chDes: "查看或编辑加工组",
},
{
// icon: IconEnum.AlignLineGroup,
typeId: "cd",
defaultCustom: CommandNames.AlignLineGroup,
command: CommandNames.AlignLineGroup,
type: "拆单",
chName: "对纹组",
chDes: "查看或编辑对纹组",
},
// 共享命令
{

Loading…
Cancel
Save