Compare commits
No commits in common. "90cf3a06db97e7e0d2c4bfcde52a6360b4b6783e" and "9f74511e69bc847a1a226ae630185c956827429c" have entirely different histories.
90cf3a06db
...
9f74511e69
5
.gitignore
vendored
5
.gitignore
vendored
@ -2,8 +2,3 @@
|
|||||||
*.user.*
|
*.user.*
|
||||||
boost/
|
boost/
|
||||||
spline_library/
|
spline_library/
|
||||||
*.stash
|
|
||||||
*.sdf
|
|
||||||
*.vcxproj
|
|
||||||
*.filters
|
|
||||||
rccs/
|
|
||||||
|
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="1965"/>
|
<location filename="datafile/hpgl/importhpgl.cpp" line="1816"/>
|
||||||
<source>Encrypted file parsing error!</source>
|
<source>Encrypted file parsing error!</source>
|
||||||
<translation>加密文件解析错误!</translation>
|
<translation>加密文件解析错误!</translation>
|
||||||
</message>
|
</message>
|
||||||
@ -269,19 +269,21 @@
|
|||||||
<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="764"/>
|
<location filename="mainwindow.cpp" line="823"/>
|
||||||
<location filename="mainwindow.cpp" line="794"/>
|
<location filename="mainwindow.cpp" line="853"/>
|
||||||
<source>Delete</source>
|
<source>Delete</source>
|
||||||
<translation>删除</translation>
|
<translation>删除</translation>
|
||||||
</message>
|
</message>
|
||||||
@ -388,7 +390,6 @@
|
|||||||
<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>
|
||||||
@ -407,255 +408,233 @@
|
|||||||
<translation></translation>
|
<translation></translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="mainwindow.cpp" line="71"/>
|
<location filename="mainwindow.cpp" line="149"/>
|
||||||
<location filename="mainwindow.cpp" line="162"/>
|
<location filename="mainwindow.cpp" line="923"/>
|
||||||
<location filename="mainwindow.cpp" line="873"/>
|
<location filename="mainwindow.cpp" line="931"/>
|
||||||
<location filename="mainwindow.cpp" line="880"/>
|
<location filename="mainwindow.cpp" line="956"/>
|
||||||
<location filename="mainwindow.cpp" line="903"/>
|
<location filename="mainwindow.cpp" line="1369"/>
|
||||||
<location filename="mainwindow.cpp" line="1280"/>
|
<location filename="mainwindow.cpp" line="1378"/>
|
||||||
<location filename="mainwindow.cpp" line="1289"/>
|
<location filename="mainwindow.cpp" line="1501"/>
|
||||||
<location filename="mainwindow.cpp" line="1420"/>
|
<location filename="mainwindow.cpp" line="1510"/>
|
||||||
<location filename="mainwindow.cpp" line="1429"/>
|
<location filename="mainwindow.cpp" line="1561"/>
|
||||||
<location filename="mainwindow.cpp" line="1481"/>
|
<location filename="mainwindow.cpp" line="1649"/>
|
||||||
<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="163"/>
|
<location filename="mainwindow.cpp" line="150"/>
|
||||||
<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="362"/>
|
<location filename="mainwindow.cpp" line="393"/>
|
||||||
<location filename="mainwindow.cpp" line="424"/>
|
<location filename="mainwindow.cpp" line="455"/>
|
||||||
<source>Connnecting...</source>
|
<source>Connnecting...</source>
|
||||||
<translation>连接中...</translation>
|
<translation>连接中...</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="mainwindow.cpp" line="366"/>
|
<location filename="mainwindow.cpp" line="397"/>
|
||||||
<location filename="mainwindow.cpp" line="428"/>
|
<location filename="mainwindow.cpp" line="459"/>
|
||||||
<source>Connected</source>
|
<source>Connected</source>
|
||||||
<translation>已连接</translation>
|
<translation>已连接</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="mainwindow.cpp" line="370"/>
|
<location filename="mainwindow.cpp" line="401"/>
|
||||||
<location filename="mainwindow.cpp" line="391"/>
|
<location filename="mainwindow.cpp" line="422"/>
|
||||||
<location filename="mainwindow.cpp" line="421"/>
|
<location filename="mainwindow.cpp" line="452"/>
|
||||||
<source>NotConnected</source>
|
<source>NotConnected</source>
|
||||||
<translation>未连接</translation>
|
<translation>未连接</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="mainwindow.cpp" line="311"/>
|
<location filename="mainwindow.cpp" line="428"/>
|
||||||
<location filename="mainwindow.cpp" line="397"/>
|
<location filename="mainwindow.cpp" line="466"/>
|
||||||
<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="72"/>
|
<location filename="mainwindow.cpp" line="432"/>
|
||||||
<source>Do you want to exit the program?</source>
|
<location filename="mainwindow.cpp" line="470"/>
|
||||||
<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="512"/>
|
<location filename="mainwindow.cpp" line="539"/>
|
||||||
<location filename="mainwindow.cpp" line="698"/>
|
<location filename="mainwindow.cpp" line="712"/>
|
||||||
<location filename="mainwindow.cpp" line="961"/>
|
<location filename="mainwindow.cpp" line="1057"/>
|
||||||
<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="516"/>
|
<location filename="mainwindow.cpp" line="543"/>
|
||||||
<location filename="mainwindow.cpp" line="702"/>
|
<location filename="mainwindow.cpp" line="716"/>
|
||||||
<location filename="mainwindow.cpp" line="1152"/>
|
<location filename="mainwindow.cpp" line="1196"/>
|
||||||
<source>Printting</source>
|
<source>Printting</source>
|
||||||
<translation>打印中</translation>
|
<translation>打印中</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="mainwindow.cpp" line="604"/>
|
<location filename="mainwindow.cpp" line="622"/>
|
||||||
<location filename="mainwindow.cpp" line="1238"/>
|
<location filename="mainwindow.cpp" line="1331"/>
|
||||||
<source>FileName</source>
|
<source>FileName</source>
|
||||||
<translation>文件名称</translation>
|
<translation>文件名称</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="mainwindow.cpp" line="604"/>
|
<location filename="mainwindow.cpp" line="622"/>
|
||||||
<location filename="mainwindow.cpp" line="1238"/>
|
<location filename="mainwindow.cpp" line="1331"/>
|
||||||
<source>Length</source>
|
<source>Length</source>
|
||||||
<translation>长度</translation>
|
<translation>长度</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="mainwindow.cpp" line="604"/>
|
<location filename="mainwindow.cpp" line="622"/>
|
||||||
<location filename="mainwindow.cpp" line="1238"/>
|
<location filename="mainwindow.cpp" line="1331"/>
|
||||||
<source>Width</source>
|
<source>Width</source>
|
||||||
<translation>宽度</translation>
|
<translation>宽度</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="mainwindow.cpp" line="605"/>
|
<location filename="mainwindow.cpp" line="623"/>
|
||||||
<location filename="mainwindow.cpp" line="1239"/>
|
<location filename="mainwindow.cpp" line="1332"/>
|
||||||
<source>Printed</source>
|
<source>Printed</source>
|
||||||
<translation>已打印</translation>
|
<translation>已打印</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="mainwindow.cpp" line="605"/>
|
<location filename="mainwindow.cpp" line="623"/>
|
||||||
<location filename="mainwindow.cpp" line="1239"/>
|
<location filename="mainwindow.cpp" line="1332"/>
|
||||||
<source>Progress</source>
|
<source>Progress</source>
|
||||||
<translation>打印进度</translation>
|
<translation>打印进度</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="mainwindow.cpp" line="605"/>
|
<location filename="mainwindow.cpp" line="623"/>
|
||||||
<location filename="mainwindow.cpp" line="1239"/>
|
<location filename="mainwindow.cpp" line="1332"/>
|
||||||
<source>Numbers</source>
|
<source>Numbers</source>
|
||||||
<translation>份数</translation>
|
<translation>份数</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="mainwindow.cpp" line="605"/>
|
<location filename="mainwindow.cpp" line="623"/>
|
||||||
<location filename="mainwindow.cpp" line="1239"/>
|
<location filename="mainwindow.cpp" line="1332"/>
|
||||||
<source>State</source>
|
<source>State</source>
|
||||||
<translation>状态</translation>
|
<translation>状态</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="mainwindow.cpp" line="605"/>
|
<location filename="mainwindow.cpp" line="623"/>
|
||||||
<location filename="mainwindow.cpp" line="1239"/>
|
<location filename="mainwindow.cpp" line="1332"/>
|
||||||
<source>FilePath</source>
|
<source>FilePath</source>
|
||||||
<translation>文件路径</translation>
|
<translation>文件路径</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="mainwindow.cpp" line="605"/>
|
<location filename="mainwindow.cpp" line="623"/>
|
||||||
<location filename="mainwindow.cpp" line="1239"/>
|
<location filename="mainwindow.cpp" line="1332"/>
|
||||||
<source>StartPoint</source>
|
<source>StartPoint</source>
|
||||||
<translation>起点</translation>
|
<translation>起点</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="mainwindow.cpp" line="626"/>
|
<location filename="mainwindow.cpp" line="644"/>
|
||||||
<location filename="mainwindow.cpp" line="1243"/>
|
<location filename="mainwindow.cpp" line="1336"/>
|
||||||
<source>McName</source>
|
<source>McName</source>
|
||||||
<translation>机器名称</translation>
|
<translation>机器名称</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="mainwindow.cpp" line="626"/>
|
<location filename="mainwindow.cpp" line="644"/>
|
||||||
<location filename="mainwindow.cpp" line="1243"/>
|
<location filename="mainwindow.cpp" line="1336"/>
|
||||||
<source>McIp</source>
|
<source>McIp</source>
|
||||||
<translation>机器IP</translation>
|
<translation>机器IP</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="mainwindow.cpp" line="626"/>
|
<location filename="mainwindow.cpp" line="644"/>
|
||||||
<location filename="mainwindow.cpp" line="1243"/>
|
<location filename="mainwindow.cpp" line="1336"/>
|
||||||
<source>McConState</source>
|
<source>McConState</source>
|
||||||
<translation>连接状态</translation>
|
<translation>连接状态</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="mainwindow.cpp" line="626"/>
|
<location filename="mainwindow.cpp" line="644"/>
|
||||||
<location filename="mainwindow.cpp" line="1243"/>
|
<location filename="mainwindow.cpp" line="1336"/>
|
||||||
<source>McState</source>
|
<source>McState</source>
|
||||||
<translation>工作状态</translation>
|
<translation>工作状态</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="mainwindow.cpp" line="626"/>
|
<location filename="mainwindow.cpp" line="644"/>
|
||||||
<location filename="mainwindow.cpp" line="1243"/>
|
<location filename="mainwindow.cpp" line="1336"/>
|
||||||
<source>McProgress</source>
|
<source>McProgress</source>
|
||||||
<translation>打印进度</translation>
|
<translation>打印进度</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="mainwindow.cpp" line="760"/>
|
<location filename="mainwindow.cpp" line="819"/>
|
||||||
<source>Print preview</source>
|
<source>Print preview</source>
|
||||||
<translation>打印预览</translation>
|
<translation>打印预览</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="mainwindow.cpp" line="761"/>
|
<location filename="mainwindow.cpp" line="820"/>
|
||||||
<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="762"/>
|
<location filename="mainwindow.cpp" line="821"/>
|
||||||
<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="763"/>
|
<location filename="mainwindow.cpp" line="822"/>
|
||||||
<source>View print information</source>
|
<source>View print information</source>
|
||||||
<translation>查看打印信息</translation>
|
<translation>查看打印信息</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="mainwindow.cpp" line="881"/>
|
<location filename="mainwindow.cpp" line="924"/>
|
||||||
<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="874"/>
|
<location filename="mainwindow.cpp" line="932"/>
|
||||||
<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="904"/>
|
<location filename="mainwindow.cpp" line="957"/>
|
||||||
<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="1160"/>
|
<location filename="mainwindow.cpp" line="1192"/>
|
||||||
<source>Complete</source>
|
<source>Complete</source>
|
||||||
<translation>打印完成</translation>
|
<translation>打印完成</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="mainwindow.cpp" line="1281"/>
|
<location filename="mainwindow.cpp" line="1370"/>
|
||||||
<location filename="mainwindow.cpp" line="1421"/>
|
<location filename="mainwindow.cpp" line="1502"/>
|
||||||
<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="1290"/>
|
<location filename="mainwindow.cpp" line="1379"/>
|
||||||
<location filename="mainwindow.cpp" line="1430"/>
|
<location filename="mainwindow.cpp" line="1511"/>
|
||||||
<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="1300"/>
|
<location filename="mainwindow.cpp" line="1392"/>
|
||||||
<location filename="mainwindow.cpp" line="1440"/>
|
<location filename="mainwindow.cpp" line="1524"/>
|
||||||
<source>Open File Dialog</source>
|
<source>Open File Dialog</source>
|
||||||
<translation>打开文件对话框</translation>
|
<translation>打开文件对话框</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="mainwindow.cpp" line="1302"/>
|
<location filename="mainwindow.cpp" line="1394"/>
|
||||||
<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="1442"/>
|
<location filename="mainwindow.cpp" line="1526"/>
|
||||||
<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="1482"/>
|
<location filename="mainwindow.cpp" line="1562"/>
|
||||||
<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="1494"/>
|
<location filename="mainwindow.cpp" line="1574"/>
|
||||||
<source>Select Folder</source>
|
<source>Select Folder</source>
|
||||||
<translation>选择文件夹</translation>
|
<translation>选择文件夹</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="mainwindow.cpp" line="1519"/>
|
<location filename="mainwindow.cpp" line="1650"/>
|
||||||
<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>
|
||||||
@ -955,7 +934,7 @@
|
|||||||
<translation>返回</translation>
|
<translation>返回</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="printinfodialog.cpp" line="80"/>
|
<location filename="printinfodialog.cpp" line="78"/>
|
||||||
<source>piece</source>
|
<source>piece</source>
|
||||||
<translation>块</translation>
|
<translation>块</translation>
|
||||||
</message>
|
</message>
|
||||||
@ -1054,12 +1033,12 @@
|
|||||||
<translation>份数:</translation>
|
<translation>份数:</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="printviewwindow.cpp" line="111"/>
|
<location filename="printviewwindow.cpp" line="106"/>
|
||||||
<source>Prompt</source>
|
<source>Prompt</source>
|
||||||
<translation>提示</translation>
|
<translation>提示</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="printviewwindow.cpp" line="112"/>
|
<location filename="printviewwindow.cpp" line="107"/>
|
||||||
<source>Unreasonable value input!</source>
|
<source>Unreasonable value input!</source>
|
||||||
<translation>数值输入不合理!</translation>
|
<translation>数值输入不合理!</translation>
|
||||||
</message>
|
</message>
|
||||||
|
@ -88,10 +88,6 @@ 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;
|
||||||
@ -99,64 +95,60 @@ bool DxfHelper::generateDxf(const QString &fileName)
|
|||||||
dxfPaths.clear();
|
dxfPaths.clear();
|
||||||
|
|
||||||
DxfReader dxfReader(fileName);
|
DxfReader dxfReader(fileName);
|
||||||
QList<BlockDatas> blockDataList = dxfReader.getBlockDatas();
|
for(auto d: dxfReader.dxfText) {
|
||||||
BlockDatas blockData;
|
//qDebug() << "text data:" << d.text.c_str() << d.angle << d.style.c_str() << d.height;
|
||||||
//扫描判断哪个块的数据最多,其他块的数据全部不显示,只显示数据最多的块
|
|
||||||
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: blockData.dxfText)
|
for(auto d: dxfReader.dxfLinetypes) {
|
||||||
{
|
//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: blockData.dxfLines)
|
for(auto d: dxfReader.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;
|
||||||
linepath.append(QPointF(d.x1, d.y1));
|
if(currentPos!=QPointF(d.x1, d.y1)) {
|
||||||
linepath.append(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);
|
||||||
|
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;
|
||||||
@ -166,6 +158,7 @@ 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;
|
||||||
@ -194,10 +187,10 @@ bool DxfHelper::generateDxf(const QString &fileName)
|
|||||||
// dxfPathList.append(path);
|
// dxfPathList.append(path);
|
||||||
}
|
}
|
||||||
|
|
||||||
for(auto d: blockData.dxfCircles)
|
for(auto d: dxfReader.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;
|
||||||
@ -205,6 +198,7 @@ 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);
|
||||||
@ -218,11 +212,10 @@ 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: blockData.dxfEllipses)
|
for(auto d: dxfReader.dxfEllipses) { // 起点角度要×ratio
|
||||||
{
|
|
||||||
// 起点角度要×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;
|
||||||
@ -235,6 +228,7 @@ 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;
|
||||||
@ -242,6 +236,7 @@ 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;
|
||||||
@ -290,8 +285,7 @@ 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)
|
for(double i = 0; i <= 1; i += 0.003) { // TODO: 步长随图片大小调整
|
||||||
{ // 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();
|
||||||
@ -299,18 +293,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: blockData.dxfPolylines)
|
for(auto d: dxfReader.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 = blockData.dxfVertexs.at(vertexIndex).x;
|
double x = dxfReader.dxfVertexs.at(vertexIndex).x;
|
||||||
double y = blockData.dxfVertexs.at(vertexIndex).y;
|
double y = dxfReader.dxfVertexs.at(vertexIndex).y;
|
||||||
double z = blockData.dxfVertexs.at(vertexIndex).z;
|
double z = dxfReader.dxfVertexs.at(vertexIndex).z;
|
||||||
pointlist.append(QVector3D(x, y, z));
|
pointlist.append(QVector3D(x, y, z));
|
||||||
vertexIndex++;
|
vertexIndex++;
|
||||||
}
|
}
|
||||||
@ -323,7 +317,7 @@ bool DxfHelper::generateDxf(const QString &fileName)
|
|||||||
currentPos = QPointF(x, y);
|
currentPos = QPointF(x, y);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(d.flags && pointlist.size() > 0) {
|
if(d.flags) {
|
||||||
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));
|
||||||
@ -332,50 +326,11 @@ bool DxfHelper::generateDxf(const QString &fileName)
|
|||||||
dxfPaths.append(path);
|
dxfPaths.append(path);
|
||||||
}
|
}
|
||||||
|
|
||||||
QVector<QPointF> path;
|
// for(auto d: dxfReader.dxfVertexs) {
|
||||||
for(int i = 0; i < blockData.dxfVertexs.size(); i++)
|
// qDebug() << "vertexs data:" << d.x << d.y << d.z << d.bulge;
|
||||||
{
|
|
||||||
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: blockData.dxfPoints)
|
for(auto d: dxfReader.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));
|
||||||
@ -383,34 +338,32 @@ bool DxfHelper::generateDxf(const QString &fileName)
|
|||||||
currentPos = QPointF(d.x, d.y);
|
currentPos = QPointF(d.x, d.y);
|
||||||
}
|
}
|
||||||
|
|
||||||
// for(auto d: blockData.dxfSplines)
|
for(auto d: dxfReader.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 x = blockData.dxfControlPoints.at(controlIndex).x;
|
int y = dxfReader.dxfControlPoints.at(controlIndex).y;
|
||||||
// int y = blockData.dxfControlPoints.at(controlIndex).y;
|
pointList.push_back(QVector2D(x, y));
|
||||||
// pointList.push_back(QVector2D(x, y));
|
currentPos = QPointF(x, y);
|
||||||
// currentPos = QPointF(x, y);
|
controlIndex++;
|
||||||
// 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;
|
||||||
@ -472,23 +425,6 @@ 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);
|
||||||
@ -528,82 +464,6 @@ 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,10 +91,7 @@ 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,10 +36,20 @@
|
|||||||
#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
|
//#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
|
||||||
|
|
||||||
#ifndef M_PI
|
#ifndef M_PI
|
||||||
#define M_PI 3.1415926535897932384626433832795
|
#define M_PI 3.1415926535897932384626433832795
|
||||||
@ -491,7 +501,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 0x08
|
#define DL_POLYLINE3D 0x80
|
||||||
#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_DimAngular2LData&) {}
|
const DL_DimAngularData&) {}
|
||||||
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_DimAngular2LData& edata) = 0;
|
const DL_DimAngularData& 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 input stream.
|
* @param stream The string 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::istream& stream,
|
bool DL_Dxf::in(std::stringstream& 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 input streams.
|
* Same as above but for stringstreams.
|
||||||
*/
|
*/
|
||||||
bool DL_Dxf::readDxfGroups(std::istream& stream,
|
bool DL_Dxf::readDxfGroups(std::stringstream& 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 input streams.
|
* Same as above but for stringstreams.
|
||||||
*/
|
*/
|
||||||
bool DL_Dxf::getStrippedLine(std::string &s, unsigned int size,
|
bool DL_Dxf::getStrippedLine(std::string &s, unsigned int size,
|
||||||
std::istream& stream, bool stripSpace) {
|
std::stringstream& stream, bool stripSpace) {
|
||||||
|
|
||||||
if (!stream.eof()) {
|
if (!stream.eof()) {
|
||||||
// Only the useful part of the line
|
// Only the useful part of the line
|
||||||
@ -925,6 +925,8 @@ 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) {
|
||||||
@ -977,7 +979,8 @@ 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);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -1445,10 +1448,10 @@ bool DL_Dxf::handleLWPolylineData(DL_CreationInterface* /*creationInterface*/) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (groupCode<=30) {
|
if (groupCode<=30) {
|
||||||
if (vertexIndex>=0 && vertexIndex<maxVertices && vertexIndex>=0) {
|
if (vertexIndex>=0 && vertexIndex<maxVertices) {
|
||||||
vertices[4*vertexIndex + (groupCode/10-1)] = toReal(groupValue);
|
vertices[4*vertexIndex + (groupCode/10-1)] = toReal(groupValue);
|
||||||
}
|
}
|
||||||
} else if (groupCode==42 && vertexIndex<maxVertices && vertexIndex>=0) {
|
} else if (groupCode==42 && vertexIndex<maxVertices) {
|
||||||
vertices[4*vertexIndex + 3] = toReal(groupValue);
|
vertices[4*vertexIndex + 3] = toReal(groupValue);
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
@ -1732,7 +1735,7 @@ void DL_Dxf::addAttribute(DL_CreationInterface* creationInterface) {
|
|||||||
*/
|
*/
|
||||||
DL_DimensionData DL_Dxf::getDimData() {
|
DL_DimensionData DL_Dxf::getDimData() {
|
||||||
// generic dimension data:
|
// generic dimension data:
|
||||||
DL_DimensionData ret(
|
return DL_DimensionData(
|
||||||
// def point
|
// def point
|
||||||
getRealValue(10, 0.0),
|
getRealValue(10, 0.0),
|
||||||
getRealValue(20, 0.0),
|
getRealValue(20, 0.0),
|
||||||
@ -1755,9 +1758,6 @@ 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_DimAngular2LData da(
|
DL_DimAngularData da(
|
||||||
// definition point 1
|
// definition point 1
|
||||||
getRealValue(13, 0.0),
|
getRealValue(13, 0.0),
|
||||||
getRealValue(23, 0.0),
|
getRealValue(23, 0.0),
|
||||||
@ -2505,6 +2505,7 @@ 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);
|
||||||
}
|
}
|
||||||
@ -2963,18 +2964,10 @@ 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, "}");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -3015,8 +3008,6 @@ 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
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -3078,8 +3069,6 @@ 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
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -3147,8 +3136,6 @@ 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
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -3208,8 +3195,6 @@ 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
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -3242,9 +3227,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::writeDimAngular2L(DL_WriterA& dw,
|
void DL_Dxf::writeDimAngular(DL_WriterA& dw,
|
||||||
const DL_DimensionData& data,
|
const DL_DimensionData& data,
|
||||||
const DL_DimAngular2LData& edata,
|
const DL_DimAngularData& edata,
|
||||||
const DL_Attributes& attrib) {
|
const DL_Attributes& attrib) {
|
||||||
|
|
||||||
dw.entity("DIMENSION");
|
dw.entity("DIMENSION");
|
||||||
@ -3269,8 +3254,6 @@ void DL_Dxf::writeDimAngular2L(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
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -3338,8 +3321,6 @@ 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
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -3409,8 +3390,6 @@ 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
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -3481,18 +3460,6 @@ 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, "}");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -3697,7 +3664,7 @@ void DL_Dxf::writeHatchEdge(DL_WriterA& dw,
|
|||||||
*
|
*
|
||||||
* @return IMAGEDEF handle. Needed for the IMAGEDEF counterpart.
|
* @return IMAGEDEF handle. Needed for the IMAGEDEF counterpart.
|
||||||
*/
|
*/
|
||||||
unsigned long DL_Dxf::writeImage(DL_WriterA& dw,
|
int DL_Dxf::writeImage(DL_WriterA& dw,
|
||||||
const DL_ImageData& data,
|
const DL_ImageData& data,
|
||||||
const DL_Attributes& attrib) {
|
const DL_Attributes& attrib) {
|
||||||
|
|
||||||
@ -3737,7 +3704,8 @@ unsigned long DL_Dxf::writeImage(DL_WriterA& dw,
|
|||||||
dw.dxfReal(23, data.height);
|
dw.dxfReal(23, data.height);
|
||||||
|
|
||||||
// handle of IMAGEDEF object
|
// handle of IMAGEDEF object
|
||||||
unsigned long handle = dw.handle(340);
|
int handle = dw.incHandle();
|
||||||
|
dw.dxfHex(340, handle);
|
||||||
|
|
||||||
// flags
|
// flags
|
||||||
dw.dxfInt(70, 15);
|
dw.dxfInt(70, 15);
|
||||||
@ -4194,7 +4162,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, int dimtad, bool dimtih) {
|
double dimgap, double dimtxt) {
|
||||||
|
|
||||||
dw.dxfString( 0, "TABLE");
|
dw.dxfString( 0, "TABLE");
|
||||||
dw.dxfString( 2, "DIMSTYLE");
|
dw.dxfString( 2, "DIMSTYLE");
|
||||||
@ -4244,15 +4212,13 @@ void DL_Dxf::writeDimStyle(DL_WriterA& dw,
|
|||||||
dw.dxfInt( 71, 0);
|
dw.dxfInt( 71, 0);
|
||||||
dw.dxfInt( 72, 0);
|
dw.dxfInt( 72, 0);
|
||||||
}
|
}
|
||||||
// DIMTIH:
|
dw.dxfInt( 73, 0);
|
||||||
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);
|
||||||
}
|
}
|
||||||
// DIMTAD:
|
dw.dxfInt( 77, 1);
|
||||||
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);
|
||||||
@ -4387,6 +4353,7 @@ 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");
|
||||||
@ -4736,9 +4703,12 @@ void DL_Dxf::writeAppDictionary(DL_WriterA& dw) {
|
|||||||
dw.dxfInt(281, 1);
|
dw.dxfInt(281, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
unsigned long DL_Dxf::writeDictionaryEntry(DL_WriterA& dw, const std::string& name) {
|
int DL_Dxf::writeDictionaryEntry(DL_WriterA& dw, const std::string& name) {
|
||||||
dw.dxfString( 3, name);
|
dw.dxfString( 3, name);
|
||||||
return dw.handle(350);
|
int handle = dw.getNextHandle();
|
||||||
|
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) {
|
||||||
@ -4804,427 +4774,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.26.4.0"
|
#define DL_VERSION "3.17.0.0"
|
||||||
|
|
||||||
#define DL_VERSION_MAJOR 3
|
#define DL_VERSION_MAJOR 3
|
||||||
#define DL_VERSION_MINOR 26
|
#define DL_VERSION_MINOR 17
|
||||||
#define DL_VERSION_REV 4
|
#define DL_VERSION_REV 0
|
||||||
#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::istream& stream,
|
bool readDxfGroups(std::stringstream& stream,
|
||||||
DL_CreationInterface* creationInterface);
|
DL_CreationInterface* creationInterface);
|
||||||
bool in(std::istream &stream,
|
bool in(std::stringstream &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::istream& stream, bool stripSpace = true);
|
std::stringstream& 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 writeDimAngular2L(DL_WriterA& dw,
|
void writeDimAngular(DL_WriterA& dw,
|
||||||
const DL_DimensionData& data,
|
const DL_DimensionData& data,
|
||||||
const DL_DimAngular2LData& edata,
|
const DL_DimAngularData& 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,8 +311,6 @@ 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);
|
||||||
@ -326,7 +324,7 @@ public:
|
|||||||
void writeHatchEdge(DL_WriterA& dw,
|
void writeHatchEdge(DL_WriterA& dw,
|
||||||
const DL_HatchEdgeData& data);
|
const DL_HatchEdgeData& data);
|
||||||
|
|
||||||
unsigned long writeImage(DL_WriterA& dw,
|
int writeImage(DL_WriterA& dw,
|
||||||
const DL_ImageData& data,
|
const DL_ImageData& data,
|
||||||
const DL_Attributes& attrib);
|
const DL_Attributes& attrib);
|
||||||
|
|
||||||
@ -352,13 +350,12 @@ 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);
|
||||||
unsigned long writeDictionaryEntry(DL_WriterA& dw, const std::string& name);
|
int 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) const {
|
bool operator==(const DL_StyleData& other) {
|
||||||
// ignore lastHeightUsed:
|
// ignore lastHeightUsed:
|
||||||
return (name==other.name &&
|
return (name==other.name &&
|
||||||
flags==other.flags &&
|
flags==other.flags &&
|
||||||
@ -1090,8 +1090,6 @@ struct DXFLIB_EXPORT DL_DimensionData {
|
|||||||
* Dimension scale (dimscale) style override.
|
* Dimension scale (dimscale) style override.
|
||||||
*/
|
*/
|
||||||
double dimScale;
|
double dimScale;
|
||||||
bool arrow1Flipped;
|
|
||||||
bool arrow2Flipped;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
@ -1240,12 +1238,12 @@ struct DXFLIB_EXPORT DL_DimDiametricData {
|
|||||||
/**
|
/**
|
||||||
* Angular Dimension Data.
|
* Angular Dimension Data.
|
||||||
*/
|
*/
|
||||||
struct DXFLIB_EXPORT DL_DimAngular2LData {
|
struct DXFLIB_EXPORT DL_DimAngularData {
|
||||||
/**
|
/**
|
||||||
* Constructor.
|
* Constructor.
|
||||||
* Parameters: see member variables.
|
* Parameters: see member variables.
|
||||||
*/
|
*/
|
||||||
DL_DimAngular2LData(double ddpx1, double ddpy1, double ddpz1,
|
DL_DimAngularData(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) {
|
||||||
@ -1322,21 +1320,21 @@ struct DXFLIB_EXPORT DL_DimAngular3PData {
|
|||||||
dpz3 = ddpz3;
|
dpz3 = ddpz3;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*! X Coordinate of definition point 1 (extension line 1 end). */
|
/*! X Coordinate of definition point 1. */
|
||||||
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 (extension line 2 end). */
|
/*! X Coordinate of definition point 2. */
|
||||||
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 (center). */
|
/*! X Coordinate of definition point 3. */
|
||||||
double dpx3;
|
double dpx3;
|
||||||
/*! Y Coordinate of definition point 3. */
|
/*! Y Coordinate of definition point 3. */
|
||||||
double dpy3;
|
double dpy3;
|
||||||
@ -1397,25 +1395,23 @@ struct DXFLIB_EXPORT DL_LeaderData {
|
|||||||
* Constructor.
|
* Constructor.
|
||||||
* Parameters: see member variables.
|
* Parameters: see member variables.
|
||||||
*/
|
*/
|
||||||
DL_LeaderData(int arrowHeadFlag,
|
DL_LeaderData(int lArrowHeadFlag,
|
||||||
int leaderPathType,
|
int lLeaderPathType,
|
||||||
int leaderCreationFlag,
|
int lLeaderCreationFlag,
|
||||||
int hooklineDirectionFlag,
|
int lHooklineDirectionFlag,
|
||||||
int hooklineFlag,
|
int lHooklineFlag,
|
||||||
double textAnnotationHeight,
|
double lTextAnnotationHeight,
|
||||||
double textAnnotationWidth,
|
double lTextAnnotationWidth,
|
||||||
int number,
|
int lNumber) {
|
||||||
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). */
|
||||||
@ -1434,8 +1430,6 @@ 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,7 +36,6 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
#endif // _MSC_VER > 1000
|
#endif // _MSC_VER > 1000
|
||||||
|
|
||||||
#include <cstring>
|
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
|
|
||||||
@ -540,6 +539,49 @@ 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,98 +1,79 @@
|
|||||||
#include "dxfreader.h"
|
#include "dxfreader.h"
|
||||||
#include <QDebug>
|
#include <QDebug>
|
||||||
|
|
||||||
DxfReader::DxfReader(const QString &m_fileName, QObject *parent)
|
DxfReader::DxfReader(const QString &fileName, QObject *parent)
|
||||||
: QObject(parent)
|
: QObject(parent)
|
||||||
,m_fileName(m_fileName)
|
, fileName(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(m_fileName.toLocal8Bit()), this))
|
if (!dxf->in(std::string(fileName.toLocal8Bit()), this)) { // if file open failed
|
||||||
{
|
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;
|
||||||
}
|
}
|
||||||
else
|
delete dxf;
|
||||||
{
|
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;
|
||||||
m_blockData.dxfText << data;
|
dxfText << data;
|
||||||
}
|
}
|
||||||
|
|
||||||
void DxfReader::addLine(const DL_LineData &data)
|
void DxfReader::addLine(const DL_LineData &data)
|
||||||
{
|
{
|
||||||
m_blockData.dxfLines << data;
|
//qDebug() << Q_FUNC_INFO;
|
||||||
|
dxfLines << data;
|
||||||
}
|
}
|
||||||
|
|
||||||
void DxfReader::addArc(const DL_ArcData &data)
|
void DxfReader::addArc(const DL_ArcData &data)
|
||||||
{
|
{
|
||||||
//qDebug() << Q_FUNC_INFO;
|
//qDebug() << Q_FUNC_INFO;
|
||||||
m_blockData.dxfArcs << data;
|
dxfArcs << data;
|
||||||
}
|
}
|
||||||
|
|
||||||
void DxfReader::addCircle(const DL_CircleData &data)
|
void DxfReader::addCircle(const DL_CircleData &data)
|
||||||
{
|
{
|
||||||
//qDebug() << Q_FUNC_INFO;
|
//qDebug() << Q_FUNC_INFO;
|
||||||
m_blockData.dxfCircles << data;
|
dxfCircles << data;
|
||||||
}
|
}
|
||||||
|
|
||||||
void DxfReader::addEllipse(const DL_EllipseData &data)
|
void DxfReader::addEllipse(const DL_EllipseData &data)
|
||||||
{
|
{
|
||||||
//qDebug() << Q_FUNC_INFO;
|
//qDebug() << Q_FUNC_INFO;
|
||||||
m_blockData.dxfEllipses << data;
|
dxfEllipses << data;
|
||||||
}
|
}
|
||||||
|
|
||||||
void DxfReader::addPolyline(const DL_PolylineData &data)
|
void DxfReader::addPolyline(const DL_PolylineData &data)
|
||||||
{
|
{
|
||||||
//qDebug() << Q_FUNC_INFO;
|
//qDebug() << Q_FUNC_INFO;
|
||||||
m_blockData.dxfPolylines << data;
|
dxfPolylines << data;
|
||||||
}
|
}
|
||||||
|
|
||||||
void DxfReader::addPoint(const DL_PointData &data)
|
void DxfReader::addPoint(const DL_PointData &data)
|
||||||
{
|
{
|
||||||
//qDebug() << Q_FUNC_INFO;
|
//qDebug() << Q_FUNC_INFO;
|
||||||
m_blockData.dxfPoints << data;
|
dxfPoints << data;
|
||||||
}
|
}
|
||||||
|
|
||||||
void DxfReader::addSpline(const DL_SplineData &data)
|
void DxfReader::addSpline(const DL_SplineData &data)
|
||||||
{
|
{
|
||||||
//qDebug() << Q_FUNC_INFO;
|
//qDebug() << Q_FUNC_INFO;
|
||||||
m_blockData.dxfSplines << data;
|
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)
|
||||||
@ -115,31 +96,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;
|
||||||
m_blockData.dxfXLines << data;
|
dxfXLines << data;
|
||||||
}
|
}
|
||||||
|
|
||||||
void DxfReader::addRay(const DL_RayData &data)
|
void DxfReader::addRay(const DL_RayData &data)
|
||||||
{
|
{
|
||||||
//qDebug() << Q_FUNC_INFO;
|
//qDebug() << Q_FUNC_INFO;
|
||||||
m_blockData.dxfRays << data;
|
dxfRays << data;
|
||||||
}
|
}
|
||||||
|
|
||||||
void DxfReader::addVertex(const DL_VertexData &data)
|
void DxfReader::addVertex(const DL_VertexData &data)
|
||||||
{
|
{
|
||||||
//qDebug() << Q_FUNC_INFO;
|
//qDebug() << Q_FUNC_INFO;
|
||||||
m_blockData.dxfVertexs << data;
|
dxfVertexs << data;
|
||||||
}
|
}
|
||||||
|
|
||||||
void DxfReader::addControlPoint(const DL_ControlPointData &data)
|
void DxfReader::addControlPoint(const DL_ControlPointData &data)
|
||||||
{
|
{
|
||||||
//qDebug() << Q_FUNC_INFO;
|
//qDebug() << Q_FUNC_INFO;
|
||||||
m_blockData.dxfControlPoints << data;
|
dxfControlPoints << data;
|
||||||
}
|
}
|
||||||
|
|
||||||
void DxfReader::addFitPoint(const DL_FitPointData &data)
|
void DxfReader::addFitPoint(const DL_FitPointData &data)
|
||||||
{
|
{
|
||||||
//qDebug() << Q_FUNC_INFO;
|
//qDebug() << Q_FUNC_INFO;
|
||||||
m_blockData.dxfFitPoints << data;
|
dxfFitPoints << data;
|
||||||
}
|
}
|
||||||
|
|
||||||
void DxfReader::addKnot(const DL_KnotData &data)
|
void DxfReader::addKnot(const DL_KnotData &data)
|
||||||
@ -224,12 +205,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)
|
||||||
{
|
{
|
||||||
@ -260,19 +241,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;
|
||||||
m_blockData.dxfHatchs << data;
|
dxfHatchs << data;
|
||||||
}
|
}
|
||||||
|
|
||||||
void DxfReader::addHatchLoop(const DL_HatchLoopData &data)
|
void DxfReader::addHatchLoop(const DL_HatchLoopData &data)
|
||||||
{
|
{
|
||||||
//qDebug() << Q_FUNC_INFO;
|
//qDebug() << Q_FUNC_INFO;
|
||||||
m_blockData.dxfHatchLoops << data;
|
dxfHatchLoops << data;
|
||||||
}
|
}
|
||||||
|
|
||||||
void DxfReader::addHatchEdge(const DL_HatchEdgeData &data)
|
void DxfReader::addHatchEdge(const DL_HatchEdgeData &data)
|
||||||
{
|
{
|
||||||
//qDebug() << Q_FUNC_INFO;
|
//qDebug() << Q_FUNC_INFO;
|
||||||
m_blockData.dxfHatchEdges << data;
|
dxfHatchEdges << data;
|
||||||
}
|
}
|
||||||
|
|
||||||
void DxfReader::addImage(const DL_ImageData &data)
|
void DxfReader::addImage(const DL_ImageData &data)
|
||||||
@ -396,29 +377,3 @@ 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();
|
|
||||||
}
|
|
||||||
|
@ -8,28 +8,6 @@
|
|||||||
#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
|
||||||
@ -38,7 +16,6 @@ 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;
|
||||||
@ -72,7 +49,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;
|
||||||
@ -105,19 +82,29 @@ 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_BlockData> dxfBlocks;
|
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;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void initBlockDatas();
|
QString fileName;
|
||||||
|
|
||||||
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;
|
||||||
QPointF pt1,pt2;
|
QPoint pt1,pt2;
|
||||||
CDrill drill;
|
CDrill drill;
|
||||||
bool bIsdirll = false;
|
bool bIsdirll = false;
|
||||||
|
|
||||||
@ -2401,7 +2401,7 @@ bool ImportHPGL::Write(QString strPathName,Marker *pMarker)
|
|||||||
for (j = 0; j < iPointCount; j++)
|
for (j = 0; j < iPointCount; j++)
|
||||||
{
|
{
|
||||||
|
|
||||||
QPointF pt = polyLine.m_listPoint.at(j);
|
QPoint 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 <QPointF> m_listXY; //还没有确定抬落刀的坐标
|
QList <QPoint> 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 = "";
|
||||||
}
|
}
|
||||||
|
|
||||||
QRectF Marker::GetRect()
|
QRect Marker::GetRect()
|
||||||
{
|
{
|
||||||
QRectF rect;
|
QRect rect;
|
||||||
|
|
||||||
CRPPolyline RPPolyline;
|
CRPPolyline RPPolyline;
|
||||||
rect.setRect(0,0,0,0);
|
rect.setRect(0,0,0,0);
|
||||||
@ -63,22 +63,22 @@ QRectF Marker::GetRect()
|
|||||||
}
|
}
|
||||||
else if (RPPolyline.m_nDrawingType == 3)
|
else if (RPPolyline.m_nDrawingType == 3)
|
||||||
{
|
{
|
||||||
rect |= QRectF(RPPolyline.m_text.m_ptPostLU,RPPolyline.m_text.m_ptPostRD);
|
rect |= QRect(RPPolyline.m_text.m_ptPostLU,RPPolyline.m_text.m_ptPostRD);
|
||||||
}
|
}
|
||||||
else if (RPPolyline.m_nDrawingType == 1)
|
else if (RPPolyline.m_nDrawingType == 1)
|
||||||
{
|
{
|
||||||
rect |= QRectF(RPPolyline.m_bitmapInfo.m_ptAbPostLU,RPPolyline.m_bitmapInfo.m_ptAbPostRD);
|
rect |= QRect(RPPolyline.m_bitmapInfo.m_ptAbPostLU,RPPolyline.m_bitmapInfo.m_ptAbPostRD);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return rect;
|
return rect;
|
||||||
}
|
}
|
||||||
|
|
||||||
QRectF Marker::RectofPolyline(const QList<QPointF> &listPoint)
|
QRect Marker::RectofPolyline(const QList<QPoint> &listPoint)
|
||||||
{
|
{
|
||||||
if(listPoint.empty())
|
if(listPoint.empty())
|
||||||
{
|
{
|
||||||
return QRectF(0,0,0,0);
|
return QRect(0,0,0,0);
|
||||||
}
|
}
|
||||||
int iXMin = INT_MAX;
|
int iXMin = INT_MAX;
|
||||||
int iXMax = INT_MIN;
|
int iXMax = INT_MIN;
|
||||||
@ -115,7 +115,7 @@ QRectF Marker::RectofPolyline(const QList<QPointF> &listPoint)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return QRectF(QPointF(iXMin,iYMin),QPointF(iXMax,iYMax));
|
return QRect(QPoint(iXMin,iYMin),QPoint(iXMax,iYMax));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -293,7 +293,7 @@ public:
|
|||||||
class CDrill
|
class CDrill
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
QPointF m_pt;//冲孔的位置
|
QPoint 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<QPointF> m_listPoint;
|
QList<QPoint> 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();
|
||||||
QRectF GetRect();
|
QRect GetRect();
|
||||||
QRectF RectofPolyline(const QList <QPointF> &listPoint);
|
QRect RectofPolyline(const QList <QPoint> &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向上为正
|
||||||
|
@ -4,7 +4,7 @@ CreatPictureStr creatPictureByData(Marker marker,int paperWidth,int butSpace,int
|
|||||||
{
|
{
|
||||||
QPainterPath painterPath;
|
QPainterPath painterPath;
|
||||||
CBitmapInfo bitmapInfo;
|
CBitmapInfo bitmapInfo;
|
||||||
QRectF rect = marker.GetRect();
|
QRect rect = marker.GetRect();
|
||||||
int minX = rect.left();
|
int minX = rect.left();
|
||||||
int maxY = rect.bottom();
|
int maxY = rect.bottom();
|
||||||
int rectSize = 20;//20毫米-对接符矩形框大小
|
int rectSize = 20;//20毫米-对接符矩形框大小
|
||||||
@ -313,26 +313,12 @@ 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))
|
||||||
{
|
{
|
||||||
QList <CRPPolyline> polylineList;
|
dxfHelper.getDxfPaths(); // 获取转换出来的dxf所有类型图形的点集
|
||||||
CRPPolyline polyline;
|
QImage img = dxfHelper.generateDXFImage(); // 获取预览图像
|
||||||
QVector<QVector<QPointF>> dxfPaths = dxfHelper.getDxfPaths(); // 获取转换出来的dxf所有类型图形的点集
|
img.save("D:\\1.png");
|
||||||
//创建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")
|
||||||
|
@ -16,10 +16,6 @@ typedef struct
|
|||||||
QPicture sendPic;//用于发送的picture,画笔为所设置像素
|
QPicture sendPic;//用于发送的picture,画笔为所设置像素
|
||||||
} CreatPictureStr;
|
} CreatPictureStr;
|
||||||
|
|
||||||
<<<<<<< HEAD
|
|
||||||
|
|
||||||
=======
|
|
||||||
>>>>>>> 9f74511e69bc847a1a226ae630185c956827429c
|
|
||||||
//marker数据,绘制路径,纸宽,对接符间距,是否对接标志,右边距,笔宽
|
//marker数据,绘制路径,纸宽,对接符间距,是否对接标志,右边距,笔宽
|
||||||
CreatPictureStr creatPictureByData(Marker marker,int paperWidth,int butSpace,int rightSpace,int penWidth = 1);
|
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);
|
CreatPictureStr creatPictureByBmp(QPixmap pixmap,int paperWidth,int butSpace,int rightSpace,int penWidth = 1);
|
||||||
|
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="1965"/>
|
<location filename="datafile/hpgl/importhpgl.cpp" line="1816"/>
|
||||||
<source>Encrypted file parsing error!</source>
|
<source>Encrypted file parsing error!</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
@ -269,19 +269,21 @@
|
|||||||
<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="764"/>
|
<location filename="mainwindow.cpp" line="823"/>
|
||||||
<location filename="mainwindow.cpp" line="794"/>
|
<location filename="mainwindow.cpp" line="853"/>
|
||||||
<source>Delete</source>
|
<source>Delete</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
@ -388,7 +390,6 @@
|
|||||||
<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>
|
||||||
@ -407,255 +408,233 @@
|
|||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="mainwindow.cpp" line="71"/>
|
<location filename="mainwindow.cpp" line="149"/>
|
||||||
<location filename="mainwindow.cpp" line="162"/>
|
<location filename="mainwindow.cpp" line="923"/>
|
||||||
<location filename="mainwindow.cpp" line="873"/>
|
<location filename="mainwindow.cpp" line="931"/>
|
||||||
<location filename="mainwindow.cpp" line="880"/>
|
<location filename="mainwindow.cpp" line="956"/>
|
||||||
<location filename="mainwindow.cpp" line="903"/>
|
<location filename="mainwindow.cpp" line="1369"/>
|
||||||
<location filename="mainwindow.cpp" line="1280"/>
|
<location filename="mainwindow.cpp" line="1378"/>
|
||||||
<location filename="mainwindow.cpp" line="1289"/>
|
<location filename="mainwindow.cpp" line="1501"/>
|
||||||
<location filename="mainwindow.cpp" line="1420"/>
|
<location filename="mainwindow.cpp" line="1510"/>
|
||||||
<location filename="mainwindow.cpp" line="1429"/>
|
<location filename="mainwindow.cpp" line="1561"/>
|
||||||
<location filename="mainwindow.cpp" line="1481"/>
|
<location filename="mainwindow.cpp" line="1649"/>
|
||||||
<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="163"/>
|
<location filename="mainwindow.cpp" line="150"/>
|
||||||
<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="362"/>
|
<location filename="mainwindow.cpp" line="393"/>
|
||||||
<location filename="mainwindow.cpp" line="424"/>
|
<location filename="mainwindow.cpp" line="455"/>
|
||||||
<source>Connnecting...</source>
|
<source>Connnecting...</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="mainwindow.cpp" line="366"/>
|
<location filename="mainwindow.cpp" line="397"/>
|
||||||
<location filename="mainwindow.cpp" line="428"/>
|
<location filename="mainwindow.cpp" line="459"/>
|
||||||
<source>Connected</source>
|
<source>Connected</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="mainwindow.cpp" line="370"/>
|
<location filename="mainwindow.cpp" line="401"/>
|
||||||
<location filename="mainwindow.cpp" line="391"/>
|
<location filename="mainwindow.cpp" line="422"/>
|
||||||
<location filename="mainwindow.cpp" line="421"/>
|
<location filename="mainwindow.cpp" line="452"/>
|
||||||
<source>NotConnected</source>
|
<source>NotConnected</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="mainwindow.cpp" line="311"/>
|
<location filename="mainwindow.cpp" line="428"/>
|
||||||
<location filename="mainwindow.cpp" line="397"/>
|
<location filename="mainwindow.cpp" line="466"/>
|
||||||
<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="72"/>
|
<location filename="mainwindow.cpp" line="432"/>
|
||||||
<source>Do you want to exit the program?</source>
|
<location filename="mainwindow.cpp" line="470"/>
|
||||||
<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="512"/>
|
<location filename="mainwindow.cpp" line="539"/>
|
||||||
<location filename="mainwindow.cpp" line="698"/>
|
<location filename="mainwindow.cpp" line="712"/>
|
||||||
<location filename="mainwindow.cpp" line="961"/>
|
<location filename="mainwindow.cpp" line="1057"/>
|
||||||
<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="516"/>
|
<location filename="mainwindow.cpp" line="543"/>
|
||||||
<location filename="mainwindow.cpp" line="702"/>
|
<location filename="mainwindow.cpp" line="716"/>
|
||||||
<location filename="mainwindow.cpp" line="1152"/>
|
<location filename="mainwindow.cpp" line="1196"/>
|
||||||
<source>Printting</source>
|
<source>Printting</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="mainwindow.cpp" line="604"/>
|
<location filename="mainwindow.cpp" line="622"/>
|
||||||
<location filename="mainwindow.cpp" line="1238"/>
|
<location filename="mainwindow.cpp" line="1331"/>
|
||||||
<source>FileName</source>
|
<source>FileName</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="mainwindow.cpp" line="604"/>
|
<location filename="mainwindow.cpp" line="622"/>
|
||||||
<location filename="mainwindow.cpp" line="1238"/>
|
<location filename="mainwindow.cpp" line="1331"/>
|
||||||
<source>Length</source>
|
<source>Length</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="mainwindow.cpp" line="604"/>
|
<location filename="mainwindow.cpp" line="622"/>
|
||||||
<location filename="mainwindow.cpp" line="1238"/>
|
<location filename="mainwindow.cpp" line="1331"/>
|
||||||
<source>Width</source>
|
<source>Width</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="mainwindow.cpp" line="605"/>
|
<location filename="mainwindow.cpp" line="623"/>
|
||||||
<location filename="mainwindow.cpp" line="1239"/>
|
<location filename="mainwindow.cpp" line="1332"/>
|
||||||
<source>Printed</source>
|
<source>Printed</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="mainwindow.cpp" line="605"/>
|
<location filename="mainwindow.cpp" line="623"/>
|
||||||
<location filename="mainwindow.cpp" line="1239"/>
|
<location filename="mainwindow.cpp" line="1332"/>
|
||||||
<source>Progress</source>
|
<source>Progress</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="mainwindow.cpp" line="605"/>
|
<location filename="mainwindow.cpp" line="623"/>
|
||||||
<location filename="mainwindow.cpp" line="1239"/>
|
<location filename="mainwindow.cpp" line="1332"/>
|
||||||
<source>Numbers</source>
|
<source>Numbers</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="mainwindow.cpp" line="605"/>
|
<location filename="mainwindow.cpp" line="623"/>
|
||||||
<location filename="mainwindow.cpp" line="1239"/>
|
<location filename="mainwindow.cpp" line="1332"/>
|
||||||
<source>State</source>
|
<source>State</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="mainwindow.cpp" line="605"/>
|
<location filename="mainwindow.cpp" line="623"/>
|
||||||
<location filename="mainwindow.cpp" line="1239"/>
|
<location filename="mainwindow.cpp" line="1332"/>
|
||||||
<source>FilePath</source>
|
<source>FilePath</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="mainwindow.cpp" line="605"/>
|
<location filename="mainwindow.cpp" line="623"/>
|
||||||
<location filename="mainwindow.cpp" line="1239"/>
|
<location filename="mainwindow.cpp" line="1332"/>
|
||||||
<source>StartPoint</source>
|
<source>StartPoint</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="mainwindow.cpp" line="626"/>
|
<location filename="mainwindow.cpp" line="644"/>
|
||||||
<location filename="mainwindow.cpp" line="1243"/>
|
<location filename="mainwindow.cpp" line="1336"/>
|
||||||
<source>McName</source>
|
<source>McName</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="mainwindow.cpp" line="626"/>
|
<location filename="mainwindow.cpp" line="644"/>
|
||||||
<location filename="mainwindow.cpp" line="1243"/>
|
<location filename="mainwindow.cpp" line="1336"/>
|
||||||
<source>McIp</source>
|
<source>McIp</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="mainwindow.cpp" line="626"/>
|
<location filename="mainwindow.cpp" line="644"/>
|
||||||
<location filename="mainwindow.cpp" line="1243"/>
|
<location filename="mainwindow.cpp" line="1336"/>
|
||||||
<source>McConState</source>
|
<source>McConState</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="mainwindow.cpp" line="626"/>
|
<location filename="mainwindow.cpp" line="644"/>
|
||||||
<location filename="mainwindow.cpp" line="1243"/>
|
<location filename="mainwindow.cpp" line="1336"/>
|
||||||
<source>McState</source>
|
<source>McState</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="mainwindow.cpp" line="626"/>
|
<location filename="mainwindow.cpp" line="644"/>
|
||||||
<location filename="mainwindow.cpp" line="1243"/>
|
<location filename="mainwindow.cpp" line="1336"/>
|
||||||
<source>McProgress</source>
|
<source>McProgress</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="mainwindow.cpp" line="760"/>
|
<location filename="mainwindow.cpp" line="819"/>
|
||||||
<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="761"/>
|
<location filename="mainwindow.cpp" line="820"/>
|
||||||
<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="762"/>
|
<location filename="mainwindow.cpp" line="821"/>
|
||||||
<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="763"/>
|
<location filename="mainwindow.cpp" line="822"/>
|
||||||
<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="881"/>
|
<location filename="mainwindow.cpp" line="924"/>
|
||||||
<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="874"/>
|
<location filename="mainwindow.cpp" line="932"/>
|
||||||
<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="904"/>
|
<location filename="mainwindow.cpp" line="957"/>
|
||||||
<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="1160"/>
|
<location filename="mainwindow.cpp" line="1192"/>
|
||||||
<source>Complete</source>
|
<source>Complete</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="mainwindow.cpp" line="1281"/>
|
<location filename="mainwindow.cpp" line="1370"/>
|
||||||
<location filename="mainwindow.cpp" line="1421"/>
|
<location filename="mainwindow.cpp" line="1502"/>
|
||||||
<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="1290"/>
|
<location filename="mainwindow.cpp" line="1379"/>
|
||||||
<location filename="mainwindow.cpp" line="1430"/>
|
<location filename="mainwindow.cpp" line="1511"/>
|
||||||
<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="1300"/>
|
<location filename="mainwindow.cpp" line="1392"/>
|
||||||
<location filename="mainwindow.cpp" line="1440"/>
|
<location filename="mainwindow.cpp" line="1524"/>
|
||||||
<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="1302"/>
|
<location filename="mainwindow.cpp" line="1394"/>
|
||||||
<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="1442"/>
|
<location filename="mainwindow.cpp" line="1526"/>
|
||||||
<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="1482"/>
|
<location filename="mainwindow.cpp" line="1562"/>
|
||||||
<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="1494"/>
|
<location filename="mainwindow.cpp" line="1574"/>
|
||||||
<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="1519"/>
|
<location filename="mainwindow.cpp" line="1650"/>
|
||||||
<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>
|
||||||
@ -955,7 +934,7 @@
|
|||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="printinfodialog.cpp" line="80"/>
|
<location filename="printinfodialog.cpp" line="78"/>
|
||||||
<source>piece</source>
|
<source>piece</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
@ -1054,12 +1033,12 @@
|
|||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="printviewwindow.cpp" line="111"/>
|
<location filename="printviewwindow.cpp" line="106"/>
|
||||||
<source>Prompt</source>
|
<source>Prompt</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="printviewwindow.cpp" line="112"/>
|
<location filename="printviewwindow.cpp" line="107"/>
|
||||||
<source>Unreasonable value input!</source>
|
<source>Unreasonable value input!</source>
|
||||||
<translation type="unfinished"></translation>
|
<translation type="unfinished"></translation>
|
||||||
</message>
|
</message>
|
||||||
|
@ -15,7 +15,6 @@ CreatPrintBmp::CreatPrintBmp(QObject *parent) : QObject(parent)
|
|||||||
m_moveFileIdx = -1;//上下移动打印文件索引
|
m_moveFileIdx = -1;//上下移动打印文件索引
|
||||||
m_moveDir = 0;//-1,上移 1,下移
|
m_moveDir = 0;//-1,上移 1,下移
|
||||||
m_rotateAngle = 0;
|
m_rotateAngle = 0;
|
||||||
m_markSpace = 0;
|
|
||||||
m_autoDirFilesList.clear();
|
m_autoDirFilesList.clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -170,19 +169,6 @@ int CreatPrintBmp::creatBmpBlockDatAndSend(int fileidx, int idx)
|
|||||||
num += 1;
|
num += 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
//计算每块位图的走纸距离
|
|
||||||
u32 paperDis = 0;
|
|
||||||
int moveOft = abs(offset)+PIXMAPWIDTH;
|
|
||||||
if(moveOft <= pic.width())
|
|
||||||
{
|
|
||||||
paperDis = ((double)PIXMAPWIDTH / MMPIXELY)*100;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
u32 cLength = moveOft - (pic.width() - oft);
|
|
||||||
paperDis = ((double)(PIXMAPWIDTH-cLength) / MMPIXELY)*100 + m_markSpace*100;
|
|
||||||
}
|
|
||||||
|
|
||||||
QBitmap *pixmap = new QBitmap(PIXMAPWIDTH,height);
|
QBitmap *pixmap = new QBitmap(PIXMAPWIDTH,height);
|
||||||
QPainter *pixPainter = new QPainter();
|
QPainter *pixPainter = new QPainter();
|
||||||
pixPainter->begin(pixmap);
|
pixPainter->begin(pixmap);
|
||||||
@ -232,11 +218,6 @@ int CreatPrintBmp::creatBmpBlockDatAndSend(int fileidx, int idx)
|
|||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
QByteArray dat = bwBmp.getPrBmpDat();
|
QByteArray dat = bwBmp.getPrBmpDat();
|
||||||
//写入每块位图走纸距离
|
|
||||||
CompBmpHead *bmphead = new CompBmpHead;
|
|
||||||
memcpy((u8*)bmphead,(u8*)dat.data(),sizeof(CompBmpHead));
|
|
||||||
bmphead->segBitPaperDis = paperDis;
|
|
||||||
|
|
||||||
emit siSendDatToMc(dat);
|
emit siSendDatToMc(dat);
|
||||||
m_mcPrintInfo->m_filesList[fileidx].m_curPrintBlock = cidx + 1;
|
m_mcPrintInfo->m_filesList[fileidx].m_curPrintBlock = cidx + 1;
|
||||||
m_mcPrintInfo->m_filesList[fileidx].m_printedBlockNum = cidx;
|
m_mcPrintInfo->m_filesList[fileidx].m_printedBlockNum = cidx;
|
||||||
@ -479,9 +460,8 @@ QString CreatPrintBmp::getSavePath()
|
|||||||
return m_savePath;
|
return m_savePath;
|
||||||
}
|
}
|
||||||
|
|
||||||
void CreatPrintBmp::setMcPrintInfo(int fileIdx,u32 markSpace,McPrintInfo *printInfo)
|
void CreatPrintBmp::setMcPrintInfo(int fileIdx, McPrintInfo *printInfo)
|
||||||
{
|
{
|
||||||
m_markSpace = markSpace;
|
|
||||||
m_mcPrintInfo = printInfo;
|
m_mcPrintInfo = printInfo;
|
||||||
|
|
||||||
if(fileIdx < 0)
|
if(fileIdx < 0)
|
||||||
|
@ -45,7 +45,6 @@ private:
|
|||||||
int m_moveFileIdx;//上下移动打印文件索引
|
int m_moveFileIdx;//上下移动打印文件索引
|
||||||
s16 m_moveDir;//-1,上移 1,下移
|
s16 m_moveDir;//-1,上移 1,下移
|
||||||
double m_rotateAngle;
|
double m_rotateAngle;
|
||||||
u32 m_markSpace;//马克间距
|
|
||||||
|
|
||||||
QFileInfoList m_autoDirFilesList;//自动绘图目录中文件列表
|
QFileInfoList m_autoDirFilesList;//自动绘图目录中文件列表
|
||||||
|
|
||||||
@ -59,7 +58,7 @@ public:
|
|||||||
void setPicture(QBitmap bitmap);
|
void setPicture(QBitmap bitmap);
|
||||||
void setSavePath(QString path);
|
void setSavePath(QString path);
|
||||||
QString getSavePath();
|
QString getSavePath();
|
||||||
void setMcPrintInfo(int fileIdx,u32 markSpace,McPrintInfo *printInfo);//设置机器信息
|
void setMcPrintInfo(int fileIdx,McPrintInfo *printInfo);//设置机器信息
|
||||||
void stopCreatPrintDat();//停止生成打印数据
|
void stopCreatPrintDat();//停止生成打印数据
|
||||||
void setDeleteFile(McPrintInfo *printInfo, int fileIdx);//删除文件
|
void setDeleteFile(McPrintInfo *printInfo, int fileIdx);//删除文件
|
||||||
void setMoveFile(McPrintInfo *printInfo, int fileIdx, int dir = -1);//上下移动文件
|
void setMoveFile(McPrintInfo *printInfo, int fileIdx, int dir = -1);//上下移动文件
|
||||||
|
@ -122,11 +122,9 @@ typedef struct
|
|||||||
u8 compType[4]; // 本块位图压缩类型, =0, 不压缩; =1, 按字节压缩(分段压缩);
|
u8 compType[4]; // 本块位图压缩类型, =0, 不压缩; =1, 按字节压缩(分段压缩);
|
||||||
u32 compSegOffset[4]; // 分段数据起始位置
|
u32 compSegOffset[4]; // 分段数据起始位置
|
||||||
|
|
||||||
// 60
|
|
||||||
u32 segBitPaperDis; // 每段位图走纸距离,0.01mm
|
|
||||||
#if (1)
|
#if (1)
|
||||||
//64
|
// 60
|
||||||
u8 rev[128-2-64]; // 保留
|
u8 rev[128-2-60]; // 保留
|
||||||
#else
|
#else
|
||||||
// 保存原图中BMP头文件(算法测试用)
|
// 保存原图中BMP头文件(算法测试用)
|
||||||
// 60
|
// 60
|
||||||
|
@ -411,11 +411,11 @@ void Machine::invalidateWorkFile(int idx)
|
|||||||
setMcStatus(MC_INVALID_FILE, idx);
|
setMcStatus(MC_INVALID_FILE, idx);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Machine::creatPrintDat(int fileIdx,u32 markSpace,int setFlag)
|
void Machine::creatPrintDat(int fileIdx,int setFlag)
|
||||||
{
|
{
|
||||||
if(setFlag == 1)
|
if(setFlag == 1)
|
||||||
{
|
{
|
||||||
m_pCreatPrintDat->setMcPrintInfo(fileIdx,markSpace,&m_mcPrintInfo);
|
m_pCreatPrintDat->setMcPrintInfo(fileIdx,&m_mcPrintInfo);
|
||||||
}
|
}
|
||||||
emit siCreatData();
|
emit siCreatData();
|
||||||
}
|
}
|
||||||
|
@ -104,7 +104,7 @@ public:
|
|||||||
// 机器工作命令
|
// 机器工作命令
|
||||||
void mcWorkCmd(int workcode, int para1 = 0 , int para2 = 0);
|
void mcWorkCmd(int workcode, int para1 = 0 , int para2 = 0);
|
||||||
|
|
||||||
void creatPrintDat(int fileIdx,u32 markSpace,int setFlag = 1); //生成打印数据
|
void creatPrintDat(int fileIdx,int setFlag = 1); //生成打印数据
|
||||||
void stopPrint(); //停止打印
|
void stopPrint(); //停止打印
|
||||||
|
|
||||||
void deleteFilePrintDat(int fileIdx);//删除文件打印数据
|
void deleteFilePrintDat(int fileIdx);//删除文件打印数据
|
||||||
|
@ -41,7 +41,7 @@ public:
|
|||||||
QString m_fileName;//文件名称
|
QString m_fileName;//文件名称
|
||||||
QString m_filePath;//文件路径
|
QString m_filePath;//文件路径
|
||||||
s16 m_fileType;//文件类型
|
s16 m_fileType;//文件类型
|
||||||
QRectF m_fileRect;//图形被包络的矩形区域
|
QRect m_fileRect;//图形被包络的矩形区域
|
||||||
s16 m_printNum;//打印份数
|
s16 m_printNum;//打印份数
|
||||||
s16 m_startPoint;//打印起始点
|
s16 m_startPoint;//打印起始点
|
||||||
s16 m_printState;//打印状态
|
s16 m_printState;//打印状态
|
||||||
|
@ -222,7 +222,6 @@ void MainWindow::startCreatBmpAndSend(int mcIdx)
|
|||||||
{
|
{
|
||||||
int mcBegIdx, mcEndIdx;
|
int mcBegIdx, mcEndIdx;
|
||||||
mcBegIdx = mcEndIdx = 0;
|
mcBegIdx = mcEndIdx = 0;
|
||||||
u32 markSpace = m_pSettings->value("DrawSet/markmargin").toUInt();//马克间距
|
|
||||||
|
|
||||||
//自动打印时mcIdx为-1
|
//自动打印时mcIdx为-1
|
||||||
//mcIdx = -1;
|
//mcIdx = -1;
|
||||||
@ -258,7 +257,7 @@ void MainWindow::startCreatBmpAndSend(int mcIdx)
|
|||||||
{
|
{
|
||||||
mcDir.mkdir(mcFile);
|
mcDir.mkdir(mcFile);
|
||||||
}
|
}
|
||||||
g_machineList[i]->creatPrintDat(m_curFileRow,markSpace);
|
g_machineList[i]->creatPrintDat(m_curFileRow);
|
||||||
|
|
||||||
if(m_curFileRow > 0)
|
if(m_curFileRow > 0)
|
||||||
{
|
{
|
||||||
@ -483,7 +482,7 @@ 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);
|
||||||
|
|
||||||
QRectF rect = filesList[i].m_fileRect;
|
QRect rect = filesList[i].m_fileRect;
|
||||||
|
|
||||||
QString length = QString::number((int)((rect.right() - rect.left())/MMPIXELY))+"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);
|
||||||
@ -669,7 +668,7 @@ 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);
|
||||||
|
|
||||||
QRectF rect = m_curFilesInfo.m_fileRect;
|
QRect rect = m_curFilesInfo.m_fileRect;
|
||||||
|
|
||||||
QString length = QString::number((int)((rect.right() - rect.left())/MMPIXELY))+"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);
|
||||||
@ -990,11 +989,7 @@ 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);
|
||||||
<<<<<<< HEAD
|
|
||||||
QRectF rect = g_machineList[m_curMcIdx]->m_mcPrintInfo.m_filesList[i].m_fileRect;
|
|
||||||
=======
|
|
||||||
QRect rect = g_machineList[m_curMcIdx]->m_mcPrintInfo.m_filesList[i].m_fileRect;
|
QRect rect = g_machineList[m_curMcIdx]->m_mcPrintInfo.m_filesList[i].m_fileRect;
|
||||||
>>>>>>> 9f74511e69bc847a1a226ae630185c956827429c
|
|
||||||
QString length = QString::number((int)((rect.right() - rect.left())/MMPIXELY))+"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((int)((rect.bottom() - rect.top())/MMPIXELY))+"mm";
|
QString width = QString::number((int)((rect.bottom() - rect.top())/MMPIXELY))+"mm";
|
||||||
@ -1014,11 +1009,7 @@ 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);
|
||||||
<<<<<<< HEAD
|
|
||||||
QRectF rect = curFilesInfo.m_fileRect;
|
|
||||||
=======
|
|
||||||
QRect rect = curFilesInfo.m_fileRect;
|
QRect rect = curFilesInfo.m_fileRect;
|
||||||
>>>>>>> 9f74511e69bc847a1a226ae630185c956827429c
|
|
||||||
QString length = QString::number((int)((rect.right() - rect.left())/MMPIXELY))+"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((int)((rect.bottom() - rect.top())/MMPIXELY))+"mm";
|
QString width = QString::number((int)((rect.bottom() - rect.top())/MMPIXELY))+"mm";
|
||||||
@ -1051,7 +1042,6 @@ void MainWindow::slotDeleteFileFromList(int mcNum, int fileIdx, int refreshFlag)
|
|||||||
{
|
{
|
||||||
//是否自动打印
|
//是否自动打印
|
||||||
int autoPrint = 0;
|
int autoPrint = 0;
|
||||||
u32 markSpace = m_pSettings->value("DrawSet/markmargin").toUInt();//马克间距
|
|
||||||
|
|
||||||
//刷新进度
|
//刷新进度
|
||||||
if(refreshFlag != 0)
|
if(refreshFlag != 0)
|
||||||
@ -1101,7 +1091,7 @@ void MainWindow::slotDeleteFileFromList(int mcNum, int fileIdx, int refreshFlag)
|
|||||||
|
|
||||||
if(m_curFileRow >= 0 && autoPrint == 1)
|
if(m_curFileRow >= 0 && autoPrint == 1)
|
||||||
{
|
{
|
||||||
g_machineList[i]->creatPrintDat(m_curFileRow,markSpace,0);
|
g_machineList[i]->creatPrintDat(m_curFileRow,0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user