!2577 功能:字体样式 命令:Style

Merge pull request !2577 from 林三/font_style
pull/3006/head
林三 3 weeks ago committed by ChenX
parent bc91477c40
commit c8a3e5c9a7

@ -1,14 +1,14 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP // Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`晨丰导入CAD解析 1`] = `"[13,103,1,2,14,0,0,5,0,0,\\"LayerNode\\",\\"根节点\\",0,1,2,1,0,0,1,\\"\\",2,2,0,0,3,\\"Board\\",11,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,0,4,100,80,18,true,\\"Polyline\\",11,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,0,2,4,[0,0],0,[0,100],0,[80,100],0,[80,0],0,true,1,4,20,10,1,true,\\"Polyline\\",11,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,0,2,4,[0,0],0,[0,20],0,[10,20],0,[10,0],0,true,0,3,0,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,0,23,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,0,0,\\"HardwareCompositeEntity\\",2,11,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,0,1,\\"Board\\",11,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,0,4,30,50,60,true,\\"Polyline\\",11,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,0,2,4,[0,0],0,[50,0],0,[50,30],0,[0,30],0,true,0,3,0,0,0,0,0,0,23,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,0,0,0,6,\\"五金\\",false,false,\\"五金颜色\\",\\"五金材质\\",\\"五金\\",\\"五金主卧\\",\\"五金标准柜\\",\\"L*W*H*100\\",\\"L*W*H\\",\\"X-1\\",\\"厂家晨丰\\",\\"品牌晨丰\\",\\"{L*2}\\",\\"1\\",\\"五金备注\\",\\"个\\",0,true,0,0,0,\\"\\",\\"\\",\\"HardwareTopline\\",11,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,0,4,\\"\\",1,\\"\\",0,0,3,0,\\"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,2,13,0,0,0]"`; exports[`晨丰导入CAD解析 1`] = `"[14,103,1,2,14,0,0,5,0,0,\\"LayerNode\\",\\"根节点\\",0,1,2,1,0,0,1,\\"\\",2,2,0,0,3,\\"Board\\",11,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,0,4,100,80,18,true,\\"Polyline\\",11,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,0,2,4,[0,0],0,[0,100],0,[80,100],0,[80,0],0,true,1,4,20,10,1,true,\\"Polyline\\",11,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,0,2,4,[0,0],0,[0,20],0,[10,20],0,[10,0],0,true,0,3,0,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,0,23,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,0,0,\\"HardwareCompositeEntity\\",2,11,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,0,1,\\"Board\\",11,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,0,4,30,50,60,true,\\"Polyline\\",11,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,0,2,4,[0,0],0,[50,0],0,[50,30],0,[0,30],0,true,0,3,0,0,0,0,0,0,23,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,0,0,0,6,\\"五金\\",false,false,\\"五金颜色\\",\\"五金材质\\",\\"五金\\",\\"五金主卧\\",\\"五金标准柜\\",\\"L*W*H*100\\",\\"L*W*H\\",\\"X-1\\",\\"厂家晨丰\\",\\"品牌晨丰\\",\\"{L*2}\\",\\"1\\",\\"五金备注\\",\\"个\\",0,true,0,0,0,\\"\\",\\"\\",\\"HardwareTopline\\",11,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,0,4,\\"\\",1,\\"\\",0,0,3,0,\\"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,2,13,0,0,0,1,2,15,0,0,5,0,0]"`;
exports[`晨丰导入五金解析 1`] = `"[2,11,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,0,1,\\"Board\\",11,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,0,4,30,50,60,true,\\"Polyline\\",11,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,0,2,4,[0,0],0,[50,0],0,[50,30],0,[0,30],0,true,0,3,0,0,0,0,0,0,23,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,0,0,0,6,\\"五金\\",false,false,\\"五金颜色\\",\\"五金材质\\",\\"五金\\",\\"五金主卧\\",\\"五金标准柜\\",\\"L*W*H*100\\",\\"L*W*H\\",\\"X-1\\",\\"厂家晨丰\\",\\"品牌晨丰\\",\\"{L*2}\\",\\"1\\",\\"五金备注\\",\\"个\\",0,true,0,0,0,\\"\\",\\"\\"]"`; exports[`晨丰导入五金解析 1`] = `"[2,11,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,0,1,\\"Board\\",11,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,0,4,30,50,60,true,\\"Polyline\\",11,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,0,2,4,[0,0],0,[50,0],0,[50,30],0,[0,30],0,true,0,3,0,0,0,0,0,0,23,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,0,0,0,6,\\"五金\\",false,false,\\"五金颜色\\",\\"五金材质\\",\\"五金\\",\\"五金主卧\\",\\"五金标准柜\\",\\"L*W*H*100\\",\\"L*W*H\\",\\"X-1\\",\\"厂家晨丰\\",\\"品牌晨丰\\",\\"{L*2}\\",\\"1\\",\\"五金备注\\",\\"个\\",0,true,0,0,0,\\"\\",\\"\\"]"`;
exports[`晨丰导入五金解析 2`] = `"[13,102,1,2,14,0,0,5,0,0,\\"LayerNode\\",\\"根节点\\",0,1,2,1,0,0,1,\\"\\",2,2,0,0,2,\\"HardwareCompositeEntity\\",2,11,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,0,1,\\"Board\\",11,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,0,4,100,100,100,true,\\"Polyline\\",11,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,0,2,4,[0,0],0,[100,0],0,[100,100],0,[0,100],0,true,0,3,0,0,0,0,0,0,23,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,0,0,0,6,\\"五金\\",false,false,\\"五金颜色\\",\\"五金材质\\",\\"五金\\",\\"五金主卧\\",\\"五金标准柜\\",\\"L*W*H*100\\",\\"L*W*H\\",\\"X-1\\",\\"厂家晨丰\\",\\"品牌晨丰\\",\\"{L*2}\\",\\"1\\",\\"五金备注\\",\\"个\\",0,true,0,0,0,\\"\\",\\"\\",\\"Board\\",11,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,0,4,100,100,100,true,\\"Polyline\\",11,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,0,2,4,[0,0],0,[100,0],0,[100,100],0,[0,100],0,true,0,3,0,0,0,0,0,0,23,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,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,10,0,0,1,\\"\\",2,11,0,0,0,0,1,2,12,0,0,5,0,0,null,2,13,0,0,0]"`; exports[`晨丰导入五金解析 2`] = `"[14,102,1,2,14,0,0,5,0,0,\\"LayerNode\\",\\"根节点\\",0,1,2,1,0,0,1,\\"\\",2,2,0,0,2,\\"HardwareCompositeEntity\\",2,11,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,0,1,\\"Board\\",11,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,0,4,100,100,100,true,\\"Polyline\\",11,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,0,2,4,[0,0],0,[100,0],0,[100,100],0,[0,100],0,true,0,3,0,0,0,0,0,0,23,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,0,0,0,6,\\"五金\\",false,false,\\"五金颜色\\",\\"五金材质\\",\\"五金\\",\\"五金主卧\\",\\"五金标准柜\\",\\"L*W*H*100\\",\\"L*W*H\\",\\"X-1\\",\\"厂家晨丰\\",\\"品牌晨丰\\",\\"{L*2}\\",\\"1\\",\\"五金备注\\",\\"个\\",0,true,0,0,0,\\"\\",\\"\\",\\"Board\\",11,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,0,4,100,100,100,true,\\"Polyline\\",11,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,0,2,4,[0,0],0,[100,0],0,[100,100],0,[0,100],0,true,0,3,0,0,0,0,0,0,23,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,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,10,0,0,1,\\"\\",2,11,0,0,0,0,1,2,12,0,0,5,0,0,null,2,13,0,0,0,1,2,15,0,0,5,0,0]"`;
exports[`晨丰导入板解析 1`] = `"[11,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,0,4,100,80,18,true,\\"Polyline\\",11,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,0,2,4,[0,0],0,[0,100],0,[80,100],0,[80,0],0,true,1,4,20,10,1,true,\\"Polyline\\",11,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,0,2,4,[0,0],0,[0,20],0,[10,20],0,[10,0],0,true,0,3,0,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,0,23,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,0,0]"`; exports[`晨丰导入板解析 1`] = `"[11,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,0,4,100,80,18,true,\\"Polyline\\",11,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,0,2,4,[0,0],0,[0,100],0,[80,100],0,[80,0],0,true,1,4,20,10,1,true,\\"Polyline\\",11,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,0,2,4,[0,0],0,[0,20],0,[10,20],0,[10,0],0,true,0,3,0,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,0,23,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,0,0]"`;
exports[`晨丰导入模板解析 1`] = `"[13,102,1,2,14,0,0,5,0,0,\\"LayerNode\\",\\"根节点\\",0,1,2,1,0,0,1,\\"\\",2,2,0,0,2,\\"HardwareCompositeEntity\\",2,11,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,0,1,\\"Board\\",11,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,0,4,100,100,100,true,\\"Polyline\\",11,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,0,2,4,[0,0],0,[100,0],0,[100,100],0,[0,100],0,true,0,3,0,0,0,0,0,0,23,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,0,0,0,6,\\"五金\\",false,false,\\"\\",\\"\\",\\"复合实体\\",\\"模板主卧\\",\\"模板标准柜\\",\\"L*W*H*100\\",\\"L*W*H*300\\",\\"X-1\\",\\"晨丰\\",\\"晨丰\\",\\"个\\",\\"1\\",\\"\\",\\"\\",0,true,0,0,0,\\"\\",\\"\\",\\"Board\\",11,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,0,4,100,100,100,true,\\"Polyline\\",11,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,0,2,4,[0,0],0,[100,0],0,[100,100],0,[0,100],0,true,0,3,0,0,0,0,0,0,23,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,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,10,0,0,1,\\"\\",2,11,0,0,0,0,1,2,12,0,0,5,0,0,null,2,13,0,0,0]"`; exports[`晨丰导入模板解析 1`] = `"[14,102,1,2,14,0,0,5,0,0,\\"LayerNode\\",\\"根节点\\",0,1,2,1,0,0,1,\\"\\",2,2,0,0,2,\\"HardwareCompositeEntity\\",2,11,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,0,1,\\"Board\\",11,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,0,4,100,100,100,true,\\"Polyline\\",11,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,0,2,4,[0,0],0,[100,0],0,[100,100],0,[0,100],0,true,0,3,0,0,0,0,0,0,23,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,0,0,0,6,\\"五金\\",false,false,\\"\\",\\"\\",\\"复合实体\\",\\"模板主卧\\",\\"模板标准柜\\",\\"L*W*H*100\\",\\"L*W*H*300\\",\\"X-1\\",\\"晨丰\\",\\"晨丰\\",\\"个\\",\\"1\\",\\"\\",\\"\\",0,true,0,0,0,\\"\\",\\"\\",\\"Board\\",11,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,0,4,100,100,100,true,\\"Polyline\\",11,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,0,2,4,[0,0],0,[100,0],0,[100,100],0,[0,100],0,true,0,3,0,0,0,0,0,0,23,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,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,10,0,0,1,\\"\\",2,11,0,0,0,0,1,2,12,0,0,5,0,0,null,2,13,0,0,0,1,2,15,0,0,5,0,0]"`;
exports[`晨丰导入顶线解析 1`] = `"[11,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,0,4,\\"Polyline\\",11,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,0,2,5,[0,0],0,[0,20],0,[20,20],0,[20,0],0,[0,0],0,false,1,\\"Polyline\\",11,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,0,2,5,[0,0],0,[0,100],0,[100,100],0,[100,0],0,[0,0],0,true,0,0,3,0,\\"0\\",\\"顶线\\",\\"顶线主卧\\",\\"顶线标准柜\\",\\"\\",\\"L*W*H\\",\\"X-1\\",\\"厂家晨丰\\",\\"品牌晨丰\\",\\"{L*2}\\",\\"顶线备注\\",0,\\"\\",\\"\\",0]"`; exports[`晨丰导入顶线解析 1`] = `"[11,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,0,4,\\"Polyline\\",11,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,0,2,5,[0,0],0,[0,20],0,[20,20],0,[20,0],0,[0,0],0,false,1,\\"Polyline\\",11,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,0,2,5,[0,0],0,[0,100],0,[100,100],0,[100,0],0,[0,0],0,true,0,0,3,0,\\"0\\",\\"顶线\\",\\"顶线主卧\\",\\"顶线标准柜\\",\\"\\",\\"L*W*H\\",\\"X-1\\",\\"厂家晨丰\\",\\"品牌晨丰\\",\\"{L*2}\\",\\"顶线备注\\",0,\\"\\",\\"\\",0]"`;

@ -1,8 +1,8 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP // Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`changev 1`] = `"[13,101,1,2,14,0,0,5,0,0,\\"LayerNode\\",\\"根节点\\",0,1,2,1,0,0,1,\\"\\",2,2,0,0,1,\\"Line\\",11,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,0,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\\",11,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,0,1,[0,0,0],[0,0,0]],100,1,\\"ObjectAllDataHistoryRecord\\",1,2,\\"AllObjectData\\",1,[11,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,0,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,2,13,0,0,0]"`; exports[`changev 1`] = `"[14,101,1,2,14,0,0,5,0,0,\\"LayerNode\\",\\"根节点\\",0,1,2,1,0,0,1,\\"\\",2,2,0,0,1,\\"Line\\",11,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,0,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\\",11,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,0,1,[0,0,0],[0,0,0]],100,1,\\"ObjectAllDataHistoryRecord\\",1,2,\\"AllObjectData\\",1,[11,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,0,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,2,13,0,0,0,1,2,15,0,0,5,0,0]"`;
exports[`创建 修改 撤销撤销 重做重做 撤销 重做 1`] = `"[13,101,1,2,14,0,0,5,0,0,\\"LayerNode\\",\\"根节点\\",0,1,2,1,0,0,1,\\"\\",2,2,0,0,1,\\"Line\\",11,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,0,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\\",11,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,0,1,[0,0,0],[0,0,0]],\\"CommandHistoryRecord\\",1,\\"\\",1,100,1,\\"ObjectAllDataHistoryRecord\\",1,2,\\"AllObjectData\\",1,[11,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,0,1,[0,0,0],[0,0,0]],\\"AllObjectData\\",1,[11,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,0,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,2,13,0,0,0]"`; exports[`创建 修改 撤销撤销 重做重做 撤销 重做 1`] = `"[14,101,1,2,14,0,0,5,0,0,\\"LayerNode\\",\\"根节点\\",0,1,2,1,0,0,1,\\"\\",2,2,0,0,1,\\"Line\\",11,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,0,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\\",11,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,0,1,[0,0,0],[0,0,0]],\\"CommandHistoryRecord\\",1,\\"\\",1,100,1,\\"ObjectAllDataHistoryRecord\\",1,2,\\"AllObjectData\\",1,[11,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,0,1,[0,0,0],[0,0,0]],\\"AllObjectData\\",1,[11,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,0,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,2,13,0,0,0,1,2,15,0,0,5,0,0]"`;
exports[`创建 修改 撤销撤销 重做重做 撤销 重做 2`] = `"[\\"HistoricManage\\",1,1,2,\\"CommandHistoryRecord\\",1,\\"\\",1,2,1,\\"HistorycRecord\\",2,\\"RemoveObjectData\\",1,0,\\"CreateObjectData\\",1,[\\"Line\\",11,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,0,1,[0,0,0],[0,0,0]],\\"CommandHistoryRecord\\",1,\\"\\",1,100,1,\\"ObjectAllDataHistoryRecord\\",1,2,\\"AllObjectData\\",1,[11,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,0,1,[0,0,0],[0,0,0]],\\"AllObjectData\\",1,[11,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,0,1,[1,2,3],[0,0,0]],100]"`; exports[`创建 修改 撤销撤销 重做重做 撤销 重做 2`] = `"[\\"HistoricManage\\",1,1,2,\\"CommandHistoryRecord\\",1,\\"\\",1,2,1,\\"HistorycRecord\\",2,\\"RemoveObjectData\\",1,0,\\"CreateObjectData\\",1,[\\"Line\\",11,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,0,1,[0,0,0],[0,0,0]],\\"CommandHistoryRecord\\",1,\\"\\",1,100,1,\\"ObjectAllDataHistoryRecord\\",1,2,\\"AllObjectData\\",1,[11,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,0,1,[0,0,0],[0,0,0]],\\"AllObjectData\\",1,[11,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,0,1,[1,2,3],[0,0,0]],100]"`;

@ -2,7 +2,7 @@
exports[`wblockClone 1`] = ` exports[`wblockClone 1`] = `
Array [ Array [
13, 14,
102, 102,
1, 1,
2, 2,
@ -177,12 +177,20 @@ Array [
0, 0,
0, 0,
0, 0,
1,
2,
15,
0,
0,
5,
0,
0,
] ]
`; `;
exports[`wblockClone 2`] = ` exports[`wblockClone 2`] = `
Array [ Array [
13, 14,
104, 104,
1, 1,
2, 2,
@ -433,12 +441,20 @@ Array [
0, 0,
0, 0,
0, 0,
1,
2,
15,
0,
0,
5,
0,
0,
] ]
`; `;
exports[`wblockClone 3`] = ` exports[`wblockClone 3`] = `
Array [ Array [
13, 14,
102, 102,
1, 1,
2, 2,
@ -613,5 +629,13 @@ Array [
0, 0,
0, 0,
0, 0,
1,
2,
15,
0,
0,
5,
0,
0,
] ]
`; `;

@ -15,7 +15,7 @@ import { Polyline } from "../../DatabaseServices/Entity/Polyline";
import { SmartPolylineSimply2Polyline } from "../../DatabaseServices/SplineConver2Polyline"; import { SmartPolylineSimply2Polyline } from "../../DatabaseServices/SplineConver2Polyline";
import { Text, TextAligen } from "../../DatabaseServices/Text/Text"; import { Text, TextAligen } from "../../DatabaseServices/Text/Text";
import { userConfig } from "../../Editor/UserConfig"; import { userConfig } from "../../Editor/UserConfig";
import { angle, AsVector2, AsVector3, equaln, equalv3, ZAxis } from "../../Geometry/GeUtils"; import { AsVector2, AsVector3, ZAxis, angle, equaln, equalv3 } from "../../Geometry/GeUtils";
import { Vec3 } from "../../Geometry/IVec3"; import { Vec3 } from "../../Geometry/IVec3";
import { Orbit } from "../../Geometry/Orbit"; import { Orbit } from "../../Geometry/Orbit";
import { DXFSpline2Points } from "../DXFSpline2Points"; import { DXFSpline2Points } from "../DXFSpline2Points";

@ -17,6 +17,7 @@ import { Text } from "../../DatabaseServices/Text/Text";
import { Command, CommandWrap } from "../../Editor/CommandMachine"; import { Command, CommandWrap } from "../../Editor/CommandMachine";
import { PromptResult } from "../../Editor/PromptResult"; import { PromptResult } from "../../Editor/PromptResult";
import { AppToaster } from "../../UI/Components/Toaster"; import { AppToaster } from "../../UI/Components/Toaster";
import { FontType } from "../TextStyle/FontStyleInterface";
interface IList interface IList
@ -433,12 +434,13 @@ export class DrawTemplateByImport implements Command
} }
private DrawText(ocs: Matrix4, isRed: boolean, name?: string) private DrawText(ocs: Matrix4, isRed: boolean, name?: string)
{ {
const textHeight = TextHeight; let text = new Text(new Vector3(), name || "平板");
let text = new Text(new Vector3(), name || "平板", "songti", textHeight); text.Height = TextHeight;
text.FontName = FontType.SongTi;
if (isRed) if (isRed)
text.ColorIndex = 1; text.ColorIndex = 1;
text.ApplyMatrix(ocs); text.ApplyMatrix(ocs);
text.Position = text.Position.add(new Vector3(0, 0, -textHeight * 3)); text.Position = text.Position.add(new Vector3(0, 0, -TextHeight * 3));
app.Database.ModelSpace.Append(text); app.Database.ModelSpace.Append(text);
} }
private DrawDim(width: number, height: number, ocs: Matrix4) private DrawDim(width: number, height: number, ocs: Matrix4)

@ -1,5 +1,6 @@
import { Vector2, Vector3 } from "three"; import { Vector2, Vector3 } from "three";
import { app } from "../../ApplicationServices/Application"; import { app } from "../../ApplicationServices/Application";
import { HostApplicationServices } from "../../ApplicationServices/HostApplicationServices";
import { EBoardKeyList } from "../../Common/BoardKeyList"; import { EBoardKeyList } from "../../Common/BoardKeyList";
import { BigFaceSelectOption, ComposingFaceSelectOption, LineTypeSelectOption } from "../../Common/CommonSelectOption"; import { BigFaceSelectOption, ComposingFaceSelectOption, LineTypeSelectOption } from "../../Common/CommonSelectOption";
import { LogType } from "../../Common/Log"; import { LogType } from "../../Common/Log";
@ -9,6 +10,7 @@ import { Board } from "../../DatabaseServices/Entity/Board";
import { BoardOpenDir, ComposingType, LinesType } from "../../DatabaseServices/Entity/BoardInterface"; import { BoardOpenDir, ComposingType, LinesType } from "../../DatabaseServices/Entity/BoardInterface";
import { Line } from "../../DatabaseServices/Entity/Line"; import { Line } from "../../DatabaseServices/Entity/Line";
import { Polyline } from "../../DatabaseServices/Entity/Polyline"; import { Polyline } from "../../DatabaseServices/Entity/Polyline";
import { FontStyleRecord } from "../../DatabaseServices/FontStyle/FontsStyleRecord";
import { GroupRecord } from "../../DatabaseServices/GroupTableRecord"; import { GroupRecord } from "../../DatabaseServices/GroupTableRecord";
import { ObjectId } from "../../DatabaseServices/ObjectId"; import { ObjectId } from "../../DatabaseServices/ObjectId";
import { ProcessingGroupRecord } from "../../DatabaseServices/ProcessingGroup/ProcessingGroupRecord"; import { ProcessingGroupRecord } from "../../DatabaseServices/ProcessingGroup/ProcessingGroupRecord";
@ -43,12 +45,15 @@ export class Command_BoardInfoDimTool implements Command
let jpgEnt: Text[] = []; let jpgEnt: Text[] = [];
let textEnts: Text[] = []; let textEnts: Text[] = [];
let backUCS = app.Editor.UCSMatrix.setPosition(0, 0, 0); let backUCS = app.Editor.UCSMatrix.setPosition(0, 0, 0);
let fontName = (HostApplicationServices.CurrentFontStyle.Object as FontStyleRecord).FontType;
const DrawText = (textString: string) => const DrawText = (textString: string) =>
{ {
let text = new Text(); let text = new Text();
text.TextString = textString; text.TextString = textString;
text.Height = userConfig.dimTextHeight; text.Height = userConfig.dimTextHeight;
text.FontName = fontName;
text.WidthFactor = 1;
text.ApplyMatrix(backUCS); text.ApplyMatrix(backUCS);
textEnts.push(text); textEnts.push(text);
}; };

@ -5,13 +5,13 @@ import { observer } from 'mobx-react';
import React, { Component } from 'react'; import React, { Component } from 'react';
import { app } from '../../ApplicationServices/Application'; import { app } from '../../ApplicationServices/Application';
import { HostApplicationServices } from '../../ApplicationServices/HostApplicationServices'; import { HostApplicationServices } from '../../ApplicationServices/HostApplicationServices';
import { Dimension } from '../../DatabaseServices/Dimension/Dimension';
import { DimStyleRecord } from '../../DatabaseServices/DimStyle/DimStyleRecord'; import { DimStyleRecord } from '../../DatabaseServices/DimStyle/DimStyleRecord';
import { Dimension } from '../../DatabaseServices/Dimension/Dimension';
import { CommandWrap } from '../../Editor/CommandMachine'; import { CommandWrap } from '../../Editor/CommandMachine';
import { AppConfirm } from '../../UI/Components/Common/Confirm'; import { AppConfirm } from '../../UI/Components/Common/Confirm';
import { ModalHeader } from '../../UI/Components/Modal/ModalContainer'; import { ModalHeader } from '../../UI/Components/Modal/ModalContainer';
import { DimStyleParam } from './DimStyleParam'; import { DimStyleParam } from './DimStyleParam';
import { dimStyleStore, DimStyleStore } from './DimStyleStore'; import { DimStyleStore, dimStyleStore } from './DimStyleStore';
import { OperDimStyle, OperDimStyleType } from './OperDimStyle'; import { OperDimStyle, OperDimStyleType } from './OperDimStyle';
export const DEFAULT_STYLE_NAME = "默认"; //默认样式名称 export const DEFAULT_STYLE_NAME = "默认"; //默认样式名称
@ -30,7 +30,7 @@ export class DimStylePanel extends Component<{ store: DimStyleStore; currentStyl
{ {
return ( return (
<div id='DimStylePanel' className={Classes.DIALOG_CONTAINER}> <div id='DimStylePanel' className={Classes.DIALOG_CONTAINER}>
<div className={Classes.DIALOG + " DimStylePanel"}> <div className={Classes.DIALOG}>
<ModalHeader <ModalHeader
title={"标注样式"} title={"标注样式"}
close={this._Cancel} close={this._Cancel}

@ -1,4 +1,6 @@
import { app } from '../ApplicationServices/Application'; import { app } from '../ApplicationServices/Application';
import { HostApplicationServices } from '../ApplicationServices/HostApplicationServices';
import { FontStyleRecord } from '../DatabaseServices/FontStyle/FontsStyleRecord';
import { TextArea } from '../DatabaseServices/Text/TextArea'; import { TextArea } from '../DatabaseServices/Text/TextArea';
import { Command } from '../Editor/CommandMachine'; import { Command } from '../Editor/CommandMachine';
import { PromptStatus } from '../Editor/PromptResult'; import { PromptStatus } from '../Editor/PromptResult';
@ -12,26 +14,27 @@ export class DrawText implements Command
let ptRes = await app.Editor.GetPoint({ Msg: "指定文字的起点" }); let ptRes = await app.Editor.GetPoint({ Msg: "指定文字的起点" });
if (ptRes.Status === PromptStatus.Cancel) if (ptRes.Status === PromptStatus.Cancel)
return; return;
const FontStyle = HostApplicationServices.CurrentFontStyle.Object as FontStyleRecord;
let startPoint = ptRes.Point; let startPoint = ptRes.Point;
let height = 30; let textHeight = FontStyle.Height;
if (userConfig.textStyleOption.appointTextHight)
{ if (!userConfig.textStyleOption.appointTextHight) //指定高度
height = userConfig.textStyleOption.textHight;
}
else
{ {
let hRes = await app.Editor.GetDistance({ let hRes = await app.Editor.GetDistance({
Msg: "指定高度", Msg: "指定高度",
BasePoint: startPoint, BasePoint: startPoint,
Default: userConfig.textStyleOption.textHight Default: FontStyle.Height
}); });
if (hRes.Status === PromptStatus.Cancel) if (hRes.Status === PromptStatus.Cancel)
return; return;
height = hRes.Distance; textHeight = hRes.Distance;
} }
if (equaln(height, 0) || !height) return;
if (equaln(textHeight, 0) || !textHeight) return;
let angle = 0; let angle = 0;
if (!userConfig.textStyleOption.noNeedAngle) if (!userConfig.textStyleOption.noNeedAngle) //不需要旋转角度
{ {
let aRes = await app.Editor.GetAngle({ let aRes = await app.Editor.GetAngle({
Msg: "指定文字旋转角度", Msg: "指定文字旋转角度",
@ -42,8 +45,9 @@ export class DrawText implements Command
return; return;
angle = aRes.Distance; angle = aRes.Distance;
} }
let text = TextArea.GetInstance(); let text = TextArea.GetInstance();
text.StartDrawText(startPoint, height, angle, ""); text.StartDrawText(startPoint, textHeight, angle, "", FontStyle.FontType, FontStyle.WidthFactor);
await text.Wait(); await text.Wait();
} }
} }

@ -51,6 +51,7 @@ import { DownPanelStore } from "../../UI/Store/DownPanelStore";
import { HardwareCuttingReactor } from "../BoardCutting/HardwareCuttingReactor"; import { HardwareCuttingReactor } from "../BoardCutting/HardwareCuttingReactor";
import { DrillingReactor } from "../DrawDrilling/DrillingReactor"; import { DrillingReactor } from "../DrawDrilling/DrillingReactor";
import { Purge } from "../Purge"; import { Purge } from "../Purge";
import { FontType } from "../TextStyle/FontStyleInterface";
import { ShareViewCameraControl } from "./ShareViewCameraControl"; import { ShareViewCameraControl } from "./ShareViewCameraControl";
import { RoamingSwitches, ShareViewStore } from "./ShareViewStore"; import { RoamingSwitches, ShareViewStore } from "./ShareViewStore";
import { MaterialDetailScrollTo } from "./ShareViewUtil"; import { MaterialDetailScrollTo } from "./ShareViewUtil";
@ -309,8 +310,8 @@ export class ShareViewService extends ApplicationService
}); });
//加载字体. //加载字体.
FontLoader.GetLoader("yahei").LoadGlyphs("1234567890."); FontLoader.GetLoader(FontType.YaHei).LoadGlyphs("1234567890.");
FontLoader.GetLoader("songti").LoadGlyphs("1234567890."); FontLoader.GetLoader(FontType.SongTi).LoadGlyphs("1234567890.");
this.MoveTool = new BoardMoveTool(); this.MoveTool = new BoardMoveTool();
this.LayoutTool = new LayoutTool(); this.LayoutTool = new LayoutTool();

@ -1,4 +1,4 @@
import { Box3, CubicBezierCurve, Curve as TCurve, LineCurve, Path, QuadraticBezierCurve, Shape, Vector2 } from "three"; import { Box3, CubicBezierCurve, LineCurve, Path, QuadraticBezierCurve, Shape, Curve as TCurve, Vector2 } from "three";
import { app } from "../ApplicationServices/Application"; import { app } from "../ApplicationServices/Application";
import { Draw } from "../Common/Draw"; import { Draw } from "../Common/Draw";
import { Curve } from "../DatabaseServices/Entity/Curve"; import { Curve } from "../DatabaseServices/Entity/Curve";
@ -29,8 +29,8 @@ export class Text2Curve implements Command
let polylineList: Curve[] = []; let polylineList: Curve[] = [];
for (let txt of txts) for (let txt of txts)
{ {
let f = FontLoader.GetLoader(txt._FontName); let f = FontLoader.GetLoader(txt.FontName);
let shapes: Shape[] = f.Font.generateShapes(txt.TextString, txt.Height); let shapes: Shape[] = f.Font.generateShapes(txt.TextString, txt.Height, txt.WidthFactor);
let cus: Curve[] = []; let cus: Curve[] = [];
for (let s of shapes) for (let s of shapes)
{ {

@ -0,0 +1,12 @@
import { app } from "../../ApplicationServices/Application";
import { Command } from "../../Editor/CommandMachine";
import { FontStylePanel } from "./FontStylePanel";
import { fontStyleStore } from "./FontStyleStore";
export class Command_FontStyle implements Command
{
async exec()
{
app.Editor.ModalManage.RenderModeless(FontStylePanel, { store: fontStyleStore });
}
}

@ -0,0 +1,94 @@
#FontStylePanel {
.bp3-dialog-body {
display: flex;
padding: 5px;
}
.styleList {
padding: 5px;
.fontStyleList {
height: 152px;
padding: 8px 0 2px 13px;
}
.bp3-card {
width: 115px;
height: 255px;
}
}
.cardTitle {
font-weight: 1000;
margin: -2px 0 0 -5px;
}
.styleParam {
width: 350px;
padding: 5px;
.bp3-card {
padding: 8px 15px;
margin-bottom: 8px;
}
.fontPreview {
display: flex;
justify-content: flex-end;
button {
height: 30px;
margin-left: 5px;
}
}
}
.fontStylePanel_fontName {
display: flex;
justify-content: space-between;
.fontName {
display: flex;
width: 130px;
flex-direction: column;
}
.fontStyle {
display: flex;
width: 100px;
flex-direction: column;
}
}
.fontSize {
display: flex;
justify-content: space-between;
.fontHeight {
display: flex;
width: 130px;
flex-direction: column;
}
}
.fontEffect {
display: flex;
justify-content: space-between;
.fontGap {
display: flex;
flex-direction: column;
}
.fontSlope {
display: flex;
width: 130px;
flex-direction: column;
}
}
.bp3-dialog-footer {
display: flex;
justify-content: space-between;
}
}

@ -0,0 +1,29 @@
export interface FontStyleInfoOption
{
height: number; //文本高度
fontType: FontType; //字体类型(宋体 黑体)
widthFactor: number; //宽度因子
}
export enum FontType
{
YaHei = "yahei",
SongTi = "songti",
KaiTi = "KaiTi",
FangSong = "FangSong",
LiShu = "LiShu",
HeiTi = "HeiTi",
HuaWenLiShu = "HuaWenLiShu",
HuaWenXingKai = "HuaWenXingKai",
}
export const FontTypeOption = [
{ label: "宋体", value: FontType.SongTi },
{ label: "雅黑", value: FontType.YaHei },
{ label: "楷体", value: FontType.KaiTi },
{ label: "仿宋", value: FontType.FangSong },
{ label: "隶书", value: FontType.LiShu },
{ label: "黑体", value: FontType.HeiTi },
{ label: "华文隶书", value: FontType.HuaWenLiShu },
{ label: "华文行楷", value: FontType.HuaWenXingKai }
];

@ -0,0 +1,412 @@
import { Card, Classes, Intent, Position } from '@blueprintjs/core';
import { Button, H5, HTMLSelect, Icon, Popover, Tab, Tabs } from '@blueprintjs/core/lib/esm/components';
import { observable } from 'mobx';
import { observer } from 'mobx-react';
import React, { Component } from 'react';
import { Mesh, MeshBasicMaterial, OrthographicCamera, Scene, ShapeGeometry, Vector3, WebGLRenderer } from 'three';
import { app } from '../../ApplicationServices/Application';
import { HostApplicationServices } from '../../ApplicationServices/HostApplicationServices';
import { FontStyleRecord } from '../../DatabaseServices/FontStyle/FontsStyleRecord';
import { FontLoader } from '../../DatabaseServices/Text/FontLoader';
import { Text } from '../../DatabaseServices/Text/Text';
import { CommandWrap } from '../../Editor/CommandMachine';
import { AppConfirm } from '../../UI/Components/Common/Confirm';
import { INumericInput } from '../../UI/Components/INumericInput';
import { ModalHeader } from '../../UI/Components/Modal/ModalContainer';
import { AppToaster } from '../../UI/Components/Toaster';
import { DownPanelStore } from '../../UI/Store/DownPanelStore';
import { DEFAULT_STYLE_NAME } from '../DrawDim/DimStylePanel';
import "./FontStyleCSS.less";
import { FontStyleInfoOption, FontType, FontTypeOption } from './FontStyleInterface';
import { FontStyleStore } from './FontStyleStore';
const GEOMETRY_CACHE = new Map<string, Mesh>();
@observer
export class FontStylePanel extends Component<{ store: FontStyleStore; }> {
@observable _CurrentStyleName = ""; //当前UI展示的样式名称
@observable _CurrentDBStyleName = ""; //当前DB使用的样式名称
_Preview: React.RefObject<HTMLCanvasElement> = React.createRef();
_PreviewScence: Scene = new Scene();;
_Camera = new OrthographicCamera(150, -150, 150, -150, 0.1, 1000);
_Renderer: WebGLRenderer;
_NameInput = React.createRef<HTMLInputElement>();
constructor(props)
{
super(props);
const Name = (app.Database.FontStyleTable.Current.Object as FontStyleRecord).Name;
this._CurrentStyleName = Name;
this._CurrentDBStyleName = Name;
this.GetFontStyle(this._CurrentStyleName, this.props.store);
}
async componentDidMount()
{
//创建预览图
this._Renderer = new WebGLRenderer({ canvas: this._Preview.current, antialias: true });
await this.UpdateScene();
}
componentWillUnmount()
{
let gl = this._Preview.current.getContext("webgl2");
gl.getExtension('WEBGL_lose_context').loseContext();
this._PreviewScence.clear();
this._Renderer.clear();
}
async componentDidUpdate(prevProps, prevState)
{
await this.UpdateScene();
}
//更新预览图
UpdateScene = async () =>
{
this._PreviewScence.clear();
const option = this.props.store.m_Option;
const key = option.fontType + option.widthFactor;
let cube = GEOMETRY_CACHE.get(key);
if (!cube)
{
let f = FontLoader.GetLoader(option.fontType);
await f.LoadGlyphs("AaBb123");
await f.AwaitLoaded();
let shapes = f.Font.generateShapes("AaBb123", 100, option.widthFactor);
let geometry = new ShapeGeometry(shapes);
geometry.name = "Text";
geometry.computeBoundingBox();
geometry.rotateY(90);
const material = new MeshBasicMaterial();
cube = new Mesh(geometry, material);
GEOMETRY_CACHE.set(key, cube);
}
this._Camera.position.set(cube.geometry.boundingBox.getCenter(new Vector3).x, 50, 0);
this._Camera.updateMatrix();
this._PreviewScence.add(cube);
this._Renderer.render(this._PreviewScence, this._Camera);
};
render()
{
const store = this.props.store;
const option = store.m_Option;
return (
<div id='FontStylePanel' className={Classes.DIALOG_CONTAINER}>
<div className={Classes.DIALOG}>
<ModalHeader
title={"字体样式"}
close={this.Cancel}
icon="cog"
/>
<div className={Classes.DIALOG_BODY}>
<div className='styleList'>
<Card>
<div className='cardTitle'>
<H5></H5>
</div>
<Tabs
vertical={true}
selectedTabId={this._CurrentStyleName}
onChange={(name) => { this.GetFontStyle(name.toString(), this.props.store); }}
animate={true}
>
{
app.Database.FontStyleTable.FontStyleNames.map((name) =>
{
return <Tab
key={name}
id={name}
title={
<div className='tabName'>
{
this._CurrentDBStyleName === name
&& <Icon icon={"dot"} />
}
{name}
</div>
}
/>;
})
}
</Tabs>
</Card>
</div>
<div className='styleParam'>
<Card>
<div className='cardTitle'>
<span></span>
</div>
<div className='fontStylePanel_fontName'>
<div className='fontName'>
<span>:</span>
<HTMLSelect
style={{ height: 22 }}
options={FontTypeOption}
value={option.fontType}
onChange={e =>
{
option.fontType = e.target.value as FontType;
}}
/>
</div>
</div>
</Card>
<Card style={{ display: "flex", justifyContent: "space-between" }}>
<div>
<div className='cardTitle'>
<span></span>
</div>
<div className='fontSize'>
<div className='fontHeight'>
<span>:</span>
<INumericInput
style={{ width: 130, height: 22 }}
intent={Intent.NONE}
value={option.height}
min={1}
max={300}
onBlur={(e) => { option.height = parseInt(e.target.value); }}
/>
</div>
</div>
</div>
</Card>
<Card>
<div className='cardTitle'>
<span></span>
</div>
<div className='fontEffect'>
<div className='fontGap'>
<span>:</span>
<INumericInput
style={{ width: 130, height: 22 }}
intent={Intent.NONE}
value={option.widthFactor}
tooltipValue='设置字符间距,小于1.0 的值将压缩文字,大于 1.0 的值将扩大文字'
min={0}
max={10}
float={2}
onBlur={(e) =>
{
let value = parseFloat(e.target.value);
if (value <= 0)
{
value = 0.1;
e.target.value = value.toString();
}
option.widthFactor = value;
}}
/>
</div>
<div className='fontSlope'>
<canvas width={150} height={73} ref={this._Preview} ></canvas>
</div>
</div>
</Card>
<div className='fontPreview'>
<Button
text='置为当前'
onClick={async () => { this.SetToCurrent(); }}
/>
<Popover
className='popover'
position={Position.TOP}
onClosed={() => this.setState({ typeName: "" })}
usePortal={false}
content={
<Card style={{ marginBottom: 0 }}>
<input type="text"
style={{ height: 30 }}
className={Classes.INPUT}
ref={this._NameInput}
onChange={(e) => { this._NameInput.current.value = e.currentTarget.value.replace(" ", ''); }}
/>
<Button
text="确定"
className={Classes.POPOVER_DISMISS}
style={{ margin: 0 }}
intent={Intent.SUCCESS}
onClick={() => this.AddStyleRecord()}
/>
</Card>
}
target={<Button
text="添加"
intent={Intent.PRIMARY}
/>}
/>
<Button text="删除" intent={Intent.DANGER} onClick={this.Delete} disabled={this._CurrentStyleName === DEFAULT_STYLE_NAME} />
<Button
text='保存'
intent={Intent.SUCCESS}
onClick={async () => { this.SaveConfig(); }}
/>
</div>
</div>
</div>
</div>
</div>
);
}
AddStyleRecord = async () =>
{
let name = this._NameInput.current.value;
//添加样式
if (!name) return;
let fontStyleRecord: FontStyleRecord = app.Database.FontStyleTable.Symbols.get(name) as FontStyleRecord;
if (fontStyleRecord)
{
await AppConfirm.show({ message: "已存在该名称样式!" });
return;
}
else
{
fontStyleRecord = new FontStyleRecord();
fontStyleRecord.Name = name;
this.ApplyParams(fontStyleRecord, this.props.store.m_Option);
app.Database.FontStyleTable.Add(fontStyleRecord);
this._CurrentStyleName = name;
}
};
//应用参数 返回fontStyleRecord属性是否被改动
ApplyParams(fontStyleRecord: FontStyleRecord, option: FontStyleInfoOption): boolean
{
if (fontStyleRecord.Height !== option.height ||
fontStyleRecord.WidthFactor !== option.widthFactor ||
fontStyleRecord.FontType !== option.fontType
)
{
fontStyleRecord.Height = option.height;
fontStyleRecord.WidthFactor = option.widthFactor;
fontStyleRecord.FontType = option.fontType;
return true;
}
return false;
}
//获取画布使用DB当前FontStyleRecord的Text
GetCurrentFontStyleRecordTexts(): Text[]
{
return app.Database.ModelSpace.Entitys.filter(ent =>
{
return ent instanceof Text &&
!ent.IsErase &&
(ent.FontStyle?.Object as FontStyleRecord)?.Name === this._CurrentStyleName;
}) as Text[];
}
//保存
SaveConfig = async () =>
{
let fontStyleRecord = app.Database.FontStyleTable.Symbols.get(this._CurrentStyleName) as FontStyleRecord;
if (fontStyleRecord)
{
await CommandWrap(() =>
{
if (this.ApplyParams(fontStyleRecord, this.props.store.m_Option))
{
let ents = this.GetCurrentFontStyleRecordTexts();
for (let ent of ents)
{
//写入撤回重做记录
ent.WriteAllObjectRecord();
ent.Update();
}
AppToaster.show({
message: "保存字体样式成功",
timeout: 5000,
intent: Intent.SUCCESS,
});
}
}, "保存字体样式");
}
};
//置为当前
SetToCurrent()
{
let fontStyleRecord = app.Database.FontStyleTable.Symbols.get(this._CurrentStyleName) as FontStyleRecord;
if (fontStyleRecord)
{
this.SetFontStyleId(fontStyleRecord);
this._CurrentDBStyleName = fontStyleRecord.Name;
DownPanelStore.GetInstance().fontType = fontStyleRecord.Name;
}
}
/**
* Database
* @memberof FontStylePanel
*/
Delete = async () =>
{
let texts = this.GetCurrentFontStyleRecordTexts();
let status = await AppConfirm.show({
message: (texts.length > 0 ? "有部分文字使用该样式," : "") + "确定删除' " + this._CurrentStyleName + " '样式?"
});
if (status)
{
await CommandWrap(() =>
{
//删除database当前使用的样式时 删除后使用默认样式
if (this._CurrentStyleName === (app.Database.FontStyleTable.Current.Object as FontStyleRecord).Name)
{
let defaultFontStyle = app.Database.FontStyleTable.Symbols.get(DEFAULT_STYLE_NAME) as FontStyleRecord;
this.SetFontStyleId(defaultFontStyle);
}
//使用该样式的标注,使用当前标注样式
for (let ent of texts)
(ent as Text).FontStyle = app.Database.FontStyleTable.Current;
app.Database.FontStyleTable.Remove(app.Database.FontStyleTable.Symbols.get(this._CurrentStyleName));
}, "删除样式");
//UI指向默认
this._CurrentStyleName = DEFAULT_STYLE_NAME;
this.GetFontStyle(DEFAULT_STYLE_NAME, this.props.store);
}
};
/**
* @param {string} name app.Database.FontStyleTable.Symbols.get(name)
* @param {FontStyleStore} store store.m_Option
* @memberof FontStylePanel
*/
GetFontStyle = async (name: string, store: FontStyleStore) =>
{
let fontStyle = app.Database.FontStyleTable.Symbols.get(name) as FontStyleRecord;
if (!fontStyle) return;
let option = store.m_Option;
option.height = fontStyle.Height;
option.fontType = fontStyle.FontType;
option.widthFactor = fontStyle.WidthFactor;
this._CurrentStyleName = name;
};
SetFontStyleId(fontStyle: FontStyleRecord)
{
app.Database.FontStyleTable.Current = fontStyle.objectId;
HostApplicationServices.CurrentFontStyle = fontStyle.objectId;
}
Cancel = () =>
{
app.Editor.ModalManage.Destory();
};
}

@ -0,0 +1,11 @@
import { observable } from "mobx";
import { Singleton } from "../../Common/Singleton";
import { DefaultFontStyleOption } from "../../Editor/DefaultConfig";
import { FontStyleInfoOption } from "./FontStyleInterface";
export class FontStyleStore extends Singleton
{
@observable m_Option: FontStyleInfoOption = { ...DefaultFontStyleOption };
}
export const fontStyleStore = FontStyleStore.GetInstance();

@ -11,6 +11,7 @@ import { AppendUserInfo } from '../Add-on/ExportData';
import { FbxImport } from '../Add-on/FBXLoad'; import { FbxImport } from '../Add-on/FBXLoad';
import { ImportJiajuFile } from '../Add-on/JiaJu/Import/JiaJuImport'; import { ImportJiajuFile } from '../Add-on/JiaJu/Import/JiaJuImport';
import { ImportKJLData } from '../Add-on/KJL/Import/KJLImport'; import { ImportKJLData } from '../Add-on/KJL/Import/KJLImport';
import { FontType } from '../Add-on/TextStyle/FontStyleInterface';
import { CommandNames } from '../Common/CommandNames'; import { CommandNames } from '../Common/CommandNames';
import { IsDev } from '../Common/Deving'; import { IsDev } from '../Common/Deving';
import { MouseKey } from '../Common/KeyEnum'; import { MouseKey } from '../Common/KeyEnum';
@ -22,6 +23,7 @@ import { BoardLinesReactor } from '../DatabaseServices/BoardLinesReactor';
import { CADFiler } from '../DatabaseServices/CADFiler'; import { CADFiler } from '../DatabaseServices/CADFiler';
import { Database } from '../DatabaseServices/Database'; import { Database } from '../DatabaseServices/Database';
import { Entity } from '../DatabaseServices/Entity/Entity'; import { Entity } from '../DatabaseServices/Entity/Entity';
import { FontStyleRecord } from '../DatabaseServices/FontStyle/FontsStyleRecord';
import { RoomParseReactor } from '../DatabaseServices/Room/ParseService/RoomParseReactor'; import { RoomParseReactor } from '../DatabaseServices/Room/ParseService/RoomParseReactor';
import { FontLoader } from '../DatabaseServices/Text/FontLoader'; import { FontLoader } from '../DatabaseServices/Text/FontLoader';
import { AutoSaveServer } from '../Editor/AutoSave'; import { AutoSaveServer } from '../Editor/AutoSave';
@ -372,8 +374,8 @@ export class ApplicationService
}); });
//加载字体. //加载字体.
FontLoader.GetLoader("yahei").LoadGlyphs("1234567890."); FontLoader.GetLoader(FontType.YaHei).LoadGlyphs("1234567890.");
FontLoader.GetLoader("songti").LoadGlyphs("1234567890."); FontLoader.GetLoader(FontType.SongTi).LoadGlyphs("1234567890.");
if (isHasTouch()) if (isHasTouch())
{ {
@ -592,5 +594,7 @@ export class ApplicationService
app.LayoutTool.CacheCamera(); app.LayoutTool.CacheCamera();
app.LayoutTool.bakUCS = undefined;//否则开图后UCS回归不到正确的位置(在已经切换过布局的状态下) app.LayoutTool.bakUCS = undefined;//否则开图后UCS回归不到正确的位置(在已经切换过布局的状态下)
app.LayoutTool.Reset(); app.LayoutTool.Reset();
DownPanelStore.GetInstance().fontType = (HostApplicationServices.CurrentFontStyle.Object as FontStyleRecord).Name;
} }
} }

@ -18,11 +18,12 @@ export class IHostApplicationServices
IsRoomEntityVisible = true;//室内实体可见 IsRoomEntityVisible = true;//室内实体可见
CurrentDimStyle: ObjectId;
CurrentLayer: ObjectId<LayerTableRecord>; CurrentLayer: ObjectId<LayerTableRecord>;
/** 当前画笔的颜色索引 */ /** 当前画笔的颜色索引 */
CurrentColorindex: number = 7; CurrentColorindex: number = 7;
CurrentDimStyle: ObjectId; //标注样式
CurrentFontStyle: ObjectId; //字体样式
@ProxyValue isShowLightShadow: boolean = true;//灯光阴影 (除太阳光外) @ProxyValue isShowLightShadow: boolean = true;//灯光阴影 (除太阳光外)
ShowHistoryLog: boolean = true; ShowHistoryLog: boolean = true;

@ -168,7 +168,7 @@ export enum CommandNames
Config = "CONFIG", Config = "CONFIG",
Enablesyncdata = "ENABLESYNCDATA", Enablesyncdata = "ENABLESYNCDATA",
DimStyle = "DIMSTYLE", DimStyle = "DIMSTYLE",
TextStyle = "TEXTSTYLE", TextConfig = "TEXTCONFIG",
ToggleDrillingReactor = "TOGGLEDRILLINGREACTOR", ToggleDrillingReactor = "TOGGLEDRILLINGREACTOR",
AddAloneDrillLock = "ADDALONEDRILLLOCK", AddAloneDrillLock = "ADDALONEDRILLLOCK",
AddAssocDrillLock = "ADDASSOCDRILLLOCK", AddAssocDrillLock = "ADDASSOCDRILLLOCK",
@ -434,4 +434,6 @@ export enum CommandNames
MoveLayerFolder = "移动图层文件夹", MoveLayerFolder = "移动图层文件夹",
DrawArcBoard = "DRAWARCBOARD", //绘制圆弧板 DrawArcBoard = "DRAWARCBOARD", //绘制圆弧板
PartsAnalysis = "PARTSANALYSIS", // 复合实体名称写入关联板件备注 PartsAnalysis = "PARTSANALYSIS", // 复合实体名称写入关联板件备注
FontStyle = "FONTSTYLE",//字体样式
Style = "STYLE",//字体样式
} }

@ -12,6 +12,7 @@ import { RoomFlatTop } from './Room/Entity/Flat/RoomFlatTop';
import { RoomHolePolyline } from './Room/Entity/Wall/Hole/RoomHolePolyline'; import { RoomHolePolyline } from './Room/Entity/Wall/Hole/RoomHolePolyline';
import { RoomWallBase } from './Room/Entity/Wall/RoomWallBase'; import { RoomWallBase } from './Room/Entity/Wall/RoomWallBase';
import { SymbolTableRecord } from './SymbolTableRecord'; import { SymbolTableRecord } from './SymbolTableRecord';
import { Text } from './Text/Text';
@Factory @Factory
export class BlockTableRecord extends SymbolTableRecord export class BlockTableRecord extends SymbolTableRecord
@ -66,6 +67,12 @@ export class BlockTableRecord extends SymbolTableRecord
if (!entity.HasLayer) if (!entity.HasLayer)
entity.Layer = this._db.LayerTable.Current; entity.Layer = this._db.LayerTable.Current;
else if (entity instanceof Text)
{
if (!entity.FontStyle)
entity.FontStyle = this._db.FontStyleTable.Current;//设置默认的字体样式
}
} }
this.EntityCol.Append(entity, isCheckObjectCleanly); this.EntityCol.Append(entity, isCheckObjectCleanly);

@ -1,4 +1,5 @@
import { MirroredRepeatWrapping, Vector3 } from 'three'; import { MirroredRepeatWrapping, Vector3 } from 'three';
import { FontType } from '../Add-on/TextStyle/FontStyleInterface';
import { HostApplicationServices } from '../ApplicationServices/HostApplicationServices'; import { HostApplicationServices } from '../ApplicationServices/HostApplicationServices';
import { DuplicateRecordCloning } from '../Common/Status'; import { DuplicateRecordCloning } from '../Common/Status';
import { AlignLineGroupTable } from './AlignLine/AlignLineGroupTable'; import { AlignLineGroupTable } from './AlignLine/AlignLineGroupTable';
@ -11,6 +12,8 @@ import { DeepCloneFiler } from './DeepCloneFiler';
import { DimStyleRecord } from './DimStyle/DimStyleRecord'; import { DimStyleRecord } from './DimStyle/DimStyleRecord';
import { DimStyleTable } from './DimStyle/DimStyleTable'; import { DimStyleTable } from './DimStyle/DimStyleTable';
import { Entity } from './Entity/Entity'; import { Entity } from './Entity/Entity';
import { FontStyleTable } from './FontStyle/FontStyleTable';
import { FontStyleRecord } from './FontStyle/FontsStyleRecord';
import { GroupTable } from './GroupTable'; import { GroupTable } from './GroupTable';
import { HistoricManage } from './HistoricManage'; import { HistoricManage } from './HistoricManage';
import { IdMaping } from './IdMaping'; import { IdMaping } from './IdMaping';
@ -49,6 +52,7 @@ export class Database
AlignLineGroupTable: AlignLineGroupTable; AlignLineGroupTable: AlignLineGroupTable;
DimStyleTable: DimStyleTable; DimStyleTable: DimStyleTable;
LayerTable: LayerTable; LayerTable: LayerTable;
FontStyleTable: FontStyleTable;
//模型空间(里面有模型空间的实体列表) //模型空间(里面有模型空间的实体列表)
ModelSpace: BlockTableRecord; ModelSpace: BlockTableRecord;
@ -101,6 +105,7 @@ export class Database
this.AlignLineGroupTable = new AlignLineGroupTable().SetOwnerDatabase(this); this.AlignLineGroupTable = new AlignLineGroupTable().SetOwnerDatabase(this);
//注意:新对象在这里添加 //注意:新对象在这里添加
this.LayerTable = new LayerTable().SetOwnerDatabase(this); this.LayerTable = new LayerTable().SetOwnerDatabase(this);
this.FontStyleTable = new FontStyleTable().SetOwnerDatabase(this);
if (IsDefaultDatabase) if (IsDefaultDatabase)
{ {
@ -119,6 +124,8 @@ export class Database
this.InitLight(); this.InitLight();
this.InitFontStyle();
this.SettingDefaultStyleAndMaterial(); this.SettingDefaultStyleAndMaterial();
} }
@ -193,6 +200,20 @@ export class Database
this.Lights.Add(this.HemisphereLight); this.Lights.Add(this.HemisphereLight);
} }
private InitFontStyle()
{
this.idIndex = 90;
let styleRd = new FontStyleRecord;
styleRd.Name = "默认";
this.FontStyleTable.Add(styleRd);
this.FontStyleTable.Current = styleRd.Id;
let styleRd1 = new FontStyleRecord;
styleRd1.Name = "样式1";
styleRd1.FontType = FontType.SongTi;
this.FontStyleTable.Add(styleRd1);
}
private SettingDefaultStyleAndMaterial() private SettingDefaultStyleAndMaterial()
{ {
if (!this.IsDefaultDatabase) if (!this.IsDefaultDatabase)
@ -210,6 +231,7 @@ export class Database
HostApplicationServices.CurrentDimStyle = this.DimStyleTable.Current; HostApplicationServices.CurrentDimStyle = this.DimStyleTable.Current;
HostApplicationServices.CurrentLayer = this.LayerTable.Current; HostApplicationServices.CurrentLayer = this.LayerTable.Current;
HostApplicationServices.CurrentFontStyle = this.FontStyleTable.Current;
} }
Destroy() Destroy()
@ -228,6 +250,7 @@ export class Database
this.AlignLineGroupTable.Destroy(); this.AlignLineGroupTable.Destroy();
this.DimStyleTable.Destroy(); this.DimStyleTable.Destroy();
this.LayerTable.Destroy(); this.LayerTable.Destroy();
this.FontStyleTable.Destroy();
this.hm.Destroy(); this.hm.Destroy();
this.CameraSnapshoots.length = 0; this.CameraSnapshoots.length = 0;
this.hm.historyRecord.length = 0; this.hm.historyRecord.length = 0;
@ -247,6 +270,7 @@ export class Database
this.AlignLineGroupTable.SetOwnerDatabase(this); this.AlignLineGroupTable.SetOwnerDatabase(this);
//注意:新对象在这里添加 //注意:新对象在这里添加
this.LayerTable.SetOwnerDatabase(this); this.LayerTable.SetOwnerDatabase(this);
this.FontStyleTable.SetOwnerDatabase(this);
this.idIndex = 100; this.idIndex = 100;
} }
@ -254,7 +278,7 @@ export class Database
FileWrite(file = new CADFiler): CADFiler FileWrite(file = new CADFiler): CADFiler
{ {
file.Write(13);//ver; file.Write(14);//ver;
file.Write(this.idIndex); file.Write(this.idIndex);
this.LayerTable.WriteFile(file); this.LayerTable.WriteFile(file);
@ -279,6 +303,7 @@ export class Database
file.Write(this.ExtendedData); file.Write(this.ExtendedData);
this.AlignLineGroupTable.WriteFile(file); this.AlignLineGroupTable.WriteFile(file);
this.FontStyleTable.WriteFile(file);
return file; return file;
} }
@ -369,6 +394,15 @@ export class Database
if (ver > 11) if (ver > 11)
this.AlignLineGroupTable.ReadFile(file); this.AlignLineGroupTable.ReadFile(file);
if (ver > 13)
this.FontStyleTable.ReadFile(file);
else
{
let indexBak = this.idIndex;
this.InitFontStyle();
this.idIndex = indexBak;
}
this.SettingDefaultStyleAndMaterial(); this.SettingDefaultStyleAndMaterial();
this.hm.doing = false; this.hm.doing = false;

@ -13,7 +13,7 @@ export abstract class Dimension extends Entity
{ {
OnlyRenderType = true; OnlyRenderType = true;
protected _TextString: string; protected _TextString: string;
protected _Text = new Text(undefined, undefined, "yahei"); protected _Text = new Text();
//避免标注实体使用材质 //避免标注实体使用材质
get Material() { return this._MaterialId; } get Material() { return this._MaterialId; }

@ -0,0 +1,6 @@
export enum FontStyleKeyCode
{
Height = 1,
WidthFactor = 2,
FontType = 3
}

@ -0,0 +1,35 @@
import { Factory } from "../CADFactory";
import { CADFiler } from "../CADFiler";
import { ObjectId } from "../ObjectId";
import { SymbolTable } from "../Tables/SymbolTable";
@Factory
export class FontStyleTable extends SymbolTable
{
Current: ObjectId;
get FontStyleNames(): string[]
{
let fontStyleNames = [];
for (let fontStyle of this.Symbols)
fontStyleNames.push(fontStyle[0]);
return fontStyleNames;
}
//#region -------------------------File-------------------------
//对象从文件中读取数据,初始化自身
override ReadFile(file: CADFiler)
{
let ver = file.Read();
super.ReadFile(file);
this.Current = file.ReadObjectId();
}
//对象将自身数据写入到文件.
override WriteFile(file: CADFiler)
{
file.Write(1);
super.WriteFile(file);
file.WriteObjectId(this.Current);
}
//#endregion
}

@ -0,0 +1,45 @@
import { FontType } from "../../Add-on/TextStyle/FontStyleInterface";
import { AutoRecord } from "../AutoRecord";
import { Factory } from "../CADFactory";
import { CADFiler } from "../CADFiler";
import { SymbolTableRecord } from "../SymbolTableRecord";
/**
*
*/
@Factory
export class FontStyleRecord extends SymbolTableRecord
{
/** 字体高度 1 */
@AutoRecord Height: number = 60;//1
/** 宽度因子 2 字符串间距 */
@AutoRecord WidthFactor: number = 1;
/** 样式类型 3 */
@AutoRecord FontType: FontType = FontType.YaHei;
//#region -------------------------File-------------------------
//对象从文件中读取数据,初始化自身
override ReadFile(file: CADFiler)
{
let ver = file.Read();
super.ReadFile(file);
this.Height = file.Read();
this.WidthFactor = file.Read();
this.FontType = file.Read();
}
//对象将自身数据写入到文件.
override WriteFile(file: CADFiler)
{
file.Write(1);
super.WriteFile(file);
file.Write(this.Height);
file.Write(this.WidthFactor);
file.Write(this.FontType);
}
//#endregion
}

@ -1,4 +1,5 @@
import { BufferGeometry, Line, Object3D, Vector2, Vector3 } from "three"; import { BufferGeometry, Line, Object3D, Vector2, Vector3 } from "three";
import { FontType } from "../../../../Add-on/TextStyle/FontStyleInterface";
import { AddEntityDrawObject } from "../../../../Common/AddEntityDrawObject"; import { AddEntityDrawObject } from "../../../../Common/AddEntityDrawObject";
import { FixedNotZero } from "../../../../Common/Utils"; import { FixedNotZero } from "../../../../Common/Utils";
import { BufferGeometryUtils } from "../../../../Geometry/BufferGeometryUtils"; import { BufferGeometryUtils } from "../../../../Geometry/BufferGeometryUtils";
@ -79,7 +80,11 @@ export class RoomRegion extends RoomBase
private get Text() private get Text()
{ {
if (!this._Text) if (!this._Text)
this._Text = new Text(undefined, undefined, "yahei", 100); {
this._Text = new Text();
this._Text.Height = 100;
this._Text.FontName = FontType.YaHei;
}
return this._Text; return this._Text;
} }

@ -7,16 +7,23 @@ import { IsPointInPolygon } from "../PointInPolyline";
export class FontExt extends Font export class FontExt extends Font
{ {
generateShapes(text: string, size: number = 100) /**
* @param {string} text
* @param {number} [size=100]
* @param {number} [widthFactor=1]
* @return {*}
* @memberof FontExt
*/
generateShapes(text: string, size: number = 100, widthFactor = 1)
{ {
let shapes: Shape[] = []; let shapes: Shape[] = [];
let paths = createPaths(text, size, this.data); let paths = createPaths(text, size, this.data, widthFactor);
for (let p of paths) for (let p of paths)
arrayPushArray(shapes, p.toShapes(false)); arrayPushArray(shapes, p.toShapes(false));
return shapes; return shapes;
} }
} }
function createPaths(text: string, size: number, data: any) function createPaths(text: string, size: number, data: any, widthFactor: number)
{ {
let scale = size / data.resolution; let scale = size / data.resolution;
let line_height = (data.boundingBox.yMax - data.boundingBox.yMin + data.underlineThickness) * scale; let line_height = (data.boundingBox.yMax - data.boundingBox.yMin + data.underlineThickness) * scale;
@ -38,7 +45,7 @@ function createPaths(text: string, size: number, data: any)
} }
else else
{ {
let ret = createPath(char, scale, offsetX, offsetY, data); let ret = createPath(char, scale, offsetX, offsetY, data, widthFactor);
if (ret) if (ret)
{ {
offsetX += ret.offsetX; offsetX += ret.offsetX;
@ -48,7 +55,7 @@ function createPaths(text: string, size: number, data: any)
} }
return paths; return paths;
} }
function createPath(char: string, scale: number, offsetX: number, offsetY: number, data: any): { offsetX: number, path: ShapePath; } function createPath(char: string, scale: number, offsetX: number, offsetY: number, data: any, widthFactor: number): { offsetX: number, path: ShapePath; }
{ {
let glyph = data.glyphs[char] || data.glyphs['?']; let glyph = data.glyphs[char] || data.glyphs['?'];
@ -73,7 +80,7 @@ function createPath(char: string, scale: number, offsetX: number, offsetY: numbe
case 'm': // moveTo case 'm': // moveTo
x = outline[i++] * scale + offsetX; x = outline[i++] * scale * widthFactor + offsetX;
y = outline[i++] * scale + offsetY; y = outline[i++] * scale + offsetY;
path.moveTo(x, y); path.moveTo(x, y);
@ -82,7 +89,7 @@ function createPath(char: string, scale: number, offsetX: number, offsetY: numbe
case 'l': // lineTo case 'l': // lineTo
x = outline[i++] * scale + offsetX; x = outline[i++] * scale * widthFactor + offsetX;
y = outline[i++] * scale + offsetY; y = outline[i++] * scale + offsetY;
path.lineTo(x, y); path.lineTo(x, y);
@ -91,9 +98,9 @@ function createPath(char: string, scale: number, offsetX: number, offsetY: numbe
case 'q': // quadraticCurveTo case 'q': // quadraticCurveTo
cpx = outline[i++] * scale + offsetX; cpx = outline[i++] * scale * widthFactor + offsetX;
cpy = outline[i++] * scale + offsetY; cpy = outline[i++] * scale + offsetY;
cpx1 = outline[i++] * scale + offsetX; cpx1 = outline[i++] * scale * widthFactor + offsetX;
cpy1 = outline[i++] * scale + offsetY; cpy1 = outline[i++] * scale + offsetY;
path.quadraticCurveTo(cpx1, cpy1, cpx, cpy); path.quadraticCurveTo(cpx1, cpy1, cpx, cpy);
@ -102,11 +109,11 @@ function createPath(char: string, scale: number, offsetX: number, offsetY: numbe
case 'b': // bezierCurveTo case 'b': // bezierCurveTo
cpx = outline[i++] * scale + offsetX; cpx = outline[i++] * scale * widthFactor + offsetX;
cpy = outline[i++] * scale + offsetY; cpy = outline[i++] * scale + offsetY;
cpx1 = outline[i++] * scale + offsetX; cpx1 = outline[i++] * scale * widthFactor + offsetX;
cpy1 = outline[i++] * scale + offsetY; cpy1 = outline[i++] * scale + offsetY;
cpx2 = outline[i++] * scale + offsetX; cpx2 = outline[i++] * scale * widthFactor + offsetX;
cpy2 = outline[i++] * scale + offsetY; cpy2 = outline[i++] * scale + offsetY;
path.bezierCurveTo(cpx1, cpy1, cpx2, cpy2, cpx, cpy); path.bezierCurveTo(cpx1, cpy1, cpx2, cpy2, cpx, cpy);
@ -119,7 +126,7 @@ function createPath(char: string, scale: number, offsetX: number, offsetY: numbe
} }
return { offsetX: glyph.ha * scale, path: path }; return { offsetX: glyph.ha * scale * widthFactor, path: path };
} }
class PathData extends Path class PathData extends Path

@ -1,14 +1,17 @@
import { BufferGeometry, Geometry, Matrix3, Matrix4, Mesh, Object3D, ShapeGeometry, Vector3 } from 'three'; import { BufferGeometry, Geometry, Matrix3, Matrix4, Mesh, Object3D, ShapeGeometry, Vector3 } from 'three';
import { FontType } from '../../Add-on/TextStyle/FontStyleInterface';
import { HostApplicationServices } from '../../ApplicationServices/HostApplicationServices';
import { ColorMaterial } from '../../Common/ColorPalette'; import { ColorMaterial } from '../../Common/ColorPalette';
import { UpdateDraw } from '../../Common/Status';
import { ObjectSnapMode } from '../../Editor/ObjectSnapMode'; import { ObjectSnapMode } from '../../Editor/ObjectSnapMode';
import { Box3Ext } from '../../Geometry/Box'; import { Box3Ext } from '../../Geometry/Box';
import { GetBox, MoveMatrix, XAxis, XAxisN, YAxis, YAxisN, ZAxisN } from '../../Geometry/GeUtils'; import { GetBox, MoveMatrix, XAxis, XAxisN, YAxis, YAxisN, ZAxisN } from '../../Geometry/GeUtils';
import { RenderType } from '../../GraphicsSystem/RenderType'; import { RenderType } from '../../GraphicsSystem/RenderType';
import { equaln } from '../../Nest/Common/Util';
import { Factory } from '../CADFactory'; import { Factory } from '../CADFactory';
import { CADFiler } from '../CADFiler'; import { CADFiler } from '../CADFiler';
import { Entity } from '../Entity/Entity'; import { Entity } from '../Entity/Entity';
import { FontStyleKeyCode } from '../FontStyle/FontStyleKeyCodeEnum';
import { FontStyleRecord } from '../FontStyle/FontsStyleRecord';
import { ObjectId } from '../ObjectId';
import { FontLoader } from './FontLoader'; import { FontLoader } from './FontLoader';
export const TEXT_HEIGHT_SCALE = 1.35; export const TEXT_HEIGHT_SCALE = 1.35;
@ -35,21 +38,18 @@ export function DisposeTextShapeCache()
export class Text extends Entity export class Text extends Entity
{ {
protected OnlyRenderType = true; protected OnlyRenderType = true;
protected _FontStyle: ObjectId;//字体样式
protected _FontStyleOverride: Map<FontStyleKeyCode, any> = new Map;//字体样式替代
private _Align: TextAligen = TextAligen.LeftDown;
IsDoubleMesh = false;//文字使用双面网格体 IsDoubleMesh = false;//文字使用双面网格体
IsFsText = false;//文字写在俯视图上 IsFsText = false;//文字写在俯视图上
private _Align: TextAligen = TextAligen.LeftDown; constructor(pos?: Vector3, private _TextString: string = "", private _TextRotation: number = 0)
constructor(pos?: Vector3,
private _TextString: string = "",
public _FontName: string = "songti",
private _Height: number = 60,
private _TextRotation: number = 0,
)
{ {
super(); super();
pos && this._Matrix.setPosition(pos); pos && this._Matrix.setPosition(pos);
} }
get TextRotation() get TextRotation()
{ {
return this._TextRotation; return this._TextRotation;
@ -62,6 +62,7 @@ export class Text extends Entity
this._TextRotation = v; this._TextRotation = v;
this.UpdateTranslate(); this.UpdateTranslate();
} }
get TextString() get TextString()
{ {
return this._TextString; return this._TextString;
@ -88,18 +89,87 @@ export class Text extends Entity
return this._Align; return this._Align;
} }
get Height() /**设置字体样式 */
set FontStyle(styleId: ObjectId)
{
if (styleId === this._FontStyle) return;
this.WriteAllObjectRecord();
this._FontStyle = styleId;
this.Update();
}
get FontStyle() { return this._FontStyle; }
//字体样式名称
get FontName()
{
return this.GetFontStyleValue(FontStyleKeyCode.FontType);
}
set FontName(fontName: FontType)
{
this.SetFontStyleOverrideValue(FontStyleKeyCode.FontType, fontName);
}
//字体尺寸大小
get Height(): number
{
return this.GetFontStyleValue(FontStyleKeyCode.Height);
}
set Height(value: number)
{
this.SetFontStyleOverrideValue(FontStyleKeyCode.Height, value);
}
//字体间距
get WidthFactor(): number
{
return this.GetFontStyleValue(FontStyleKeyCode.WidthFactor);
}
set WidthFactor(value: number)
{
this.SetFontStyleOverrideValue(FontStyleKeyCode.WidthFactor, value);
}
GetFontStyleOverrideValue(key: FontStyleKeyCode): any { return this._FontStyleOverride.get(key); }
GetFontStyleValue(key: FontStyleKeyCode)
{ {
return this._Height; let value = this.GetFontStyleOverrideValue(key);
if (value !== undefined) return value;
if (this._FontStyle?.Object)
return this._FontStyle.Object[FontStyleKeyCode[key]];
if (HostApplicationServices.CurrentFontStyle && HostApplicationServices.CurrentFontStyle.Object instanceof FontStyleRecord)
return HostApplicationServices.CurrentFontStyle.Object[FontStyleKeyCode[key]];
} }
set Height(v: number)
//设置覆盖的样式
SetFontStyleOverrideValue(key: FontStyleKeyCode, value: any)
{ {
if (equaln(v, this._Height)) return; if (this.GetFontStyleOverrideValue(key) === value) return;
this.WriteAllObjectRecord(); this.WriteAllObjectRecord();
this._Height = v;
this.Update(UpdateDraw.Geometry); let oldV = this.GetFontStyleValue(key);
this._FontStyleOverride.set(key, value);
if (oldV !== value)
this.Update();
}
ClearFontStyleOverride()
{
if (this._FontStyleOverride.size === 0) return;
this.WriteAllObjectRecord();
this._FontStyleOverride.clear();
this.Update();
} }
//创建字体对象 //创建字体对象
async AsyncUpdateDrawObject(obj: Object3D, renderType: RenderType) async AsyncUpdateDrawObject(obj: Object3D, renderType: RenderType)
{ {
@ -128,16 +198,20 @@ export class Text extends Entity
} }
} }
let f = FontLoader.GetLoader(this._FontName); const Height = this.Height;
const FontName = this.FontName;
const WidthFactor = this.GetFontStyleValue(FontStyleKeyCode.WidthFactor);
let f = FontLoader.GetLoader(FontName);
await f.LoadGlyphs(this.TextString); await f.LoadGlyphs(this.TextString);
await f.AwaitLoaded(); await f.AwaitLoaded();
const key = this._FontName + this._TextString + this._Height; const key = FontName + this._TextString + Height + WidthFactor;
let geometry = ShapeCache.get(key); let geometry = ShapeCache.get(key);
if (!geometry) if (!geometry)
{ {
let shapes = f.Font.generateShapes(this._TextString || ".", this._Height); let shapes = f.Font.generateShapes(this._TextString || ".", Height, WidthFactor);
geometry = new ShapeGeometry(shapes); geometry = new ShapeGeometry(shapes);
geometry.name = "Text"; geometry.name = "Text";
geometry.computeBoundingBox(); geometry.computeBoundingBox();
@ -180,7 +254,8 @@ export class Text extends Entity
else else
count += 0.5; count += 0.5;
} }
return count * this._Height * TEXT_HEIGHT_SCALE;
return count * this.Height * TEXT_HEIGHT_SCALE * this.WidthFactor;
} }
get HasBoundingBox() { return this._CacheDrawObject.has(RenderType.Wireframe); } get HasBoundingBox() { return this._CacheDrawObject.has(RenderType.Wireframe); }
@ -307,7 +382,7 @@ export class Text extends Entity
{ {
this.WriteAllObjectRecord(); this.WriteAllObjectRecord();
let p1 = this.Position; let p1 = this.Position;
let p2 = new Vector3(0, this._Height).applyMatrix4(this.OCS); let p2 = new Vector3(0, this.Height).applyMatrix4(this.OCS);
[p1, p2].forEach(p => p.applyMatrix4(m)); [p1, p2].forEach(p => p.applyMatrix4(m));
this.Position = p1; this.Position = p1;
this.Height = p1.distanceTo(p2); this.Height = p1.distanceTo(p2);
@ -395,27 +470,66 @@ export class Text extends Entity
//#region -----------------------------File----------------------------- //#region -----------------------------File-----------------------------
//对象应该实现dataIn和DataOut的方法,为了对象的序列化和反序列化 //对象应该实现dataIn和DataOut的方法,为了对象的序列化和反序列化
protected ReadFontStyle(file: CADFiler)
{
this._FontStyleOverride.clear();
let size = file.Read();
for (let i = 0; i < size; i++)
{
let k = file.Read();
let v = file.Read();
this._FontStyleOverride.set(k, v);
}
}
protected WriteFontStyle(file: CADFiler)
{
file.Write(this._FontStyleOverride.size);
for (let [k, v] of this._FontStyleOverride)
{
file.Write(k);
file.Write(v);
}
}
//对象从文件中读取数据,初始化自身 //对象从文件中读取数据,初始化自身
protected _ReadFile(file: CADFiler) protected _ReadFile(file: CADFiler)
{ {
super._ReadFile(file); super._ReadFile(file);
let ver = file.Read();//1 let ver = file.Read();//1
this._TextString = file.Read(); this._TextString = file.Read();
this._Height = file.Read();
if (ver < 2)
this.Height = file.Read();
this.TextRotation = file.Read(); this.TextRotation = file.Read();
this._FontName = file.Read();
if (ver < 2)
this.FontName = file.Read();
this._Align = file.Read(); this._Align = file.Read();
//从版本开始使用FontStyle
if (ver >= 2)
{
this.ReadFontStyle(file);
this._FontStyle = file.ReadHardObjectId() ?? HostApplicationServices.CurrentFontStyle;
}
else
this._FontStyle = HostApplicationServices.CurrentFontStyle;
} }
//对象将自身数据写入到文件. //对象将自身数据写入到文件.
WriteFile(file: CADFiler) WriteFile(file: CADFiler)
{ {
super.WriteFile(file); super.WriteFile(file);
file.Write(1);//ver file.Write(2);//ver
file.Write(this._TextString); file.Write(this._TextString);
file.Write(this._Height);
file.Write(this.TextRotation); file.Write(this.TextRotation);
file.Write(this._FontName);
file.Write(this._Align); file.Write(this._Align);
this.WriteFontStyle(file);
file.WriteHardObjectId(this._FontStyle);
} }
//#endregion-----------------------------File End----------------------------- //#endregion-----------------------------File End-----------------------------
} }

@ -1,10 +1,13 @@
import { Object3D, Vector3 } from 'three'; import { Object3D, Vector3 } from 'three';
import { end } from 'xaop'; import { end } from 'xaop';
import { FontType } from '../../Add-on/TextStyle/FontStyleInterface';
import { app } from '../../ApplicationServices/Application'; import { app } from '../../ApplicationServices/Application';
import { HostApplicationServices } from '../../ApplicationServices/HostApplicationServices';
import { KeyBoard } from '../../Common/KeyEnum'; import { KeyBoard } from '../../Common/KeyEnum';
import { Singleton } from '../../Common/Singleton'; import { Singleton } from '../../Common/Singleton';
import { GetEntity } from '../../Common/Utils'; import { GetEntity } from '../../Common/Utils';
import { DownPanelStore } from '../../UI/Store/DownPanelStore'; import { equaln } from '../../Geometry/GeUtils';
import { FontStyleRecord } from '../FontStyle/FontsStyleRecord';
import { RoomRegion } from '../Room/Entity/Region/RoomRegion'; import { RoomRegion } from '../Room/Entity/Region/RoomRegion';
import { FontLoader } from './FontLoader'; import { FontLoader } from './FontLoader';
import { TEXT_HEIGHT_SCALE, Text } from './Text'; import { TEXT_HEIGHT_SCALE, Text } from './Text';
@ -20,6 +23,8 @@ export class TextArea extends Singleton
private _TextRotation: number; private _TextRotation: number;
private _CurrentValue: string = "";//当前编辑框的值 private _CurrentValue: string = "";//当前编辑框的值
private _EditoringObject: Object3D; //正在编辑的对象 private _EditoringObject: Object3D; //正在编辑的对象
private _FontType: FontType = FontType.YaHei;
constructor() constructor()
{ {
super(); super();
@ -34,7 +39,7 @@ export class TextArea extends Singleton
zIndex:1; zIndex:1;
`; `;
} }
StartDrawText(position: Vector3, height: number, rotate: number, str: string) StartDrawText(position: Vector3, height: number, rotate: number, str: string, fontType: FontType, widthFactor: number)
{ {
document.getElementById('Webgl').parentNode.appendChild(this._AreaContiner); document.getElementById('Webgl').parentNode.appendChild(this._AreaContiner);
this.RegisterEvent(); this.RegisterEvent();
@ -42,6 +47,7 @@ export class TextArea extends Singleton
this._TextHeight = height; this._TextHeight = height;
this._TextRotation = rotate; this._TextRotation = rotate;
this._CurrentValue = str; this._CurrentValue = str;
this._FontType = fontType;
this.CreateEditorArea(); this.CreateEditorArea();
} }
StartEditorText(textObj, editorPosition?: Vector3) StartEditorText(textObj, editorPosition?: Vector3)
@ -49,8 +55,6 @@ export class TextArea extends Singleton
let text = GetEntity(textObj) as Text | RoomRegion; let text = GetEntity(textObj) as Text | RoomRegion;
if (text) if (text)
{ {
if (text instanceof Text)
DownPanelStore.GetInstance().fontName = text._FontName;
document.getElementById('Webgl').parentNode.appendChild(this._AreaContiner); document.getElementById('Webgl').parentNode.appendChild(this._AreaContiner);
textObj.visible = false; textObj.visible = false;
app.Editor.UpdateScreen(); app.Editor.UpdateScreen();
@ -66,11 +70,13 @@ export class TextArea extends Singleton
{ {
this._TextHeight = text.Height; this._TextHeight = text.Height;
this._TextRotation = text.TextRotation; this._TextRotation = text.TextRotation;
this._FontType = text.FontName;
} }
else else
{ {
this._TextHeight = 60; this._TextHeight = 60;
this._TextRotation = 0; this._TextRotation = 0;
this._FontType = FontType.YaHei;
} }
this._CurrentValue = text.TextString; this._CurrentValue = text.TextString;
this.CreateEditorArea(editorPosition); this.CreateEditorArea(editorPosition);
@ -185,7 +191,7 @@ export class TextArea extends Singleton
if (this._EditoringObject) if (this._EditoringObject)
{ {
let t = GetEntity(this._EditoringObject) as Text; let t = GetEntity(this._EditoringObject) as Text;
let f = FontLoader.GetLoader(DownPanelStore.GetInstance().fontName); let f = FontLoader.GetLoader(this._FontType);
f.LoadGlyphs(el.innerText); f.LoadGlyphs(el.innerText);
await f.AwaitLoaded(); await f.AwaitLoaded();
t.TextString = el.innerText; t.TextString = el.innerText;
@ -210,13 +216,20 @@ export class TextArea extends Singleton
async EndEditor() async EndEditor()
{ {
this.ClearEvent(); this.ClearEvent();
let f = FontLoader.GetLoader(DownPanelStore.GetInstance().fontName); let f = FontLoader.GetLoader(this._FontType);
for (let [el, pos] of this._EditorElList) for (let [el, pos] of this._EditorElList)
{ {
f.LoadGlyphs(el.innerText); f.LoadGlyphs(el.innerText);
await f.AwaitLoaded(); await f.AwaitLoaded();
let text = new Text(new Vector3(), el.innerText, f.FontName, this._TextHeight, this._TextRotation); let text = new Text(new Vector3(), el.innerText, this._TextRotation);
const FontStyle = HostApplicationServices.CurrentFontStyle.Object as FontStyleRecord;
text.FontStyle = FontStyle.objectId;
if (!equaln(this._TextHeight, FontStyle.Height))
text.Height = this._TextHeight;
text.ApplyMatrix(app.Editor.UCSMatrix.setPosition(pos)); text.ApplyMatrix(app.Editor.UCSMatrix.setPosition(pos));
app.LayoutTool.AppendDatabaseSpace(text); app.LayoutTool.AppendDatabaseSpace(text);
if (el.parentElement) if (el.parentElement)

@ -243,6 +243,7 @@ import { Command_Show2DPathObject } from "../Add-on/Show2DPathLine/Show2DPathObj
import { TestFb } from "../Add-on/TestFb"; import { TestFb } from "../Add-on/TestFb";
import { Command_TestPointPickParse } from "../Add-on/TestPointPickParse"; import { Command_TestPointPickParse } from "../Add-on/TestPointPickParse";
import { Text2Curve } from "../Add-on/Text2Curve"; import { Text2Curve } from "../Add-on/Text2Curve";
import { Command_FontStyle } from "../Add-on/TextStyle/Command_FontStyle";
import { Command_ToggleUI } from "../Add-on/ToggleUI"; import { Command_ToggleUI } from "../Add-on/ToggleUI";
import { Command_Trim } from "../Add-on/Trim"; import { Command_Trim } from "../Add-on/Trim";
import { Redo, Undo } from "../Add-on/Undo"; import { Redo, Undo } from "../Add-on/Undo";
@ -574,7 +575,9 @@ export function registerCommand()
commandMachine.RegisterCommand(CommandNames.BreakDim, new BreakDim()); commandMachine.RegisterCommand(CommandNames.BreakDim, new BreakDim());
commandMachine.RegisterCommand(CommandNames.DeleteDim, new DeleteDim()); commandMachine.RegisterCommand(CommandNames.DeleteDim, new DeleteDim());
commandMachine.RegisterCommand(CommandNames.DeleteMinDim, new DeleteMinDim()); commandMachine.RegisterCommand(CommandNames.DeleteMinDim, new DeleteMinDim());
commandMachine.RegisterCommand(CommandNames.DimStyle, new Command_DimStyle()); commandMachine.RegisterCommand(CommandNames.DimStyle, new Command_DimStyle());
commandMachine.RegisterCommand(CommandNames.Style, new Command_FontStyle());
commandMachine.RegisterCommand(CommandNames.RotateLayerBoard, new RotateLayerBoard()); commandMachine.RegisterCommand(CommandNames.RotateLayerBoard, new RotateLayerBoard());
@ -661,8 +664,7 @@ export function registerCommand()
commandMachine.RegisterCommand(CommandNames.SwitchServers, new Comman_SwitchServers()); commandMachine.RegisterCommand(CommandNames.SwitchServers, new Comman_SwitchServers());
//选项 //选项
commandMachine.RegisterCommand(CommandNames.Config, new Command_Options(EOptionTabId.Show)); commandMachine.RegisterCommand(CommandNames.Config, new Command_Options(EOptionTabId.Show));
commandMachine.RegisterCommand(CommandNames.DimStyle, new Command_DimStyle()); commandMachine.RegisterCommand(CommandNames.TextConfig, new Command_Options(EOptionTabId.TextConfig));
commandMachine.RegisterCommand(CommandNames.TextStyle, new Command_Options(EOptionTabId.TextStyle));
commandMachine.RegisterCommand("esc", new Command_Esc()); commandMachine.RegisterCommand("esc", new Command_Esc());
commandMachine.RegisterCommand(CommandNames.EraseNoSelect, new Command_EraseNoSelect()); commandMachine.RegisterCommand(CommandNames.EraseNoSelect, new Command_EraseNoSelect());

@ -1,4 +1,5 @@
import { FaceDirection } from "../Add-on/DrawDrilling/DrillType"; import { FaceDirection } from "../Add-on/DrawDrilling/DrillType";
import { FontStyleInfoOption, FontType } from "../Add-on/TextStyle/FontStyleInterface";
import { EditViewOption } from "../Add-on/ViewortConfig/EditViewOption"; import { EditViewOption } from "../Add-on/ViewortConfig/EditViewOption";
import { Curve2RecOption } from "../Add-on/twoD2threeD/Modals/Curve2RecOption"; import { Curve2RecOption } from "../Add-on/twoD2threeD/Modals/Curve2RecOption";
import { IParseBoardNameOption, IRec2BrOption, IRect2Br2Option } from "../Add-on/twoD2threeD/R2bInterface"; import { IParseBoardNameOption, IRec2BrOption, IRect2Br2Option } from "../Add-on/twoD2threeD/R2bInterface";
@ -1211,6 +1212,8 @@ export const DefaultFastDimOption: IFastDimOption = {
filterAppointForBoardNameValues: "", filterAppointForBoardNameValues: "",
conditionType: ForBoardNameType.Same, conditionType: ForBoardNameType.Same,
}; };
Object.freeze(DefaultFastDimOption);
export const DefaultOneClickInspectionOption: OneClickInspectionOption = { export const DefaultOneClickInspectionOption: OneClickInspectionOption = {
version: 2, version: 2,
InspectionOption: { InspectionOption: {
@ -1301,3 +1304,10 @@ export const DefaultEditViewOption: EditViewOption = {
showLayerValue: "" showLayerValue: ""
}; };
Object.freeze(DefaultEditViewOption); Object.freeze(DefaultEditViewOption);
export const DefaultFontStyleOption: FontStyleInfoOption = {
height: 60,
fontType: FontType.YaHei,
widthFactor: 1,
};
Object.freeze(DefaultFontStyleOption);

@ -161,7 +161,6 @@ export class UserConfig implements IConfigStore
@observable textStyleOption = { @observable textStyleOption = {
appointTextHight: false, appointTextHight: false,
noNeedAngle: false, noNeedAngle: false,
textHight: 30,
}; };
showShareModule: boolean = false; showShareModule: boolean = false;
@observable openHistoryList = true; @observable openHistoryList = true;
@ -274,7 +273,6 @@ export class UserConfig implements IConfigStore
Object.assign(this.textStyleOption, { Object.assign(this.textStyleOption, {
appointTextHight: false, appointTextHight: false,
needAngle: false, needAngle: false,
textHight: 60,
}); });
this.dimTextHeight = 60; this.dimTextHeight = 60;
this.boardCustomNumberTextHeight = 60; this.boardCustomNumberTextHeight = 60;

@ -81,4 +81,5 @@ export enum BoardModalType
ResourceStoreIcon = "resourceStoreIcon",//模型库列表的显示方式 ResourceStoreIcon = "resourceStoreIcon",//模型库列表的显示方式
SpaceParse = "SpaceParse",//空间解析配置 SpaceParse = "SpaceParse",//空间解析配置
BBSModelStore = "bbsModelStore",//bbs模态框位置大小 BBSModelStore = "bbsModelStore",//bbs模态框位置大小
FontStyleStore = "FontStyleStore",//字体样式
} }

@ -1,4 +1,4 @@
import { Button, Card, Checkbox, Classes, HTMLSelect, Intent, IOptionProps, Popover, Position } from '@blueprintjs/core'; import { Button, Card, Checkbox, Classes, HTMLSelect, Intent, Popover, Position } from '@blueprintjs/core';
import { action, observable } from 'mobx'; import { action, observable } from 'mobx';
import { observer } from 'mobx-react'; import { observer } from 'mobx-react';
import * as React from 'react'; import * as React from 'react';
@ -276,8 +276,6 @@ export class DrillTypeCom extends React.Component<{ store: DrillStore; }, { type
@observer @observer
export class SelectDrillTemp extends React.Component<{ store: DrillStore; }, {}> export class SelectDrillTemp extends React.Component<{ store: DrillStore; }, {}>
{ {
@observable drillingTempList: IOptionProps[] = [];
@observable drillingDirList: IOptionProps[] = [];
render() render()
{ {
let option = this.props.store.m_Option; let option = this.props.store.m_Option;

@ -52,7 +52,7 @@ export enum Config_ModalType
ConfigListModal = 3, //用户列表样式 ConfigListModal = 3, //用户列表样式
} }
const alwaysUpdateType = [BoardModalType.SpotLight, BoardModalType.PointLight]; //都更新 (保存上一次配置除外) const alwaysUpdateType = [BoardModalType.SpotLight, BoardModalType.PointLight, BoardModalType.FontStyleStore]; //都更新 (保存上一次配置除外)
const alwaysNotUpdateType = [BoardModalType.RectAreaLight]; //都不更新 const alwaysNotUpdateType = [BoardModalType.RectAreaLight]; //都不更新

@ -1710,7 +1710,15 @@ export const CommandList: ICommand[] = [
chName: "标注样式", chName: "标注样式",
chDes: "设置当前图纸的标注样式", chDes: "设置当前图纸的标注样式",
}, },
{
typeId: "dim",
link: `#`,
defaultCustom: CommandNames.Style,
command: CommandNames.Style,
type: "标注",
chName: "字体样式",
chDes: "设置字体样式",
},
//视觉样式命令 //视觉样式命令
{ {
icon: IconEnum.WireframeView, icon: IconEnum.WireframeView,

@ -17,6 +17,8 @@ interface INumericInputProps
onBlur?: (e: React.FocusEvent<HTMLInputElement, Element>) => void; //可以用来赋值使用 onBlur?: (e: React.FocusEvent<HTMLInputElement, Element>) => void; //可以用来赋值使用
style?: React.CSSProperties; style?: React.CSSProperties;
tooltip?: boolean; tooltip?: boolean;
tooltipValue?: string;
intent?: Intent;
} }
@observer @observer
@ -28,6 +30,7 @@ export class INumericInput extends React.Component<INumericInputProps, {}>
_Value_Max: number = this.props.max ?? 1e7; _Value_Max: number = this.props.max ?? 1e7;
_CanNull: boolean = this.props.canNull ?? false; //输入框值可为空 _CanNull: boolean = this.props.canNull ?? false; //输入框值可为空
_InitialValue: number | string = this.props.value; //初始值 _InitialValue: number | string = this.props.value; //初始值
_Intent: Intent = this.props.intent ?? Intent.WARNING; //tip Intent属性
@observable _Value: number | string = this.props.value; @observable _Value: number | string = this.props.value;
@observable _isPopoverOpen: boolean = false; @observable _isPopoverOpen: boolean = false;
@ -41,9 +44,9 @@ export class INumericInput extends React.Component<INumericInputProps, {}>
{ {
return ( return (
<Tooltip <Tooltip
content={`仅限${this._Value_Min}-${this._Value_Max}间的数字!`} content={this.props.tooltipValue || `仅限${this._Value_Min}-${this._Value_Max}间的数字!`}
position={Position.TOP} position={Position.TOP}
intent={Intent.WARNING} intent={this._Intent}
isOpen={this.props.tooltip && this._isPopoverOpen} isOpen={this.props.tooltip && this._isPopoverOpen}
> >
<NumericInput <NumericInput

@ -32,7 +32,7 @@ export enum EOptionTabId
Draw = "ht", Draw = "ht",
ChaiDan = "chaidan", ChaiDan = "chaidan",
Perf = "perf", Perf = "perf",
TextStyle = "textstyle", TextConfig = "textConfig",
} }
export class ConfigStore extends Singleton export class ConfigStore extends Singleton
@ -280,7 +280,7 @@ export class ConfigDialog extends React.Component<{ store: ConfigStore; selected
<Tab id={EOptionTabId.Sys} title="系统" panel={<SystemConfigPanel />} /> <Tab id={EOptionTabId.Sys} title="系统" panel={<SystemConfigPanel />} />
<Tab id={EOptionTabId.Draw} title="绘图" panel={<DrawConfigPanel store={store} />} /> <Tab id={EOptionTabId.Draw} title="绘图" panel={<DrawConfigPanel store={store} />} />
<Tab id={EOptionTabId.ChaiDan} title="拆单" panel={<ChaiDanPanel />} /> <Tab id={EOptionTabId.ChaiDan} title="拆单" panel={<ChaiDanPanel />} />
<Tab id={EOptionTabId.TextStyle} title="文本" panel={<TextConfigPanel />} /> <Tab id={EOptionTabId.TextConfig} title="文本" panel={<TextConfigPanel />} />
</Tabs> </Tabs>
</div> </div>

@ -5,10 +5,6 @@ import * as React from 'react';
import { userConfig } from "../../../../Editor/UserConfig"; import { userConfig } from "../../../../Editor/UserConfig";
import { INumericInput } from "../../INumericInput"; import { INumericInput } from "../../INumericInput";
const WDCss: React.CSSProperties = {
width: 100
};
const Padding: React.CSSProperties = { const Padding: React.CSSProperties = {
padding: "4px 0", padding: "4px 0",
margin: 0 margin: 0
@ -18,8 +14,6 @@ const Padding: React.CSSProperties = {
export class TextConfigPanel extends React.Component<{}> export class TextConfigPanel extends React.Component<{}>
{ {
@observable _isPopoverOpen: boolean = false; @observable _isPopoverOpen: boolean = false;
@observable _textHeight: number = userConfig.dimTextHeight;
@observable _appoinTextHeight: boolean = userConfig.textStyleOption.appointTextHight;
_InputEl = React.createRef<HTMLInputElement>(); _InputEl = React.createRef<HTMLInputElement>();
render() render()
{ {
@ -35,20 +29,6 @@ export class TextConfigPanel extends React.Component<{}>
onChange={() => userConfig.textStyleOption.appointTextHight = !userConfig.textStyleOption.appointTextHight} onChange={() => userConfig.textStyleOption.appointTextHight = !userConfig.textStyleOption.appointTextHight}
/> />
</div> </div>
<div>
<span style={WDCss}></span>
<INumericInput
min={1}
max={300}
float={0}
value={userConfig.textStyleOption.textHight}
tooltip
onBlur={(e) =>
{
userConfig.textStyleOption.textHight = parseInt(e.currentTarget.value);
}}
/>
</div>
<div> <div>
<Checkbox <Checkbox
style={{ marginTop: "10px" }} style={{ marginTop: "10px" }}
@ -58,7 +38,7 @@ export class TextConfigPanel extends React.Component<{}>
/> />
</div> </div>
<div> <div>
<span style={WDCss}></span> <span style={{ width: 100 }}></span>
<INumericInput <INumericInput
min={1} min={1}
max={300} max={300}

@ -4,12 +4,15 @@ import { inject, observer } from 'mobx-react';
import * as React from 'react'; import * as React from 'react';
import { end } from 'xaop'; import { end } from 'xaop';
import { SendFile } from '../../Add-on/SendCADFileOnKF'; import { SendFile } from '../../Add-on/SendCADFileOnKF';
import { FontTypeOption } from '../../Add-on/TextStyle/FontStyleInterface';
import { app } from '../../ApplicationServices/Application'; import { app } from '../../ApplicationServices/Application';
import { HostApplicationServices } from '../../ApplicationServices/HostApplicationServices';
import { CommandNames } from '../../Common/CommandNames'; import { CommandNames } from '../../Common/CommandNames';
import { SignUrl } from '../../Common/HostUrl'; import { SignUrl } from '../../Common/HostUrl';
import { Log, LogType } from '../../Common/Log'; import { Log, LogType } from '../../Common/Log';
import { Post, RequestStatus } from '../../Common/Request'; import { Post, RequestStatus } from '../../Common/Request';
import { Entity } from '../../DatabaseServices/Entity/Entity'; import { Entity } from '../../DatabaseServices/Entity/Entity';
import { FontStyleRecord } from '../../DatabaseServices/FontStyle/FontsStyleRecord';
import { DirectionalLight } from '../../DatabaseServices/Lights/DirectionalLight'; import { DirectionalLight } from '../../DatabaseServices/Lights/DirectionalLight';
import { Light } from '../../DatabaseServices/Lights/Light'; import { Light } from '../../DatabaseServices/Lights/Light';
import { PointLight } from '../../DatabaseServices/Lights/PointLight'; import { PointLight } from '../../DatabaseServices/Lights/PointLight';
@ -24,7 +27,6 @@ import { TempEditor } from '../../Editor/TempEditor';
import { userConfig } from '../../Editor/UserConfig'; import { userConfig } from '../../Editor/UserConfig';
import '../Css/PanelStyle.less'; import '../Css/PanelStyle.less';
import { DownPanelStore, LightDataModeType } from '../Store/DownPanelStore'; import { DownPanelStore, LightDataModeType } from '../Store/DownPanelStore';
import { RightPanelStore } from '../Store/RightPanelStore/RightPanelStore';
import { TopPanelStore } from '../Store/TopPanelStore'; import { TopPanelStore } from '../Store/TopPanelStore';
import { userConfigStore } from '../Store/UserConfigStore'; import { userConfigStore } from '../Store/UserConfigStore';
import { BoardModalType } from "./Board/BoardModalType"; import { BoardModalType } from "./Board/BoardModalType";
@ -253,7 +255,6 @@ export class TopPanel extends React.Component<{ store?: TopPanelStore; }, {}>
export class DownPanel extends React.Component<{ store: DownPanelStore; }, {}> export class DownPanel extends React.Component<{ store: DownPanelStore; }, {}>
{ {
@observable showHideSyncEnable = false; //显隐同步显示 @observable showHideSyncEnable = false; //显隐同步显示
rStore: RightPanelStore = RightPanelStore.GetInstance();
private downStore = DownPanelStore.GetInstance(); private downStore = DownPanelStore.GetInstance();
private handleChange = async (e: React.FormEvent<HTMLInputElement>) => private handleChange = async (e: React.FormEvent<HTMLInputElement>) =>
{ {
@ -401,6 +402,21 @@ export class DownPanel extends React.Component<{ store: DownPanelStore; }, {}>
return LightDataModeType.P; return LightDataModeType.P;
} }
private GetFontStyleOption()
{
let option = [];
for (let symbols of app.Database.FontStyleTable.Symbols)
{
if (symbols)
{
let key = (symbols[1] as FontStyleRecord).FontType;
let label = FontTypeOption.find((obj) => obj.value === key).label;
option.push({ label: `${symbols[0]}(${label})`, value: symbols[0] });
}
}
return option;
}
componentDidMount(): void componentDidMount(): void
{ {
let gws = SwitchServerStore.GetInstance()._gangplankWs; let gws = SwitchServerStore.GetInstance()._gangplankWs;
@ -515,13 +531,16 @@ export class DownPanel extends React.Component<{ store: DownPanelStore; }, {}>
<HTMLSelect <HTMLSelect
onChange={e => onChange={e =>
{ {
this.props.store.fontName = e.target.value; let name = e.target.value;
this.props.store.Upload(); let fontStyle = app.Database.FontStyleTable.Symbols.get(name) as FontStyleRecord;
app.Database.FontStyleTable.Current = fontStyle.objectId;
HostApplicationServices.CurrentFontStyle = fontStyle.objectId;
this.props.store.fontType = fontStyle.Name;
}} }}
value={this.props.store.fontName} value={this.props.store.fontType}
style={{ height: 15, fontSize: "12px", outline: "none", verticalAlign: "bottom" }} style={{ height: 15, fontSize: "12px", outline: "none", verticalAlign: "bottom" }}
options={[ options={this.GetFontStyleOption()}
{ label: "宋体", value: "songti" }, { label: "雅黑", value: "yahei" }]} /> />
</div> </div>
<div style={switchCss}> <div style={switchCss}>
<SnapMenuFixed /> <SnapMenuFixed />

@ -1,16 +1,11 @@
import { Card, Classes, HTMLSelect, Intent, Position, Tooltip } from "@blueprintjs/core"; import { Card, Classes, HTMLSelect } from "@blueprintjs/core";
import hotkeys from "hotkeys-js-ext";
import { observable } from "mobx"; import { observable } from "mobx";
import { observer } from "mobx-react"; import { observer } from "mobx-react";
import React from "react"; import React from "react";
import { end } from "xaop"; import { FixedNotZero } from "../../../Common/Utils";
import { app } from "../../../ApplicationServices/Application";
import { KeyBoard, KeyCode } from "../../../Common/KeyEnum";
import { LogType } from "../../../Common/Log";
import { FixedNotZero, digitStrReg } from "../../../Common/Utils";
import { safeEval } from "../../../Common/eval";
import { Text, TextAligen } from "../../../DatabaseServices/Text/Text"; import { Text, TextAligen } from "../../../DatabaseServices/Text/Text";
import { CommandWrap } from "../../../Editor/CommandMachine"; import { CommandWrap } from "../../../Editor/CommandMachine";
import { INumericInput } from "../INumericInput";
export interface Properties_TextProps export interface Properties_TextProps
{ {
@ -21,26 +16,14 @@ export interface Properties_TextProps
export class Properties_Text extends React.Component<Properties_TextProps, {}> export class Properties_Text extends React.Component<Properties_TextProps, {}>
{ {
_removeFuncs: Function[] = []; _removeFuncs: Function[] = [];
_textHeightInputEl = React.createRef<HTMLInputElement>(); @observable _TextHeight: number = 60;
@observable _numericInputVal: string = ""; @observable _TextWidthFactor: number = 1;
@observable _isPopoverOpen: boolean = false;
componentDidMount() componentDidMount()
{ {
let numval = this.props.ents[0].Height; let text = this.props.ents[0];
this._numericInputVal = FixedNotZero(numval, 2); this._TextHeight = parseFloat(FixedNotZero(text.Height, 2));
this._TextWidthFactor = text.WidthFactor;
this._removeFuncs.push(
end(app.Editor.KeyCtrl, app.Editor.KeyCtrl.OnKeyUp, (e: KeyboardEvent) =>
{
if (hotkeys.ctrl)
if (e.code === KeyCode.KeyZ || e.code === KeyCode.KeyY)
{
let numval = this.props.ents[0].Height;
this._numericInputVal = FixedNotZero(numval, 2);
}
})
);
} }
componentWillUnmount() componentWillUnmount()
@ -50,47 +33,6 @@ export class Properties_Text extends React.Component<Properties_TextProps, {}>
this._removeFuncs.length = 0; this._removeFuncs.length = 0;
} }
private handleChange = (el: HTMLInputElement) =>
{
const vs = el.value;
let isOK = digitStrReg.test(vs);
if (isOK || vs === "")
{
this._textHeightInputEl.current.classList.remove("bp3-intent-danger");
this._isPopoverOpen = false;
}
else
{
this._textHeightInputEl.current.classList.add("bp3-intent-danger");
this._isPopoverOpen = true;
}
this._numericInputVal = vs;
};
private handleFocus = (e: React.FocusEvent<HTMLInputElement>) =>
{
this._textHeightInputEl.current.setSelectionRange(0, this._textHeightInputEl.current.value.length);
};
private handleBlur = (e: React.FocusEvent<HTMLInputElement>) =>
{
let val = safeEval(e.target.value);
if (!isNaN(val))
{
if (val <= 0 || val > 999)
app.Editor.Prompt('文字尺寸仅限1-999间的数字!', LogType.Error);
else
{
CommandWrap(() =>
{
for (let al of this.props.ents)
{
al.Height = val;
}
}, "字体大小");
}
}
else
app.Editor.Prompt('文字尺寸仅限1-999间的数字!', LogType.Error);
};
_HandleSelectOnChange(e: React.ChangeEvent<HTMLSelectElement>) _HandleSelectOnChange(e: React.ChangeEvent<HTMLSelectElement>)
{ {
let ents = this.props.ents; let ents = this.props.ents;
@ -111,36 +53,39 @@ export class Properties_Text extends React.Component<Properties_TextProps, {}>
<li className="text-editor"> <li className="text-editor">
<div> <div>
<span>: </span> <span>: </span>
<div className="numeric_input"> <INumericInput
<Tooltip min={1}
content={"仅限1-999间的数字!"} max={999}
position={Position.TOP} style={{ width: 91 }}
intent={Intent.WARNING} value={this._TextHeight}
isOpen={this._isPopoverOpen} onBlur={(e) =>
> {
<input CommandWrap(() =>
style={{ width: "100%" }} {
className={Classes.INPUT} for (let al of this.props.ents)
ref={this._textHeightInputEl} al.Height = parseInt(e.target.value);
onKeyDown={e => }, "字体大小");
{ }}
if (e.keyCode === KeyBoard.Escape) />
{ </div>
//@ts-ignore </li>
e.target.blur(); <li className="text-editor">
} <div>
<span>: </span>
if (e.keyCode === KeyBoard.Enter || e.keyCode === KeyBoard.Space) <INumericInput
this._textHeightInputEl.current.blur(); min={0}
e.stopPropagation(); max={999}
}} style={{ width: 91 }}
onChange={e => this.handleChange(e.target)} value={this._TextWidthFactor}
value={this._numericInputVal} onBlur={(e) =>
onFocus={this.handleFocus} {
onBlur={this.handleBlur} CommandWrap(() =>
/> {
</Tooltip> for (let text of this.props.ents)
</div> text.WidthFactor = parseInt(e.target.value);
}, "字体间距");
}}
/>
</div> </div>
</li> </li>
<li className="text-editor"> <li className="text-editor">

@ -2,10 +2,12 @@ import { action, autorun, observable, reaction } from 'mobx';
import * as xaop from 'xaop'; import * as xaop from 'xaop';
import { Command_ToggleUI } from '../../Add-on/ToggleUI'; import { Command_ToggleUI } from '../../Add-on/ToggleUI';
import { app } from '../../ApplicationServices/Application'; import { app } from '../../ApplicationServices/Application';
import { HostApplicationServices } from '../../ApplicationServices/HostApplicationServices';
import { appCache } from '../../Common/AppCache'; import { appCache } from '../../Common/AppCache';
import { ConfigUrls } from '../../Common/HostUrl'; import { ConfigUrls } from '../../Common/HostUrl';
import { PostJson, RequestStatus } from '../../Common/Request'; import { PostJson, RequestStatus } from '../../Common/Request';
import { GetIndexDBID } from '../../Common/Utils'; import { GetIndexDBID } from '../../Common/Utils';
import { FontStyleRecord } from '../../DatabaseServices/FontStyle/FontsStyleRecord';
import { ObjectSnapMode } from '../../Editor/ObjectSnapMode'; import { ObjectSnapMode } from '../../Editor/ObjectSnapMode';
import { SNAPMODE } from '../../Editor/ShowSnapMenu'; import { SNAPMODE } from '../../Editor/ShowSnapMenu';
import { AxisSnapMode } from '../../Editor/SnapServices'; import { AxisSnapMode } from '../../Editor/SnapServices';
@ -57,8 +59,6 @@ export class DownPanelStore
@observable useDynSnap: boolean = true; @observable useDynSnap: boolean = true;
@observable usePass: boolean = true; @observable usePass: boolean = true;
@observable useOrtho: boolean = false; @observable useOrtho: boolean = false;
@observable fontName: string = "songti";
@observable progressName = ""; @observable progressName = "";
@observable progress = 1; @observable progress = 1;
@observable isF3Checked: boolean = true;//捕捉开启 @observable isF3Checked: boolean = true;//捕捉开启
@ -158,6 +158,7 @@ export class DownPanelStore
@observable showHideSync: boolean = false; //显隐同步 @observable showHideSync: boolean = false; //显隐同步
@observable smartUCS: boolean = false; //智能UCS @observable smartUCS: boolean = false; //智能UCS
@observable capturePenetration: boolean = true; //捕捉穿透 @observable capturePenetration: boolean = true; //捕捉穿透
@observable fontType = "";
private timeId; private timeId;
private constructor() private constructor()
@ -189,6 +190,8 @@ export class DownPanelStore
app.LayoutTool.SwitchLayout(); app.LayoutTool.SwitchLayout();
}); });
this.fontType = (HostApplicationServices.CurrentFontStyle.Object as FontStyleRecord).Name;
} }
private OnWindowsResize = () => private OnWindowsResize = () =>
@ -226,7 +229,6 @@ export class DownPanelStore
isF3Checked: this.isF3Checked, isF3Checked: this.isF3Checked,
isF11Checked: this.isF11Checked, isF11Checked: this.isF11Checked,
snapData: this.snapData.map(d => d.enable), snapData: this.snapData.map(d => d.enable),
fontName: this.fontName,
lightsData: this.lightsData.map(l => l.enable), lightsData: this.lightsData.map(l => l.enable),
showHideSync: this.showHideSync, showHideSync: this.showHideSync,
smartUCS: this.smartUCS, smartUCS: this.smartUCS,
@ -298,7 +300,6 @@ export class DownPanelStore
this.isF3Checked = config.isF3Checked; this.isF3Checked = config.isF3Checked;
this.isF11Checked = config.isF11Checked; this.isF11Checked = config.isF11Checked;
this.fontName = config.fontName;
for (let i = 0; i < config.snapData.length; i++) for (let i = 0; i < config.snapData.length; i++)
{ {
if (this.snapData[i]) if (this.snapData[i])

Loading…
Cancel
Save