20240322
1、完善dxf解析
This commit is contained in:
parent
3ce55cebbd
commit
80684daf9b
187
chinese.ts
187
chinese.ts
@ -179,7 +179,7 @@
|
|||||||
<context>
|
<context>
|
||||||
<name>ImportHPGL</name>
|
<name>ImportHPGL</name>
|
||||||
<message>
|
<message>
|
||||||
<location filename="datafile/hpgl/importhpgl.cpp" line="1816"/>
|
<location filename="datafile/hpgl/importhpgl.cpp" line="1965"/>
|
||||||
<source>Encrypted file parsing error!</source>
|
<source>Encrypted file parsing error!</source>
|
||||||
<translation>加密文件解析错误!</translation>
|
<translation>加密文件解析错误!</translation>
|
||||||
</message>
|
</message>
|
||||||
@ -269,21 +269,19 @@
|
|||||||
<translation></translation>
|
<translation></translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="mainwindow.ui" line="350"/>
|
|
||||||
<location filename="mainwindow.ui" line="465"/>
|
<location filename="mainwindow.ui" line="465"/>
|
||||||
<source>Start</source>
|
<source>Start</source>
|
||||||
<translation>启动</translation>
|
<translation>启动</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="mainwindow.ui" line="355"/>
|
|
||||||
<location filename="mainwindow.ui" line="477"/>
|
<location filename="mainwindow.ui" line="477"/>
|
||||||
<source>Pause</source>
|
<source>Pause</source>
|
||||||
<translation>停止</translation>
|
<translation>停止</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="mainwindow.ui" line="360"/>
|
<location filename="mainwindow.ui" line="360"/>
|
||||||
<location filename="mainwindow.cpp" line="823"/>
|
<location filename="mainwindow.cpp" line="764"/>
|
||||||
<location filename="mainwindow.cpp" line="853"/>
|
<location filename="mainwindow.cpp" line="794"/>
|
||||||
<source>Delete</source>
|
<source>Delete</source>
|
||||||
<translation>删除</translation>
|
<translation>删除</translation>
|
||||||
</message>
|
</message>
|
||||||
@ -390,6 +388,7 @@
|
|||||||
<message>
|
<message>
|
||||||
<location filename="mainwindow.ui" line="489"/>
|
<location filename="mainwindow.ui" line="489"/>
|
||||||
<source>DrawingSetting</source>
|
<source>DrawingSetting</source>
|
||||||
|
<extracomment>图形设置</extracomment>
|
||||||
<translation></translation>
|
<translation></translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
@ -408,233 +407,255 @@
|
|||||||
<translation></translation>
|
<translation></translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="mainwindow.cpp" line="149"/>
|
<location filename="mainwindow.cpp" line="71"/>
|
||||||
<location filename="mainwindow.cpp" line="923"/>
|
<location filename="mainwindow.cpp" line="162"/>
|
||||||
<location filename="mainwindow.cpp" line="931"/>
|
<location filename="mainwindow.cpp" line="873"/>
|
||||||
<location filename="mainwindow.cpp" line="956"/>
|
<location filename="mainwindow.cpp" line="880"/>
|
||||||
<location filename="mainwindow.cpp" line="1369"/>
|
<location filename="mainwindow.cpp" line="903"/>
|
||||||
<location filename="mainwindow.cpp" line="1378"/>
|
<location filename="mainwindow.cpp" line="1280"/>
|
||||||
<location filename="mainwindow.cpp" line="1501"/>
|
<location filename="mainwindow.cpp" line="1289"/>
|
||||||
<location filename="mainwindow.cpp" line="1510"/>
|
<location filename="mainwindow.cpp" line="1420"/>
|
||||||
<location filename="mainwindow.cpp" line="1561"/>
|
<location filename="mainwindow.cpp" line="1429"/>
|
||||||
<location filename="mainwindow.cpp" line="1649"/>
|
<location filename="mainwindow.cpp" line="1481"/>
|
||||||
|
<location filename="mainwindow.cpp" line="1518"/>
|
||||||
|
<location filename="mainwindow.cpp" line="1604"/>
|
||||||
<source>Prompt</source>
|
<source>Prompt</source>
|
||||||
<translation>提示</translation>
|
<translation>提示</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="mainwindow.cpp" line="150"/>
|
<location filename="mainwindow.cpp" line="163"/>
|
||||||
<source>Printing this file, it cannot be moved!</source>
|
<source>Printing this file, it cannot be moved!</source>
|
||||||
<translation>正在打印此文件,不可移动!</translation>
|
<translation>正在打印此文件,不可移动!</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="mainwindow.cpp" line="393"/>
|
<location filename="mainwindow.cpp" line="362"/>
|
||||||
<location filename="mainwindow.cpp" line="455"/>
|
<location filename="mainwindow.cpp" line="424"/>
|
||||||
<source>Connnecting...</source>
|
<source>Connnecting...</source>
|
||||||
<translation>连接中...</translation>
|
<translation>连接中...</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="mainwindow.cpp" line="397"/>
|
<location filename="mainwindow.cpp" line="366"/>
|
||||||
<location filename="mainwindow.cpp" line="459"/>
|
<location filename="mainwindow.cpp" line="428"/>
|
||||||
<source>Connected</source>
|
<source>Connected</source>
|
||||||
<translation>已连接</translation>
|
<translation>已连接</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="mainwindow.cpp" line="401"/>
|
<location filename="mainwindow.cpp" line="370"/>
|
||||||
<location filename="mainwindow.cpp" line="422"/>
|
<location filename="mainwindow.cpp" line="391"/>
|
||||||
<location filename="mainwindow.cpp" line="452"/>
|
<location filename="mainwindow.cpp" line="421"/>
|
||||||
<source>NotConnected</source>
|
<source>NotConnected</source>
|
||||||
<translation>未连接</translation>
|
<translation>未连接</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="mainwindow.cpp" line="428"/>
|
<location filename="mainwindow.cpp" line="311"/>
|
||||||
<location filename="mainwindow.cpp" line="466"/>
|
<location filename="mainwindow.cpp" line="397"/>
|
||||||
|
<location filename="mainwindow.cpp" line="435"/>
|
||||||
|
<location filename="mainwindow.cpp" line="1108"/>
|
||||||
<source>Idle</source>
|
<source>Idle</source>
|
||||||
<translation>空闲中</translation>
|
<translation>空闲中</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="mainwindow.cpp" line="432"/>
|
<location filename="mainwindow.cpp" line="72"/>
|
||||||
<location filename="mainwindow.cpp" line="470"/>
|
<source>Do you want to exit the program?</source>
|
||||||
|
<translation type="unfinished"></translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="mainwindow.cpp" line="319"/>
|
||||||
|
<location filename="mainwindow.cpp" line="1156"/>
|
||||||
|
<source>Pause print</source>
|
||||||
|
<translation type="unfinished"></translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="mainwindow.cpp" line="401"/>
|
||||||
|
<location filename="mainwindow.cpp" line="439"/>
|
||||||
|
<location filename="mainwindow.cpp" line="1112"/>
|
||||||
<source>Working</source>
|
<source>Working</source>
|
||||||
<translation>工作中</translation>
|
<translation>工作中</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="mainwindow.cpp" line="539"/>
|
<location filename="mainwindow.cpp" line="512"/>
|
||||||
<location filename="mainwindow.cpp" line="712"/>
|
<location filename="mainwindow.cpp" line="698"/>
|
||||||
<location filename="mainwindow.cpp" line="1057"/>
|
<location filename="mainwindow.cpp" line="961"/>
|
||||||
|
<location filename="mainwindow.cpp" line="1148"/>
|
||||||
<source>Waitting</source>
|
<source>Waitting</source>
|
||||||
<translation>未打印</translation>
|
<translation>未打印</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="mainwindow.cpp" line="543"/>
|
<location filename="mainwindow.cpp" line="516"/>
|
||||||
<location filename="mainwindow.cpp" line="716"/>
|
<location filename="mainwindow.cpp" line="702"/>
|
||||||
<location filename="mainwindow.cpp" line="1196"/>
|
<location filename="mainwindow.cpp" line="1152"/>
|
||||||
<source>Printting</source>
|
<source>Printting</source>
|
||||||
<translation>打印中</translation>
|
<translation>打印中</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="mainwindow.cpp" line="622"/>
|
<location filename="mainwindow.cpp" line="604"/>
|
||||||
<location filename="mainwindow.cpp" line="1331"/>
|
<location filename="mainwindow.cpp" line="1238"/>
|
||||||
<source>FileName</source>
|
<source>FileName</source>
|
||||||
<translation>文件名称</translation>
|
<translation>文件名称</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="mainwindow.cpp" line="622"/>
|
<location filename="mainwindow.cpp" line="604"/>
|
||||||
<location filename="mainwindow.cpp" line="1331"/>
|
<location filename="mainwindow.cpp" line="1238"/>
|
||||||
<source>Length</source>
|
<source>Length</source>
|
||||||
<translation>长度</translation>
|
<translation>长度</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="mainwindow.cpp" line="622"/>
|
<location filename="mainwindow.cpp" line="604"/>
|
||||||
<location filename="mainwindow.cpp" line="1331"/>
|
<location filename="mainwindow.cpp" line="1238"/>
|
||||||
<source>Width</source>
|
<source>Width</source>
|
||||||
<translation>宽度</translation>
|
<translation>宽度</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="mainwindow.cpp" line="623"/>
|
<location filename="mainwindow.cpp" line="605"/>
|
||||||
<location filename="mainwindow.cpp" line="1332"/>
|
<location filename="mainwindow.cpp" line="1239"/>
|
||||||
<source>Printed</source>
|
<source>Printed</source>
|
||||||
<translation>已打印</translation>
|
<translation>已打印</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="mainwindow.cpp" line="623"/>
|
<location filename="mainwindow.cpp" line="605"/>
|
||||||
<location filename="mainwindow.cpp" line="1332"/>
|
<location filename="mainwindow.cpp" line="1239"/>
|
||||||
<source>Progress</source>
|
<source>Progress</source>
|
||||||
<translation>打印进度</translation>
|
<translation>打印进度</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="mainwindow.cpp" line="623"/>
|
<location filename="mainwindow.cpp" line="605"/>
|
||||||
<location filename="mainwindow.cpp" line="1332"/>
|
<location filename="mainwindow.cpp" line="1239"/>
|
||||||
<source>Numbers</source>
|
<source>Numbers</source>
|
||||||
<translation>份数</translation>
|
<translation>份数</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="mainwindow.cpp" line="623"/>
|
<location filename="mainwindow.cpp" line="605"/>
|
||||||
<location filename="mainwindow.cpp" line="1332"/>
|
<location filename="mainwindow.cpp" line="1239"/>
|
||||||
<source>State</source>
|
<source>State</source>
|
||||||
<translation>状态</translation>
|
<translation>状态</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="mainwindow.cpp" line="623"/>
|
<location filename="mainwindow.cpp" line="605"/>
|
||||||
<location filename="mainwindow.cpp" line="1332"/>
|
<location filename="mainwindow.cpp" line="1239"/>
|
||||||
<source>FilePath</source>
|
<source>FilePath</source>
|
||||||
<translation>文件路径</translation>
|
<translation>文件路径</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="mainwindow.cpp" line="623"/>
|
<location filename="mainwindow.cpp" line="605"/>
|
||||||
<location filename="mainwindow.cpp" line="1332"/>
|
<location filename="mainwindow.cpp" line="1239"/>
|
||||||
<source>StartPoint</source>
|
<source>StartPoint</source>
|
||||||
<translation>起点</translation>
|
<translation>起点</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="mainwindow.cpp" line="644"/>
|
<location filename="mainwindow.cpp" line="626"/>
|
||||||
<location filename="mainwindow.cpp" line="1336"/>
|
<location filename="mainwindow.cpp" line="1243"/>
|
||||||
<source>McName</source>
|
<source>McName</source>
|
||||||
<translation>机器名称</translation>
|
<translation>机器名称</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="mainwindow.cpp" line="644"/>
|
<location filename="mainwindow.cpp" line="626"/>
|
||||||
<location filename="mainwindow.cpp" line="1336"/>
|
<location filename="mainwindow.cpp" line="1243"/>
|
||||||
<source>McIp</source>
|
<source>McIp</source>
|
||||||
<translation>机器IP</translation>
|
<translation>机器IP</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="mainwindow.cpp" line="644"/>
|
<location filename="mainwindow.cpp" line="626"/>
|
||||||
<location filename="mainwindow.cpp" line="1336"/>
|
<location filename="mainwindow.cpp" line="1243"/>
|
||||||
<source>McConState</source>
|
<source>McConState</source>
|
||||||
<translation>连接状态</translation>
|
<translation>连接状态</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="mainwindow.cpp" line="644"/>
|
<location filename="mainwindow.cpp" line="626"/>
|
||||||
<location filename="mainwindow.cpp" line="1336"/>
|
<location filename="mainwindow.cpp" line="1243"/>
|
||||||
<source>McState</source>
|
<source>McState</source>
|
||||||
<translation>工作状态</translation>
|
<translation>工作状态</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="mainwindow.cpp" line="644"/>
|
<location filename="mainwindow.cpp" line="626"/>
|
||||||
<location filename="mainwindow.cpp" line="1336"/>
|
<location filename="mainwindow.cpp" line="1243"/>
|
||||||
<source>McProgress</source>
|
<source>McProgress</source>
|
||||||
<translation>打印进度</translation>
|
<translation>打印进度</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="mainwindow.cpp" line="819"/>
|
<location filename="mainwindow.cpp" line="760"/>
|
||||||
<source>Print preview</source>
|
<source>Print preview</source>
|
||||||
<translation>打印预览</translation>
|
<translation>打印预览</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="mainwindow.cpp" line="820"/>
|
<location filename="mainwindow.cpp" line="761"/>
|
||||||
<source>Number of modified print</source>
|
<source>Number of modified print</source>
|
||||||
<translation>修改打印份数</translation>
|
<translation>修改打印份数</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="mainwindow.cpp" line="821"/>
|
<location filename="mainwindow.cpp" line="762"/>
|
||||||
<source>Modify the starting print point</source>
|
<source>Modify the starting print point</source>
|
||||||
<translation>修改起始打印点</translation>
|
<translation>修改起始打印点</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="mainwindow.cpp" line="822"/>
|
<location filename="mainwindow.cpp" line="763"/>
|
||||||
<source>View print information</source>
|
<source>View print information</source>
|
||||||
<translation>查看打印信息</translation>
|
<translation>查看打印信息</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="mainwindow.cpp" line="924"/>
|
<location filename="mainwindow.cpp" line="881"/>
|
||||||
<source>Do you want to delete this drawing?</source>
|
<source>Do you want to delete this drawing?</source>
|
||||||
<translation>是否删除该项绘图?</translation>
|
<translation>是否删除该项绘图?</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="mainwindow.cpp" line="932"/>
|
<location filename="mainwindow.cpp" line="874"/>
|
||||||
<source>Printing this file, it cannot be deleted!</source>
|
<source>Printing this file, it cannot be deleted!</source>
|
||||||
<translation>正在打印此文件,不可删除!</translation>
|
<translation>正在打印此文件,不可删除!</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="mainwindow.cpp" line="957"/>
|
<location filename="mainwindow.cpp" line="904"/>
|
||||||
<source>After deletion, the machine cannot be controlled. Do you want to delete this machine?</source>
|
<source>After deletion, the machine cannot be controlled. Do you want to delete this machine?</source>
|
||||||
<translation>删除后将不能控制机器,是否删除此机器?</translation>
|
<translation>删除后将不能控制机器,是否删除此机器?</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="mainwindow.cpp" line="1192"/>
|
<location filename="mainwindow.cpp" line="1160"/>
|
||||||
<source>Complete</source>
|
<source>Complete</source>
|
||||||
<translation>打印完成</translation>
|
<translation>打印完成</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="mainwindow.cpp" line="1370"/>
|
<location filename="mainwindow.cpp" line="1281"/>
|
||||||
<location filename="mainwindow.cpp" line="1502"/>
|
<location filename="mainwindow.cpp" line="1421"/>
|
||||||
<source>Please select a machine!</source>
|
<source>Please select a machine!</source>
|
||||||
<translation>请选择机器!</translation>
|
<translation>请选择机器!</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="mainwindow.cpp" line="1379"/>
|
<location filename="mainwindow.cpp" line="1290"/>
|
||||||
<location filename="mainwindow.cpp" line="1511"/>
|
<location filename="mainwindow.cpp" line="1430"/>
|
||||||
<source>Loading file, please wait!</source>
|
<source>Loading file, please wait!</source>
|
||||||
<translation>正在加载文件,请等待!</translation>
|
<translation>正在加载文件,请等待!</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="mainwindow.cpp" line="1392"/>
|
<location filename="mainwindow.cpp" line="1300"/>
|
||||||
<location filename="mainwindow.cpp" line="1524"/>
|
<location filename="mainwindow.cpp" line="1440"/>
|
||||||
<source>Open File Dialog</source>
|
<source>Open File Dialog</source>
|
||||||
<translation>打开文件对话框</translation>
|
<translation>打开文件对话框</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="mainwindow.cpp" line="1394"/>
|
<location filename="mainwindow.cpp" line="1302"/>
|
||||||
<source>File(*.plt *.dxf)</source>
|
<source>File(*.plt *.dxf)</source>
|
||||||
<translation>文件(*.plt *.dxf)</translation>
|
<translation>文件(*.plt *.dxf)</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="mainwindow.cpp" line="1526"/>
|
<location filename="mainwindow.cpp" line="1442"/>
|
||||||
<source>Image File(*.png *.bmp *.jpg)</source>
|
<source>Image File(*.png *.bmp *.jpg)</source>
|
||||||
<translation>图片(*.png *.bmp *.jpg)</translation>
|
<translation>图片(*.png *.bmp *.jpg)</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="mainwindow.cpp" line="1562"/>
|
<location filename="mainwindow.cpp" line="1482"/>
|
||||||
<source>Please select the machine you want to set the directory!</source>
|
<source>Please select the machine you want to set the directory!</source>
|
||||||
<translation>请选择要设置目录的机器!</translation>
|
<translation>请选择要设置目录的机器!</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="mainwindow.cpp" line="1574"/>
|
<location filename="mainwindow.cpp" line="1494"/>
|
||||||
<source>Select Folder</source>
|
<source>Select Folder</source>
|
||||||
<translation>选择文件夹</translation>
|
<translation>选择文件夹</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="mainwindow.cpp" line="1650"/>
|
<location filename="mainwindow.cpp" line="1519"/>
|
||||||
|
<source>Do you want to start printing on all machines?</source>
|
||||||
|
<translation type="unfinished"></translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="mainwindow.cpp" line="1605"/>
|
||||||
<source>The maximum number of connections has been reached and cannot be added again!</source>
|
<source>The maximum number of connections has been reached and cannot be added again!</source>
|
||||||
<translation>已达到最大连接数量,不可再添加!</translation>
|
<translation>已达到最大连接数量,不可再添加!</translation>
|
||||||
</message>
|
</message>
|
||||||
@ -934,7 +955,7 @@
|
|||||||
<translation>返回</translation>
|
<translation>返回</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="printinfodialog.cpp" line="78"/>
|
<location filename="printinfodialog.cpp" line="80"/>
|
||||||
<source>piece</source>
|
<source>piece</source>
|
||||||
<translation>块</translation>
|
<translation>块</translation>
|
||||||
</message>
|
</message>
|
||||||
@ -1033,12 +1054,12 @@
|
|||||||
<translation>份数:</translation>
|
<translation>份数:</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="printviewwindow.cpp" line="106"/>
|
<location filename="printviewwindow.cpp" line="111"/>
|
||||||
<source>Prompt</source>
|
<source>Prompt</source>
|
||||||
<translation>提示</translation>
|
<translation>提示</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="printviewwindow.cpp" line="107"/>
|
<location filename="printviewwindow.cpp" line="112"/>
|
||||||
<source>Unreasonable value input!</source>
|
<source>Unreasonable value input!</source>
|
||||||
<translation>数值输入不合理!</translation>
|
<translation>数值输入不合理!</translation>
|
||||||
</message>
|
</message>
|
||||||
|
@ -88,6 +88,10 @@ QList<QVector3D> DxfHelper::expandPolygon(QList<QVector3D> polygon, float expand
|
|||||||
|
|
||||||
bool DxfHelper::generateDxf(const QString &fileName)
|
bool DxfHelper::generateDxf(const QString &fileName)
|
||||||
{
|
{
|
||||||
|
//获取引用块集合
|
||||||
|
QList<std::string> blockNameList;
|
||||||
|
getDxfReferenceBlocks(fileName,blockNameList);
|
||||||
|
|
||||||
// currentPos = QPointF(QRandomGenerator::global()->bounded(9999.99), QRandomGenerator::global()->bounded(9999.99));
|
// currentPos = QPointF(QRandomGenerator::global()->bounded(9999.99), QRandomGenerator::global()->bounded(9999.99));
|
||||||
currentPos = QPointF(9999.99, 9999.99);
|
currentPos = QPointF(9999.99, 9999.99);
|
||||||
vertexIndex = 0;
|
vertexIndex = 0;
|
||||||
@ -95,60 +99,64 @@ bool DxfHelper::generateDxf(const QString &fileName)
|
|||||||
dxfPaths.clear();
|
dxfPaths.clear();
|
||||||
|
|
||||||
DxfReader dxfReader(fileName);
|
DxfReader dxfReader(fileName);
|
||||||
for(auto d: dxfReader.dxfText) {
|
QList<BlockDatas> blockDataList = dxfReader.getBlockDatas();
|
||||||
//qDebug() << "text data:" << d.text.c_str() << d.angle << d.style.c_str() << d.height;
|
BlockDatas blockData;
|
||||||
|
//扫描判断哪个块的数据最多,其他块的数据全部不显示,只显示数据最多的块
|
||||||
|
for (int i = 0; i < blockDataList.size(); i++)
|
||||||
|
{
|
||||||
|
if(blockNameList.size() == 0)
|
||||||
|
{
|
||||||
|
blockData.dxfLines.append(blockDataList[i].dxfLines);
|
||||||
|
//blockData.dxfText.append(blockDataList[i].dxfText);
|
||||||
|
blockData.dxfArcs.append(blockDataList[i].dxfArcs);
|
||||||
|
blockData.dxfCircles.append(blockDataList[i].dxfCircles);
|
||||||
|
blockData.dxfEllipses.append(blockDataList[i].dxfEllipses);
|
||||||
|
blockData.dxfPolylines.append(blockDataList[i].dxfPolylines);
|
||||||
|
blockData.dxfPoints.append(blockDataList[i].dxfPoints);
|
||||||
|
blockData.dxfSplines.append(blockDataList[i].dxfSplines);
|
||||||
|
blockData.dxfVertexs.append(blockDataList[i].dxfVertexs);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if(blockNameList.contains(blockDataList[i].blockName) == true)
|
||||||
|
{
|
||||||
|
blockData.dxfLines.append(blockDataList[i].dxfLines);
|
||||||
|
//blockData.dxfText.append(blockDataList[i].dxfText);
|
||||||
|
blockData.dxfArcs.append(blockDataList[i].dxfArcs);
|
||||||
|
blockData.dxfCircles.append(blockDataList[i].dxfCircles);
|
||||||
|
blockData.dxfEllipses.append(blockDataList[i].dxfEllipses);
|
||||||
|
blockData.dxfPolylines.append(blockDataList[i].dxfPolylines);
|
||||||
|
blockData.dxfPoints.append(blockDataList[i].dxfPoints);
|
||||||
|
blockData.dxfSplines.append(blockDataList[i].dxfSplines);
|
||||||
|
blockData.dxfVertexs.append(blockDataList[i].dxfVertexs);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
for(auto d: dxfReader.dxfLinetypes) {
|
for(auto d: blockData.dxfText)
|
||||||
//qDebug() << "linetypes data:" << d.name.c_str() << d.flags << d.pattern << d.description.c_str() << d.patternLength << d.numberOfDashes;
|
{
|
||||||
|
qDebug() << "text data:" << d.text.c_str() << d.angle << d.style.c_str() << d.height;
|
||||||
|
}
|
||||||
|
|
||||||
|
for(auto d: dxfReader.dxfLinetypes)
|
||||||
|
{
|
||||||
|
qDebug() << "linetypes data:" << d.name.c_str() << d.flags << d.pattern << d.description.c_str() << d.patternLength << d.numberOfDashes;
|
||||||
}
|
}
|
||||||
|
|
||||||
QVector<QPointF> linepath;
|
QVector<QPointF> linepath;
|
||||||
for(auto d: dxfReader.dxfLines) {
|
for(auto d: blockData.dxfLines)
|
||||||
|
{
|
||||||
//qDebug() << "line data:" << d.x1 << d.y1 << d.z1 << "," << d.x2 << d.y2 << d.z2;
|
//qDebug() << "line data:" << d.x1 << d.y1 << d.z1 << "," << d.x2 << d.y2 << d.z2;
|
||||||
if(currentPos!=QPointF(d.x1, d.y1)) {
|
linepath.append(QPointF(d.x1, d.y1));
|
||||||
if(!linepath.isEmpty()) {
|
linepath.append(QPointF(d.x2, d.y2));
|
||||||
QList<QVector3D> linelist;
|
|
||||||
foreach(auto point, linepath) linelist.append(QVector3D(point));
|
|
||||||
linepath.clear();
|
|
||||||
linelist = expandPolygon(linelist, expandOffset);
|
|
||||||
foreach(QVector3D point, linelist) {
|
|
||||||
double x = point.x();
|
|
||||||
double y = point.y();
|
|
||||||
linepath.append(QPointF(x, y));
|
|
||||||
currentPos = QPointF(x, y);
|
|
||||||
}
|
|
||||||
dxfPaths.append(linepath);
|
|
||||||
linepath.clear();
|
|
||||||
}
|
|
||||||
linepath.append(QPointF(d.x1, d.y1));
|
|
||||||
linepath.append(QPointF(d.x2, d.y2));
|
|
||||||
currentPos = QPointF(d.x2, d.y2);
|
|
||||||
} else {
|
|
||||||
linepath.append(QPointF(d.x2, d.y2));
|
|
||||||
currentPos = QPointF(d.x2, d.y2);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if(!linepath.isEmpty()) {
|
|
||||||
QList<QVector3D> linelist;
|
|
||||||
foreach(auto point, linepath) linelist.append(QVector3D(point));
|
|
||||||
linepath.clear();
|
|
||||||
linelist = expandPolygon(linelist, expandOffset);
|
|
||||||
foreach(QVector3D point, linelist) {
|
|
||||||
double x = point.x();
|
|
||||||
double y = point.y();
|
|
||||||
linepath.append(QPointF(x, y));
|
|
||||||
currentPos = QPointF(x, y);
|
|
||||||
}
|
|
||||||
dxfPaths.append(linepath);
|
dxfPaths.append(linepath);
|
||||||
linepath.clear();
|
linepath.clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
for(auto d: blockData.dxfArcs)
|
||||||
for(auto d: dxfReader.dxfArcs) {
|
{
|
||||||
//qDebug() << "arcs data:" << d.cx << d.cy << d.cz << d.angle1 << d.angle2 << d.radius;
|
//qDebug() << "arcs data:" << d.cx << d.cy << d.cz << d.angle1 << d.angle2 << d.radius;
|
||||||
|
|
||||||
|
|
||||||
double cx = d.cx;
|
double cx = d.cx;
|
||||||
double cy = d.cy;
|
double cy = d.cy;
|
||||||
// double cz = d.cz;
|
// double cz = d.cz;
|
||||||
@ -158,7 +166,6 @@ bool DxfHelper::generateDxf(const QString &fileName)
|
|||||||
|
|
||||||
radius = radius + expandOffset;
|
radius = radius + expandOffset;
|
||||||
|
|
||||||
|
|
||||||
QPainterPath path;
|
QPainterPath path;
|
||||||
double startXPos = cx + cos(abs(angle1)*M_PI/180)*radius;
|
double startXPos = cx + cos(abs(angle1)*M_PI/180)*radius;
|
||||||
double startYPos = cy + sin(abs(angle1)*M_PI/180)*radius;
|
double startYPos = cy + sin(abs(angle1)*M_PI/180)*radius;
|
||||||
@ -187,10 +194,10 @@ bool DxfHelper::generateDxf(const QString &fileName)
|
|||||||
// dxfPathList.append(path);
|
// dxfPathList.append(path);
|
||||||
}
|
}
|
||||||
|
|
||||||
for(auto d: dxfReader.dxfCircles) {
|
for(auto d: blockData.dxfCircles)
|
||||||
|
{
|
||||||
//qDebug() << "circle data:" << d.cx << d.cy << d.cz << d.radius;
|
//qDebug() << "circle data:" << d.cx << d.cy << d.cz << d.radius;
|
||||||
|
|
||||||
|
|
||||||
double cx = d.cx;
|
double cx = d.cx;
|
||||||
double cy = d.cy;
|
double cy = d.cy;
|
||||||
// double cz = d.cz;
|
// double cz = d.cz;
|
||||||
@ -198,7 +205,6 @@ bool DxfHelper::generateDxf(const QString &fileName)
|
|||||||
|
|
||||||
radius = radius + expandOffset;
|
radius = radius + expandOffset;
|
||||||
|
|
||||||
|
|
||||||
QPainterPath path;
|
QPainterPath path;
|
||||||
path.moveTo(cx+radius, cy);
|
path.moveTo(cx+radius, cy);
|
||||||
path.arcTo(cx-radius, cy-radius, 2*radius, 2*radius, 0, 360);
|
path.arcTo(cx-radius, cy-radius, 2*radius, 2*radius, 0, 360);
|
||||||
@ -212,10 +218,11 @@ bool DxfHelper::generateDxf(const QString &fileName)
|
|||||||
currentPos=QPointF(x, y);
|
currentPos=QPointF(x, y);
|
||||||
}
|
}
|
||||||
dxfPaths.append(circlepath);
|
dxfPaths.append(circlepath);
|
||||||
// dxfPathList.append(path);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
for(auto d: dxfReader.dxfEllipses) { // 起点角度要×ratio
|
for(auto d: blockData.dxfEllipses)
|
||||||
|
{
|
||||||
|
// 起点角度要×ratio
|
||||||
//qDebug() << "ellipses data:" << d.cx << d.cy << d.cz << d.mx << d.my << d.mz << d.ratio << d.angle1 << d.angle2;
|
//qDebug() << "ellipses data:" << d.cx << d.cy << d.cz << d.mx << d.my << d.mz << d.ratio << d.angle1 << d.angle2;
|
||||||
|
|
||||||
double cx = d.cx;
|
double cx = d.cx;
|
||||||
@ -228,7 +235,6 @@ bool DxfHelper::generateDxf(const QString &fileName)
|
|||||||
double angle1 = d.angle1;
|
double angle1 = d.angle1;
|
||||||
double angle2 = d.angle2;
|
double angle2 = d.angle2;
|
||||||
|
|
||||||
|
|
||||||
double rab = sqrt((cx- mx)*(cx - mx) +(cy - my)*(cy - my));
|
double rab = sqrt((cx- mx)*(cx - mx) +(cy - my)*(cy - my));
|
||||||
double resy = (expandOffset*(my-cy))/rab + my;
|
double resy = (expandOffset*(my-cy))/rab + my;
|
||||||
double resx = (expandOffset*(mx-cx))/rab + mx;
|
double resx = (expandOffset*(mx-cx))/rab + mx;
|
||||||
@ -236,7 +242,6 @@ bool DxfHelper::generateDxf(const QString &fileName)
|
|||||||
mx = resx;
|
mx = resx;
|
||||||
my = resy;
|
my = resy;
|
||||||
|
|
||||||
|
|
||||||
QPainterPath path;
|
QPainterPath path;
|
||||||
double angle_1 = angle1;
|
double angle_1 = angle1;
|
||||||
double angle_2 = angle2;
|
double angle_2 = angle2;
|
||||||
@ -285,7 +290,8 @@ bool DxfHelper::generateDxf(const QString &fileName)
|
|||||||
path.arcTo(c_x-rx, c_y-ry, 2*rx, 2*ry, angleStart, anglePassed);
|
path.arcTo(c_x-rx, c_y-ry, 2*rx, 2*ry, angleStart, anglePassed);
|
||||||
|
|
||||||
QVector<QPointF> ellipsepath;
|
QVector<QPointF> ellipsepath;
|
||||||
for(double i = 0; i <= 1; i += 0.003) { // TODO: 步长随图片大小调整
|
for(double i = 0; i <= 1; i += 0.003)
|
||||||
|
{ // TODO: 步长随图片大小调整
|
||||||
QPointF point = path.pointAtPercent(i);
|
QPointF point = path.pointAtPercent(i);
|
||||||
double x = point.x();
|
double x = point.x();
|
||||||
double y = point.y();
|
double y = point.y();
|
||||||
@ -293,18 +299,18 @@ bool DxfHelper::generateDxf(const QString &fileName)
|
|||||||
currentPos=QPointF(x, y);
|
currentPos=QPointF(x, y);
|
||||||
}
|
}
|
||||||
dxfPaths.append(ellipsepath);
|
dxfPaths.append(ellipsepath);
|
||||||
// dxfPathList.append(path);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
for(auto d: dxfReader.dxfPolylines) {
|
for(auto d: blockData.dxfPolylines)
|
||||||
|
{
|
||||||
//qDebug() << "polylines data:" << d.m << d.n << d.flags << d.number << d.elevation;
|
//qDebug() << "polylines data:" << d.m << d.n << d.flags << d.number << d.elevation;
|
||||||
|
|
||||||
QList<QVector3D> pointlist;
|
QList<QVector3D> pointlist;
|
||||||
QVector<QPointF> path;
|
QVector<QPointF> path;
|
||||||
for(unsigned int i = 0; i < d.number; i++) {
|
for(unsigned int i = 0; i < d.number; i++) {
|
||||||
double x = dxfReader.dxfVertexs.at(vertexIndex).x;
|
double x = blockData.dxfVertexs.at(vertexIndex).x;
|
||||||
double y = dxfReader.dxfVertexs.at(vertexIndex).y;
|
double y = blockData.dxfVertexs.at(vertexIndex).y;
|
||||||
double z = dxfReader.dxfVertexs.at(vertexIndex).z;
|
double z = blockData.dxfVertexs.at(vertexIndex).z;
|
||||||
pointlist.append(QVector3D(x, y, z));
|
pointlist.append(QVector3D(x, y, z));
|
||||||
vertexIndex++;
|
vertexIndex++;
|
||||||
}
|
}
|
||||||
@ -317,7 +323,7 @@ bool DxfHelper::generateDxf(const QString &fileName)
|
|||||||
currentPos = QPointF(x, y);
|
currentPos = QPointF(x, y);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(d.flags) {
|
if(d.flags && pointlist.size() > 0) {
|
||||||
double x = pointlist.first().x();
|
double x = pointlist.first().x();
|
||||||
double y = pointlist.first().y();
|
double y = pointlist.first().y();
|
||||||
path.append(QPointF(x, y));
|
path.append(QPointF(x, y));
|
||||||
@ -326,11 +332,50 @@ bool DxfHelper::generateDxf(const QString &fileName)
|
|||||||
dxfPaths.append(path);
|
dxfPaths.append(path);
|
||||||
}
|
}
|
||||||
|
|
||||||
// for(auto d: dxfReader.dxfVertexs) {
|
QVector<QPointF> path;
|
||||||
// qDebug() << "vertexs data:" << d.x << d.y << d.z << d.bulge;
|
for(int i = 0; i < blockData.dxfVertexs.size(); i++)
|
||||||
|
{
|
||||||
|
QPointF point;
|
||||||
|
//qDebug() << "vertexs data:" << d.x << d.y << d.z << d.bulge;
|
||||||
|
point.setX(blockData.dxfVertexs.at(i).x);
|
||||||
|
point.setY(blockData.dxfVertexs.at(i).y);
|
||||||
|
path.append(point);
|
||||||
|
|
||||||
|
if(path.size() == 2)
|
||||||
|
{
|
||||||
|
if(i+1 < blockData.dxfVertexs.size())
|
||||||
|
{
|
||||||
|
QPointF point1;
|
||||||
|
//qDebug() << "vertexs data:" << d.x << d.y << d.z << d.bulge;
|
||||||
|
point1.setX(blockData.dxfVertexs.at(i+1).x);
|
||||||
|
point1.setY(blockData.dxfVertexs.at(i+1).y);
|
||||||
|
if(point1 != point)
|
||||||
|
{
|
||||||
|
path.append(point1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
dxfPaths.append(path);
|
||||||
|
path.clear();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// for(auto d: blockData.dxfVertexs)
|
||||||
|
// {
|
||||||
|
// QPointF point;
|
||||||
|
// //qDebug() << "vertexs data:" << d.x << d.y << d.z << d.bulge;
|
||||||
|
// point.setX(d.x);
|
||||||
|
// point.setY(d.y);
|
||||||
|
// path.append(point);
|
||||||
|
|
||||||
|
// if(path.size() == 2)
|
||||||
|
// {
|
||||||
|
// dxfPaths.append(path);
|
||||||
|
// path.clear();
|
||||||
|
// }
|
||||||
// }
|
// }
|
||||||
|
|
||||||
for(auto d: dxfReader.dxfPoints) {
|
for(auto d: blockData.dxfPoints)
|
||||||
|
{
|
||||||
//qDebug() << "points data:" << d.x << d.y << d.z;
|
//qDebug() << "points data:" << d.x << d.y << d.z;
|
||||||
QVector<QPointF> path;
|
QVector<QPointF> path;
|
||||||
path.append(QPointF(d.x, d.y));
|
path.append(QPointF(d.x, d.y));
|
||||||
@ -338,32 +383,34 @@ bool DxfHelper::generateDxf(const QString &fileName)
|
|||||||
currentPos = QPointF(d.x, d.y);
|
currentPos = QPointF(d.x, d.y);
|
||||||
}
|
}
|
||||||
|
|
||||||
for(auto d: dxfReader.dxfSplines) {
|
// for(auto d: blockData.dxfSplines)
|
||||||
|
// {
|
||||||
//qDebug() << "splines data:" << d.nFit << d.flags << d.degree << d.nKnots << d.nControl << d.tangentEndX << d.tangentEndY << d.tangentEndZ << d.tangentStartX << d.tangentStartY << d.tangentStartZ;
|
//qDebug() << "splines data:" << d.nFit << d.flags << d.degree << d.nKnots << d.nControl << d.tangentEndX << d.tangentEndY << d.tangentEndZ << d.tangentStartX << d.tangentStartY << d.tangentStartZ;
|
||||||
std::vector<QVector2D> pointList;
|
// std::vector<QVector2D> pointList;
|
||||||
for(unsigned int i = 0; i < d.nControl; i++) {
|
// for(unsigned int i = 0; i < d.nControl; i++)
|
||||||
int x = dxfReader.dxfControlPoints.at(controlIndex).x;
|
// {
|
||||||
int y = dxfReader.dxfControlPoints.at(controlIndex).y;
|
// int x = blockData.dxfControlPoints.at(controlIndex).x;
|
||||||
pointList.push_back(QVector2D(x, y));
|
// int y = blockData.dxfControlPoints.at(controlIndex).y;
|
||||||
currentPos = QPointF(x, y);
|
// pointList.push_back(QVector2D(x, y));
|
||||||
controlIndex++;
|
// currentPos = QPointF(x, y);
|
||||||
}
|
// controlIndex++;
|
||||||
|
// }
|
||||||
|
|
||||||
QList<QVector3D> templist;
|
// QList<QVector3D> templist;
|
||||||
foreach(auto point, pointList) templist.append(point);
|
// foreach(auto point, pointList) templist.append(point);
|
||||||
templist = expandPolygon(templist, expandOffset);
|
// templist = expandPolygon(templist, expandOffset);
|
||||||
|
|
||||||
QVector<QVector2D> inputList;
|
// QVector<QVector2D> inputList;
|
||||||
foreach(auto point, templist) inputList.append(point.toVector2D());
|
// foreach(auto point, templist) inputList.append(point.toVector2D());
|
||||||
inputList.push_front(inputList.first());
|
// inputList.push_front(inputList.first());
|
||||||
inputList.push_back(inputList.back());
|
// inputList.push_back(inputList.back());
|
||||||
// std::vector<QVector2D> finalList(inputList.begin(), inputList.end());
|
// std::vector<QVector2D> finalList(inputList.begin(), inputList.end());
|
||||||
|
|
||||||
// SplineHelper splineHelper(finalList, TypeCubicBSpline);
|
// SplineHelper splineHelper(finalList, TypeCubicBSpline);
|
||||||
// auto splinePath = splineHelper.getSplinePath();
|
// auto splinePath = splineHelper.getSplinePath();
|
||||||
|
|
||||||
// dxfPaths.append(splinePath);
|
// dxfPaths.append(splinePath);
|
||||||
}
|
// }
|
||||||
|
|
||||||
// for(auto d: dxfReader.dxfControlPoints) {
|
// for(auto d: dxfReader.dxfControlPoints) {
|
||||||
// qDebug() << "control points data:" << d.w << d.x << d.y << d.z;
|
// qDebug() << "control points data:" << d.w << d.x << d.y << d.z;
|
||||||
@ -425,6 +472,23 @@ void DxfHelper::matchDXFSize()
|
|||||||
|
|
||||||
QImage DxfHelper::generateDXFImage()
|
QImage DxfHelper::generateDXFImage()
|
||||||
{
|
{
|
||||||
|
// //放大数据
|
||||||
|
// QVector<QVector<QPointF>> dxfPathscp;
|
||||||
|
// foreach (QVector<QPointF> path, dxfPaths)
|
||||||
|
// {
|
||||||
|
// QVector<QPointF> pathcp;
|
||||||
|
// for(int i = 0; i < path.length(); i++)
|
||||||
|
// {
|
||||||
|
// QPointF point = path.at(i);
|
||||||
|
// double x = point.x()*10;
|
||||||
|
// double y = point.y()*10;
|
||||||
|
// pathcp.append(QPointF(x,y));
|
||||||
|
// }
|
||||||
|
// dxfPathscp.append(pathcp);
|
||||||
|
// }
|
||||||
|
// dxfPaths.clear();
|
||||||
|
// dxfPaths = dxfPathscp;
|
||||||
|
|
||||||
matchDXFSize();
|
matchDXFSize();
|
||||||
double minx = dxfBorderList.at(0);
|
double minx = dxfBorderList.at(0);
|
||||||
double miny = dxfBorderList.at(1);
|
double miny = dxfBorderList.at(1);
|
||||||
@ -464,6 +528,82 @@ QList<double> DxfHelper::getDxfBorderList() const
|
|||||||
return dxfBorderList;
|
return dxfBorderList;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool DxfHelper::getDxfReferenceBlocks(const QString &fileName, QList<std::string> &blockNameList)
|
||||||
|
{
|
||||||
|
blockNameList.clear();
|
||||||
|
QFile file(fileName);
|
||||||
|
if (!file.open(QIODevice::ReadOnly | QIODevice::Text))
|
||||||
|
{
|
||||||
|
qDebug() << "Failed to open file:" << fileName;
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
int addFlag = 0;
|
||||||
|
int blockFlag = 0;
|
||||||
|
int getFlag = 0;
|
||||||
|
int endFlag = 0;
|
||||||
|
QTextStream in(&file);
|
||||||
|
while (!in.atEnd())
|
||||||
|
{
|
||||||
|
std::string line = in.readLine().remove(QRegExp("\\s")).toStdString();
|
||||||
|
|
||||||
|
// 处理每一行数据
|
||||||
|
if(line == "AcDbBlockReference")//块被引用的标志
|
||||||
|
{
|
||||||
|
addFlag = 1;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
if(addFlag == 1)
|
||||||
|
{
|
||||||
|
if(line == "AcDbBlockBegin")//块开始标志
|
||||||
|
{
|
||||||
|
blockFlag = 1;
|
||||||
|
endFlag = 0;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
if(blockFlag == 1)
|
||||||
|
{
|
||||||
|
if(line == "2")//下一行为块名称
|
||||||
|
{
|
||||||
|
getFlag = 1;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
if(getFlag == 1)//块名称
|
||||||
|
{
|
||||||
|
if(blockNameList.contains(line) == false)
|
||||||
|
//if(!line.empty() && line[0] != '*')
|
||||||
|
{
|
||||||
|
blockNameList.append(line);
|
||||||
|
}
|
||||||
|
getFlag = 0;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if(line == "AcDbBlockEnd")//块结束标志
|
||||||
|
{
|
||||||
|
blockFlag = 0;
|
||||||
|
endFlag = 1;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if(endFlag == 0 && addFlag == 1)
|
||||||
|
{
|
||||||
|
if(blockNameList.size() > 0)
|
||||||
|
{
|
||||||
|
blockNameList.removeLast();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
file.close();
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
QSize DxfHelper::getImageSize() const
|
QSize DxfHelper::getImageSize() const
|
||||||
{
|
{
|
||||||
return imageSize;
|
return imageSize;
|
||||||
|
@ -91,7 +91,10 @@ public:
|
|||||||
QList<QPainterPath> getDxfPathList() const;
|
QList<QPainterPath> getDxfPathList() const;
|
||||||
QSize getImageSize() const;
|
QSize getImageSize() const;
|
||||||
QList<double> getDxfBorderList() const;
|
QList<double> getDxfBorderList() const;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
bool getDxfReferenceBlocks(const QString &fileName,QList<std::string> &blockNameList);
|
||||||
|
|
||||||
QPointF currentPos;
|
QPointF currentPos;
|
||||||
unsigned int vertexIndex = 0;
|
unsigned int vertexIndex = 0;
|
||||||
unsigned int controlIndex = 0;
|
unsigned int controlIndex = 0;
|
||||||
|
@ -36,21 +36,11 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
#endif // _MSC_VER > 1000
|
#endif // _MSC_VER > 1000
|
||||||
|
|
||||||
//#if defined(__OS2__)||defined(__EMX__)
|
#if defined(__OS2__)||defined(__EMX__)
|
||||||
//#define strcasecmp(s,t) stricmp(s,t)
|
#define strcasecmp(s,t) stricmp(s,t)
|
||||||
//#endif
|
|
||||||
|
|
||||||
//#if defined(_WIN32)
|
|
||||||
//#define strcasecmp(s,t) _stricmp(s,t)
|
|
||||||
//#endif
|
|
||||||
|
|
||||||
|
|
||||||
#ifdef _WIN32
|
|
||||||
#undef M_PI
|
|
||||||
#define M_PI 3.14159265358979323846
|
|
||||||
//#pragma warning(disable : 4800)
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
#ifndef M_PI
|
#ifndef M_PI
|
||||||
#define M_PI 3.1415926535897932384626433832795
|
#define M_PI 3.1415926535897932384626433832795
|
||||||
#endif
|
#endif
|
||||||
@ -501,7 +491,7 @@ const double dxfColors[][3] = {
|
|||||||
// Flags
|
// Flags
|
||||||
#define DL_OPEN_PLINE 0x00
|
#define DL_OPEN_PLINE 0x00
|
||||||
#define DL_CLOSED_PLINE 0x01
|
#define DL_CLOSED_PLINE 0x01
|
||||||
#define DL_POLYLINE3D 0x80
|
#define DL_POLYLINE3D 0x08
|
||||||
#define DL_PFACE_MESH 0x40
|
#define DL_PFACE_MESH 0x40
|
||||||
#define DL_PGON_MESH 0x10
|
#define DL_PGON_MESH 0x10
|
||||||
// Vertices follow entity, required in POLYLINES
|
// Vertices follow entity, required in POLYLINES
|
||||||
|
@ -82,7 +82,7 @@ public:
|
|||||||
virtual void addDimDiametric(const DL_DimensionData&,
|
virtual void addDimDiametric(const DL_DimensionData&,
|
||||||
const DL_DimDiametricData&) {}
|
const DL_DimDiametricData&) {}
|
||||||
virtual void addDimAngular(const DL_DimensionData&,
|
virtual void addDimAngular(const DL_DimensionData&,
|
||||||
const DL_DimAngularData&) {}
|
const DL_DimAngular2LData&) {}
|
||||||
virtual void addDimAngular3P(const DL_DimensionData&,
|
virtual void addDimAngular3P(const DL_DimensionData&,
|
||||||
const DL_DimAngular3PData&) {}
|
const DL_DimAngular3PData&) {}
|
||||||
virtual void addDimOrdinate(const DL_DimensionData&,
|
virtual void addDimOrdinate(const DL_DimensionData&,
|
||||||
|
@ -191,7 +191,7 @@ public:
|
|||||||
* Called for every angular dimension (2 lines version) entity.
|
* Called for every angular dimension (2 lines version) entity.
|
||||||
*/
|
*/
|
||||||
virtual void addDimAngular(const DL_DimensionData& data,
|
virtual void addDimAngular(const DL_DimensionData& data,
|
||||||
const DL_DimAngularData& edata) = 0;
|
const DL_DimAngular2LData& edata) = 0;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Called for every angular dimension (3 points version) entity.
|
* Called for every angular dimension (3 points version) entity.
|
||||||
|
@ -129,14 +129,14 @@ bool DL_Dxf::in(const std::string& file, DL_CreationInterface* creationInterface
|
|||||||
/**
|
/**
|
||||||
* Reads a DXF file from an existing stream.
|
* Reads a DXF file from an existing stream.
|
||||||
*
|
*
|
||||||
* @param stream The string stream.
|
* @param stream The input stream.
|
||||||
* @param creationInterface
|
* @param creationInterface
|
||||||
* Pointer to the class which takes care of the entities in the file.
|
* Pointer to the class which takes care of the entities in the file.
|
||||||
*
|
*
|
||||||
* @retval true If \p file could be opened.
|
* @retval true If \p file could be opened.
|
||||||
* @retval false If \p file could not be opened.
|
* @retval false If \p file could not be opened.
|
||||||
*/
|
*/
|
||||||
bool DL_Dxf::in(std::stringstream& stream,
|
bool DL_Dxf::in(std::istream& stream,
|
||||||
DL_CreationInterface* creationInterface) {
|
DL_CreationInterface* creationInterface) {
|
||||||
|
|
||||||
if (stream.good()) {
|
if (stream.good()) {
|
||||||
@ -193,9 +193,9 @@ bool DL_Dxf::readDxfGroups(FILE *fp, DL_CreationInterface* creationInterface) {
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Same as above but for stringstreams.
|
* Same as above but for input streams.
|
||||||
*/
|
*/
|
||||||
bool DL_Dxf::readDxfGroups(std::stringstream& stream,
|
bool DL_Dxf::readDxfGroups(std::istream& stream,
|
||||||
DL_CreationInterface* creationInterface) {
|
DL_CreationInterface* creationInterface) {
|
||||||
|
|
||||||
static int line = 1;
|
static int line = 1;
|
||||||
@ -263,10 +263,10 @@ bool DL_Dxf::getStrippedLine(std::string& s, unsigned int size, FILE *fp, bool s
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Same as above but for stringstreams.
|
* Same as above but for input streams.
|
||||||
*/
|
*/
|
||||||
bool DL_Dxf::getStrippedLine(std::string &s, unsigned int size,
|
bool DL_Dxf::getStrippedLine(std::string &s, unsigned int size,
|
||||||
std::stringstream& stream, bool stripSpace) {
|
std::istream& stream, bool stripSpace) {
|
||||||
|
|
||||||
if (!stream.eof()) {
|
if (!stream.eof()) {
|
||||||
// Only the useful part of the line
|
// Only the useful part of the line
|
||||||
@ -925,8 +925,6 @@ void DL_Dxf::endBlock(DL_CreationInterface* creationInterface) {
|
|||||||
creationInterface->endBlock();
|
creationInterface->endBlock();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
void DL_Dxf::addTextStyle(DL_CreationInterface* creationInterface) {
|
void DL_Dxf::addTextStyle(DL_CreationInterface* creationInterface) {
|
||||||
std::string name = getStringValue(2, "");
|
std::string name = getStringValue(2, "");
|
||||||
if (name.length()==0) {
|
if (name.length()==0) {
|
||||||
@ -979,8 +977,7 @@ void DL_Dxf::addLine(DL_CreationInterface* creationInterface) {
|
|||||||
getRealValue(11, 0.0),
|
getRealValue(11, 0.0),
|
||||||
getRealValue(21, 0.0),
|
getRealValue(21, 0.0),
|
||||||
getRealValue(31, 0.0));
|
getRealValue(31, 0.0));
|
||||||
|
creationInterface->addLine(d);
|
||||||
creationInterface->addLine(d);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -1448,10 +1445,10 @@ bool DL_Dxf::handleLWPolylineData(DL_CreationInterface* /*creationInterface*/) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (groupCode<=30) {
|
if (groupCode<=30) {
|
||||||
if (vertexIndex>=0 && vertexIndex<maxVertices) {
|
if (vertexIndex>=0 && vertexIndex<maxVertices && vertexIndex>=0) {
|
||||||
vertices[4*vertexIndex + (groupCode/10-1)] = toReal(groupValue);
|
vertices[4*vertexIndex + (groupCode/10-1)] = toReal(groupValue);
|
||||||
}
|
}
|
||||||
} else if (groupCode==42 && vertexIndex<maxVertices) {
|
} else if (groupCode==42 && vertexIndex<maxVertices && vertexIndex>=0) {
|
||||||
vertices[4*vertexIndex + 3] = toReal(groupValue);
|
vertices[4*vertexIndex + 3] = toReal(groupValue);
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
@ -1735,7 +1732,7 @@ void DL_Dxf::addAttribute(DL_CreationInterface* creationInterface) {
|
|||||||
*/
|
*/
|
||||||
DL_DimensionData DL_Dxf::getDimData() {
|
DL_DimensionData DL_Dxf::getDimData() {
|
||||||
// generic dimension data:
|
// generic dimension data:
|
||||||
return DL_DimensionData(
|
DL_DimensionData ret(
|
||||||
// def point
|
// def point
|
||||||
getRealValue(10, 0.0),
|
getRealValue(10, 0.0),
|
||||||
getRealValue(20, 0.0),
|
getRealValue(20, 0.0),
|
||||||
@ -1758,6 +1755,9 @@ DL_DimensionData DL_Dxf::getDimData() {
|
|||||||
getStringValue(3, ""),
|
getStringValue(3, ""),
|
||||||
// angle
|
// angle
|
||||||
getRealValue(53, 0.0));
|
getRealValue(53, 0.0));
|
||||||
|
ret.arrow1Flipped = getIntValue(74, 0)==1;
|
||||||
|
ret.arrow2Flipped = getIntValue(75, 0)==1;
|
||||||
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -1852,7 +1852,7 @@ void DL_Dxf::addDimAngular(DL_CreationInterface* creationInterface) {
|
|||||||
DL_DimensionData d = getDimData();
|
DL_DimensionData d = getDimData();
|
||||||
|
|
||||||
// angular dimension:
|
// angular dimension:
|
||||||
DL_DimAngularData da(
|
DL_DimAngular2LData da(
|
||||||
// definition point 1
|
// definition point 1
|
||||||
getRealValue(13, 0.0),
|
getRealValue(13, 0.0),
|
||||||
getRealValue(23, 0.0),
|
getRealValue(23, 0.0),
|
||||||
@ -2505,7 +2505,6 @@ void DL_Dxf::writeVertex(DL_WriterA& dw,
|
|||||||
if (version==DL_VERSION_2000) {
|
if (version==DL_VERSION_2000) {
|
||||||
dw.dxfReal(10, data.x);
|
dw.dxfReal(10, data.x);
|
||||||
dw.dxfReal(20, data.y);
|
dw.dxfReal(20, data.y);
|
||||||
dw.dxfReal(30, data.z);
|
|
||||||
if (fabs(data.bulge)>1.0e-10) {
|
if (fabs(data.bulge)>1.0e-10) {
|
||||||
dw.dxfReal(42, data.bulge);
|
dw.dxfReal(42, data.bulge);
|
||||||
}
|
}
|
||||||
@ -2964,10 +2963,18 @@ void DL_Dxf::writeDimStyleOverrides(DL_WriterA& dw,
|
|||||||
dw.dxfString(1001, "ACAD");
|
dw.dxfString(1001, "ACAD");
|
||||||
dw.dxfString(1000, "DSTYLE");
|
dw.dxfString(1000, "DSTYLE");
|
||||||
dw.dxfString(1002, "{");
|
dw.dxfString(1002, "{");
|
||||||
|
|
||||||
|
if (data.type&128) {
|
||||||
|
// custom text position:
|
||||||
|
dw.dxfInt(1070, 279);
|
||||||
|
dw.dxfInt(1070, 2);
|
||||||
|
}
|
||||||
dw.dxfInt(1070, 144);
|
dw.dxfInt(1070, 144);
|
||||||
dw.dxfReal(1040, data.linearFactor);
|
dw.dxfReal(1040, data.linearFactor);
|
||||||
|
|
||||||
dw.dxfInt(1070,40);
|
dw.dxfInt(1070,40);
|
||||||
dw.dxfReal(1040, data.dimScale);
|
dw.dxfReal(1040, data.dimScale);
|
||||||
|
|
||||||
dw.dxfString(1002, "}");
|
dw.dxfString(1002, "}");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -3008,6 +3015,8 @@ void DL_Dxf::writeDimAligned(DL_WriterA& dw,
|
|||||||
if (version>DL_VERSION_R12) {
|
if (version>DL_VERSION_R12) {
|
||||||
dw.dxfInt(71, data.attachmentPoint);
|
dw.dxfInt(71, data.attachmentPoint);
|
||||||
dw.dxfInt(72, data.lineSpacingStyle); // opt
|
dw.dxfInt(72, data.lineSpacingStyle); // opt
|
||||||
|
dw.dxfInt(74, data.arrow1Flipped);
|
||||||
|
dw.dxfInt(75, data.arrow2Flipped);
|
||||||
dw.dxfReal(41, data.lineSpacingFactor); // opt
|
dw.dxfReal(41, data.lineSpacingFactor); // opt
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -3069,6 +3078,8 @@ void DL_Dxf::writeDimLinear(DL_WriterA& dw,
|
|||||||
if (version>DL_VERSION_R12) {
|
if (version>DL_VERSION_R12) {
|
||||||
dw.dxfInt(71, data.attachmentPoint);
|
dw.dxfInt(71, data.attachmentPoint);
|
||||||
dw.dxfInt(72, data.lineSpacingStyle); // opt
|
dw.dxfInt(72, data.lineSpacingStyle); // opt
|
||||||
|
dw.dxfInt(74, data.arrow1Flipped);
|
||||||
|
dw.dxfInt(75, data.arrow2Flipped);
|
||||||
dw.dxfReal(41, data.lineSpacingFactor); // opt
|
dw.dxfReal(41, data.lineSpacingFactor); // opt
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -3136,6 +3147,8 @@ void DL_Dxf::writeDimRadial(DL_WriterA& dw,
|
|||||||
if (version>DL_VERSION_R12) {
|
if (version>DL_VERSION_R12) {
|
||||||
dw.dxfInt(71, data.attachmentPoint);
|
dw.dxfInt(71, data.attachmentPoint);
|
||||||
dw.dxfInt(72, data.lineSpacingStyle); // opt
|
dw.dxfInt(72, data.lineSpacingStyle); // opt
|
||||||
|
dw.dxfInt(74, data.arrow1Flipped);
|
||||||
|
//dw.dxfInt(75, data.arrow2Flipped);
|
||||||
dw.dxfReal(41, data.lineSpacingFactor); // opt
|
dw.dxfReal(41, data.lineSpacingFactor); // opt
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -3195,6 +3208,8 @@ void DL_Dxf::writeDimDiametric(DL_WriterA& dw,
|
|||||||
if (version>DL_VERSION_R12) {
|
if (version>DL_VERSION_R12) {
|
||||||
dw.dxfInt(71, data.attachmentPoint);
|
dw.dxfInt(71, data.attachmentPoint);
|
||||||
dw.dxfInt(72, data.lineSpacingStyle); // opt
|
dw.dxfInt(72, data.lineSpacingStyle); // opt
|
||||||
|
dw.dxfInt(74, data.arrow1Flipped);
|
||||||
|
dw.dxfInt(75, data.arrow2Flipped);
|
||||||
dw.dxfReal(41, data.lineSpacingFactor); // opt
|
dw.dxfReal(41, data.lineSpacingFactor); // opt
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -3227,9 +3242,9 @@ void DL_Dxf::writeDimDiametric(DL_WriterA& dw,
|
|||||||
* @param data Specific angular dimension data from the file
|
* @param data Specific angular dimension data from the file
|
||||||
* @param attrib Attributes
|
* @param attrib Attributes
|
||||||
*/
|
*/
|
||||||
void DL_Dxf::writeDimAngular(DL_WriterA& dw,
|
void DL_Dxf::writeDimAngular2L(DL_WriterA& dw,
|
||||||
const DL_DimensionData& data,
|
const DL_DimensionData& data,
|
||||||
const DL_DimAngularData& edata,
|
const DL_DimAngular2LData& edata,
|
||||||
const DL_Attributes& attrib) {
|
const DL_Attributes& attrib) {
|
||||||
|
|
||||||
dw.entity("DIMENSION");
|
dw.entity("DIMENSION");
|
||||||
@ -3254,6 +3269,8 @@ void DL_Dxf::writeDimAngular(DL_WriterA& dw,
|
|||||||
if (version>DL_VERSION_R12) {
|
if (version>DL_VERSION_R12) {
|
||||||
dw.dxfInt(71, data.attachmentPoint);
|
dw.dxfInt(71, data.attachmentPoint);
|
||||||
dw.dxfInt(72, data.lineSpacingStyle); // opt
|
dw.dxfInt(72, data.lineSpacingStyle); // opt
|
||||||
|
dw.dxfInt(74, data.arrow1Flipped);
|
||||||
|
dw.dxfInt(75, data.arrow2Flipped);
|
||||||
dw.dxfReal(41, data.lineSpacingFactor); // opt
|
dw.dxfReal(41, data.lineSpacingFactor); // opt
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -3321,6 +3338,8 @@ void DL_Dxf::writeDimAngular3P(DL_WriterA& dw,
|
|||||||
if (version>DL_VERSION_R12) {
|
if (version>DL_VERSION_R12) {
|
||||||
dw.dxfInt(71, data.attachmentPoint);
|
dw.dxfInt(71, data.attachmentPoint);
|
||||||
dw.dxfInt(72, data.lineSpacingStyle); // opt
|
dw.dxfInt(72, data.lineSpacingStyle); // opt
|
||||||
|
dw.dxfInt(74, data.arrow1Flipped);
|
||||||
|
dw.dxfInt(75, data.arrow2Flipped);
|
||||||
dw.dxfReal(41, data.lineSpacingFactor); // opt
|
dw.dxfReal(41, data.lineSpacingFactor); // opt
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -3390,6 +3409,8 @@ void DL_Dxf::writeDimOrdinate(DL_WriterA& dw,
|
|||||||
if (version>DL_VERSION_R12) {
|
if (version>DL_VERSION_R12) {
|
||||||
dw.dxfInt(71, data.attachmentPoint);
|
dw.dxfInt(71, data.attachmentPoint);
|
||||||
dw.dxfInt(72, data.lineSpacingStyle); // opt
|
dw.dxfInt(72, data.lineSpacingStyle); // opt
|
||||||
|
//dw.dxfInt(74, data.arrow1Flipped);
|
||||||
|
//dw.dxfInt(75, data.arrow2Flipped);
|
||||||
dw.dxfReal(41, data.lineSpacingFactor); // opt
|
dw.dxfReal(41, data.lineSpacingFactor); // opt
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -3460,6 +3481,18 @@ void DL_Dxf::writeLeaderVertex(DL_WriterA& dw,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void DL_Dxf::writeLeaderEnd(DL_WriterA& dw,
|
||||||
|
const DL_LeaderData& data) {
|
||||||
|
if (version==DL_VERSION_2000) {
|
||||||
|
dw.dxfString(1001, "ACAD");
|
||||||
|
dw.dxfString(1000, "DSTYLE");
|
||||||
|
dw.dxfString(1002, "{");
|
||||||
|
dw.dxfInt(1070,40);
|
||||||
|
dw.dxfReal(1040, data.dimScale);
|
||||||
|
dw.dxfString(1002, "}");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -3664,7 +3697,7 @@ void DL_Dxf::writeHatchEdge(DL_WriterA& dw,
|
|||||||
*
|
*
|
||||||
* @return IMAGEDEF handle. Needed for the IMAGEDEF counterpart.
|
* @return IMAGEDEF handle. Needed for the IMAGEDEF counterpart.
|
||||||
*/
|
*/
|
||||||
int DL_Dxf::writeImage(DL_WriterA& dw,
|
unsigned long DL_Dxf::writeImage(DL_WriterA& dw,
|
||||||
const DL_ImageData& data,
|
const DL_ImageData& data,
|
||||||
const DL_Attributes& attrib) {
|
const DL_Attributes& attrib) {
|
||||||
|
|
||||||
@ -3704,8 +3737,7 @@ int DL_Dxf::writeImage(DL_WriterA& dw,
|
|||||||
dw.dxfReal(23, data.height);
|
dw.dxfReal(23, data.height);
|
||||||
|
|
||||||
// handle of IMAGEDEF object
|
// handle of IMAGEDEF object
|
||||||
int handle = dw.incHandle();
|
unsigned long handle = dw.handle(340);
|
||||||
dw.dxfHex(340, handle);
|
|
||||||
|
|
||||||
// flags
|
// flags
|
||||||
dw.dxfInt(70, 15);
|
dw.dxfInt(70, 15);
|
||||||
@ -4162,7 +4194,7 @@ void DL_Dxf::writeUcs(DL_WriterA& dw) {
|
|||||||
*/
|
*/
|
||||||
void DL_Dxf::writeDimStyle(DL_WriterA& dw,
|
void DL_Dxf::writeDimStyle(DL_WriterA& dw,
|
||||||
double dimasz, double dimexe, double dimexo,
|
double dimasz, double dimexe, double dimexo,
|
||||||
double dimgap, double dimtxt) {
|
double dimgap, double dimtxt, int dimtad, bool dimtih) {
|
||||||
|
|
||||||
dw.dxfString( 0, "TABLE");
|
dw.dxfString( 0, "TABLE");
|
||||||
dw.dxfString( 2, "DIMSTYLE");
|
dw.dxfString( 2, "DIMSTYLE");
|
||||||
@ -4212,13 +4244,15 @@ void DL_Dxf::writeDimStyle(DL_WriterA& dw,
|
|||||||
dw.dxfInt( 71, 0);
|
dw.dxfInt( 71, 0);
|
||||||
dw.dxfInt( 72, 0);
|
dw.dxfInt( 72, 0);
|
||||||
}
|
}
|
||||||
dw.dxfInt( 73, 0);
|
// DIMTIH:
|
||||||
|
dw.dxfInt( 73, (int)dimtih);
|
||||||
dw.dxfInt( 74, 0);
|
dw.dxfInt( 74, 0);
|
||||||
if (version==DL_VERSION_R12) {
|
if (version==DL_VERSION_R12) {
|
||||||
dw.dxfInt( 75, 0);
|
dw.dxfInt( 75, 0);
|
||||||
dw.dxfInt( 76, 0);
|
dw.dxfInt( 76, 0);
|
||||||
}
|
}
|
||||||
dw.dxfInt( 77, 1);
|
// DIMTAD:
|
||||||
|
dw.dxfInt( 77, dimtad);
|
||||||
dw.dxfInt( 78, 8);
|
dw.dxfInt( 78, 8);
|
||||||
dw.dxfReal(140, dimtxt);
|
dw.dxfReal(140, dimtxt);
|
||||||
dw.dxfReal(141, 2.5);
|
dw.dxfReal(141, 2.5);
|
||||||
@ -4353,7 +4387,6 @@ void DL_Dxf::writeObjects(DL_WriterA& dw, const std::string& appDictionaryName)
|
|||||||
dw.dxfString( 0, "SECTION");
|
dw.dxfString( 0, "SECTION");
|
||||||
dw.dxfString( 2, "OBJECTS");
|
dw.dxfString( 2, "OBJECTS");
|
||||||
|
|
||||||
|
|
||||||
dw.dxfString( 0, "DICTIONARY");
|
dw.dxfString( 0, "DICTIONARY");
|
||||||
dw.dxfHex(5, 0xC);
|
dw.dxfHex(5, 0xC);
|
||||||
dw.dxfString(100, "AcDbDictionary");
|
dw.dxfString(100, "AcDbDictionary");
|
||||||
@ -4703,12 +4736,9 @@ void DL_Dxf::writeAppDictionary(DL_WriterA& dw) {
|
|||||||
dw.dxfInt(281, 1);
|
dw.dxfInt(281, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
int DL_Dxf::writeDictionaryEntry(DL_WriterA& dw, const std::string& name) {
|
unsigned long DL_Dxf::writeDictionaryEntry(DL_WriterA& dw, const std::string& name) {
|
||||||
dw.dxfString( 3, name);
|
dw.dxfString( 3, name);
|
||||||
int handle = dw.getNextHandle();
|
return dw.handle(350);
|
||||||
dw.dxfHex(350, handle);
|
|
||||||
dw.incHandle();
|
|
||||||
return handle;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void DL_Dxf::writeXRecord(DL_WriterA& dw, int handle, int value) {
|
void DL_Dxf::writeXRecord(DL_WriterA& dw, int handle, int value) {
|
||||||
@ -4774,427 +4804,427 @@ bool DL_Dxf::checkVariable(const char* var, DL_Codes::version version) {
|
|||||||
return true;
|
return true;
|
||||||
} else if (version==DL_VERSION_R12) {
|
} else if (version==DL_VERSION_R12) {
|
||||||
// these are all the variables recognized by dxf r12:
|
// these are all the variables recognized by dxf r12:
|
||||||
if (!strcmp(var, "$ACADVER")) {
|
if (!strcmp(var, "ACADVER")) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
if (!strcmp(var, "$ACADVER")) {
|
if (!strcmp(var, "ACADVER")) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
if (!strcmp(var, "$ANGBASE")) {
|
if (!strcmp(var, "ANGBASE")) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
if (!strcmp(var, "$ANGDIR")) {
|
if (!strcmp(var, "ANGDIR")) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
if (!strcmp(var, "$ATTDIA")) {
|
if (!strcmp(var, "ATTDIA")) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
if (!strcmp(var, "$ATTMODE")) {
|
if (!strcmp(var, "ATTMODE")) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
if (!strcmp(var, "$ATTREQ")) {
|
if (!strcmp(var, "ATTREQ")) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
if (!strcmp(var, "$AUNITS")) {
|
if (!strcmp(var, "AUNITS")) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
if (!strcmp(var, "$AUPREC")) {
|
if (!strcmp(var, "AUPREC")) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
if (!strcmp(var, "$AXISMODE")) {
|
if (!strcmp(var, "AXISMODE")) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
if (!strcmp(var, "$AXISUNIT")) {
|
if (!strcmp(var, "AXISUNIT")) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
if (!strcmp(var, "$BLIPMODE")) {
|
if (!strcmp(var, "BLIPMODE")) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
if (!strcmp(var, "$CECOLOR")) {
|
if (!strcmp(var, "CECOLOR")) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
if (!strcmp(var, "$CELTYPE")) {
|
if (!strcmp(var, "CELTYPE")) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
if (!strcmp(var, "$CHAMFERA")) {
|
if (!strcmp(var, "CHAMFERA")) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
if (!strcmp(var, "$CHAMFERB")) {
|
if (!strcmp(var, "CHAMFERB")) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
if (!strcmp(var, "$CLAYER")) {
|
if (!strcmp(var, "CLAYER")) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
if (!strcmp(var, "$COORDS")) {
|
if (!strcmp(var, "COORDS")) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
if (!strcmp(var, "$DIMALT")) {
|
if (!strcmp(var, "DIMALT")) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
if (!strcmp(var, "$DIMALTD")) {
|
if (!strcmp(var, "DIMALTD")) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
if (!strcmp(var, "$DIMALTF")) {
|
if (!strcmp(var, "DIMALTF")) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
if (!strcmp(var, "$DIMAPOST")) {
|
if (!strcmp(var, "DIMAPOST")) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
if (!strcmp(var, "$DIMASO")) {
|
if (!strcmp(var, "DIMASO")) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
if (!strcmp(var, "$DIMASZ")) {
|
if (!strcmp(var, "DIMASZ")) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
if (!strcmp(var, "$DIMBLK")) {
|
if (!strcmp(var, "DIMBLK")) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
if (!strcmp(var, "$DIMBLK1")) {
|
if (!strcmp(var, "DIMBLK1")) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
if (!strcmp(var, "$DIMBLK2")) {
|
if (!strcmp(var, "DIMBLK2")) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
if (!strcmp(var, "$DIMCEN")) {
|
if (!strcmp(var, "DIMCEN")) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
if (!strcmp(var, "$DIMCLRD")) {
|
if (!strcmp(var, "DIMCLRD")) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
if (!strcmp(var, "$DIMCLRE")) {
|
if (!strcmp(var, "DIMCLRE")) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
if (!strcmp(var, "$DIMCLRT")) {
|
if (!strcmp(var, "DIMCLRT")) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
if (!strcmp(var, "$DIMDLE")) {
|
if (!strcmp(var, "DIMDLE")) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
if (!strcmp(var, "$DIMDLI")) {
|
if (!strcmp(var, "DIMDLI")) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
if (!strcmp(var, "$DIMEXE")) {
|
if (!strcmp(var, "DIMEXE")) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
if (!strcmp(var, "$DIMEXO")) {
|
if (!strcmp(var, "DIMEXO")) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
if (!strcmp(var, "$DIMGAP")) {
|
if (!strcmp(var, "DIMGAP")) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
if (!strcmp(var, "$DIMLFAC")) {
|
if (!strcmp(var, "DIMLFAC")) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
if (!strcmp(var, "$DIMLIM")) {
|
if (!strcmp(var, "DIMLIM")) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
if (!strcmp(var, "$DIMPOST")) {
|
if (!strcmp(var, "DIMPOST")) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
if (!strcmp(var, "$DIMRND")) {
|
if (!strcmp(var, "DIMRND")) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
if (!strcmp(var, "$DIMSAH")) {
|
if (!strcmp(var, "DIMSAH")) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
if (!strcmp(var, "$DIMSCALE")) {
|
if (!strcmp(var, "DIMSCALE")) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
if (!strcmp(var, "$DIMSE1")) {
|
if (!strcmp(var, "DIMSE1")) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
if (!strcmp(var, "$DIMSE2")) {
|
if (!strcmp(var, "DIMSE2")) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
if (!strcmp(var, "$DIMSHO")) {
|
if (!strcmp(var, "DIMSHO")) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
if (!strcmp(var, "$DIMSOXD")) {
|
if (!strcmp(var, "DIMSOXD")) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
if (!strcmp(var, "$DIMSTYLE")) {
|
if (!strcmp(var, "DIMSTYLE")) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
if (!strcmp(var, "$DIMTAD")) {
|
if (!strcmp(var, "DIMTAD")) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
if (!strcmp(var, "$DIMTFAC")) {
|
if (!strcmp(var, "DIMTFAC")) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
if (!strcmp(var, "$DIMTIH")) {
|
if (!strcmp(var, "DIMTIH")) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
if (!strcmp(var, "$DIMTIX")) {
|
if (!strcmp(var, "DIMTIX")) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
if (!strcmp(var, "$DIMTM")) {
|
if (!strcmp(var, "DIMTM")) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
if (!strcmp(var, "$DIMTOFL")) {
|
if (!strcmp(var, "DIMTOFL")) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
if (!strcmp(var, "$DIMTOH")) {
|
if (!strcmp(var, "DIMTOH")) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
if (!strcmp(var, "$DIMTOL")) {
|
if (!strcmp(var, "DIMTOL")) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
if (!strcmp(var, "$DIMTP")) {
|
if (!strcmp(var, "DIMTP")) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
if (!strcmp(var, "$DIMTSZ")) {
|
if (!strcmp(var, "DIMTSZ")) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
if (!strcmp(var, "$DIMTVP")) {
|
if (!strcmp(var, "DIMTVP")) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
if (!strcmp(var, "$DIMTXT")) {
|
if (!strcmp(var, "DIMTXT")) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
if (!strcmp(var, "$DIMZIN")) {
|
if (!strcmp(var, "DIMZIN")) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
if (!strcmp(var, "$DWGCODEPAGE")) {
|
if (!strcmp(var, "DWGCODEPAGE")) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
if (!strcmp(var, "$DRAGMODE")) {
|
if (!strcmp(var, "DRAGMODE")) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
if (!strcmp(var, "$ELEVATION")) {
|
if (!strcmp(var, "ELEVATION")) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
if (!strcmp(var, "$EXTMAX")) {
|
if (!strcmp(var, "EXTMAX")) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
if (!strcmp(var, "$EXTMIN")) {
|
if (!strcmp(var, "EXTMIN")) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
if (!strcmp(var, "$FILLETRAD")) {
|
if (!strcmp(var, "FILLETRAD")) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
if (!strcmp(var, "$FILLMODE")) {
|
if (!strcmp(var, "FILLMODE")) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
if (!strcmp(var, "$HANDLING")) {
|
if (!strcmp(var, "HANDLING")) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
if (!strcmp(var, "$HANDSEED")) {
|
if (!strcmp(var, "HANDSEED")) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
if (!strcmp(var, "$INSBASE")) {
|
if (!strcmp(var, "INSBASE")) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
if (!strcmp(var, "$LIMCHECK")) {
|
if (!strcmp(var, "LIMCHECK")) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
if (!strcmp(var, "$LIMMAX")) {
|
if (!strcmp(var, "LIMMAX")) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
if (!strcmp(var, "$LIMMIN")) {
|
if (!strcmp(var, "LIMMIN")) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
if (!strcmp(var, "$LTSCALE")) {
|
if (!strcmp(var, "LTSCALE")) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
if (!strcmp(var, "$LUNITS")) {
|
if (!strcmp(var, "LUNITS")) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
if (!strcmp(var, "$LUPREC")) {
|
if (!strcmp(var, "LUPREC")) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
if (!strcmp(var, "$MAXACTVP")) {
|
if (!strcmp(var, "MAXACTVP")) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
if (!strcmp(var, "$MENU")) {
|
if (!strcmp(var, "MENU")) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
if (!strcmp(var, "$MIRRTEXT")) {
|
if (!strcmp(var, "MIRRTEXT")) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
if (!strcmp(var, "$ORTHOMODE")) {
|
if (!strcmp(var, "ORTHOMODE")) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
if (!strcmp(var, "$OSMODE")) {
|
if (!strcmp(var, "OSMODE")) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
if (!strcmp(var, "$PDMODE")) {
|
if (!strcmp(var, "PDMODE")) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
if (!strcmp(var, "$PDSIZE")) {
|
if (!strcmp(var, "PDSIZE")) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
if (!strcmp(var, "$PELEVATION")) {
|
if (!strcmp(var, "PELEVATION")) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
if (!strcmp(var, "$PEXTMAX")) {
|
if (!strcmp(var, "PEXTMAX")) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
if (!strcmp(var, "$PEXTMIN")) {
|
if (!strcmp(var, "PEXTMIN")) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
if (!strcmp(var, "$PLIMCHECK")) {
|
if (!strcmp(var, "PLIMCHECK")) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
if (!strcmp(var, "$PLIMMAX")) {
|
if (!strcmp(var, "PLIMMAX")) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
if (!strcmp(var, "$PLIMMIN")) {
|
if (!strcmp(var, "PLIMMIN")) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
if (!strcmp(var, "$PLINEGEN")) {
|
if (!strcmp(var, "PLINEGEN")) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
if (!strcmp(var, "$PLINEWID")) {
|
if (!strcmp(var, "PLINEWID")) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
if (!strcmp(var, "$PSLTSCALE")) {
|
if (!strcmp(var, "PSLTSCALE")) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
if (!strcmp(var, "$PUCSNAME")) {
|
if (!strcmp(var, "PUCSNAME")) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
if (!strcmp(var, "$PUCSORG")) {
|
if (!strcmp(var, "PUCSORG")) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
if (!strcmp(var, "$PUCSXDIR")) {
|
if (!strcmp(var, "PUCSXDIR")) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
if (!strcmp(var, "$PUCSYDIR")) {
|
if (!strcmp(var, "PUCSYDIR")) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
if (!strcmp(var, "$QTEXTMODE")) {
|
if (!strcmp(var, "QTEXTMODE")) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
if (!strcmp(var, "$REGENMODE")) {
|
if (!strcmp(var, "REGENMODE")) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
if (!strcmp(var, "$SHADEDGE")) {
|
if (!strcmp(var, "SHADEDGE")) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
if (!strcmp(var, "$SHADEDIF")) {
|
if (!strcmp(var, "SHADEDIF")) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
if (!strcmp(var, "$SKETCHINC")) {
|
if (!strcmp(var, "SKETCHINC")) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
if (!strcmp(var, "$SKPOLY")) {
|
if (!strcmp(var, "SKPOLY")) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
if (!strcmp(var, "$SPLFRAME")) {
|
if (!strcmp(var, "SPLFRAME")) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
if (!strcmp(var, "$SPLINESEGS")) {
|
if (!strcmp(var, "SPLINESEGS")) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
if (!strcmp(var, "$SPLINETYPE")) {
|
if (!strcmp(var, "SPLINETYPE")) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
if (!strcmp(var, "$SURFTAB1")) {
|
if (!strcmp(var, "SURFTAB1")) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
if (!strcmp(var, "$SURFTAB2")) {
|
if (!strcmp(var, "SURFTAB2")) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
if (!strcmp(var, "$SURFTYPE")) {
|
if (!strcmp(var, "SURFTYPE")) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
if (!strcmp(var, "$SURFU")) {
|
if (!strcmp(var, "SURFU")) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
if (!strcmp(var, "$SURFV")) {
|
if (!strcmp(var, "SURFV")) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
if (!strcmp(var, "$TDCREATE")) {
|
if (!strcmp(var, "TDCREATE")) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
if (!strcmp(var, "$TDINDWG")) {
|
if (!strcmp(var, "TDINDWG")) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
if (!strcmp(var, "$TDUPDATE")) {
|
if (!strcmp(var, "TDUPDATE")) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
if (!strcmp(var, "$TDUSRTIMER")) {
|
if (!strcmp(var, "TDUSRTIMER")) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
if (!strcmp(var, "$TEXTSIZE")) {
|
if (!strcmp(var, "TEXTSIZE")) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
if (!strcmp(var, "$TEXTSTYLE")) {
|
if (!strcmp(var, "TEXTSTYLE")) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
if (!strcmp(var, "$THICKNESS")) {
|
if (!strcmp(var, "THICKNESS")) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
if (!strcmp(var, "$TILEMODE")) {
|
if (!strcmp(var, "TILEMODE")) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
if (!strcmp(var, "$TRACEWID")) {
|
if (!strcmp(var, "TRACEWID")) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
if (!strcmp(var, "$UCSNAME")) {
|
if (!strcmp(var, "UCSNAME")) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
if (!strcmp(var, "$UCSORG")) {
|
if (!strcmp(var, "UCSORG")) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
if (!strcmp(var, "$UCSXDIR")) {
|
if (!strcmp(var, "UCSXDIR")) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
if (!strcmp(var, "$UCSYDIR")) {
|
if (!strcmp(var, "UCSYDIR")) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
if (!strcmp(var, "$UNITMODE")) {
|
if (!strcmp(var, "UNITMODE")) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
if (!strcmp(var, "$USERI1")) {
|
if (!strcmp(var, "USERI1")) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
if (!strcmp(var, "$USERR1")) {
|
if (!strcmp(var, "USERR1")) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
if (!strcmp(var, "$USRTIMER")) {
|
if (!strcmp(var, "USRTIMER")) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
if (!strcmp(var, "$VISRETAIN")) {
|
if (!strcmp(var, "VISRETAIN")) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
if (!strcmp(var, "$WORLDVIEW")) {
|
if (!strcmp(var, "WORLDVIEW")) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
if (!strcmp(var, "$FASTZOOM")) {
|
if (!strcmp(var, "FASTZOOM")) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
if (!strcmp(var, "$GRIDMODE")) {
|
if (!strcmp(var, "GRIDMODE")) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
if (!strcmp(var, "$GRIDUNIT")) {
|
if (!strcmp(var, "GRIDUNIT")) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
if (!strcmp(var, "$SNAPANG")) {
|
if (!strcmp(var, "SNAPANG")) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
if (!strcmp(var, "$SNAPBASE")) {
|
if (!strcmp(var, "SNAPBASE")) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
if (!strcmp(var, "$SNAPISOPAIR")) {
|
if (!strcmp(var, "SNAPISOPAIR")) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
if (!strcmp(var, "$SNAPMODE")) {
|
if (!strcmp(var, "SNAPMODE")) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
if (!strcmp(var, "$SNAPSTYLE")) {
|
if (!strcmp(var, "SNAPSTYLE")) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
if (!strcmp(var, "$SNAPUNIT")) {
|
if (!strcmp(var, "SNAPUNIT")) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
if (!strcmp(var, "$VIEWCTR")) {
|
if (!strcmp(var, "VIEWCTR")) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
if (!strcmp(var, "$VIEWDIR")) {
|
if (!strcmp(var, "VIEWDIR")) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
if (!strcmp(var, "$VIEWSIZE")) {
|
if (!strcmp(var, "VIEWSIZE")) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
|
@ -57,11 +57,11 @@ class DL_CreationInterface;
|
|||||||
class DL_WriterA;
|
class DL_WriterA;
|
||||||
|
|
||||||
|
|
||||||
#define DL_VERSION "3.17.0.0"
|
#define DL_VERSION "3.26.4.0"
|
||||||
|
|
||||||
#define DL_VERSION_MAJOR 3
|
#define DL_VERSION_MAJOR 3
|
||||||
#define DL_VERSION_MINOR 17
|
#define DL_VERSION_MINOR 26
|
||||||
#define DL_VERSION_REV 0
|
#define DL_VERSION_REV 4
|
||||||
#define DL_VERSION_BUILD 0
|
#define DL_VERSION_BUILD 0
|
||||||
|
|
||||||
#define DL_UNKNOWN 0
|
#define DL_UNKNOWN 0
|
||||||
@ -131,12 +131,12 @@ public:
|
|||||||
static bool getStrippedLine(std::string& s, unsigned int size,
|
static bool getStrippedLine(std::string& s, unsigned int size,
|
||||||
FILE* stream, bool stripSpace = true);
|
FILE* stream, bool stripSpace = true);
|
||||||
|
|
||||||
bool readDxfGroups(std::stringstream& stream,
|
bool readDxfGroups(std::istream& stream,
|
||||||
DL_CreationInterface* creationInterface);
|
DL_CreationInterface* creationInterface);
|
||||||
bool in(std::stringstream &stream,
|
bool in(std::istream &stream,
|
||||||
DL_CreationInterface* creationInterface);
|
DL_CreationInterface* creationInterface);
|
||||||
static bool getStrippedLine(std::string& s, unsigned int size,
|
static bool getStrippedLine(std::string& s, unsigned int size,
|
||||||
std::stringstream& stream, bool stripSpace = true);
|
std::istream& stream, bool stripSpace = true);
|
||||||
|
|
||||||
static bool stripWhiteSpace(char** s, bool stripSpaces = true);
|
static bool stripWhiteSpace(char** s, bool stripSpaces = true);
|
||||||
|
|
||||||
@ -294,9 +294,9 @@ public:
|
|||||||
const DL_DimensionData& data,
|
const DL_DimensionData& data,
|
||||||
const DL_DimDiametricData& edata,
|
const DL_DimDiametricData& edata,
|
||||||
const DL_Attributes& attrib);
|
const DL_Attributes& attrib);
|
||||||
void writeDimAngular(DL_WriterA& dw,
|
void writeDimAngular2L(DL_WriterA& dw,
|
||||||
const DL_DimensionData& data,
|
const DL_DimensionData& data,
|
||||||
const DL_DimAngularData& edata,
|
const DL_DimAngular2LData& edata,
|
||||||
const DL_Attributes& attrib);
|
const DL_Attributes& attrib);
|
||||||
void writeDimAngular3P(DL_WriterA& dw,
|
void writeDimAngular3P(DL_WriterA& dw,
|
||||||
const DL_DimensionData& data,
|
const DL_DimensionData& data,
|
||||||
@ -311,6 +311,8 @@ public:
|
|||||||
const DL_Attributes& attrib);
|
const DL_Attributes& attrib);
|
||||||
void writeLeaderVertex(DL_WriterA& dw,
|
void writeLeaderVertex(DL_WriterA& dw,
|
||||||
const DL_LeaderVertexData& data);
|
const DL_LeaderVertexData& data);
|
||||||
|
void writeLeaderEnd(DL_WriterA& dw,
|
||||||
|
const DL_LeaderData& data);
|
||||||
void writeHatch1(DL_WriterA& dw,
|
void writeHatch1(DL_WriterA& dw,
|
||||||
const DL_HatchData& data,
|
const DL_HatchData& data,
|
||||||
const DL_Attributes& attrib);
|
const DL_Attributes& attrib);
|
||||||
@ -324,7 +326,7 @@ public:
|
|||||||
void writeHatchEdge(DL_WriterA& dw,
|
void writeHatchEdge(DL_WriterA& dw,
|
||||||
const DL_HatchEdgeData& data);
|
const DL_HatchEdgeData& data);
|
||||||
|
|
||||||
int writeImage(DL_WriterA& dw,
|
unsigned long writeImage(DL_WriterA& dw,
|
||||||
const DL_ImageData& data,
|
const DL_ImageData& data,
|
||||||
const DL_Attributes& attrib);
|
const DL_Attributes& attrib);
|
||||||
|
|
||||||
@ -350,12 +352,13 @@ public:
|
|||||||
void writeUcs(DL_WriterA& dw);
|
void writeUcs(DL_WriterA& dw);
|
||||||
void writeDimStyle(DL_WriterA& dw,
|
void writeDimStyle(DL_WriterA& dw,
|
||||||
double dimasz, double dimexe, double dimexo,
|
double dimasz, double dimexe, double dimexo,
|
||||||
double dimgap, double dimtxt);
|
double dimgap, double dimtxt,
|
||||||
|
int dimtad = 1, bool dimtih = false);
|
||||||
void writeBlockRecord(DL_WriterA& dw);
|
void writeBlockRecord(DL_WriterA& dw);
|
||||||
void writeBlockRecord(DL_WriterA& dw, const std::string& name);
|
void writeBlockRecord(DL_WriterA& dw, const std::string& name);
|
||||||
void writeObjects(DL_WriterA& dw, const std::string& appDictionaryName = "");
|
void writeObjects(DL_WriterA& dw, const std::string& appDictionaryName = "");
|
||||||
void writeAppDictionary(DL_WriterA& dw);
|
void writeAppDictionary(DL_WriterA& dw);
|
||||||
int writeDictionaryEntry(DL_WriterA& dw, const std::string& name);
|
unsigned long writeDictionaryEntry(DL_WriterA& dw, const std::string& name);
|
||||||
void writeXRecord(DL_WriterA& dw, int handle, int value);
|
void writeXRecord(DL_WriterA& dw, int handle, int value);
|
||||||
void writeXRecord(DL_WriterA& dw, int handle, double value);
|
void writeXRecord(DL_WriterA& dw, int handle, double value);
|
||||||
void writeXRecord(DL_WriterA& dw, int handle, bool value);
|
void writeXRecord(DL_WriterA& dw, int handle, bool value);
|
||||||
|
@ -156,7 +156,7 @@ struct DXFLIB_EXPORT DL_StyleData {
|
|||||||
italic(false) {
|
italic(false) {
|
||||||
}
|
}
|
||||||
|
|
||||||
bool operator==(const DL_StyleData& other) {
|
bool operator==(const DL_StyleData& other) const {
|
||||||
// ignore lastHeightUsed:
|
// ignore lastHeightUsed:
|
||||||
return (name==other.name &&
|
return (name==other.name &&
|
||||||
flags==other.flags &&
|
flags==other.flags &&
|
||||||
@ -1090,6 +1090,8 @@ struct DXFLIB_EXPORT DL_DimensionData {
|
|||||||
* Dimension scale (dimscale) style override.
|
* Dimension scale (dimscale) style override.
|
||||||
*/
|
*/
|
||||||
double dimScale;
|
double dimScale;
|
||||||
|
bool arrow1Flipped;
|
||||||
|
bool arrow2Flipped;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
@ -1238,12 +1240,12 @@ struct DXFLIB_EXPORT DL_DimDiametricData {
|
|||||||
/**
|
/**
|
||||||
* Angular Dimension Data.
|
* Angular Dimension Data.
|
||||||
*/
|
*/
|
||||||
struct DXFLIB_EXPORT DL_DimAngularData {
|
struct DXFLIB_EXPORT DL_DimAngular2LData {
|
||||||
/**
|
/**
|
||||||
* Constructor.
|
* Constructor.
|
||||||
* Parameters: see member variables.
|
* Parameters: see member variables.
|
||||||
*/
|
*/
|
||||||
DL_DimAngularData(double ddpx1, double ddpy1, double ddpz1,
|
DL_DimAngular2LData(double ddpx1, double ddpy1, double ddpz1,
|
||||||
double ddpx2, double ddpy2, double ddpz2,
|
double ddpx2, double ddpy2, double ddpz2,
|
||||||
double ddpx3, double ddpy3, double ddpz3,
|
double ddpx3, double ddpy3, double ddpz3,
|
||||||
double ddpx4, double ddpy4, double ddpz4) {
|
double ddpx4, double ddpy4, double ddpz4) {
|
||||||
@ -1320,21 +1322,21 @@ struct DXFLIB_EXPORT DL_DimAngular3PData {
|
|||||||
dpz3 = ddpz3;
|
dpz3 = ddpz3;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*! X Coordinate of definition point 1. */
|
/*! X Coordinate of definition point 1 (extension line 1 end). */
|
||||||
double dpx1;
|
double dpx1;
|
||||||
/*! Y Coordinate of definition point 1. */
|
/*! Y Coordinate of definition point 1. */
|
||||||
double dpy1;
|
double dpy1;
|
||||||
/*! Z Coordinate of definition point 1. */
|
/*! Z Coordinate of definition point 1. */
|
||||||
double dpz1;
|
double dpz1;
|
||||||
|
|
||||||
/*! X Coordinate of definition point 2. */
|
/*! X Coordinate of definition point 2 (extension line 2 end). */
|
||||||
double dpx2;
|
double dpx2;
|
||||||
/*! Y Coordinate of definition point 2. */
|
/*! Y Coordinate of definition point 2. */
|
||||||
double dpy2;
|
double dpy2;
|
||||||
/*! Z Coordinate of definition point 2. */
|
/*! Z Coordinate of definition point 2. */
|
||||||
double dpz2;
|
double dpz2;
|
||||||
|
|
||||||
/*! X Coordinate of definition point 3. */
|
/*! X Coordinate of definition point 3 (center). */
|
||||||
double dpx3;
|
double dpx3;
|
||||||
/*! Y Coordinate of definition point 3. */
|
/*! Y Coordinate of definition point 3. */
|
||||||
double dpy3;
|
double dpy3;
|
||||||
@ -1395,23 +1397,25 @@ struct DXFLIB_EXPORT DL_LeaderData {
|
|||||||
* Constructor.
|
* Constructor.
|
||||||
* Parameters: see member variables.
|
* Parameters: see member variables.
|
||||||
*/
|
*/
|
||||||
DL_LeaderData(int lArrowHeadFlag,
|
DL_LeaderData(int arrowHeadFlag,
|
||||||
int lLeaderPathType,
|
int leaderPathType,
|
||||||
int lLeaderCreationFlag,
|
int leaderCreationFlag,
|
||||||
int lHooklineDirectionFlag,
|
int hooklineDirectionFlag,
|
||||||
int lHooklineFlag,
|
int hooklineFlag,
|
||||||
double lTextAnnotationHeight,
|
double textAnnotationHeight,
|
||||||
double lTextAnnotationWidth,
|
double textAnnotationWidth,
|
||||||
int lNumber) {
|
int number,
|
||||||
|
double dimScale = 1.0) :
|
||||||
|
arrowHeadFlag(arrowHeadFlag),
|
||||||
|
leaderPathType(leaderPathType),
|
||||||
|
leaderCreationFlag(leaderCreationFlag),
|
||||||
|
hooklineDirectionFlag(hooklineDirectionFlag),
|
||||||
|
hooklineFlag(hooklineFlag),
|
||||||
|
textAnnotationHeight(textAnnotationHeight),
|
||||||
|
textAnnotationWidth(textAnnotationWidth),
|
||||||
|
number(number),
|
||||||
|
dimScale(dimScale) {
|
||||||
|
|
||||||
arrowHeadFlag = lArrowHeadFlag;
|
|
||||||
leaderPathType = lLeaderPathType;
|
|
||||||
leaderCreationFlag = lLeaderCreationFlag;
|
|
||||||
hooklineDirectionFlag = lHooklineDirectionFlag;
|
|
||||||
hooklineFlag = lHooklineFlag;
|
|
||||||
textAnnotationHeight = lTextAnnotationHeight;
|
|
||||||
textAnnotationWidth = lTextAnnotationWidth;
|
|
||||||
number = lNumber;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*! Arrow head flag (71). */
|
/*! Arrow head flag (71). */
|
||||||
@ -1430,6 +1434,8 @@ struct DXFLIB_EXPORT DL_LeaderData {
|
|||||||
double textAnnotationWidth;
|
double textAnnotationWidth;
|
||||||
/*! Number of vertices in leader (76). */
|
/*! Number of vertices in leader (76). */
|
||||||
int number;
|
int number;
|
||||||
|
/*! Dimension scale (dimscale) style override. */
|
||||||
|
double dimScale;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
@ -36,6 +36,7 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
#endif // _MSC_VER > 1000
|
#endif // _MSC_VER > 1000
|
||||||
|
|
||||||
|
#include <cstring>
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
|
|
||||||
@ -539,49 +540,6 @@ public:
|
|||||||
return m_handle;
|
return m_handle;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Increases handle, so that the handle returned remains available.
|
|
||||||
*/
|
|
||||||
unsigned long incHandle() const {
|
|
||||||
return m_handle++;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Sets the handle of the model space. Entities refer to
|
|
||||||
* this handle.
|
|
||||||
*/
|
|
||||||
void setModelSpaceHandle(unsigned long h) {
|
|
||||||
modelSpaceHandle = h;
|
|
||||||
}
|
|
||||||
|
|
||||||
unsigned long getModelSpaceHandle() {
|
|
||||||
return modelSpaceHandle;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Sets the handle of the paper space. Some special blocks refer to
|
|
||||||
* this handle.
|
|
||||||
*/
|
|
||||||
void setPaperSpaceHandle(unsigned long h) {
|
|
||||||
paperSpaceHandle = h;
|
|
||||||
}
|
|
||||||
|
|
||||||
unsigned long getPaperSpaceHandle() {
|
|
||||||
return paperSpaceHandle;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Sets the handle of the paper space 0. Some special blocks refer to
|
|
||||||
* this handle.
|
|
||||||
*/
|
|
||||||
void setPaperSpace0Handle(unsigned long h) {
|
|
||||||
paperSpace0Handle = h;
|
|
||||||
}
|
|
||||||
|
|
||||||
unsigned long getPaperSpace0Handle() {
|
|
||||||
return paperSpace0Handle;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Must be overwritten by the implementing class to write a
|
* Must be overwritten by the implementing class to write a
|
||||||
* real value to the file.
|
* real value to the file.
|
||||||
|
@ -1,79 +1,98 @@
|
|||||||
#include "dxfreader.h"
|
#include "dxfreader.h"
|
||||||
#include <QDebug>
|
#include <QDebug>
|
||||||
|
|
||||||
DxfReader::DxfReader(const QString &fileName, QObject *parent)
|
DxfReader::DxfReader(const QString &m_fileName, QObject *parent)
|
||||||
: QObject(parent)
|
: QObject(parent)
|
||||||
, fileName(fileName)
|
,m_fileName(m_fileName)
|
||||||
{
|
{
|
||||||
//QTextCodec::setCodecForLocale(QTextCodec::codecForName("GBK"));
|
//QTextCodec::setCodecForLocale(QTextCodec::codecForName("GBK"));
|
||||||
|
|
||||||
|
m_blockDataList.clear();
|
||||||
|
m_blockData.blockId = 0;
|
||||||
|
initBlockDatas();
|
||||||
// 读取 dxf 文件
|
// 读取 dxf 文件
|
||||||
DL_Dxf *dxf = new DL_Dxf;
|
DL_Dxf *dxf = new DL_Dxf;
|
||||||
if (!dxf->in(std::string(fileName.toLocal8Bit()), this)) { // if file open failed
|
if (!dxf->in(std::string(m_fileName.toLocal8Bit()), this))
|
||||||
std::cerr << std::string(fileName.toLocal8Bit()) << " could not be opened.\n";
|
{
|
||||||
|
// if file open failed
|
||||||
|
std::cerr << std::string(m_fileName.toLocal8Bit()) << " could not be opened.\n";
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
delete dxf;
|
else
|
||||||
dxf = nullptr;
|
{
|
||||||
|
m_blockData.blockId++;
|
||||||
|
m_blockDataList.append(m_blockData);
|
||||||
|
initBlockDatas();
|
||||||
|
}
|
||||||
|
|
||||||
|
if(dxf != NULL)
|
||||||
|
{
|
||||||
|
delete dxf;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
DxfReader::~DxfReader()
|
||||||
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
void DxfReader::addText(const DL_TextData &data)
|
void DxfReader::addText(const DL_TextData &data)
|
||||||
{
|
{
|
||||||
//qDebug() << Q_FUNC_INFO;
|
//qDebug() << Q_FUNC_INFO;
|
||||||
dxfText << data;
|
m_blockData.dxfText << data;
|
||||||
}
|
}
|
||||||
|
|
||||||
void DxfReader::addLine(const DL_LineData &data)
|
void DxfReader::addLine(const DL_LineData &data)
|
||||||
{
|
{
|
||||||
//qDebug() << Q_FUNC_INFO;
|
m_blockData.dxfLines << data;
|
||||||
dxfLines << data;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void DxfReader::addArc(const DL_ArcData &data)
|
void DxfReader::addArc(const DL_ArcData &data)
|
||||||
{
|
{
|
||||||
//qDebug() << Q_FUNC_INFO;
|
//qDebug() << Q_FUNC_INFO;
|
||||||
dxfArcs << data;
|
m_blockData.dxfArcs << data;
|
||||||
}
|
}
|
||||||
|
|
||||||
void DxfReader::addCircle(const DL_CircleData &data)
|
void DxfReader::addCircle(const DL_CircleData &data)
|
||||||
{
|
{
|
||||||
//qDebug() << Q_FUNC_INFO;
|
//qDebug() << Q_FUNC_INFO;
|
||||||
dxfCircles << data;
|
m_blockData.dxfCircles << data;
|
||||||
}
|
}
|
||||||
|
|
||||||
void DxfReader::addEllipse(const DL_EllipseData &data)
|
void DxfReader::addEllipse(const DL_EllipseData &data)
|
||||||
{
|
{
|
||||||
//qDebug() << Q_FUNC_INFO;
|
//qDebug() << Q_FUNC_INFO;
|
||||||
dxfEllipses << data;
|
m_blockData.dxfEllipses << data;
|
||||||
}
|
}
|
||||||
|
|
||||||
void DxfReader::addPolyline(const DL_PolylineData &data)
|
void DxfReader::addPolyline(const DL_PolylineData &data)
|
||||||
{
|
{
|
||||||
//qDebug() << Q_FUNC_INFO;
|
//qDebug() << Q_FUNC_INFO;
|
||||||
dxfPolylines << data;
|
m_blockData.dxfPolylines << data;
|
||||||
}
|
}
|
||||||
|
|
||||||
void DxfReader::addPoint(const DL_PointData &data)
|
void DxfReader::addPoint(const DL_PointData &data)
|
||||||
{
|
{
|
||||||
//qDebug() << Q_FUNC_INFO;
|
//qDebug() << Q_FUNC_INFO;
|
||||||
dxfPoints << data;
|
m_blockData.dxfPoints << data;
|
||||||
}
|
}
|
||||||
|
|
||||||
void DxfReader::addSpline(const DL_SplineData &data)
|
void DxfReader::addSpline(const DL_SplineData &data)
|
||||||
{
|
{
|
||||||
//qDebug() << Q_FUNC_INFO;
|
//qDebug() << Q_FUNC_INFO;
|
||||||
dxfSplines << data;
|
m_blockData.dxfSplines << data;
|
||||||
}
|
}
|
||||||
|
|
||||||
void DxfReader::addBlock(const DL_BlockData &data)
|
void DxfReader::addBlock(const DL_BlockData &data)
|
||||||
{
|
{
|
||||||
//qDebug() << Q_FUNC_INFO;
|
|
||||||
dxfBlocks << data;
|
dxfBlocks << data;
|
||||||
|
m_blockData.blockName = data.name;
|
||||||
|
m_blockData.blockId++;
|
||||||
}
|
}
|
||||||
|
|
||||||
void DxfReader::endBlock()
|
void DxfReader::endBlock()
|
||||||
{
|
{
|
||||||
|
m_blockDataList.append(m_blockData);
|
||||||
|
initBlockDatas();
|
||||||
}
|
}
|
||||||
|
|
||||||
void DxfReader::addLayer(const DL_LayerData &data)
|
void DxfReader::addLayer(const DL_LayerData &data)
|
||||||
@ -96,31 +115,31 @@ void DxfReader::addLinetypeDash(double length)
|
|||||||
void DxfReader::addXLine(const DL_XLineData &data)
|
void DxfReader::addXLine(const DL_XLineData &data)
|
||||||
{
|
{
|
||||||
//qDebug() << Q_FUNC_INFO;
|
//qDebug() << Q_FUNC_INFO;
|
||||||
dxfXLines << data;
|
m_blockData.dxfXLines << data;
|
||||||
}
|
}
|
||||||
|
|
||||||
void DxfReader::addRay(const DL_RayData &data)
|
void DxfReader::addRay(const DL_RayData &data)
|
||||||
{
|
{
|
||||||
//qDebug() << Q_FUNC_INFO;
|
//qDebug() << Q_FUNC_INFO;
|
||||||
dxfRays << data;
|
m_blockData.dxfRays << data;
|
||||||
}
|
}
|
||||||
|
|
||||||
void DxfReader::addVertex(const DL_VertexData &data)
|
void DxfReader::addVertex(const DL_VertexData &data)
|
||||||
{
|
{
|
||||||
//qDebug() << Q_FUNC_INFO;
|
//qDebug() << Q_FUNC_INFO;
|
||||||
dxfVertexs << data;
|
m_blockData.dxfVertexs << data;
|
||||||
}
|
}
|
||||||
|
|
||||||
void DxfReader::addControlPoint(const DL_ControlPointData &data)
|
void DxfReader::addControlPoint(const DL_ControlPointData &data)
|
||||||
{
|
{
|
||||||
//qDebug() << Q_FUNC_INFO;
|
//qDebug() << Q_FUNC_INFO;
|
||||||
dxfControlPoints << data;
|
m_blockData.dxfControlPoints << data;
|
||||||
}
|
}
|
||||||
|
|
||||||
void DxfReader::addFitPoint(const DL_FitPointData &data)
|
void DxfReader::addFitPoint(const DL_FitPointData &data)
|
||||||
{
|
{
|
||||||
//qDebug() << Q_FUNC_INFO;
|
//qDebug() << Q_FUNC_INFO;
|
||||||
dxfFitPoints << data;
|
m_blockData.dxfFitPoints << data;
|
||||||
}
|
}
|
||||||
|
|
||||||
void DxfReader::addKnot(const DL_KnotData &data)
|
void DxfReader::addKnot(const DL_KnotData &data)
|
||||||
@ -205,12 +224,12 @@ void DxfReader::addDimDiametric(const DL_DimensionData &data, const DL_DimDiamet
|
|||||||
//qDebug() << Q_FUNC_INFO;
|
//qDebug() << Q_FUNC_INFO;
|
||||||
}
|
}
|
||||||
|
|
||||||
void DxfReader::addDimAngular(const DL_DimensionData &data, const DL_DimAngularData &edata)
|
//void DxfReader::addDimAngular(const DL_DimensionData &data, const DL_DimAngularData &edata)
|
||||||
{
|
//{
|
||||||
if(data.angle == 0){}
|
// if(data.angle == 0){}
|
||||||
if(edata.dpx1 == 0){}
|
// if(edata.dpx1 == 0){}
|
||||||
//qDebug() << Q_FUNC_INFO;
|
// //qDebug() << Q_FUNC_INFO;
|
||||||
}
|
//}
|
||||||
|
|
||||||
void DxfReader::addDimAngular3P(const DL_DimensionData &data, const DL_DimAngular3PData &edata)
|
void DxfReader::addDimAngular3P(const DL_DimensionData &data, const DL_DimAngular3PData &edata)
|
||||||
{
|
{
|
||||||
@ -241,19 +260,19 @@ void DxfReader::addLeaderVertex(const DL_LeaderVertexData &data)
|
|||||||
void DxfReader::addHatch(const DL_HatchData &data)
|
void DxfReader::addHatch(const DL_HatchData &data)
|
||||||
{
|
{
|
||||||
//qDebug() << Q_FUNC_INFO;
|
//qDebug() << Q_FUNC_INFO;
|
||||||
dxfHatchs << data;
|
m_blockData.dxfHatchs << data;
|
||||||
}
|
}
|
||||||
|
|
||||||
void DxfReader::addHatchLoop(const DL_HatchLoopData &data)
|
void DxfReader::addHatchLoop(const DL_HatchLoopData &data)
|
||||||
{
|
{
|
||||||
//qDebug() << Q_FUNC_INFO;
|
//qDebug() << Q_FUNC_INFO;
|
||||||
dxfHatchLoops << data;
|
m_blockData.dxfHatchLoops << data;
|
||||||
}
|
}
|
||||||
|
|
||||||
void DxfReader::addHatchEdge(const DL_HatchEdgeData &data)
|
void DxfReader::addHatchEdge(const DL_HatchEdgeData &data)
|
||||||
{
|
{
|
||||||
//qDebug() << Q_FUNC_INFO;
|
//qDebug() << Q_FUNC_INFO;
|
||||||
dxfHatchEdges << data;
|
m_blockData.dxfHatchEdges << data;
|
||||||
}
|
}
|
||||||
|
|
||||||
void DxfReader::addImage(const DL_ImageData &data)
|
void DxfReader::addImage(const DL_ImageData &data)
|
||||||
@ -377,3 +396,29 @@ void DxfReader::endSequence()
|
|||||||
{
|
{
|
||||||
//qDebug() << Q_FUNC_INFO;
|
//qDebug() << Q_FUNC_INFO;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
QList<BlockDatas> DxfReader::getBlockDatas()
|
||||||
|
{
|
||||||
|
return m_blockDataList;
|
||||||
|
}
|
||||||
|
|
||||||
|
void DxfReader::initBlockDatas()
|
||||||
|
{
|
||||||
|
m_blockData.dxfArcs.clear();
|
||||||
|
m_blockData.dxfLines.clear();
|
||||||
|
m_blockData.dxfText.clear();
|
||||||
|
m_blockData.dxfArcs.clear();
|
||||||
|
m_blockData.dxfCircles.clear();
|
||||||
|
m_blockData.dxfEllipses.clear();
|
||||||
|
m_blockData.dxfPolylines.clear();
|
||||||
|
m_blockData.dxfPoints.clear();
|
||||||
|
m_blockData.dxfSplines.clear();
|
||||||
|
m_blockData.dxfVertexs.clear();
|
||||||
|
m_blockData.dxfXLines.clear();
|
||||||
|
m_blockData.dxfRays.clear();
|
||||||
|
m_blockData.dxfControlPoints.clear();
|
||||||
|
m_blockData.dxfFitPoints.clear();
|
||||||
|
m_blockData.dxfHatchs.clear();
|
||||||
|
m_blockData.dxfHatchLoops.clear();
|
||||||
|
m_blockData.dxfHatchEdges.clear();
|
||||||
|
}
|
||||||
|
@ -9,6 +9,28 @@
|
|||||||
#include <QMetaType>
|
#include <QMetaType>
|
||||||
#include <QtCore/QList>
|
#include <QtCore/QList>
|
||||||
|
|
||||||
|
typedef struct
|
||||||
|
{
|
||||||
|
int blockId;//块索引
|
||||||
|
std::string blockName;//块名称
|
||||||
|
QList<DL_LineData> dxfLines;
|
||||||
|
QList<DL_TextData> dxfText;
|
||||||
|
QList<DL_ArcData> dxfArcs;
|
||||||
|
QList<DL_CircleData> dxfCircles;
|
||||||
|
QList<DL_EllipseData> dxfEllipses;
|
||||||
|
QList<DL_PolylineData> dxfPolylines;
|
||||||
|
QList<DL_PointData> dxfPoints;
|
||||||
|
QList<DL_SplineData> dxfSplines;
|
||||||
|
QList<DL_VertexData> dxfVertexs;
|
||||||
|
QList<DL_XLineData> dxfXLines;
|
||||||
|
QList<DL_RayData> dxfRays;
|
||||||
|
QList<DL_ControlPointData> dxfControlPoints;
|
||||||
|
QList<DL_FitPointData> dxfFitPoints;
|
||||||
|
QList<DL_HatchData> dxfHatchs;
|
||||||
|
QList<DL_HatchLoopData> dxfHatchLoops;
|
||||||
|
QList<DL_HatchEdgeData> dxfHatchEdges;
|
||||||
|
} BlockDatas;
|
||||||
|
|
||||||
class DxfReader : public QObject, public DL_CreationAdapter
|
class DxfReader : public QObject, public DL_CreationAdapter
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
@ -17,6 +39,7 @@ public:
|
|||||||
QString Text;
|
QString Text;
|
||||||
};
|
};
|
||||||
explicit DxfReader(const QString &fileName, QObject *parent = nullptr);
|
explicit DxfReader(const QString &fileName, QObject *parent = nullptr);
|
||||||
|
~DxfReader();
|
||||||
|
|
||||||
virtual void addText(const DL_TextData& data) override;
|
virtual void addText(const DL_TextData& data) override;
|
||||||
virtual void addLine(const DL_LineData& data) override;
|
virtual void addLine(const DL_LineData& data) override;
|
||||||
@ -50,7 +73,7 @@ public:
|
|||||||
virtual void addDimLinear(const DL_DimensionData& data, const DL_DimLinearData& edata) override;
|
virtual void addDimLinear(const DL_DimensionData& data, const DL_DimLinearData& edata) override;
|
||||||
virtual void addDimRadial(const DL_DimensionData& data, const DL_DimRadialData& edata) override;
|
virtual void addDimRadial(const DL_DimensionData& data, const DL_DimRadialData& edata) override;
|
||||||
virtual void addDimDiametric(const DL_DimensionData& data, const DL_DimDiametricData& edata) override;
|
virtual void addDimDiametric(const DL_DimensionData& data, const DL_DimDiametricData& edata) override;
|
||||||
virtual void addDimAngular(const DL_DimensionData& data, const DL_DimAngularData& edata) override;
|
//virtual void addDimAngular(const DL_DimensionData& data, const DL_DimAngularData& edata) override;
|
||||||
virtual void addDimAngular3P(const DL_DimensionData& data, const DL_DimAngular3PData& edata) override;
|
virtual void addDimAngular3P(const DL_DimensionData& data, const DL_DimAngular3PData& edata) override;
|
||||||
virtual void addDimOrdinate(const DL_DimensionData& data, const DL_DimOrdinateData& edata) override;
|
virtual void addDimOrdinate(const DL_DimensionData& data, const DL_DimOrdinateData& edata) override;
|
||||||
virtual void addLeader(const DL_LeaderData &data) override;
|
virtual void addLeader(const DL_LeaderData &data) override;
|
||||||
@ -83,29 +106,19 @@ public:
|
|||||||
virtual void add3dFace(const DL_3dFaceData &data) override;
|
virtual void add3dFace(const DL_3dFaceData &data) override;
|
||||||
virtual void addComment(const std::string &comment) override;
|
virtual void addComment(const std::string &comment) override;
|
||||||
virtual void endSequence() override;
|
virtual void endSequence() override;
|
||||||
|
QList<BlockDatas> getBlockDatas();
|
||||||
|
|
||||||
QList<DL_LineData> dxfLines;
|
|
||||||
QList<DL_TextData> dxfText;
|
|
||||||
QList<DL_ArcData> dxfArcs;
|
|
||||||
QList<DL_CircleData> dxfCircles;
|
|
||||||
QList<DL_EllipseData> dxfEllipses;
|
|
||||||
QList<DL_PolylineData> dxfPolylines;
|
|
||||||
QList<DL_PointData> dxfPoints;
|
|
||||||
QList<DL_SplineData> dxfSplines;
|
|
||||||
QList<DL_BlockData> dxfBlocks;
|
|
||||||
QList<DL_VertexData> dxfVertexs;
|
|
||||||
QList<DL_LayerData> dxfLayers;
|
QList<DL_LayerData> dxfLayers;
|
||||||
QList<DL_LinetypeData> dxfLinetypes;
|
QList<DL_LinetypeData> dxfLinetypes;
|
||||||
QList<DL_XLineData> dxfXLines;
|
QList<DL_BlockData> dxfBlocks;
|
||||||
QList<DL_RayData> dxfRays;
|
|
||||||
QList<DL_ControlPointData> dxfControlPoints;
|
|
||||||
QList<DL_FitPointData> dxfFitPoints;
|
|
||||||
QList<DL_HatchData> dxfHatchs;
|
|
||||||
QList<DL_HatchLoopData> dxfHatchLoops;
|
|
||||||
QList<DL_HatchEdgeData> dxfHatchEdges;
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
QString fileName;
|
void initBlockDatas();
|
||||||
|
|
||||||
|
private:
|
||||||
|
QString m_fileName;
|
||||||
|
QList<BlockDatas> m_blockDataList;
|
||||||
|
BlockDatas m_blockData;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -637,7 +637,7 @@ void ImportHPGL::AddPolylineToMarker()
|
|||||||
|
|
||||||
//长度<0.2mm为钻孔
|
//长度<0.2mm为钻孔
|
||||||
CRPPolyline RPPolyline1;
|
CRPPolyline RPPolyline1;
|
||||||
QPoint pt1,pt2;
|
QPointF pt1,pt2;
|
||||||
CDrill drill;
|
CDrill drill;
|
||||||
bool bIsdirll = false;
|
bool bIsdirll = false;
|
||||||
|
|
||||||
@ -693,6 +693,7 @@ void ImportHPGL::AddPoint2listXY(QPoint ptPoint)
|
|||||||
{
|
{
|
||||||
double angle, sina, cosa;
|
double angle, sina, cosa;
|
||||||
double rcx, rcy;
|
double rcx, rcy;
|
||||||
|
angle = sina = cosa = rcx = rcy = 0;
|
||||||
|
|
||||||
if(m_rotateAngle != 0)
|
if(m_rotateAngle != 0)
|
||||||
{
|
{
|
||||||
@ -2400,7 +2401,7 @@ bool ImportHPGL::Write(QString strPathName,Marker *pMarker)
|
|||||||
for (j = 0; j < iPointCount; j++)
|
for (j = 0; j < iPointCount; j++)
|
||||||
{
|
{
|
||||||
|
|
||||||
QPoint pt = polyLine.m_listPoint.at(j);
|
QPointF pt = polyLine.m_listPoint.at(j);
|
||||||
|
|
||||||
if (j == 0)
|
if (j == 0)
|
||||||
{
|
{
|
||||||
|
@ -213,7 +213,7 @@ protected:
|
|||||||
QPen m_cutPen;//切割画笔
|
QPen m_cutPen;//切割画笔
|
||||||
QPen m_halfCutPen;//半透切割画笔
|
QPen m_halfCutPen;//半透切割画笔
|
||||||
|
|
||||||
QList <QPoint> m_listXY; //还没有确定抬落刀的坐标
|
QList <QPointF> m_listXY; //还没有确定抬落刀的坐标
|
||||||
//QPainterPath m_polylinePainterPath;//绘图路径-线段
|
//QPainterPath m_polylinePainterPath;//绘图路径-线段
|
||||||
|
|
||||||
unsigned char m_chTerminator;//标志终结符,除了NULL LF ESC及;十进制分别为0,5,27,59;外的所有字符,默认为ETX 十进制3
|
unsigned char m_chTerminator;//标志终结符,除了NULL LF ESC及;十进制分别为0,5,27,59;外的所有字符,默认为ETX 十进制3
|
||||||
|
@ -47,9 +47,9 @@ void Marker::Initialize()
|
|||||||
m_strProductCode = "";
|
m_strProductCode = "";
|
||||||
}
|
}
|
||||||
|
|
||||||
QRect Marker::GetRect()
|
QRectF Marker::GetRect()
|
||||||
{
|
{
|
||||||
QRect rect;
|
QRectF rect;
|
||||||
|
|
||||||
CRPPolyline RPPolyline;
|
CRPPolyline RPPolyline;
|
||||||
rect.setRect(0,0,0,0);
|
rect.setRect(0,0,0,0);
|
||||||
@ -63,22 +63,22 @@ QRect Marker::GetRect()
|
|||||||
}
|
}
|
||||||
else if (RPPolyline.m_nDrawingType == 3)
|
else if (RPPolyline.m_nDrawingType == 3)
|
||||||
{
|
{
|
||||||
rect |= QRect(RPPolyline.m_text.m_ptPostLU,RPPolyline.m_text.m_ptPostRD);
|
rect |= QRectF(RPPolyline.m_text.m_ptPostLU,RPPolyline.m_text.m_ptPostRD);
|
||||||
}
|
}
|
||||||
else if (RPPolyline.m_nDrawingType == 1)
|
else if (RPPolyline.m_nDrawingType == 1)
|
||||||
{
|
{
|
||||||
rect |= QRect(RPPolyline.m_bitmapInfo.m_ptAbPostLU,RPPolyline.m_bitmapInfo.m_ptAbPostRD);
|
rect |= QRectF(RPPolyline.m_bitmapInfo.m_ptAbPostLU,RPPolyline.m_bitmapInfo.m_ptAbPostRD);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return rect;
|
return rect;
|
||||||
}
|
}
|
||||||
|
|
||||||
QRect Marker::RectofPolyline(const QList<QPoint> &listPoint)
|
QRectF Marker::RectofPolyline(const QList<QPointF> &listPoint)
|
||||||
{
|
{
|
||||||
if(listPoint.empty())
|
if(listPoint.empty())
|
||||||
{
|
{
|
||||||
return QRect(0,0,0,0);
|
return QRectF(0,0,0,0);
|
||||||
}
|
}
|
||||||
int iXMin = INT_MAX;
|
int iXMin = INT_MAX;
|
||||||
int iXMax = INT_MIN;
|
int iXMax = INT_MIN;
|
||||||
@ -115,7 +115,7 @@ QRect Marker::RectofPolyline(const QList<QPoint> &listPoint)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return QRect(QPoint(iXMin,iYMin),QPoint(iXMax,iYMax));
|
return QRectF(QPointF(iXMin,iYMin),QPointF(iXMax,iYMax));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -293,7 +293,7 @@ public:
|
|||||||
class CDrill
|
class CDrill
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
QPoint m_pt;//冲孔的位置
|
QPointF m_pt;//冲孔的位置
|
||||||
int m_nDrillType;//冲孔类型
|
int m_nDrillType;//冲孔类型
|
||||||
int m_nAngle;//冲孔的角度(逆时针方向为正),单位:0.01度
|
int m_nAngle;//冲孔的角度(逆时针方向为正),单位:0.01度
|
||||||
|
|
||||||
@ -337,7 +337,7 @@ public:
|
|||||||
CNotch m_notch;
|
CNotch m_notch;
|
||||||
|
|
||||||
LineType m_lineType;
|
LineType m_lineType;
|
||||||
QList<QPoint> m_listPoint;
|
QList<QPointF> m_listPoint;
|
||||||
|
|
||||||
CRPPolyline()
|
CRPPolyline()
|
||||||
{
|
{
|
||||||
@ -401,8 +401,8 @@ public:
|
|||||||
Marker(const Marker &a);
|
Marker(const Marker &a);
|
||||||
Marker operator=(const Marker &a);
|
Marker operator=(const Marker &a);
|
||||||
void Initialize();
|
void Initialize();
|
||||||
QRect GetRect();
|
QRectF GetRect();
|
||||||
QRect RectofPolyline(const QList <QPoint> &listPoint);
|
QRectF RectofPolyline(const QList <QPointF> &listPoint);
|
||||||
|
|
||||||
double m_iDPMM; //长度数据单位:m_iDPMM(每毫米点)
|
double m_iDPMM; //长度数据单位:m_iDPMM(每毫米点)
|
||||||
QList <CRPPolyline> m_listPolyline; //切割的点链,单位:1/m_iDPMM mm, X向右为正,Y向上为正
|
QList <CRPPolyline> m_listPolyline; //切割的点链,单位:1/m_iDPMM mm, X向右为正,Y向上为正
|
||||||
|
@ -1,11 +1,14 @@
|
|||||||
#include "drawdata.h"
|
#include "drawdata.h"
|
||||||
|
|
||||||
QPicture creatPictureByData(Marker marker, QPainterPath &painterPath, int penWidth)
|
CreatPictureStr creatPictureByData(Marker marker,int paperWidth,int butSpace,int rightSpace,int penWidth)
|
||||||
{
|
{
|
||||||
|
QPainterPath painterPath;
|
||||||
CBitmapInfo bitmapInfo;
|
CBitmapInfo bitmapInfo;
|
||||||
QRect rect = marker.GetRect();
|
QRectF rect = marker.GetRect();
|
||||||
int minX = rect.left();
|
int minX = rect.left();
|
||||||
int maxY = rect.bottom();
|
int maxY = rect.bottom();
|
||||||
|
int rectSize = 20;//20毫米-对接符矩形框大小
|
||||||
|
int blockSpace = 50;//50毫米-块与块之间的间距
|
||||||
|
|
||||||
int nLineCount = marker.m_listPolyline.size();
|
int nLineCount = marker.m_listPolyline.size();
|
||||||
for(int i = 0; i < nLineCount; i++)
|
for(int i = 0; i < nLineCount; i++)
|
||||||
@ -43,14 +46,14 @@ QPicture creatPictureByData(Marker marker, QPainterPath &painterPath, int penWid
|
|||||||
int lux = bitmapInfo.m_ptAbPostLU.x();
|
int lux = bitmapInfo.m_ptAbPostLU.x();
|
||||||
int luy = bitmapInfo.m_ptAbPostLU.y();
|
int luy = bitmapInfo.m_ptAbPostLU.y();
|
||||||
int nlux = (lux - minX)/M_IDPMM*MMPIXELY;
|
int nlux = (lux - minX)/M_IDPMM*MMPIXELY;
|
||||||
int nluy = (maxY-luy)/M_IDPMM*MMPIXELY;
|
int nluy = (maxY - luy)/M_IDPMM*MMPIXELY;
|
||||||
bitmapInfo.m_ptAbPostLU.setX(nlux);
|
bitmapInfo.m_ptAbPostLU.setX(nlux);
|
||||||
bitmapInfo.m_ptAbPostLU.setY(nluy);
|
bitmapInfo.m_ptAbPostLU.setY(nluy);
|
||||||
|
|
||||||
int rdx = bitmapInfo.m_ptAbPostRD.x();
|
int rdx = bitmapInfo.m_ptAbPostRD.x();
|
||||||
int rdy = bitmapInfo.m_ptAbPostRD.y();
|
int rdy = bitmapInfo.m_ptAbPostRD.y();
|
||||||
int nrdx = (rdx - minX)/M_IDPMM*MMPIXELY;
|
int nrdx = (rdx - minX)/M_IDPMM*MMPIXELY;
|
||||||
int nrdy = (maxY-rdy)/M_IDPMM*MMPIXELY;
|
int nrdy = (maxY - rdy)/M_IDPMM*MMPIXELY;
|
||||||
bitmapInfo.m_ptAbPostRD.setX(nrdx);
|
bitmapInfo.m_ptAbPostRD.setX(nrdx);
|
||||||
bitmapInfo.m_ptAbPostRD.setY(nrdy);
|
bitmapInfo.m_ptAbPostRD.setY(nrdy);
|
||||||
}
|
}
|
||||||
@ -61,13 +64,162 @@ QPicture creatPictureByData(Marker marker, QPainterPath &painterPath, int penWid
|
|||||||
qDebug()<<"painterPath.isEmpty";
|
qDebug()<<"painterPath.isEmpty";
|
||||||
}
|
}
|
||||||
|
|
||||||
//将路径画在picture上
|
CreatPictureStr picStr;
|
||||||
QPicture pic;
|
QPen pen;
|
||||||
QPen pen(Qt::black, penWidth, Qt::SolidLine, Qt::SquareCap, Qt::MiterJoin);
|
pen.setWidth(1);//设置笔号,像素为1,用于显示的pic
|
||||||
//pen.setCosmetic(true); // 对于固定宽度的笔划很有用
|
pen.setColor(QColor(Qt::black));
|
||||||
|
|
||||||
QPainter painter;
|
QPainter painter;
|
||||||
painter.begin(&pic);
|
|
||||||
|
//当纸张宽度不够打印时需要对接打印
|
||||||
|
int width = rect.width()/M_IDPMM;
|
||||||
|
int length = rect.height()/M_IDPMM;
|
||||||
|
|
||||||
|
if(rightSpace != 0)
|
||||||
|
{
|
||||||
|
if(paperWidth >= length)
|
||||||
|
{
|
||||||
|
paperWidth = length - rightSpace;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
double oft = paperWidth*MMPIXELY;
|
||||||
|
if(width <= rectSize)
|
||||||
|
{
|
||||||
|
rectSize = width / 2;
|
||||||
|
blockSpace = rectSize / 2;
|
||||||
|
}
|
||||||
|
int square = rectSize*MMPIXELY;
|
||||||
|
|
||||||
|
if(paperWidth < length)
|
||||||
|
{
|
||||||
|
int seNum = length / paperWidth;
|
||||||
|
if(length % paperWidth != 0)
|
||||||
|
{
|
||||||
|
seNum += 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
butSpace += rectSize;
|
||||||
|
int num = width / butSpace;
|
||||||
|
double space = (double)width / (double)num;
|
||||||
|
for(int m = 0; m < seNum-1; m++)
|
||||||
|
{
|
||||||
|
for(int i = 0; i < num; i++)
|
||||||
|
{
|
||||||
|
//绘制对接符,5mm的正方形,里面是交叉线X
|
||||||
|
//添加正方形path
|
||||||
|
int x = i*space * MMPIXELY;
|
||||||
|
int y = oft + m * oft - square / 2;
|
||||||
|
painterPath.moveTo(x,y);
|
||||||
|
QRectF rect(x,y,square,square);
|
||||||
|
painterPath.addRect(rect);
|
||||||
|
|
||||||
|
//添加交叉线(X)
|
||||||
|
QPointF diagonalStart(rect.left(), rect.top());
|
||||||
|
QPointF diagonalEnd(rect.right(), rect.bottom());
|
||||||
|
painterPath.moveTo(diagonalStart);
|
||||||
|
painterPath.lineTo(diagonalEnd);
|
||||||
|
// 另一条对角线
|
||||||
|
QPointF otherDiagonalStart(rect.right(), rect.top());
|
||||||
|
QPointF otherDiagonalEnd(rect.left(), rect.bottom());
|
||||||
|
painterPath.moveTo(otherDiagonalStart);
|
||||||
|
painterPath.lineTo(otherDiagonalEnd);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
QPainterPath pathSegments[seNum];
|
||||||
|
splitPaintPath(painterPath,oft,seNum,pathSegments);
|
||||||
|
|
||||||
|
int startx,starty,targetWidth,targetHeight,blockSize,bmpNum;
|
||||||
|
if(bitmapInfo.m_iBytes > 0)//有位图
|
||||||
|
{
|
||||||
|
startx = bitmapInfo.m_ptAbPostLU.x();
|
||||||
|
starty = bitmapInfo.m_ptAbPostLU.y();
|
||||||
|
targetWidth = abs(bitmapInfo.m_ptAbPostRD.x() - bitmapInfo.m_ptAbPostLU.x());
|
||||||
|
targetHeight = abs(bitmapInfo.m_ptAbPostRD.y() - bitmapInfo.m_ptAbPostLU.y());
|
||||||
|
blockSize = paperWidth * MMPIXELY;
|
||||||
|
|
||||||
|
if(targetHeight > blockSize)
|
||||||
|
{
|
||||||
|
bmpNum = targetHeight / blockSize;
|
||||||
|
if(targetHeight % blockSize != 0)
|
||||||
|
{
|
||||||
|
bmpNum += 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
painter.begin(&picStr.showPic);
|
||||||
|
painter.setPen(pen);
|
||||||
|
int oftH = 0;
|
||||||
|
int oftW = 0;
|
||||||
|
for(int i = 0; i < seNum; i++)
|
||||||
|
{
|
||||||
|
if(i != 0)
|
||||||
|
{
|
||||||
|
oftH = 0 - pathSegments[i].boundingRect().height();
|
||||||
|
oftW = pathSegments[i].boundingRect().width() + blockSpace * MMPIXELY;
|
||||||
|
}
|
||||||
|
painter.translate(oftW, oftH);
|
||||||
|
painter.drawPath(pathSegments[i]);
|
||||||
|
|
||||||
|
int boftH = i*(0 - (starty + oftH));
|
||||||
|
if(targetHeight > blockSize)
|
||||||
|
{
|
||||||
|
int bmpH = bitmapInfo.m_pBitmap.height() / bmpNum;
|
||||||
|
|
||||||
|
int bmpOft = i*bmpH;
|
||||||
|
painter.drawPixmap(startx,boftH,targetWidth,blockSize,bitmapInfo.m_pBitmap,
|
||||||
|
startx,bmpOft, bitmapInfo.m_pBitmap.width(), bmpH);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if(startx <= abs(oftW) && starty <= abs(oftH))
|
||||||
|
{
|
||||||
|
painter.drawPixmap(startx,boftH,targetWidth,targetHeight,bitmapInfo.m_pBitmap,
|
||||||
|
startx,starty, bitmapInfo.m_pBitmap.width(), bitmapInfo.m_pBitmap.height());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
painter.end();
|
||||||
|
|
||||||
|
painter.begin(&picStr.sendPic);
|
||||||
|
pen.setWidth(penWidth);
|
||||||
|
painter.setPen(pen);
|
||||||
|
oftH = 0;
|
||||||
|
oftW = 0;
|
||||||
|
for(int i = 0; i < seNum; i++)
|
||||||
|
{
|
||||||
|
if(i != 0)
|
||||||
|
{
|
||||||
|
oftH = 0 - pathSegments[i].boundingRect().height();
|
||||||
|
oftW = pathSegments[i].boundingRect().width() + blockSpace * MMPIXELY;
|
||||||
|
}
|
||||||
|
painter.translate(oftW, oftH);
|
||||||
|
painter.drawPath(pathSegments[i]);
|
||||||
|
|
||||||
|
int boftH = i*(0 - (starty + oftH));
|
||||||
|
if(targetHeight > blockSize)
|
||||||
|
{
|
||||||
|
int bmpH = bitmapInfo.m_pBitmap.height() / bmpNum;
|
||||||
|
|
||||||
|
int bmpOft = i*bmpH;
|
||||||
|
painter.drawPixmap(startx,boftH,targetWidth,blockSize,bitmapInfo.m_pBitmap,
|
||||||
|
startx,bmpOft, bitmapInfo.m_pBitmap.width(), bmpH);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if(startx <= abs(oftW) && starty <= abs(oftH))
|
||||||
|
{
|
||||||
|
painter.drawPixmap(startx,boftH,targetWidth,targetHeight,bitmapInfo.m_pBitmap,
|
||||||
|
startx,starty, bitmapInfo.m_pBitmap.width(), bitmapInfo.m_pBitmap.height());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
painter.end();
|
||||||
|
return picStr;
|
||||||
|
}
|
||||||
|
|
||||||
|
//将路径画在picture上
|
||||||
|
painter.begin(&picStr.showPic);
|
||||||
painter.setPen(pen);
|
painter.setPen(pen);
|
||||||
painter.drawPath(painterPath);
|
painter.drawPath(painterPath);
|
||||||
if(bitmapInfo.m_iBytes > 0)//有位图
|
if(bitmapInfo.m_iBytes > 0)//有位图
|
||||||
@ -79,26 +231,79 @@ QPicture creatPictureByData(Marker marker, QPainterPath &painterPath, int penWid
|
|||||||
int targetHeight = abs(bitmapInfo.m_ptAbPostRD.y() - bitmapInfo.m_ptAbPostLU.y());
|
int targetHeight = abs(bitmapInfo.m_ptAbPostRD.y() - bitmapInfo.m_ptAbPostLU.y());
|
||||||
painter.drawPixmap(startx,starty,targetWidth,targetHeight,bitmapInfo.m_pBitmap,
|
painter.drawPixmap(startx,starty,targetWidth,targetHeight,bitmapInfo.m_pBitmap,
|
||||||
startx,starty, bitmapInfo.m_pBitmap.width(), bitmapInfo.m_pBitmap.height());
|
startx,starty, bitmapInfo.m_pBitmap.width(), bitmapInfo.m_pBitmap.height());
|
||||||
// painter.drawPixmap(bitmapInfo.m_ptAbPostLU.x(),bitmapInfo.m_ptAbPostLU.y(),bitmapInfo.m_pBitmap);
|
// painter.drawPixmap(bitmapInfo.m_ptAbPostLU.x(),bitmapInfo.m_ptAbPostLU.y(),bitmapInfo.m_pBitmap);
|
||||||
}
|
}
|
||||||
painter.end();
|
painter.end();
|
||||||
return pic;
|
|
||||||
|
painter.begin(&picStr.sendPic);
|
||||||
|
pen.setWidth(penWidth);
|
||||||
|
painter.setPen(pen);//设置笔号,像素为penWidth,用于发送的pic
|
||||||
|
painter.drawPath(painterPath);
|
||||||
|
if(bitmapInfo.m_iBytes > 0)//有位图
|
||||||
|
{
|
||||||
|
int startx = bitmapInfo.m_ptAbPostLU.x();
|
||||||
|
int starty = bitmapInfo.m_ptAbPostLU.y();
|
||||||
|
//bitmapInfo.m_pBitmap.save("D:\\1.bmp");
|
||||||
|
int targetWidth = abs(bitmapInfo.m_ptAbPostRD.x() - bitmapInfo.m_ptAbPostLU.x());
|
||||||
|
int targetHeight = abs(bitmapInfo.m_ptAbPostRD.y() - bitmapInfo.m_ptAbPostLU.y());
|
||||||
|
painter.drawPixmap(startx,starty,targetWidth,targetHeight,bitmapInfo.m_pBitmap,
|
||||||
|
startx,starty, bitmapInfo.m_pBitmap.width(), bitmapInfo.m_pBitmap.height());
|
||||||
|
// painter.drawPixmap(bitmapInfo.m_ptAbPostLU.x(),bitmapInfo.m_ptAbPostLU.y(),bitmapInfo.m_pBitmap);
|
||||||
|
}
|
||||||
|
painter.end();
|
||||||
|
|
||||||
|
return picStr;
|
||||||
}
|
}
|
||||||
|
|
||||||
QPicture creatPictureByBmp(QPixmap pixmap,int penWidth)
|
CreatPictureStr creatPictureByBmp(QPixmap pixmap,int paperWidth,int butSpace,int rightSpace,int penWidth)
|
||||||
{
|
{
|
||||||
//将图片画在picture上
|
//将图片画在picture上
|
||||||
QPicture pic;
|
CreatPictureStr picStr;
|
||||||
QPen pen;
|
QPen pen;
|
||||||
pen.setWidth(penWidth);//设置笔号
|
pen.setWidth(1);//设置笔号
|
||||||
pen.setColor(QColor(Qt::black));
|
pen.setColor(QColor(Qt::black));
|
||||||
|
int height = pixmap.height() / MMPIXELY;
|
||||||
|
|
||||||
|
if(rightSpace != 0)
|
||||||
|
{
|
||||||
|
if(paperWidth >= height)
|
||||||
|
{
|
||||||
|
paperWidth = height - rightSpace;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
QPainter painter;
|
QPainter painter;
|
||||||
painter.begin(&pic);
|
painter.begin(&picStr.showPic);
|
||||||
painter.setPen(pen);
|
painter.setPen(pen);
|
||||||
painter.drawPixmap(0,0,pixmap);
|
if(height > paperWidth)
|
||||||
|
{
|
||||||
|
//功能未实现
|
||||||
|
if(butSpace == 0)//为了去掉警告
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
painter.drawPixmap(0,0,pixmap);
|
||||||
|
}
|
||||||
painter.end();
|
painter.end();
|
||||||
return pic;
|
|
||||||
|
pen.setWidth(penWidth);//设置笔号
|
||||||
|
pen.setColor(QColor(Qt::black));
|
||||||
|
painter.begin(&picStr.sendPic);
|
||||||
|
painter.setPen(pen);
|
||||||
|
if(height > paperWidth)
|
||||||
|
{
|
||||||
|
//功能未实现
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
painter.drawPixmap(0,0,pixmap);
|
||||||
|
}
|
||||||
|
painter.end();
|
||||||
|
|
||||||
|
return picStr;
|
||||||
}
|
}
|
||||||
|
|
||||||
void creatMarkerDat(McFilesInfo &curFilesInfo, QString printDir, QString filePath, int fileIdx, double angle)
|
void creatMarkerDat(McFilesInfo &curFilesInfo, QString printDir, QString filePath, int fileIdx, double angle)
|
||||||
@ -108,12 +313,26 @@ void creatMarkerDat(McFilesInfo &curFilesInfo, QString printDir, QString filePat
|
|||||||
|
|
||||||
if(fileInfo.suffix().toUpper() == "DXF")
|
if(fileInfo.suffix().toUpper() == "DXF")
|
||||||
{
|
{
|
||||||
|
curFilesInfo.m_fileType = TYPE_FILE;
|
||||||
DxfHelper dxfHelper;
|
DxfHelper dxfHelper;
|
||||||
if(dxfHelper.generateDxf(filePath))
|
if(dxfHelper.generateDxf(filePath))
|
||||||
{
|
{
|
||||||
dxfHelper.getDxfPaths(); // 获取转换出来的dxf所有类型图形的点集
|
QList <CRPPolyline> polylineList;
|
||||||
QImage img = dxfHelper.generateDXFImage(); // 获取预览图像
|
CRPPolyline polyline;
|
||||||
img.save("D:\\1.png");
|
QVector<QVector<QPointF>> dxfPaths = dxfHelper.getDxfPaths(); // 获取转换出来的dxf所有类型图形的点集
|
||||||
|
//创建mark数据
|
||||||
|
for (int j = 0; j < dxfPaths.size(); j++)
|
||||||
|
{
|
||||||
|
polyline.m_listPoint.clear();
|
||||||
|
for(int i = 0; i < dxfPaths[j].length(); i++)
|
||||||
|
{
|
||||||
|
QPointF point = dxfPaths[j].at(i);
|
||||||
|
polyline.m_listPoint.append(point);
|
||||||
|
}
|
||||||
|
polylineList.append(polyline);
|
||||||
|
}
|
||||||
|
curFilesInfo.m_marker.m_listPolyline = polylineList;
|
||||||
|
curFilesInfo.m_fileRect = curFilesInfo.m_marker.GetRect();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if(fileInfo.suffix().toUpper() == "PLT")
|
else if(fileInfo.suffix().toUpper() == "PLT")
|
||||||
@ -181,3 +400,197 @@ void creatMarkerDat(McFilesInfo &curFilesInfo, QString printDir, QString filePat
|
|||||||
curFilesInfo.m_selectBlockNum = 0;//当前选择块数
|
curFilesInfo.m_selectBlockNum = 0;//当前选择块数
|
||||||
curFilesInfo.m_creatDataFlag = 1;
|
curFilesInfo.m_creatDataFlag = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void splitPaintPath(QPainterPath originalPath,double segmentHeight,int segmenNum,QPainterPath *pathSegments)
|
||||||
|
{
|
||||||
|
QPainterPath::Element element = originalPath.elementAt(0);
|
||||||
|
QPointF firstPoint(element.x, element.y);
|
||||||
|
qreal currentY = 0;
|
||||||
|
pathSegments[0].moveTo(firstPoint);
|
||||||
|
|
||||||
|
for (int i = 1; i < originalPath.elementCount(); i++)
|
||||||
|
{
|
||||||
|
QPainterPath::Element element = originalPath.elementAt(i);
|
||||||
|
QPointF curPoint(element.x, element.y);
|
||||||
|
QPointF prePoint(originalPath.elementAt(i-1).x, originalPath.elementAt(i-1).y);
|
||||||
|
|
||||||
|
QPointF prePot = prePoint;
|
||||||
|
int addFlag = 0;
|
||||||
|
for(int j = 0; j < segmenNum; j++)
|
||||||
|
{
|
||||||
|
currentY = segmentHeight + segmentHeight * j;
|
||||||
|
//在此块内
|
||||||
|
if(curPoint.y() <= currentY && curPoint.y() >= (currentY - segmentHeight) &&
|
||||||
|
prePoint.y() <= currentY && prePoint.y() >= (currentY - segmentHeight))
|
||||||
|
{
|
||||||
|
if (element.type == QPainterPath::MoveToElement)
|
||||||
|
{
|
||||||
|
pathSegments[j].moveTo(prePot);
|
||||||
|
pathSegments[j].moveTo(curPoint);
|
||||||
|
}
|
||||||
|
if (element.type == QPainterPath::LineToElement)
|
||||||
|
{
|
||||||
|
pathSegments[j].moveTo(prePot);
|
||||||
|
pathSegments[j].lineTo(curPoint);
|
||||||
|
}
|
||||||
|
addFlag = 1;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//未添加时继续判断
|
||||||
|
if(addFlag == 0)
|
||||||
|
{
|
||||||
|
//跨块,要判断跨了几块,求出交点
|
||||||
|
//判断prePoint在哪个块
|
||||||
|
int preIdx = 0;
|
||||||
|
int curIdx = 0;
|
||||||
|
int flag = 0;
|
||||||
|
for(int m = 0; m < segmenNum; m++)
|
||||||
|
{
|
||||||
|
qreal height = segmentHeight + segmentHeight * m;
|
||||||
|
//在此块内
|
||||||
|
if(prePoint.y() <= height && prePoint.y() >= (height - segmentHeight))
|
||||||
|
{
|
||||||
|
preIdx = m;
|
||||||
|
flag |= 1;
|
||||||
|
}
|
||||||
|
//在此块内
|
||||||
|
if(curPoint.y() <= height && curPoint.y() >= (height - segmentHeight))
|
||||||
|
{
|
||||||
|
curIdx = m;
|
||||||
|
flag |= 2;
|
||||||
|
}
|
||||||
|
if(flag == 3)
|
||||||
|
{
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//从上到下
|
||||||
|
if(preIdx < curIdx)
|
||||||
|
{
|
||||||
|
for(int p = preIdx; p < curIdx+1; p++)
|
||||||
|
{
|
||||||
|
currentY = segmentHeight + segmentHeight * p;
|
||||||
|
|
||||||
|
QPointF intersection;
|
||||||
|
if (lineIntersection(prePoint, curPoint, currentY, &intersection))
|
||||||
|
{
|
||||||
|
if (element.type == QPainterPath::MoveToElement)
|
||||||
|
{
|
||||||
|
pathSegments[p].moveTo(prePot);
|
||||||
|
pathSegments[p].moveTo(intersection);
|
||||||
|
if(curPoint.y() < currentY + segmentHeight)
|
||||||
|
{
|
||||||
|
if(p+1 < segmenNum)
|
||||||
|
{
|
||||||
|
pathSegments[p+1].moveTo(intersection);
|
||||||
|
pathSegments[p+1].moveTo(curPoint);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (element.type == QPainterPath::LineToElement)
|
||||||
|
{
|
||||||
|
pathSegments[p].moveTo(prePot);
|
||||||
|
pathSegments[p].lineTo(intersection);
|
||||||
|
if(curPoint.y() < currentY + segmentHeight)
|
||||||
|
{
|
||||||
|
if(p+1 < segmenNum)
|
||||||
|
{
|
||||||
|
pathSegments[p+1].moveTo(intersection);
|
||||||
|
pathSegments[p+1].lineTo(curPoint);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
prePot = intersection;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
//从下到上
|
||||||
|
for(int p = preIdx+1; p > curIdx; p--)
|
||||||
|
{
|
||||||
|
currentY = segmentHeight * p - segmentHeight;
|
||||||
|
|
||||||
|
QPointF intersection;
|
||||||
|
if (lineIntersection(curPoint, prePoint, currentY, &intersection))
|
||||||
|
{
|
||||||
|
if (element.type == QPainterPath::MoveToElement)
|
||||||
|
{
|
||||||
|
pathSegments[p-1].moveTo(prePot);
|
||||||
|
pathSegments[p-1].moveTo(intersection);
|
||||||
|
if(curPoint.y() > currentY - segmentHeight)
|
||||||
|
{
|
||||||
|
if(p-1-1 >= 0)
|
||||||
|
{
|
||||||
|
pathSegments[p-1-1].moveTo(intersection);
|
||||||
|
pathSegments[p-1-1].moveTo(curPoint);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (element.type == QPainterPath::LineToElement)
|
||||||
|
{
|
||||||
|
pathSegments[p-1].moveTo(prePot);
|
||||||
|
pathSegments[p-1].lineTo(intersection);
|
||||||
|
if(curPoint.y() > currentY - segmentHeight)
|
||||||
|
{
|
||||||
|
if(p-1-1 >= 0)
|
||||||
|
{
|
||||||
|
pathSegments[p-1-1].moveTo(intersection);
|
||||||
|
pathSegments[p-1-1].lineTo(curPoint);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
prePot = intersection;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 求一条线段与y轴的坐标
|
||||||
|
//返回值:
|
||||||
|
//-1: 没有交点
|
||||||
|
// 0: 线段与Y轴重合
|
||||||
|
// 1: 有一个交点(x)
|
||||||
|
bool lineIntersection(QPointF p1, QPointF p2, double y, QPointF* intersection)
|
||||||
|
{
|
||||||
|
//-1是为了避免double乘除时产生的误差
|
||||||
|
if (((p1.y() < (y - 1)) && (p2.y() < (y - 1))) ||
|
||||||
|
((p1.y() > y) && (p2.y() > y)) ||
|
||||||
|
0)
|
||||||
|
{// 没有交点
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
else if ((p1.y() == y) && (p2.y() == y))
|
||||||
|
{// 线段与Y重合,返回false,因为这种情况已经被添加到块中
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
// else if (p1.y() == y)
|
||||||
|
// {// p1与Y重合
|
||||||
|
// intersection->setX(p1.x());
|
||||||
|
// intersection->setY(y);
|
||||||
|
// return true;
|
||||||
|
// }
|
||||||
|
// else if (p2.y() == y)
|
||||||
|
// {// p2与Y重合
|
||||||
|
// intersection->setX(p2.x());
|
||||||
|
// intersection->setY(y);
|
||||||
|
// return true;
|
||||||
|
// }
|
||||||
|
else
|
||||||
|
{// 有一个交点
|
||||||
|
double dx1 = p2.x() - p1.x();
|
||||||
|
double dy1 = p2.y() - p1.y();
|
||||||
|
double dy = y - p1.y();
|
||||||
|
|
||||||
|
double x = (dx1/dy1) * dy + p1.x();
|
||||||
|
intersection->setX(x);
|
||||||
|
intersection->setY(y);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
@ -2,6 +2,7 @@
|
|||||||
#define DRAWDATA_H
|
#define DRAWDATA_H
|
||||||
|
|
||||||
#include <QPicture>
|
#include <QPicture>
|
||||||
|
#include <QBitmap>
|
||||||
#include "datafile/dxf/dxfhelper.h"
|
#include "datafile/dxf/dxfhelper.h"
|
||||||
#include "datafile/hpgl/importhpgl.h"
|
#include "datafile/hpgl/importhpgl.h"
|
||||||
#include "machine/printinfo/mcfiles.h"
|
#include "machine/printinfo/mcfiles.h"
|
||||||
@ -9,8 +10,19 @@
|
|||||||
#define TYPE_FILE 0
|
#define TYPE_FILE 0
|
||||||
#define TYPE_IMAGE 1
|
#define TYPE_IMAGE 1
|
||||||
|
|
||||||
QPicture creatPictureByData(Marker marker, QPainterPath &painterPath,int penWidth = 1);
|
typedef struct
|
||||||
QPicture creatPictureByBmp(QPixmap pixmap,int penWidth = 1);
|
{
|
||||||
|
QPicture showPic;//用于显示的picture,画笔为1像素,不为1像素时,MyGraphicsItem中绘制的线条会很淡
|
||||||
|
QPicture sendPic;//用于发送的picture,画笔为所设置像素
|
||||||
|
} CreatPictureStr;
|
||||||
|
|
||||||
|
|
||||||
|
//marker数据,绘制路径,纸宽,对接符间距,是否对接标志,右边距,笔宽
|
||||||
|
CreatPictureStr creatPictureByData(Marker marker,int paperWidth,int butSpace,int rightSpace,int penWidth = 1);
|
||||||
|
CreatPictureStr creatPictureByBmp(QPixmap pixmap,int paperWidth,int butSpace,int rightSpace,int penWidth = 1);
|
||||||
void creatMarkerDat(McFilesInfo &curFilesInfo, QString printDir, QString filePath, int fileIdx = -1, double angle = 0);//创建Marker数据
|
void creatMarkerDat(McFilesInfo &curFilesInfo, QString printDir, QString filePath, int fileIdx = -1, double angle = 0);//创建Marker数据
|
||||||
|
void splitPaintPath(QPainterPath originalPath,double segmentHeight,int segmenNum,QPainterPath *pathSegments);//纸张宽度不够时分割图形
|
||||||
|
//计算两线段的交点
|
||||||
|
bool lineIntersection(QPointF p1, QPointF p2, double y, QPointF* intersection);
|
||||||
|
|
||||||
#endif // DRAWDATA_H
|
#endif // DRAWDATA_H
|
||||||
|
@ -4,7 +4,6 @@ MyGraphicsItem::MyGraphicsItem()
|
|||||||
{
|
{
|
||||||
m_point.setX(0);
|
m_point.setX(0);
|
||||||
m_point.setY(0);
|
m_point.setY(0);
|
||||||
m_fileType = TYPE_FILE;
|
|
||||||
|
|
||||||
//使item可以被选择
|
//使item可以被选择
|
||||||
//this->setFlag(QGraphicsItem::ItemIsSelectable);
|
//this->setFlag(QGraphicsItem::ItemIsSelectable);
|
||||||
@ -33,55 +32,25 @@ void MyGraphicsItem::mouseReleaseEvent(QGraphicsSceneMouseEvent *event)
|
|||||||
return QGraphicsItem::mouseReleaseEvent(event);
|
return QGraphicsItem::mouseReleaseEvent(event);
|
||||||
}
|
}
|
||||||
|
|
||||||
QPicture MyGraphicsItem::getPictureByDat(Marker marker,int penWidth)
|
CreatPictureStr MyGraphicsItem::getPictureByDat(Marker marker,int paperWidth,int butSpace,int rightSpace,int penWidth)
|
||||||
{
|
{
|
||||||
m_fileType = TYPE_FILE;
|
m_pictureStr = creatPictureByData(marker,paperWidth,butSpace,rightSpace,penWidth);
|
||||||
if(penWidth != 1)
|
m_boundingRect = m_pictureStr.showPic.boundingRect();
|
||||||
{
|
return m_pictureStr;
|
||||||
QPicture pic;
|
|
||||||
pic = creatPictureByData(marker,m_drawPath,penWidth);
|
|
||||||
m_boundingRect = pic.boundingRect();
|
|
||||||
return pic;
|
|
||||||
}
|
|
||||||
return m_picture;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
QPicture MyGraphicsItem::getPictureByBmp(QPixmap pixmap,int penWidth)
|
CreatPictureStr MyGraphicsItem::getPictureByBmp(QPixmap pixmap,int paperWidth,int butSpace,int rightSpace,int penWidth)
|
||||||
{
|
{
|
||||||
m_fileType = TYPE_IMAGE;
|
m_pictureStr = creatPictureByBmp(pixmap,paperWidth,butSpace,rightSpace,penWidth);
|
||||||
m_picture = creatPictureByBmp(pixmap,penWidth);
|
m_boundingRect = m_pictureStr.showPic.boundingRect();
|
||||||
m_boundingRect = m_picture.boundingRect();
|
return m_pictureStr;
|
||||||
return m_picture;
|
|
||||||
}
|
|
||||||
|
|
||||||
QPainterPath MyGraphicsItem::getDrawPath()
|
|
||||||
{
|
|
||||||
return m_drawPath;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void MyGraphicsItem::setPicture(QPicture pic)
|
void MyGraphicsItem::setPicture(QPicture pic)
|
||||||
{
|
{
|
||||||
m_fileType = TYPE_IMAGE;
|
m_pictureStr.showPic = pic;
|
||||||
m_picture = pic;
|
|
||||||
// 外矩形
|
// 外矩形
|
||||||
m_boundingRect = m_picture.boundingRect();
|
m_boundingRect = m_pictureStr.showPic.boundingRect();
|
||||||
update();
|
|
||||||
}
|
|
||||||
|
|
||||||
void MyGraphicsItem::setPaintPath(QPainterPath path)
|
|
||||||
{
|
|
||||||
m_fileType = TYPE_FILE;
|
|
||||||
m_drawPath = path;
|
|
||||||
m_boundingRect = m_drawPath.boundingRect();
|
|
||||||
update();
|
|
||||||
}
|
|
||||||
|
|
||||||
void MyGraphicsItem::setPaintPathAndPic(QPainterPath path, QPicture pic)
|
|
||||||
{
|
|
||||||
m_fileType = TYPE_FILE;
|
|
||||||
m_drawPath = path;
|
|
||||||
m_picture = pic;
|
|
||||||
m_boundingRect = m_drawPath.boundingRect();
|
|
||||||
update();
|
update();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -89,7 +58,7 @@ void MyGraphicsItem::reflushBlockPos(QPoint p)
|
|||||||
{
|
{
|
||||||
m_point = p;
|
m_point = p;
|
||||||
|
|
||||||
m_blockPixmap = QPixmap(PIXMAPWIDTH,m_picture.height());
|
m_blockPixmap = QPixmap(PIXMAPWIDTH,m_pictureStr.showPic.height());
|
||||||
m_blockPixmap.fill(Qt::transparent);//透明色
|
m_blockPixmap.fill(Qt::transparent);//透明色
|
||||||
if(m_point.x() >= 0 && m_point.y() >= 0)
|
if(m_point.x() >= 0 && m_point.y() >= 0)
|
||||||
{
|
{
|
||||||
@ -133,15 +102,7 @@ void MyGraphicsItem::paint(QPainter *painter, const QStyleOptionGraphicsItem *op
|
|||||||
// painter->setRenderHint(QPainter::Antialiasing, true);
|
// painter->setRenderHint(QPainter::Antialiasing, true);
|
||||||
// painter->setRenderHint(QPainter::SmoothPixmapTransform, true);
|
// painter->setRenderHint(QPainter::SmoothPixmapTransform, true);
|
||||||
|
|
||||||
//用MyGraphicsItem画图缩放时如果笔宽不为1,直接画QPicture时线条会很轻,所以用m_drawPath绘制,pic就为原笔宽pic
|
painter->drawPicture(0,0,m_pictureStr.showPic);
|
||||||
//文件类型用m_drawPath,图片类型为m_picture
|
|
||||||
if(m_fileType == TYPE_FILE)
|
|
||||||
{
|
|
||||||
painter->drawPath(m_drawPath);
|
|
||||||
}
|
|
||||||
else if(m_fileType == TYPE_IMAGE)
|
|
||||||
{
|
|
||||||
painter->drawPicture(0,0,m_picture);
|
|
||||||
}
|
|
||||||
painter->drawPixmap(m_point.x(),m_point.y(),m_blockPixmap);
|
painter->drawPixmap(m_point.x(),m_point.y(),m_blockPixmap);
|
||||||
|
//painter->end();
|
||||||
}
|
}
|
||||||
|
@ -35,20 +35,15 @@ protected: //事件
|
|||||||
void mouseReleaseEvent(QGraphicsSceneMouseEvent* event);
|
void mouseReleaseEvent(QGraphicsSceneMouseEvent* event);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
QPicture m_picture;
|
CreatPictureStr m_pictureStr;
|
||||||
QPainterPath m_drawPath;
|
|
||||||
QPixmap m_blockPixmap;
|
QPixmap m_blockPixmap;
|
||||||
QPoint m_point;
|
QPoint m_point;
|
||||||
QRectF m_boundingRect;//返回形状
|
QRectF m_boundingRect;//返回形状
|
||||||
int m_fileType;
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
QPicture getPictureByDat(Marker marker,int penWidth = 1);
|
CreatPictureStr getPictureByDat(Marker marker,int paperWidth,int butSpace,int rightSpace,int penWidth = 1);
|
||||||
QPicture getPictureByBmp(QPixmap pixmap,int penWidth = 1);
|
CreatPictureStr getPictureByBmp(QPixmap pixmap,int paperWidth,int butSpace,int rightSpace,int penWidth = 1);
|
||||||
QPainterPath getDrawPath();
|
|
||||||
void setPicture(QPicture pic);
|
void setPicture(QPicture pic);
|
||||||
void setPaintPath(QPainterPath path);
|
|
||||||
void setPaintPathAndPic(QPainterPath path,QPicture pic);
|
|
||||||
void reflushBlockPos(QPoint p);//更显打印块位置
|
void reflushBlockPos(QPoint p);//更显打印块位置
|
||||||
|
|
||||||
public slots:
|
public slots:
|
||||||
|
@ -29,16 +29,6 @@ void MyGraphicsScene::mouseReleaseEvent(QGraphicsSceneMouseEvent *mouseEvent)
|
|||||||
return QGraphicsScene::mouseReleaseEvent(mouseEvent);
|
return QGraphicsScene::mouseReleaseEvent(mouseEvent);
|
||||||
}
|
}
|
||||||
|
|
||||||
void MyGraphicsScene::createScenePathAndPic(QPainterPath path, QPicture pic)
|
|
||||||
{
|
|
||||||
if(m_myGraphicsItem != NULL)
|
|
||||||
{
|
|
||||||
this->clear();
|
|
||||||
m_myGraphicsItem->setPaintPathAndPic(path,pic);
|
|
||||||
this->addItem(m_myGraphicsItem);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void MyGraphicsScene::addItemToScene()
|
void MyGraphicsScene::addItemToScene()
|
||||||
{
|
{
|
||||||
//绘制留边
|
//绘制留边
|
||||||
@ -56,34 +46,24 @@ void MyGraphicsScene::cleanScene()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
QPicture MyGraphicsScene::getPictureByDat(Marker marker,int penWidth)
|
CreatPictureStr MyGraphicsScene::getPictureByDat(Marker marker,int paperWidth,int butSpace,int rightSpace,int penWidth)
|
||||||
{
|
{
|
||||||
QPicture pic;
|
CreatPictureStr picStr;
|
||||||
if(m_myGraphicsItem != NULL)
|
if(m_myGraphicsItem != NULL)
|
||||||
{
|
{
|
||||||
pic = m_myGraphicsItem->getPictureByDat(marker,penWidth);
|
picStr = m_myGraphicsItem->getPictureByDat(marker,paperWidth,butSpace,rightSpace,penWidth);
|
||||||
}
|
}
|
||||||
return pic;
|
return picStr;
|
||||||
}
|
}
|
||||||
|
|
||||||
QPicture MyGraphicsScene::getPictureByBmp(QPixmap pixmap,int penWidth)
|
CreatPictureStr MyGraphicsScene::getPictureByBmp(QPixmap pixmap,int paperWidth,int butSpace,int rightSpace,int penWidth)
|
||||||
{
|
{
|
||||||
QPicture pic;
|
CreatPictureStr picStr;
|
||||||
if(m_myGraphicsItem != NULL)
|
if(m_myGraphicsItem != NULL)
|
||||||
{
|
{
|
||||||
pic = m_myGraphicsItem->getPictureByBmp(pixmap,penWidth);
|
picStr = m_myGraphicsItem->getPictureByBmp(pixmap,paperWidth,butSpace,rightSpace,penWidth);
|
||||||
}
|
}
|
||||||
return pic;
|
return picStr;
|
||||||
}
|
|
||||||
|
|
||||||
QPainterPath MyGraphicsScene::getDrawPath()
|
|
||||||
{
|
|
||||||
QPainterPath path;
|
|
||||||
if(m_myGraphicsItem != NULL)
|
|
||||||
{
|
|
||||||
path = m_myGraphicsItem->getDrawPath();
|
|
||||||
}
|
|
||||||
return path;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void MyGraphicsScene::swithSceneByPic(QPicture pic)
|
void MyGraphicsScene::swithSceneByPic(QPicture pic)
|
||||||
@ -96,17 +76,7 @@ void MyGraphicsScene::swithSceneByPic(QPicture pic)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void MyGraphicsScene::swithSceneByPath(QPainterPath path)
|
void MyGraphicsScene::reflushBlockScene(QPoint p)
|
||||||
{
|
|
||||||
if(m_myGraphicsItem != NULL)
|
|
||||||
{
|
|
||||||
this->clear();
|
|
||||||
m_myGraphicsItem->setPaintPath(path);
|
|
||||||
this->addItem(m_myGraphicsItem);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void MyGraphicsScene::ReflushBlockScene(QPoint p)
|
|
||||||
{
|
{
|
||||||
if(m_myGraphicsItem != NULL)
|
if(m_myGraphicsItem != NULL)
|
||||||
{
|
{
|
||||||
|
@ -23,15 +23,12 @@ private:
|
|||||||
MyGraphicsItem *m_myGraphicsItem;
|
MyGraphicsItem *m_myGraphicsItem;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
void createScenePathAndPic(QPainterPath path,QPicture pic);
|
|
||||||
void addItemToScene();
|
void addItemToScene();
|
||||||
void cleanScene();
|
void cleanScene();
|
||||||
QPicture getPictureByDat(Marker marker,int penWidth = 1);
|
CreatPictureStr getPictureByDat(Marker marker,int paperWidth,int butSpace,int rightSpace,int penWidth = 1);
|
||||||
QPicture getPictureByBmp(QPixmap pixmap,int penWidth = 1);
|
CreatPictureStr getPictureByBmp(QPixmap pixmap,int paperWidth,int butSpace,int rightSpace,int penWidth = 1);
|
||||||
QPainterPath getDrawPath();
|
|
||||||
void swithSceneByPic(QPicture pic);
|
void swithSceneByPic(QPicture pic);
|
||||||
void swithSceneByPath(QPainterPath path);
|
void reflushBlockScene(QPoint p);
|
||||||
void ReflushBlockScene(QPoint p);
|
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
|
|
||||||
|
@ -183,50 +183,30 @@ void MyGraphicsView::wheelEvent(QWheelEvent *event)
|
|||||||
verticalScrollBar()->setValue(int(viewPoint.y() - viewHeight * vScale));
|
verticalScrollBar()->setValue(int(viewPoint.y() - viewHeight * vScale));
|
||||||
}
|
}
|
||||||
|
|
||||||
QPicture MyGraphicsView::getPictureByDat(Marker marker,int penWidth)
|
CreatPictureStr MyGraphicsView::getPictureByDat(Marker marker,int paperWidth,int butSpace,int rightSpace,int penWidth)
|
||||||
{
|
{
|
||||||
QPicture pic;
|
CreatPictureStr picStr;
|
||||||
if(m_scene != NULL)
|
if(m_scene != NULL)
|
||||||
{
|
{
|
||||||
pic = m_scene->getPictureByDat(marker,penWidth);
|
picStr = m_scene->getPictureByDat(marker,paperWidth,butSpace,rightSpace,penWidth);
|
||||||
m_scene->addItemToScene();
|
m_scene->addItemToScene();
|
||||||
QRectF rectItem = m_scene->itemsBoundingRect();
|
QRectF rectItem = m_scene->itemsBoundingRect();
|
||||||
this->fitInView(rectItem, Qt::KeepAspectRatio);
|
this->fitInView(rectItem, Qt::KeepAspectRatio);
|
||||||
}
|
}
|
||||||
return pic;
|
return picStr;
|
||||||
}
|
}
|
||||||
|
|
||||||
QPicture MyGraphicsView::getPictureByBmp(QPixmap pixmap,int penWidth)
|
CreatPictureStr MyGraphicsView::getPictureByBmp(QPixmap pixmap,int paperWidth,int butSpace,int rightSpace,int penWidth)
|
||||||
{
|
{
|
||||||
QPicture pic;
|
CreatPictureStr picStr;
|
||||||
if(m_scene != NULL)
|
if(m_scene != NULL)
|
||||||
{
|
{
|
||||||
pic = m_scene->getPictureByBmp(pixmap,penWidth);
|
picStr = m_scene->getPictureByBmp(pixmap,paperWidth,butSpace,rightSpace,penWidth);
|
||||||
m_scene->addItemToScene();
|
m_scene->addItemToScene();
|
||||||
QRectF rectItem = m_scene->itemsBoundingRect();
|
QRectF rectItem = m_scene->itemsBoundingRect();
|
||||||
this->fitInView(rectItem, Qt::KeepAspectRatio);
|
this->fitInView(rectItem, Qt::KeepAspectRatio);
|
||||||
}
|
}
|
||||||
return pic;
|
return picStr;
|
||||||
}
|
|
||||||
|
|
||||||
QPainterPath MyGraphicsView::getDrawPath()
|
|
||||||
{
|
|
||||||
QPainterPath path;
|
|
||||||
if(m_scene != NULL)
|
|
||||||
{
|
|
||||||
path = m_scene->getDrawPath();
|
|
||||||
}
|
|
||||||
return path;
|
|
||||||
}
|
|
||||||
|
|
||||||
void MyGraphicsView::creatViewPathAndPic(QPainterPath path,QPicture pic)
|
|
||||||
{
|
|
||||||
if(m_scene != NULL)
|
|
||||||
{
|
|
||||||
m_scene->createScenePathAndPic(path,pic);
|
|
||||||
QRectF rectItem = m_scene->itemsBoundingRect();
|
|
||||||
this->fitInView(rectItem, Qt::KeepAspectRatio);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void MyGraphicsView::cleanView()
|
void MyGraphicsView::cleanView()
|
||||||
@ -251,20 +231,10 @@ void MyGraphicsView::swithViewByPic(QPicture pic)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void MyGraphicsView::swithViewByPath(QPainterPath path)
|
|
||||||
{
|
|
||||||
if(m_scene != NULL)
|
|
||||||
{
|
|
||||||
m_scene->swithSceneByPath(path);
|
|
||||||
QRectF rectItem = m_scene->itemsBoundingRect();
|
|
||||||
this->fitInView(rectItem, Qt::KeepAspectRatio);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void MyGraphicsView::reflushBlockView(QPoint p)
|
void MyGraphicsView::reflushBlockView(QPoint p)
|
||||||
{
|
{
|
||||||
if(m_scene != NULL)
|
if(m_scene != NULL)
|
||||||
{
|
{
|
||||||
m_scene->ReflushBlockScene(p);
|
m_scene->reflushBlockScene(p);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -34,13 +34,10 @@ protected:
|
|||||||
void wheelEvent(QWheelEvent *event);
|
void wheelEvent(QWheelEvent *event);
|
||||||
|
|
||||||
public:
|
public:
|
||||||
QPicture getPictureByDat(Marker marker,int penWidth = 1);
|
CreatPictureStr getPictureByDat(Marker marker,int paperWidth,int butSpace,int rightSpace,int penWidth = 1);
|
||||||
QPicture getPictureByBmp(QPixmap pixmap,int penWidth = 1);
|
CreatPictureStr getPictureByBmp(QPixmap pixmap,int paperWidth,int butSpace,int rightSpace,int penWidth = 1);
|
||||||
QPainterPath getDrawPath();
|
|
||||||
void creatViewPathAndPic(QPainterPath path,QPicture pic);
|
|
||||||
void cleanView();
|
void cleanView();
|
||||||
void swithViewByPic(QPicture pic);
|
void swithViewByPic(QPicture pic);
|
||||||
void swithViewByPath(QPainterPath path);
|
|
||||||
void reflushBlockView(QPoint p);
|
void reflushBlockView(QPoint p);
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
|
187
english.ts
187
english.ts
@ -179,7 +179,7 @@
|
|||||||
<context>
|
<context>
|
||||||
<name>ImportHPGL</name>
|
<name>ImportHPGL</name>
|
||||||
<message>
|
<message>
|
||||||
<location filename="datafile/hpgl/importhpgl.cpp" line="1816"/>
|
<location filename="datafile/hpgl/importhpgl.cpp" line="1965"/>
|
||||||
<source>Encrypted file parsing error!</source>
|
<source>Encrypted file parsing error!</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
@ -269,21 +269,19 @@
|
|||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="mainwindow.ui" line="350"/>
|
|
||||||
<location filename="mainwindow.ui" line="465"/>
|
<location filename="mainwindow.ui" line="465"/>
|
||||||
<source>Start</source>
|
<source>Start</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="mainwindow.ui" line="355"/>
|
|
||||||
<location filename="mainwindow.ui" line="477"/>
|
<location filename="mainwindow.ui" line="477"/>
|
||||||
<source>Pause</source>
|
<source>Pause</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="mainwindow.ui" line="360"/>
|
<location filename="mainwindow.ui" line="360"/>
|
||||||
<location filename="mainwindow.cpp" line="823"/>
|
<location filename="mainwindow.cpp" line="764"/>
|
||||||
<location filename="mainwindow.cpp" line="853"/>
|
<location filename="mainwindow.cpp" line="794"/>
|
||||||
<source>Delete</source>
|
<source>Delete</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
@ -390,6 +388,7 @@
|
|||||||
<message>
|
<message>
|
||||||
<location filename="mainwindow.ui" line="489"/>
|
<location filename="mainwindow.ui" line="489"/>
|
||||||
<source>DrawingSetting</source>
|
<source>DrawingSetting</source>
|
||||||
|
<extracomment>图形设置</extracomment>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
@ -408,233 +407,255 @@
|
|||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="mainwindow.cpp" line="149"/>
|
<location filename="mainwindow.cpp" line="71"/>
|
||||||
<location filename="mainwindow.cpp" line="923"/>
|
<location filename="mainwindow.cpp" line="162"/>
|
||||||
<location filename="mainwindow.cpp" line="931"/>
|
<location filename="mainwindow.cpp" line="873"/>
|
||||||
<location filename="mainwindow.cpp" line="956"/>
|
<location filename="mainwindow.cpp" line="880"/>
|
||||||
<location filename="mainwindow.cpp" line="1369"/>
|
<location filename="mainwindow.cpp" line="903"/>
|
||||||
<location filename="mainwindow.cpp" line="1378"/>
|
<location filename="mainwindow.cpp" line="1280"/>
|
||||||
<location filename="mainwindow.cpp" line="1501"/>
|
<location filename="mainwindow.cpp" line="1289"/>
|
||||||
<location filename="mainwindow.cpp" line="1510"/>
|
<location filename="mainwindow.cpp" line="1420"/>
|
||||||
<location filename="mainwindow.cpp" line="1561"/>
|
<location filename="mainwindow.cpp" line="1429"/>
|
||||||
<location filename="mainwindow.cpp" line="1649"/>
|
<location filename="mainwindow.cpp" line="1481"/>
|
||||||
|
<location filename="mainwindow.cpp" line="1518"/>
|
||||||
|
<location filename="mainwindow.cpp" line="1604"/>
|
||||||
<source>Prompt</source>
|
<source>Prompt</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="mainwindow.cpp" line="150"/>
|
<location filename="mainwindow.cpp" line="163"/>
|
||||||
<source>Printing this file, it cannot be moved!</source>
|
<source>Printing this file, it cannot be moved!</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="mainwindow.cpp" line="393"/>
|
<location filename="mainwindow.cpp" line="362"/>
|
||||||
<location filename="mainwindow.cpp" line="455"/>
|
<location filename="mainwindow.cpp" line="424"/>
|
||||||
<source>Connnecting...</source>
|
<source>Connnecting...</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="mainwindow.cpp" line="397"/>
|
<location filename="mainwindow.cpp" line="366"/>
|
||||||
<location filename="mainwindow.cpp" line="459"/>
|
<location filename="mainwindow.cpp" line="428"/>
|
||||||
<source>Connected</source>
|
<source>Connected</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="mainwindow.cpp" line="401"/>
|
<location filename="mainwindow.cpp" line="370"/>
|
||||||
<location filename="mainwindow.cpp" line="422"/>
|
<location filename="mainwindow.cpp" line="391"/>
|
||||||
<location filename="mainwindow.cpp" line="452"/>
|
<location filename="mainwindow.cpp" line="421"/>
|
||||||
<source>NotConnected</source>
|
<source>NotConnected</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="mainwindow.cpp" line="428"/>
|
<location filename="mainwindow.cpp" line="311"/>
|
||||||
<location filename="mainwindow.cpp" line="466"/>
|
<location filename="mainwindow.cpp" line="397"/>
|
||||||
|
<location filename="mainwindow.cpp" line="435"/>
|
||||||
|
<location filename="mainwindow.cpp" line="1108"/>
|
||||||
<source>Idle</source>
|
<source>Idle</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="mainwindow.cpp" line="432"/>
|
<location filename="mainwindow.cpp" line="72"/>
|
||||||
<location filename="mainwindow.cpp" line="470"/>
|
<source>Do you want to exit the program?</source>
|
||||||
|
<translation type="unfinished"></translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="mainwindow.cpp" line="319"/>
|
||||||
|
<location filename="mainwindow.cpp" line="1156"/>
|
||||||
|
<source>Pause print</source>
|
||||||
|
<translation type="unfinished"></translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="mainwindow.cpp" line="401"/>
|
||||||
|
<location filename="mainwindow.cpp" line="439"/>
|
||||||
|
<location filename="mainwindow.cpp" line="1112"/>
|
||||||
<source>Working</source>
|
<source>Working</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="mainwindow.cpp" line="539"/>
|
<location filename="mainwindow.cpp" line="512"/>
|
||||||
<location filename="mainwindow.cpp" line="712"/>
|
<location filename="mainwindow.cpp" line="698"/>
|
||||||
<location filename="mainwindow.cpp" line="1057"/>
|
<location filename="mainwindow.cpp" line="961"/>
|
||||||
|
<location filename="mainwindow.cpp" line="1148"/>
|
||||||
<source>Waitting</source>
|
<source>Waitting</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="mainwindow.cpp" line="543"/>
|
<location filename="mainwindow.cpp" line="516"/>
|
||||||
<location filename="mainwindow.cpp" line="716"/>
|
<location filename="mainwindow.cpp" line="702"/>
|
||||||
<location filename="mainwindow.cpp" line="1196"/>
|
<location filename="mainwindow.cpp" line="1152"/>
|
||||||
<source>Printting</source>
|
<source>Printting</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="mainwindow.cpp" line="622"/>
|
<location filename="mainwindow.cpp" line="604"/>
|
||||||
<location filename="mainwindow.cpp" line="1331"/>
|
<location filename="mainwindow.cpp" line="1238"/>
|
||||||
<source>FileName</source>
|
<source>FileName</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="mainwindow.cpp" line="622"/>
|
<location filename="mainwindow.cpp" line="604"/>
|
||||||
<location filename="mainwindow.cpp" line="1331"/>
|
<location filename="mainwindow.cpp" line="1238"/>
|
||||||
<source>Length</source>
|
<source>Length</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="mainwindow.cpp" line="622"/>
|
<location filename="mainwindow.cpp" line="604"/>
|
||||||
<location filename="mainwindow.cpp" line="1331"/>
|
<location filename="mainwindow.cpp" line="1238"/>
|
||||||
<source>Width</source>
|
<source>Width</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="mainwindow.cpp" line="623"/>
|
<location filename="mainwindow.cpp" line="605"/>
|
||||||
<location filename="mainwindow.cpp" line="1332"/>
|
<location filename="mainwindow.cpp" line="1239"/>
|
||||||
<source>Printed</source>
|
<source>Printed</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="mainwindow.cpp" line="623"/>
|
<location filename="mainwindow.cpp" line="605"/>
|
||||||
<location filename="mainwindow.cpp" line="1332"/>
|
<location filename="mainwindow.cpp" line="1239"/>
|
||||||
<source>Progress</source>
|
<source>Progress</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="mainwindow.cpp" line="623"/>
|
<location filename="mainwindow.cpp" line="605"/>
|
||||||
<location filename="mainwindow.cpp" line="1332"/>
|
<location filename="mainwindow.cpp" line="1239"/>
|
||||||
<source>Numbers</source>
|
<source>Numbers</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="mainwindow.cpp" line="623"/>
|
<location filename="mainwindow.cpp" line="605"/>
|
||||||
<location filename="mainwindow.cpp" line="1332"/>
|
<location filename="mainwindow.cpp" line="1239"/>
|
||||||
<source>State</source>
|
<source>State</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="mainwindow.cpp" line="623"/>
|
<location filename="mainwindow.cpp" line="605"/>
|
||||||
<location filename="mainwindow.cpp" line="1332"/>
|
<location filename="mainwindow.cpp" line="1239"/>
|
||||||
<source>FilePath</source>
|
<source>FilePath</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="mainwindow.cpp" line="623"/>
|
<location filename="mainwindow.cpp" line="605"/>
|
||||||
<location filename="mainwindow.cpp" line="1332"/>
|
<location filename="mainwindow.cpp" line="1239"/>
|
||||||
<source>StartPoint</source>
|
<source>StartPoint</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="mainwindow.cpp" line="644"/>
|
<location filename="mainwindow.cpp" line="626"/>
|
||||||
<location filename="mainwindow.cpp" line="1336"/>
|
<location filename="mainwindow.cpp" line="1243"/>
|
||||||
<source>McName</source>
|
<source>McName</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="mainwindow.cpp" line="644"/>
|
<location filename="mainwindow.cpp" line="626"/>
|
||||||
<location filename="mainwindow.cpp" line="1336"/>
|
<location filename="mainwindow.cpp" line="1243"/>
|
||||||
<source>McIp</source>
|
<source>McIp</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="mainwindow.cpp" line="644"/>
|
<location filename="mainwindow.cpp" line="626"/>
|
||||||
<location filename="mainwindow.cpp" line="1336"/>
|
<location filename="mainwindow.cpp" line="1243"/>
|
||||||
<source>McConState</source>
|
<source>McConState</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="mainwindow.cpp" line="644"/>
|
<location filename="mainwindow.cpp" line="626"/>
|
||||||
<location filename="mainwindow.cpp" line="1336"/>
|
<location filename="mainwindow.cpp" line="1243"/>
|
||||||
<source>McState</source>
|
<source>McState</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="mainwindow.cpp" line="644"/>
|
<location filename="mainwindow.cpp" line="626"/>
|
||||||
<location filename="mainwindow.cpp" line="1336"/>
|
<location filename="mainwindow.cpp" line="1243"/>
|
||||||
<source>McProgress</source>
|
<source>McProgress</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="mainwindow.cpp" line="819"/>
|
<location filename="mainwindow.cpp" line="760"/>
|
||||||
<source>Print preview</source>
|
<source>Print preview</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="mainwindow.cpp" line="820"/>
|
<location filename="mainwindow.cpp" line="761"/>
|
||||||
<source>Number of modified print</source>
|
<source>Number of modified print</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="mainwindow.cpp" line="821"/>
|
<location filename="mainwindow.cpp" line="762"/>
|
||||||
<source>Modify the starting print point</source>
|
<source>Modify the starting print point</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="mainwindow.cpp" line="822"/>
|
<location filename="mainwindow.cpp" line="763"/>
|
||||||
<source>View print information</source>
|
<source>View print information</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="mainwindow.cpp" line="924"/>
|
<location filename="mainwindow.cpp" line="881"/>
|
||||||
<source>Do you want to delete this drawing?</source>
|
<source>Do you want to delete this drawing?</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="mainwindow.cpp" line="932"/>
|
<location filename="mainwindow.cpp" line="874"/>
|
||||||
<source>Printing this file, it cannot be deleted!</source>
|
<source>Printing this file, it cannot be deleted!</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="mainwindow.cpp" line="957"/>
|
<location filename="mainwindow.cpp" line="904"/>
|
||||||
<source>After deletion, the machine cannot be controlled. Do you want to delete this machine?</source>
|
<source>After deletion, the machine cannot be controlled. Do you want to delete this machine?</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="mainwindow.cpp" line="1192"/>
|
<location filename="mainwindow.cpp" line="1160"/>
|
||||||
<source>Complete</source>
|
<source>Complete</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="mainwindow.cpp" line="1370"/>
|
<location filename="mainwindow.cpp" line="1281"/>
|
||||||
<location filename="mainwindow.cpp" line="1502"/>
|
<location filename="mainwindow.cpp" line="1421"/>
|
||||||
<source>Please select a machine!</source>
|
<source>Please select a machine!</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="mainwindow.cpp" line="1379"/>
|
<location filename="mainwindow.cpp" line="1290"/>
|
||||||
<location filename="mainwindow.cpp" line="1511"/>
|
<location filename="mainwindow.cpp" line="1430"/>
|
||||||
<source>Loading file, please wait!</source>
|
<source>Loading file, please wait!</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="mainwindow.cpp" line="1392"/>
|
<location filename="mainwindow.cpp" line="1300"/>
|
||||||
<location filename="mainwindow.cpp" line="1524"/>
|
<location filename="mainwindow.cpp" line="1440"/>
|
||||||
<source>Open File Dialog</source>
|
<source>Open File Dialog</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="mainwindow.cpp" line="1394"/>
|
<location filename="mainwindow.cpp" line="1302"/>
|
||||||
<source>File(*.plt *.dxf)</source>
|
<source>File(*.plt *.dxf)</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="mainwindow.cpp" line="1526"/>
|
<location filename="mainwindow.cpp" line="1442"/>
|
||||||
<source>Image File(*.png *.bmp *.jpg)</source>
|
<source>Image File(*.png *.bmp *.jpg)</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="mainwindow.cpp" line="1562"/>
|
<location filename="mainwindow.cpp" line="1482"/>
|
||||||
<source>Please select the machine you want to set the directory!</source>
|
<source>Please select the machine you want to set the directory!</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="mainwindow.cpp" line="1574"/>
|
<location filename="mainwindow.cpp" line="1494"/>
|
||||||
<source>Select Folder</source>
|
<source>Select Folder</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="mainwindow.cpp" line="1650"/>
|
<location filename="mainwindow.cpp" line="1519"/>
|
||||||
|
<source>Do you want to start printing on all machines?</source>
|
||||||
|
<translation type="unfinished"></translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<location filename="mainwindow.cpp" line="1605"/>
|
||||||
<source>The maximum number of connections has been reached and cannot be added again!</source>
|
<source>The maximum number of connections has been reached and cannot be added again!</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
@ -934,7 +955,7 @@
|
|||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="printinfodialog.cpp" line="78"/>
|
<location filename="printinfodialog.cpp" line="80"/>
|
||||||
<source>piece</source>
|
<source>piece</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
@ -1033,12 +1054,12 @@
|
|||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="printviewwindow.cpp" line="106"/>
|
<location filename="printviewwindow.cpp" line="111"/>
|
||||||
<source>Prompt</source>
|
<source>Prompt</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="printviewwindow.cpp" line="107"/>
|
<location filename="printviewwindow.cpp" line="112"/>
|
||||||
<source>Unreasonable value input!</source>
|
<source>Unreasonable value input!</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
|
@ -154,6 +154,7 @@ int BWBmp::Compress(int idx, int dir, int segWidth, int segHeight)
|
|||||||
//---------------------------------------------------------
|
//---------------------------------------------------------
|
||||||
// 读取位图信息,对数组赋值
|
// 读取位图信息,对数组赋值
|
||||||
unsigned char sta,tmpdat,mod;
|
unsigned char sta,tmpdat,mod;
|
||||||
|
sta = tmpdat = mod = 0;
|
||||||
const unsigned char * pBitDat;
|
const unsigned char * pBitDat;
|
||||||
int i, j, k, l, m, n;
|
int i, j, k, l, m, n;
|
||||||
int addr;
|
int addr;
|
||||||
@ -163,7 +164,7 @@ int BWBmp::Compress(int idx, int dir, int segWidth, int segHeight)
|
|||||||
int * segdat = new int [msegnum];
|
int * segdat = new int [msegnum];
|
||||||
|
|
||||||
//------------------------------------
|
//------------------------------------
|
||||||
unsigned char tgtdat;
|
unsigned char tgtdat = 0;
|
||||||
QVector<unsigned char> compType(wsegnum); // 本块位图压缩类型, =0, 不压缩; =1, 按字节压缩(分段压缩);
|
QVector<unsigned char> compType(wsegnum); // 本块位图压缩类型, =0, 不压缩; =1, 按字节压缩(分段压缩);
|
||||||
QVector<unsigned int> compSegOffset(wsegnum); // 分段数据起始位置
|
QVector<unsigned int> compSegOffset(wsegnum); // 分段数据起始位置
|
||||||
|
|
||||||
|
@ -58,7 +58,7 @@ int CreatPrintBmp::creatFileListMarker(int idx)
|
|||||||
{
|
{
|
||||||
McFilesInfo curFilesInfo;//当前文件信息
|
McFilesInfo curFilesInfo;//当前文件信息
|
||||||
creatMarkerDat(curFilesInfo,m_printFileDir,filePath,m_listFileIdx,m_rotateAngle);
|
creatMarkerDat(curFilesInfo,m_printFileDir,filePath,m_listFileIdx,m_rotateAngle);
|
||||||
long long fileTotalLength = (curFilesInfo.m_fileRect.right() - curFilesInfo.m_fileRect.left())/M_IDPMM;
|
long long fileTotalLength = (curFilesInfo.m_fileRect.right() - curFilesInfo.m_fileRect.left())/MMPIXELY;
|
||||||
m_mcPrintInfo->m_fileNums += 1;
|
m_mcPrintInfo->m_fileNums += 1;
|
||||||
m_mcPrintInfo->m_fileTotalLength += fileTotalLength;
|
m_mcPrintInfo->m_fileTotalLength += fileTotalLength;
|
||||||
m_mcPrintInfo->m_filesList.append(curFilesInfo);
|
m_mcPrintInfo->m_filesList.append(curFilesInfo);
|
||||||
@ -107,43 +107,20 @@ int CreatPrintBmp::creatFileListDatAndSend(int idx)
|
|||||||
}
|
}
|
||||||
|
|
||||||
QPicture pic;
|
QPicture pic;
|
||||||
QPen pen;
|
|
||||||
pen.setWidth(1);
|
|
||||||
pen.setColor(QColor(Qt::black));
|
|
||||||
|
|
||||||
int oft = 0;//起始打印位置的偏移
|
int oft = 0;//起始打印位置的偏移
|
||||||
if(curFilesInfo.m_fileType == TYPE_FILE)
|
pic = m_mcPrintInfo->m_filesList[idx].m_sendPic;
|
||||||
|
oft = (int)(m_mcPrintInfo->m_filesList[idx].m_startPoint*MMPIXELY);
|
||||||
|
//将picture保存为多个宽度为PIXMAPWIDTH像素的bmp
|
||||||
|
m_mcPrintInfo->m_totalNums = (pic.width() - oft) / PIXMAPWIDTH;
|
||||||
|
int lwidth = (pic.width() - oft) % (PIXMAPWIDTH);
|
||||||
|
if(lwidth != 0)
|
||||||
{
|
{
|
||||||
pic = m_mcPrintInfo->m_filesList[idx].m_pic;
|
m_mcPrintInfo->m_totalNums += 1;
|
||||||
oft = (int)(m_mcPrintInfo->m_filesList[idx].m_startPoint*MMPIXELY);
|
|
||||||
//将picture保存为多个宽度为PIXMAPWIDTH像素的bmp
|
|
||||||
m_mcPrintInfo->m_totalNums = (pic.width() - oft) / PIXMAPWIDTH;
|
|
||||||
int lwidth = (pic.width() - oft) % (PIXMAPWIDTH);
|
|
||||||
if(lwidth != 0)
|
|
||||||
{
|
|
||||||
m_mcPrintInfo->m_totalNums += 1;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
else if(curFilesInfo.m_fileType == TYPE_IMAGE)
|
|
||||||
{
|
|
||||||
//将图片画在picture上
|
|
||||||
QPainter painter;
|
|
||||||
painter.begin(&pic);
|
|
||||||
painter.setPen(pen);
|
|
||||||
painter.drawPixmap(0,0,m_mcPrintInfo->m_filesList[idx].m_pixmap);
|
|
||||||
painter.end();
|
|
||||||
|
|
||||||
//将pixmap保存为多个宽度为PIXMAPWIDTH像素的bmp
|
|
||||||
m_mcPrintInfo->m_totalNums = curFilesInfo.m_pixmap.width() / PIXMAPWIDTH;
|
|
||||||
int lwidth = curFilesInfo.m_pixmap.width() % PIXMAPWIDTH;
|
|
||||||
if(lwidth != 0)
|
|
||||||
{
|
|
||||||
m_mcPrintInfo->m_totalNums += 1;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
m_mcPrintInfo->m_filesList[idx].m_totalBlocks = (pic.width() - oft)/ PIXMAPWIDTH;
|
m_mcPrintInfo->m_filesList[idx].m_totalBlocks = (pic.width() - oft)/ PIXMAPWIDTH;
|
||||||
|
lwidth = (pic.width() - oft) % PIXMAPWIDTH;
|
||||||
int lwidth = (pic.width() - oft) % PIXMAPWIDTH;
|
|
||||||
if(lwidth != 0)
|
if(lwidth != 0)
|
||||||
{
|
{
|
||||||
m_mcPrintInfo->m_filesList[idx].m_totalBlocks += 1;
|
m_mcPrintInfo->m_filesList[idx].m_totalBlocks += 1;
|
||||||
@ -178,7 +155,7 @@ int CreatPrintBmp::creatBmpBlockDatAndSend(int fileidx, int idx)
|
|||||||
int nextNum = idx / oneNumCount;
|
int nextNum = idx / oneNumCount;
|
||||||
idx = idx - nextNum * oneNumCount;
|
idx = idx - nextNum * oneNumCount;
|
||||||
|
|
||||||
QPicture pic = m_mcPrintInfo->m_filesList[fileidx].m_pic;
|
QPicture pic = m_mcPrintInfo->m_filesList[fileidx].m_sendPic;
|
||||||
int oft = (int)(m_mcPrintInfo->m_filesList[fileidx].m_startPoint*MMPIXELY);
|
int oft = (int)(m_mcPrintInfo->m_filesList[fileidx].m_startPoint*MMPIXELY);
|
||||||
|
|
||||||
//将picture保存为多个宽度为PIXMAPWIDTH像素的bmp
|
//将picture保存为多个宽度为PIXMAPWIDTH像素的bmp
|
||||||
@ -568,7 +545,7 @@ void CreatPrintBmp::setDeleteFile(McPrintInfo *printInfo, int fileIdx)
|
|||||||
|
|
||||||
if(m_deleteFileIdx != m_fileBegIdx && m_deleteFileIdx != -1)
|
if(m_deleteFileIdx != m_fileBegIdx && m_deleteFileIdx != -1)
|
||||||
{
|
{
|
||||||
int length = (m_mcPrintInfo->m_filesList[m_deleteFileIdx].m_fileRect.right() - m_mcPrintInfo->m_filesList[m_deleteFileIdx].m_fileRect.left())/M_IDPMM;
|
int length = (m_mcPrintInfo->m_filesList[m_deleteFileIdx].m_fileRect.right() - m_mcPrintInfo->m_filesList[m_deleteFileIdx].m_fileRect.left())/MMPIXELY;
|
||||||
m_mcPrintInfo->m_fileTotalLength -= length;
|
m_mcPrintInfo->m_fileTotalLength -= length;
|
||||||
|
|
||||||
QString mcFile = m_printFileDir + QString::number(m_deleteFileIdx+1);
|
QString mcFile = m_printFileDir + QString::number(m_deleteFileIdx+1);
|
||||||
|
@ -17,7 +17,6 @@
|
|||||||
#include "datafile/view/drawdata.h"
|
#include "datafile/view/drawdata.h"
|
||||||
|
|
||||||
#define PIXMAPWIDTH 1200
|
#define PIXMAPWIDTH 1200
|
||||||
#define PENWIDTH 5
|
|
||||||
|
|
||||||
#define PRINTDIR "print"
|
#define PRINTDIR "print"
|
||||||
#define PRINTMCDIR "mc"
|
#define PRINTMCDIR "mc"
|
||||||
|
@ -138,7 +138,7 @@ Machine::~Machine()
|
|||||||
|
|
||||||
void Machine::startFileTrans(FileTransCtrl &transCtrl)
|
void Machine::startFileTrans(FileTransCtrl &transCtrl)
|
||||||
{
|
{
|
||||||
int rslt;
|
int rslt = 0;
|
||||||
OperPacket sendPacket;
|
OperPacket sendPacket;
|
||||||
memset(&sendPacket, 0, sizeof(OperPacket));
|
memset(&sendPacket, 0, sizeof(OperPacket));
|
||||||
sendPacket.startTrans.cmdCode = UCMD_START_TRANS;
|
sendPacket.startTrans.cmdCode = UCMD_START_TRANS;
|
||||||
@ -969,7 +969,7 @@ void Machine::onSendTimer()
|
|||||||
|
|
||||||
void Machine::slotSendDatToMc(QByteArray dat)
|
void Machine::slotSendDatToMc(QByteArray dat)
|
||||||
{
|
{
|
||||||
if(m_connected == Connected)
|
//if(m_connected == Connected)
|
||||||
{
|
{
|
||||||
if (dat.size() <= 0 || m_pCompBmpHead == NULL)
|
if (dat.size() <= 0 || m_pCompBmpHead == NULL)
|
||||||
{
|
{
|
||||||
@ -1039,8 +1039,8 @@ void Machine::slotSendPlotFileListToMc(int idx)
|
|||||||
qsrand(QTime(0,0,0).secsTo(QTime::currentTime()));
|
qsrand(QTime(0,0,0).secsTo(QTime::currentTime()));
|
||||||
u32 id =qrand() % (UINT16_MAX);//产生0到UINT16_MAX的随机数
|
u32 id =qrand() % (UINT16_MAX);//产生0到UINT16_MAX的随机数
|
||||||
m_pPlotFileList->fileId = id;
|
m_pPlotFileList->fileId = id;
|
||||||
m_pPlotFileList->totalWidth = (m_mcPrintInfo.m_filesList[idx].m_pic.width() - oft) * m_mcPrintInfo.m_filesList[idx].m_printNum;
|
m_pPlotFileList->totalWidth = (m_mcPrintInfo.m_filesList[idx].m_sendPic.width() - oft) * m_mcPrintInfo.m_filesList[idx].m_printNum;
|
||||||
m_pPlotFileList->totalHeight = m_mcPrintInfo.m_filesList[idx].m_pic.height();
|
m_pPlotFileList->totalHeight = m_mcPrintInfo.m_filesList[idx].m_sendPic.height();
|
||||||
m_pPlotFileList->blkNums = m_mcPrintInfo.m_filesList[idx].m_totalBlocks;
|
m_pPlotFileList->blkNums = m_mcPrintInfo.m_filesList[idx].m_totalBlocks;
|
||||||
m_pPlotFileList->blkWidth = PIXMAPWIDTH;
|
m_pPlotFileList->blkWidth = PIXMAPWIDTH;
|
||||||
|
|
||||||
|
@ -41,12 +41,12 @@ public:
|
|||||||
QString m_fileName;//文件名称
|
QString m_fileName;//文件名称
|
||||||
QString m_filePath;//文件路径
|
QString m_filePath;//文件路径
|
||||||
s16 m_fileType;//文件类型
|
s16 m_fileType;//文件类型
|
||||||
QRect m_fileRect;//图形被包络的矩形区域
|
QRectF m_fileRect;//图形被包络的矩形区域
|
||||||
s16 m_printNum;//打印份数
|
s16 m_printNum;//打印份数
|
||||||
s16 m_startPoint;//打印起始点
|
s16 m_startPoint;//打印起始点
|
||||||
s16 m_printState;//打印状态
|
s16 m_printState;//打印状态
|
||||||
QPicture m_pic;//文件-发送的图片-实际笔宽绘制的pic
|
QPicture m_showPic;//文件-显示的图片-1像素绘制的pic
|
||||||
QPainterPath m_drawPath;//文件-数据绘图路径-用MyGraphicsItem画图时如果笔宽不为1,直接画QPicture时线条会很轻,所以用m_drawPath绘制
|
QPicture m_sendPic;//文件-发送的图片-实际笔宽绘制的pic
|
||||||
QBitmap m_pixmap;//图片-图片
|
QBitmap m_pixmap;//图片-图片
|
||||||
s16 m_totalBlocks;//总块数
|
s16 m_totalBlocks;//总块数
|
||||||
s16 m_curPrintBlock;//当前打印块数
|
s16 m_curPrintBlock;//当前打印块数
|
||||||
@ -58,7 +58,6 @@ public:
|
|||||||
void clear()
|
void clear()
|
||||||
{
|
{
|
||||||
QPicture pic;
|
QPicture pic;
|
||||||
QPainterPath path;
|
|
||||||
|
|
||||||
m_creatDataFlag = -1;
|
m_creatDataFlag = -1;
|
||||||
m_creatBmpFlag = -1;//是否已经生成bmp的标志
|
m_creatBmpFlag = -1;//是否已经生成bmp的标志
|
||||||
@ -68,8 +67,8 @@ public:
|
|||||||
m_printNum = 0;//打印份数
|
m_printNum = 0;//打印份数
|
||||||
m_startPoint = 0;//打印起始点
|
m_startPoint = 0;//打印起始点
|
||||||
m_printState = Waitting;//打印状态
|
m_printState = Waitting;//打印状态
|
||||||
m_pic = pic;
|
m_showPic = pic;
|
||||||
m_drawPath = path;
|
m_sendPic = pic;
|
||||||
m_pixmap.clear();
|
m_pixmap.clear();
|
||||||
m_totalBlocks = 0;//总块数
|
m_totalBlocks = 0;//总块数
|
||||||
m_curPrintBlock = 0;//当前打印块数
|
m_curPrintBlock = 0;//当前打印块数
|
||||||
@ -107,8 +106,8 @@ public:
|
|||||||
m_printNum = item.m_printNum;//打印份数
|
m_printNum = item.m_printNum;//打印份数
|
||||||
m_startPoint = item.m_startPoint;//打印起始点
|
m_startPoint = item.m_startPoint;//打印起始点
|
||||||
m_printState = item.m_printState;//打印状态
|
m_printState = item.m_printState;//打印状态
|
||||||
m_pic = item.m_pic;
|
m_showPic = item.m_showPic;
|
||||||
m_drawPath = item.m_drawPath;
|
m_sendPic = item.m_sendPic;
|
||||||
m_pixmap = item.m_pixmap;
|
m_pixmap = item.m_pixmap;
|
||||||
m_totalBlocks = item.m_totalBlocks;//总块数
|
m_totalBlocks = item.m_totalBlocks;//总块数
|
||||||
m_curPrintBlock = item.m_curPrintBlock;//当前打印块数
|
m_curPrintBlock = item.m_curPrintBlock;//当前打印块数
|
||||||
@ -129,8 +128,8 @@ public:
|
|||||||
m_printNum = item.m_printNum;//打印份数
|
m_printNum = item.m_printNum;//打印份数
|
||||||
m_startPoint = item.m_startPoint;//打印起始点
|
m_startPoint = item.m_startPoint;//打印起始点
|
||||||
m_printState = item.m_printState;//打印状态
|
m_printState = item.m_printState;//打印状态
|
||||||
m_pic = item.m_pic;
|
m_showPic = item.m_showPic;
|
||||||
m_drawPath = item.m_drawPath;
|
m_sendPic = item.m_sendPic;
|
||||||
m_pixmap = item.m_pixmap;
|
m_pixmap = item.m_pixmap;
|
||||||
m_totalBlocks = item.m_totalBlocks;//总块数
|
m_totalBlocks = item.m_totalBlocks;//总块数
|
||||||
m_curPrintBlock = item.m_curPrintBlock;//当前打印块数
|
m_curPrintBlock = item.m_curPrintBlock;//当前打印块数
|
||||||
|
109
mainwindow.cpp
109
mainwindow.cpp
@ -109,13 +109,19 @@ void MainWindow::reflushPreview(int row)
|
|||||||
ui->tableView_Connection->setEnabled(false);
|
ui->tableView_Connection->setEnabled(false);
|
||||||
|
|
||||||
int penWidth = m_pSettings->value("DrawSet/linewidth").toInt();
|
int penWidth = m_pSettings->value("DrawSet/linewidth").toInt();
|
||||||
|
int paperWidth = m_pSettings->value("DrawSet/paperwidth").toInt();
|
||||||
|
int butSpace = m_pSettings->value("DrawSet/buttmargin").toInt();
|
||||||
|
int rightSpace = m_pSettings->value("DrawSet/rightmargin").toInt();
|
||||||
|
|
||||||
//生成绘制图
|
//生成绘制图
|
||||||
g_machineList[m_curMcIdx]->m_mcPrintInfo.m_filesList[row].m_pic = creatFilePicture(g_machineList[m_curMcIdx]->m_mcPrintInfo.m_filesList[row],penWidth);
|
CreatPictureStr picStr;
|
||||||
|
picStr = creatFilePicture(g_machineList[m_curMcIdx]->m_mcPrintInfo.m_filesList[row],paperWidth,butSpace,rightSpace,penWidth);
|
||||||
|
g_machineList[m_curMcIdx]->m_mcPrintInfo.m_filesList[row].m_showPic = picStr.showPic;
|
||||||
|
g_machineList[m_curMcIdx]->m_mcPrintInfo.m_filesList[row].m_sendPic = picStr.sendPic;
|
||||||
|
|
||||||
//将picture保存为多个宽度为PIXMAPWIDTH像素的bmp
|
//将picture保存为多个宽度为PIXMAPWIDTH像素的bmp
|
||||||
int num = g_machineList[m_curMcIdx]->m_mcPrintInfo.m_filesList[row].m_pic.width() / PIXMAPWIDTH;
|
int num = g_machineList[m_curMcIdx]->m_mcPrintInfo.m_filesList[row].m_sendPic.width() / PIXMAPWIDTH;
|
||||||
int lwidth = g_machineList[m_curMcIdx]->m_mcPrintInfo.m_filesList[row].m_pic.width() % PIXMAPWIDTH;
|
int lwidth = g_machineList[m_curMcIdx]->m_mcPrintInfo.m_filesList[row].m_sendPic.width() % PIXMAPWIDTH;
|
||||||
if(lwidth != 0)
|
if(lwidth != 0)
|
||||||
{
|
{
|
||||||
num +=1;
|
num +=1;
|
||||||
@ -130,16 +136,8 @@ void MainWindow::reflushPreview(int row)
|
|||||||
|
|
||||||
//刷新图形
|
//刷新图形
|
||||||
m_preView->cleanView();
|
m_preView->cleanView();
|
||||||
if(g_machineList[m_curMcIdx]->m_mcPrintInfo.m_filesList[row].m_fileType == TYPE_FILE)
|
QPicture pic = g_machineList[m_curMcIdx]->m_mcPrintInfo.m_filesList[row].m_showPic;
|
||||||
{
|
m_preView->swithViewByPic(pic);
|
||||||
QPainterPath path = g_machineList[m_curMcIdx]->m_mcPrintInfo.m_filesList[row].m_drawPath;
|
|
||||||
m_preView->swithViewByPath(path);
|
|
||||||
}
|
|
||||||
else if(g_machineList[m_curMcIdx]->m_mcPrintInfo.m_filesList[row].m_fileType == TYPE_IMAGE)
|
|
||||||
{
|
|
||||||
QPicture pic = g_machineList[m_curMcIdx]->m_mcPrintInfo.m_filesList[row].m_pic;
|
|
||||||
m_preView->swithViewByPic(pic);
|
|
||||||
}
|
|
||||||
m_curFilesInfo = g_machineList[m_curMcIdx]->m_mcPrintInfo.m_filesList[row];
|
m_curFilesInfo = g_machineList[m_curMcIdx]->m_mcPrintInfo.m_filesList[row];
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -325,24 +323,20 @@ void MainWindow::stopPrint(int mcIdx)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
QPicture MainWindow::creatFilePicture(McFilesInfo & mcFileInfo, s16 penWidth)
|
CreatPictureStr MainWindow::creatFilePicture(McFilesInfo & mcFileInfo,int paperWidth,int butSpace,int rightSpace,s16 penWidth)
|
||||||
{
|
{
|
||||||
//将图片画在picture上
|
//将图片画在picture上
|
||||||
QPicture pic;
|
CreatPictureStr picStr;
|
||||||
if(mcFileInfo.m_fileType == TYPE_IMAGE)
|
if(mcFileInfo.m_fileType == TYPE_IMAGE)
|
||||||
{
|
{
|
||||||
pic = creatPictureByBmp(mcFileInfo.m_pixmap,penWidth);
|
picStr = creatPictureByBmp(mcFileInfo.m_pixmap,paperWidth,butSpace,rightSpace,penWidth);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
pic = creatPictureByData(mcFileInfo.m_marker,mcFileInfo.m_drawPath,penWidth);
|
picStr = creatPictureByData(mcFileInfo.m_marker,paperWidth,butSpace,rightSpace,penWidth);
|
||||||
if(mcFileInfo.m_drawPath.isEmpty())
|
|
||||||
{
|
|
||||||
qDebug()<<"painterPath.isEmpty";
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return pic;
|
return picStr;
|
||||||
}
|
}
|
||||||
|
|
||||||
void MainWindow::refConnectUi()
|
void MainWindow::refConnectUi()
|
||||||
@ -488,12 +482,12 @@ int MainWindow::refreshMcFileListShow(int idx)
|
|||||||
m_tabelViewModelFile->insertRow(i);//在最后一行的后面插入一行
|
m_tabelViewModelFile->insertRow(i);//在最后一行的后面插入一行
|
||||||
m_tabelViewModelFile->setData(m_tabelViewModelFile->index(i,COLUMN_FILENAME),filesList[i].m_fileName);
|
m_tabelViewModelFile->setData(m_tabelViewModelFile->index(i,COLUMN_FILENAME),filesList[i].m_fileName);
|
||||||
|
|
||||||
QRect rect = filesList[i].m_fileRect;
|
QRectF rect = filesList[i].m_fileRect;
|
||||||
|
|
||||||
QString length = QString::number((rect.right() - rect.left())/(int)M_IDPMM)+"mm";
|
QString length = QString::number((int)((rect.right() - rect.left())/MMPIXELY))+"mm";
|
||||||
m_tabelViewModelFile->setData(m_tabelViewModelFile->index(i,COLUMN_LENGTH),length);
|
m_tabelViewModelFile->setData(m_tabelViewModelFile->index(i,COLUMN_LENGTH),length);
|
||||||
|
|
||||||
QString width = QString::number((rect.bottom() - rect.top())/(int)M_IDPMM)+"mm";
|
QString width = QString::number((int)((rect.bottom() - rect.top())/MMPIXELY))+"mm";
|
||||||
m_tabelViewModelFile->setData(m_tabelViewModelFile->index(i,COLUMN_WIDTH),width);
|
m_tabelViewModelFile->setData(m_tabelViewModelFile->index(i,COLUMN_WIDTH),width);
|
||||||
|
|
||||||
QString start = QString::number(filesList[i].m_startPoint)+"mm";
|
QString start = QString::number(filesList[i].m_startPoint)+"mm";
|
||||||
@ -674,12 +668,12 @@ void MainWindow::slotAddNewFileToList(int newFlag)
|
|||||||
m_tabelViewModelFile->insertRow(row);//在最后一行的后面插入一行
|
m_tabelViewModelFile->insertRow(row);//在最后一行的后面插入一行
|
||||||
m_tabelViewModelFile->setData(m_tabelViewModelFile->index(row,COLUMN_FILENAME),m_curFilesInfo.m_fileName);
|
m_tabelViewModelFile->setData(m_tabelViewModelFile->index(row,COLUMN_FILENAME),m_curFilesInfo.m_fileName);
|
||||||
|
|
||||||
QRect rect = m_curFilesInfo.m_fileRect;
|
QRectF rect = m_curFilesInfo.m_fileRect;
|
||||||
|
|
||||||
QString length = QString::number((rect.right() - rect.left())/(int)M_IDPMM)+"mm";
|
QString length = QString::number((int)((rect.right() - rect.left())/MMPIXELY))+"mm";
|
||||||
m_tabelViewModelFile->setData(m_tabelViewModelFile->index(row,COLUMN_LENGTH),length);
|
m_tabelViewModelFile->setData(m_tabelViewModelFile->index(row,COLUMN_LENGTH),length);
|
||||||
|
|
||||||
QString width = QString::number((rect.bottom() - rect.top())/(int)M_IDPMM)+"mm";
|
QString width = QString::number((int)((rect.bottom() - rect.top())/MMPIXELY))+"mm";
|
||||||
m_tabelViewModelFile->setData(m_tabelViewModelFile->index(row,COLUMN_WIDTH),width);
|
m_tabelViewModelFile->setData(m_tabelViewModelFile->index(row,COLUMN_WIDTH),width);
|
||||||
|
|
||||||
QString start = QString::number(m_printViewWi->getStartPoint())+"mm";
|
QString start = QString::number(m_printViewWi->getStartPoint())+"mm";
|
||||||
@ -712,23 +706,10 @@ void MainWindow::slotAddNewFileToList(int newFlag)
|
|||||||
|
|
||||||
m_tabelViewModelFile->setData(m_tabelViewModelFile->index(row,COLUMN_FILEPATH),m_curFilesInfo.m_filePath);
|
m_tabelViewModelFile->setData(m_tabelViewModelFile->index(row,COLUMN_FILEPATH),m_curFilesInfo.m_filePath);
|
||||||
|
|
||||||
//m_preView->cleanView();
|
|
||||||
// int penWidth = m_pSettings->value("DrawSet/linewidth").toInt();//线宽
|
|
||||||
// if(m_curFilesInfo.m_fileType == TYPE_FILE)
|
|
||||||
// {
|
|
||||||
// //刷新显示
|
|
||||||
// m_curFilesInfo.m_pic = m_preView->getPictureByDat(m_curFilesInfo.m_marker,penWidth);
|
|
||||||
// m_curFilesInfo.m_drawPath = m_preView->getDrawPath();
|
|
||||||
// }
|
|
||||||
// else if(m_curFilesInfo.m_fileType == TYPE_IMAGE)
|
|
||||||
// {
|
|
||||||
// m_curFilesInfo.m_pic = m_preView->getPictureByBmp(m_curFilesInfo.m_pixmap);
|
|
||||||
// }
|
|
||||||
|
|
||||||
m_curFilesInfo.m_creatBmpFlag = 1;
|
m_curFilesInfo.m_creatBmpFlag = 1;
|
||||||
//将picture保存为多个宽度为PIXMAPWIDTH像素的bmp
|
//将picture保存为多个宽度为PIXMAPWIDTH像素的bmp
|
||||||
int num = m_curFilesInfo.m_pic.width() / PIXMAPWIDTH;
|
int num = m_curFilesInfo.m_sendPic.width() / PIXMAPWIDTH;
|
||||||
int lwidth = m_curFilesInfo.m_pic.width() % PIXMAPWIDTH;
|
int lwidth = m_curFilesInfo.m_sendPic.width() % PIXMAPWIDTH;
|
||||||
if(lwidth != 0)
|
if(lwidth != 0)
|
||||||
{
|
{
|
||||||
num +=1;
|
num +=1;
|
||||||
@ -745,7 +726,7 @@ void MainWindow::slotAddNewFileToList(int newFlag)
|
|||||||
|
|
||||||
McPrintInfo McF;
|
McPrintInfo McF;
|
||||||
McF.m_fileNums = row+1;
|
McF.m_fileNums = row+1;
|
||||||
McF.m_fileTotalLength = (m_curFilesInfo.m_fileRect.right() - m_curFilesInfo.m_fileRect.left())/M_IDPMM;
|
McF.m_fileTotalLength = (m_curFilesInfo.m_fileRect.right() - m_curFilesInfo.m_fileRect.left())/MMPIXELY;
|
||||||
McF.m_filesList.append(m_curFilesInfo);
|
McF.m_filesList.append(m_curFilesInfo);
|
||||||
m_curFileRow = row;
|
m_curFileRow = row;
|
||||||
|
|
||||||
@ -826,9 +807,13 @@ void MainWindow::slotMcListMenu(QPoint pos)
|
|||||||
|
|
||||||
void MainWindow::slotPrintPreview()
|
void MainWindow::slotPrintPreview()
|
||||||
{
|
{
|
||||||
int penWidth = m_pSettings->value("DrawSet/linewidth").toInt();//线宽
|
int penWidth = m_pSettings->value("DrawSet/linewidth").toInt();
|
||||||
|
int paperWidth = m_pSettings->value("DrawSet/paperwidth").toInt();
|
||||||
|
int butSpace = m_pSettings->value("DrawSet/buttmargin").toInt();
|
||||||
|
int rightSpace = m_pSettings->value("DrawSet/rightmargin").toInt();
|
||||||
|
|
||||||
m_curFilesInfo = g_machineList[m_curMcIdx]->m_mcPrintInfo.m_filesList[m_curFileRow];
|
m_curFilesInfo = g_machineList[m_curMcIdx]->m_mcPrintInfo.m_filesList[m_curFileRow];
|
||||||
m_printViewWi->refreshShow(m_curFilesInfo,penWidth,0);
|
m_printViewWi->refreshShow(m_curFilesInfo,paperWidth,butSpace,rightSpace,penWidth,0);
|
||||||
}
|
}
|
||||||
|
|
||||||
void MainWindow::slotPrintNumberSetDlgShow()
|
void MainWindow::slotPrintNumberSetDlgShow()
|
||||||
@ -849,7 +834,7 @@ void MainWindow::slotStartSetDlgShow()
|
|||||||
{
|
{
|
||||||
QString fileName = m_curFilesInfo.m_fileName;
|
QString fileName = m_curFilesInfo.m_fileName;
|
||||||
QString startPoint= QString::number(m_curFilesInfo.m_startPoint);
|
QString startPoint= QString::number(m_curFilesInfo.m_startPoint);
|
||||||
QString length= QString::number(m_curFilesInfo.m_fileRect.right()-m_curFilesInfo.m_fileRect.left());
|
QString length= QString::number((int)((m_curFilesInfo.m_fileRect.right()-m_curFilesInfo.m_fileRect.left())/MMPIXELY));
|
||||||
StartSetDialog startSetDlg;
|
StartSetDialog startSetDlg;
|
||||||
if(startSetDlg.exec(fileName,startPoint,length) == 1)
|
if(startSetDlg.exec(fileName,startPoint,length) == 1)
|
||||||
{
|
{
|
||||||
@ -1004,10 +989,10 @@ void MainWindow::slotLoadAutoPrintFiles()
|
|||||||
if(g_machineList[m_curMcIdx]->m_mcPrintInfo.m_filesList[i].m_creatDataFlag == 1)
|
if(g_machineList[m_curMcIdx]->m_mcPrintInfo.m_filesList[i].m_creatDataFlag == 1)
|
||||||
{
|
{
|
||||||
m_tabelViewModelFile->setData(m_tabelViewModelFile->index(row, COLUMN_FILENAME),g_machineList[m_curMcIdx]->m_mcPrintInfo.m_filesList[i].m_fileName);
|
m_tabelViewModelFile->setData(m_tabelViewModelFile->index(row, COLUMN_FILENAME),g_machineList[m_curMcIdx]->m_mcPrintInfo.m_filesList[i].m_fileName);
|
||||||
QRect rect = g_machineList[m_curMcIdx]->m_mcPrintInfo.m_filesList[i].m_fileRect;
|
QRectF rect = g_machineList[m_curMcIdx]->m_mcPrintInfo.m_filesList[i].m_fileRect;
|
||||||
QString length = QString::number((rect.right() - rect.left())/(int)M_IDPMM)+"mm";
|
QString length = QString::number((int)((rect.right() - rect.left())/MMPIXELY))+"mm";
|
||||||
m_tabelViewModelFile->setData(m_tabelViewModelFile->index(row, COLUMN_LENGTH),length);
|
m_tabelViewModelFile->setData(m_tabelViewModelFile->index(row, COLUMN_LENGTH),length);
|
||||||
QString width = QString::number((rect.bottom() - rect.top())/(int)M_IDPMM)+"mm";
|
QString width = QString::number((int)((rect.bottom() - rect.top())/MMPIXELY))+"mm";
|
||||||
m_tabelViewModelFile->setData(m_tabelViewModelFile->index(row, COLUMN_WIDTH),width);
|
m_tabelViewModelFile->setData(m_tabelViewModelFile->index(row, COLUMN_WIDTH),width);
|
||||||
m_tabelViewModelFile->setData(m_tabelViewModelFile->index(row, COLUMN_START),start);
|
m_tabelViewModelFile->setData(m_tabelViewModelFile->index(row, COLUMN_START),start);
|
||||||
m_tabelViewModelFile->setData(m_tabelViewModelFile->index(row, COLUMN_PRINTEDLENGTH),"0mm");
|
m_tabelViewModelFile->setData(m_tabelViewModelFile->index(row, COLUMN_PRINTEDLENGTH),"0mm");
|
||||||
@ -1024,10 +1009,10 @@ void MainWindow::slotLoadAutoPrintFiles()
|
|||||||
creatMarkerDat(curFilesInfo,m_printPath,filePath,-1,m_rotateAngle);
|
creatMarkerDat(curFilesInfo,m_printPath,filePath,-1,m_rotateAngle);
|
||||||
|
|
||||||
m_tabelViewModelFile->setData(m_tabelViewModelFile->index(row, COLUMN_FILENAME),curFilesInfo.m_fileName);
|
m_tabelViewModelFile->setData(m_tabelViewModelFile->index(row, COLUMN_FILENAME),curFilesInfo.m_fileName);
|
||||||
QRect rect = curFilesInfo.m_fileRect;
|
QRectF rect = curFilesInfo.m_fileRect;
|
||||||
QString length = QString::number((rect.right() - rect.left())/(int)M_IDPMM)+"mm";
|
QString length = QString::number((int)((rect.right() - rect.left())/MMPIXELY))+"mm";
|
||||||
m_tabelViewModelFile->setData(m_tabelViewModelFile->index(row, COLUMN_LENGTH),length);
|
m_tabelViewModelFile->setData(m_tabelViewModelFile->index(row, COLUMN_LENGTH),length);
|
||||||
QString width = QString::number((rect.bottom() - rect.top())/(int)M_IDPMM)+"mm";
|
QString width = QString::number((int)((rect.bottom() - rect.top())/MMPIXELY))+"mm";
|
||||||
m_tabelViewModelFile->setData(m_tabelViewModelFile->index(row, COLUMN_WIDTH),width);
|
m_tabelViewModelFile->setData(m_tabelViewModelFile->index(row, COLUMN_WIDTH),width);
|
||||||
m_tabelViewModelFile->setData(m_tabelViewModelFile->index(row, COLUMN_START),start);
|
m_tabelViewModelFile->setData(m_tabelViewModelFile->index(row, COLUMN_START),start);
|
||||||
m_tabelViewModelFile->setData(m_tabelViewModelFile->index(row, COLUMN_PRINTEDLENGTH),"0mm");
|
m_tabelViewModelFile->setData(m_tabelViewModelFile->index(row, COLUMN_PRINTEDLENGTH),"0mm");
|
||||||
@ -1036,7 +1021,7 @@ void MainWindow::slotLoadAutoPrintFiles()
|
|||||||
m_tabelViewModelFile->setData(m_tabelViewModelFile->index(row, COLUMN_STATE),state);
|
m_tabelViewModelFile->setData(m_tabelViewModelFile->index(row, COLUMN_STATE),state);
|
||||||
m_tabelViewModelFile->setData(m_tabelViewModelFile->index(row, COLUMN_FILEPATH),curFilesInfo.m_filePath);
|
m_tabelViewModelFile->setData(m_tabelViewModelFile->index(row, COLUMN_FILEPATH),curFilesInfo.m_filePath);
|
||||||
|
|
||||||
long long fileTotalLength = (curFilesInfo.m_fileRect.right() - curFilesInfo.m_fileRect.left())/M_IDPMM;
|
long long fileTotalLength = (curFilesInfo.m_fileRect.right() - curFilesInfo.m_fileRect.left())/MMPIXELY;
|
||||||
|
|
||||||
g_machineList[m_curMcIdx]->m_mcPrintInfo.m_fileNums = i+1;
|
g_machineList[m_curMcIdx]->m_mcPrintInfo.m_fileNums = i+1;
|
||||||
g_machineList[m_curMcIdx]->m_mcPrintInfo.m_fileTotalLength += fileTotalLength;
|
g_machineList[m_curMcIdx]->m_mcPrintInfo.m_fileTotalLength += fileTotalLength;
|
||||||
@ -1366,8 +1351,11 @@ void MainWindow::on_actionOpen_File_triggered()
|
|||||||
//m_curFilesInfo.m_painterPath = importHPGL.GetPolylinePainterPath();
|
//m_curFilesInfo.m_painterPath = importHPGL.GetPolylinePainterPath();
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
int penWidth = m_pSettings->value("DrawSet/linewidth").toInt();//线宽
|
int penWidth = m_pSettings->value("DrawSet/linewidth").toInt();
|
||||||
m_printViewWi->refreshShow(m_curFilesInfo,penWidth,1);
|
int paperWidth = m_pSettings->value("DrawSet/paperwidth").toInt();
|
||||||
|
int butSpace = m_pSettings->value("DrawSet/buttmargin").toInt();
|
||||||
|
int rightSpace = m_pSettings->value("DrawSet/rightmargin").toInt();
|
||||||
|
m_printViewWi->refreshShow(m_curFilesInfo,paperWidth,butSpace,rightSpace,penWidth,1);
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -1468,12 +1456,15 @@ void MainWindow::on_actionOpen_Image_triggered()
|
|||||||
QBitmap pixmap;
|
QBitmap pixmap;
|
||||||
pixmap.load(filePath);
|
pixmap.load(filePath);
|
||||||
QRect rect;
|
QRect rect;
|
||||||
rect.setRect(0,0,pixmap.width()/MMPIXELY*M_IDPMM,pixmap.height()/MMPIXELY*M_IDPMM);
|
rect.setRect(0,0,pixmap.width()/MMPIXELY*MMPIXELY,pixmap.height()/MMPIXELY*MMPIXELY);
|
||||||
|
|
||||||
m_curFilesInfo.m_pixmap = pixmap;
|
m_curFilesInfo.m_pixmap = pixmap;
|
||||||
m_curFilesInfo.m_fileRect = rect;
|
m_curFilesInfo.m_fileRect = rect;
|
||||||
int penWidth = m_pSettings->value("DrawSet/linewidth").toInt();//线宽
|
int penWidth = m_pSettings->value("DrawSet/linewidth").toInt();
|
||||||
m_printViewWi->refreshShow(m_curFilesInfo,penWidth,1);
|
int paperWidth = m_pSettings->value("DrawSet/paperwidth").toInt();
|
||||||
|
int butSpace = m_pSettings->value("DrawSet/buttmargin").toInt();
|
||||||
|
int rightSpace = m_pSettings->value("DrawSet/rightmargin").toInt();
|
||||||
|
m_printViewWi->refreshShow(m_curFilesInfo,paperWidth,butSpace,rightSpace,penWidth,1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -102,7 +102,7 @@ private:
|
|||||||
bool deleteDir(QString path);
|
bool deleteDir(QString path);
|
||||||
void startCreatBmpAndSend(int mcIdx = -1);//开始创建位图并发送
|
void startCreatBmpAndSend(int mcIdx = -1);//开始创建位图并发送
|
||||||
void stopPrint(int mcIdx = -1);//停止打印
|
void stopPrint(int mcIdx = -1);//停止打印
|
||||||
QPicture creatFilePicture(McFilesInfo & mcFileInfo, s16 penWidth = 1);
|
CreatPictureStr creatFilePicture(McFilesInfo & mcFileInfo,int paperWidth,int butSpace,int rightSpace,s16 penWidth = 1);
|
||||||
//刷新连接状态
|
//刷新连接状态
|
||||||
void refConnectUi();//刷新连接状态(1秒)
|
void refConnectUi();//刷新连接状态(1秒)
|
||||||
void refConnectUi(Machine * pMachine,int & linkSta, int idx);
|
void refConnectUi(Machine * pMachine,int & linkSta, int idx);
|
||||||
|
@ -48,7 +48,7 @@ void PrintInfoDialog::on_listView_blockList_clicked(const QModelIndex &index)
|
|||||||
str = QString::number((m_curFilesInfo.m_selectBlockNum-1)*BLOCK_MM)+" - ";
|
str = QString::number((m_curFilesInfo.m_selectBlockNum-1)*BLOCK_MM)+" - ";
|
||||||
if(row == m_listViewModel->rowCount() - 1)
|
if(row == m_listViewModel->rowCount() - 1)
|
||||||
{
|
{
|
||||||
str1 = QString::number((m_curFilesInfo.m_fileRect.right() - m_curFilesInfo.m_fileRect.left())/(int)M_IDPMM);
|
str1 = QString::number((int)((m_curFilesInfo.m_fileRect.right() - m_curFilesInfo.m_fileRect.left())/MMPIXELY));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -84,8 +84,8 @@ void PrintInfoDialog::reflushFileInfo()
|
|||||||
|
|
||||||
ui->label_fileNameVal->setText(m_curFilesInfo.m_fileName);
|
ui->label_fileNameVal->setText(m_curFilesInfo.m_fileName);
|
||||||
|
|
||||||
int length = (m_curFilesInfo.m_fileRect.right() - m_curFilesInfo.m_fileRect.left())/M_IDPMM;
|
int length = (m_curFilesInfo.m_fileRect.right() - m_curFilesInfo.m_fileRect.left())/MMPIXELY;
|
||||||
int height = (m_curFilesInfo.m_fileRect.bottom() - m_curFilesInfo.m_fileRect.top())/M_IDPMM;
|
int height = (m_curFilesInfo.m_fileRect.bottom() - m_curFilesInfo.m_fileRect.top())/MMPIXELY;
|
||||||
QString WH = QString::number(length) + "x" + QString::number(height)+ "mm";
|
QString WH = QString::number(length) + "x" + QString::number(height)+ "mm";
|
||||||
ui->label_drawWHVal->setText(WH);
|
ui->label_drawWHVal->setText(WH);
|
||||||
|
|
||||||
@ -106,14 +106,7 @@ void PrintInfoDialog::setFilesInfo(McFilesInfo info)
|
|||||||
m_curFilesInfo = info;
|
m_curFilesInfo = info;
|
||||||
|
|
||||||
m_preView->cleanView();
|
m_preView->cleanView();
|
||||||
if(m_curFilesInfo.m_fileType == TYPE_FILE)
|
m_preView->swithViewByPic(m_curFilesInfo.m_showPic);//刷新显示
|
||||||
{
|
|
||||||
m_preView->creatViewPathAndPic(m_curFilesInfo.m_drawPath,m_curFilesInfo.m_pic);//刷新显示
|
|
||||||
}
|
|
||||||
else if(m_curFilesInfo.m_fileType == TYPE_IMAGE)
|
|
||||||
{
|
|
||||||
m_preView->swithViewByPic(m_curFilesInfo.m_pic);//刷新显示
|
|
||||||
}
|
|
||||||
|
|
||||||
reflushFileInfo();
|
reflushFileInfo();
|
||||||
|
|
||||||
|
@ -37,7 +37,7 @@ void PrintViewWindow::refreshLanguage()
|
|||||||
ui->retranslateUi(this);
|
ui->retranslateUi(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
void PrintViewWindow::refreshShow(McFilesInfo &mcFilesInfo,int penWidth,int flag)
|
void PrintViewWindow::refreshShow(McFilesInfo &mcFilesInfo,int paperWidth,int butSpace,int rightSpace,int penWidth,int flag)
|
||||||
{
|
{
|
||||||
m_startPoint = 0;
|
m_startPoint = 0;
|
||||||
m_printNumber = 1;
|
m_printNumber = 1;
|
||||||
@ -54,20 +54,24 @@ void PrintViewWindow::refreshShow(McFilesInfo &mcFilesInfo,int penWidth,int flag
|
|||||||
}
|
}
|
||||||
|
|
||||||
m_filePath = mcFilesInfo.m_filePath;
|
m_filePath = mcFilesInfo.m_filePath;
|
||||||
m_length = (mcFilesInfo.m_fileRect.right() - mcFilesInfo.m_fileRect.left())/M_IDPMM;
|
|
||||||
int width = (mcFilesInfo.m_fileRect.bottom() - mcFilesInfo.m_fileRect.top())/M_IDPMM;
|
|
||||||
this->setWindowTitle(m_filePath+"("+QString::number(m_length)+"mm"+" * " + QString::number(width) + "mm)");
|
|
||||||
|
|
||||||
m_view->cleanView();
|
m_view->cleanView();
|
||||||
|
CreatPictureStr picStr;
|
||||||
if(mcFilesInfo.m_fileType == TYPE_FILE)
|
if(mcFilesInfo.m_fileType == TYPE_FILE)
|
||||||
{
|
{
|
||||||
mcFilesInfo.m_pic = m_view->getPictureByDat(mcFilesInfo.m_marker,penWidth);
|
picStr = m_view->getPictureByDat(mcFilesInfo.m_marker,paperWidth,butSpace,rightSpace,penWidth);
|
||||||
mcFilesInfo.m_drawPath = m_view->getDrawPath();
|
|
||||||
}
|
}
|
||||||
else if(mcFilesInfo.m_fileType == TYPE_IMAGE)
|
else if(mcFilesInfo.m_fileType == TYPE_IMAGE)
|
||||||
{
|
{
|
||||||
mcFilesInfo.m_pic = m_view->getPictureByBmp(mcFilesInfo.m_pixmap);
|
picStr = m_view->getPictureByBmp(mcFilesInfo.m_pixmap,paperWidth,butSpace,rightSpace,penWidth);
|
||||||
}
|
}
|
||||||
|
mcFilesInfo.m_showPic = picStr.showPic;
|
||||||
|
mcFilesInfo.m_sendPic = picStr.sendPic;
|
||||||
|
mcFilesInfo.m_fileRect = picStr.sendPic.boundingRect();
|
||||||
|
|
||||||
|
m_length = (mcFilesInfo.m_fileRect.right() - mcFilesInfo.m_fileRect.left())/MMPIXELY;
|
||||||
|
int width = (mcFilesInfo.m_fileRect.bottom() - mcFilesInfo.m_fileRect.top())/MMPIXELY;
|
||||||
|
this->setWindowTitle(m_filePath+"("+QString::number(m_length)+"mm"+" * " + QString::number(width) + "mm)");
|
||||||
|
|
||||||
//如果是最大化变为正常大小
|
//如果是最大化变为正常大小
|
||||||
if(this->windowState() == Qt::WindowMaximized)
|
if(this->windowState() == Qt::WindowMaximized)
|
||||||
|
@ -33,7 +33,7 @@ private:
|
|||||||
int m_length;
|
int m_length;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
void refreshShow(McFilesInfo &mcFilesInfo,int penWidth,int flag = 0);
|
void refreshShow(McFilesInfo &mcFilesInfo,int paperWidth,int butSpace,int rightSpace,int penWidth,int flag = 0);
|
||||||
void setStartLineText(QString str);
|
void setStartLineText(QString str);
|
||||||
void setNumberLineText(QString str);
|
void setNumberLineText(QString str);
|
||||||
inline int getStartPoint(){return m_startPoint;}
|
inline int getStartPoint(){return m_startPoint;}
|
||||||
|
Loading…
Reference in New Issue
Block a user