13 #include "libdxfrw/libdxfrw.h"
14 #include "../vmisc/vabstractapplication.h"
23 : dxfW(new dxfRW(file.c_str())),
46 dxfW->writePoint(
static_cast<DRW_Point*
>(e));
49 dxfW->writeLine(
static_cast<DRW_Line*
>(e));
52 dxfW->writeCircle(
static_cast<DRW_Circle*
>(e));
55 dxfW->writeArc(
static_cast<DRW_Arc*
>(e));
58 dxfW->writeSolid(
static_cast<DRW_Solid*
>(e));
61 dxfW->writeEllipse(
static_cast<DRW_Ellipse*
>(e));
64 dxfW->writeLWPolyline(
static_cast<DRW_LWPolyline*
>(e));
67 dxfW->writePolyline(
static_cast<DRW_Polyline*
>(e));
70 dxfW->writeSpline(
static_cast<DRW_Spline*
>(e));
78 dxfW->writeInsert(
static_cast<DRW_Insert*
>(e));
81 dxfW->writeMText(
static_cast<DRW_MText*
>(e));
84 dxfW->writeText(
static_cast<DRW_Text*
>(e));
89 case DRW::DIMANGULAR3P:
91 case DRW::DIMDIAMETRIC:
92 case DRW::DIMORDINATE:
93 dxfW->writeDimension(
static_cast<DRW_Dimension*
>(e));
96 dxfW->writeLeader(
static_cast<DRW_Leader*
>(e));
99 dxfW->writeHatch(
static_cast<DRW_Hatch*
>(e));
102 dxfW->writeImage(
static_cast<DRW_Image*
>(e),
static_cast<dx_ifaceImg*
>(e)->path);
121 dxfW->writeBlock(bk);
123 for (std::list<DRW_Entity*>::const_iterator it=bk->
ent.begin(); it!=bk->
ent.end(); ++it)
130 dxfW->writeBlockRecord((*it)->name);
140 dxfW->writeLineType(&(*it));
145 dxfW->writeLayer(&(*it));
150 dxfW->writeTextstyle(&(*it));
155 dxfW->writeVport(&(*it));
160 dxfW->writeDimstyle(&(*it));
165 dxfW->writeAppId(&(*it));
176 cData.
headerC.addInt(
"$MEASUREMENT",
static_cast<int>(varMeasurement), 70);
177 cData.
headerC.addInt(
"$INSUNITS",
static_cast<int>(varInsunits), 70);
179 QString dateTime = QDateTime::currentDateTime().toString(
"yyyyMMdd.HHmmsszzz");
181 cData.
headerC.addStr(
"$TDCREATE", dateTime.toStdString(), 40);
197 ltype.desc =
"Dot . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .";
199 ltype.length = 0.125;
200 ltype.path.push_back(0.0);
201 ltype.path.push_back(-0.125);
205 ltype.name =
"DASHED";
206 ltype.desc =
"Dashed _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _";
208 ltype.length = 0.375;
209 ltype.path.push_back(0.25);
210 ltype.path.push_back(-0.125);
214 ltype.name =
"DASHDOT2";
215 ltype.desc =
"Dash dot2 _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._.";
218 ltype.path.push_back(0.25);
219 ltype.path.push_back(-0.125);
220 ltype.path.push_back(0.0);
221 ltype.path.push_back(-0.125);
225 ltype.name =
"DIVIDE2";
226 ltype.desc =
"Divide2 __..__..__..__..__..__..__..__..__..__..__..__..__..__..__..__..";
228 ltype.length = 0.625;
229 ltype.path.push_back(0.25);
230 ltype.path.push_back(-0.125);
231 ltype.path.push_back(0.0);
232 ltype.path.push_back(-0.125);
233 ltype.path.push_back(0.0);
234 ltype.path.push_back(-0.125);
243 layer.color = DRW::black;
247 layer.color = DRW::black;
251 layer.color = DRW::black;
259 layer.color = DRW::black;
267 layer.color = DRW::black;
289 defLayer.color = DRW::black;
290 defLayer.lWeight = DRW_LW_Conv::width03;
297 style.name =
"Standard";
298 style.lastHeight = 2.5;
319 ts.name = f.family().toUpper().toStdString();
325 ts.fontFamily += 0x2000000;
330 ts.name +=
"_ITALIC";
331 ts.fontFamily += 0x1000000;
336 if ((*it).name == ts.name)
342 ts.font = f.family().toStdString();
357 locMap[
"croatian"] =
"ISO8859-2";
358 locMap[
"cs"] =
"ISO8859-2";
359 locMap[
"cs_CS"] =
"ISO8859-2";
360 locMap[
"cs_CZ"] =
"ISO8859-2";
361 locMap[
"cz"] =
"ISO8859-2";
362 locMap[
"cz_CZ"] =
"ISO8859-2";
363 locMap[
"czech"] =
"ISO8859-2";
364 locMap[
"hr"] =
"ISO8859-2";
365 locMap[
"hr_HR"] =
"ISO8859-2";
366 locMap[
"hu"] =
"ISO8859-2";
367 locMap[
"hu_HU"] =
"ISO8859-2";
368 locMap[
"hungarian"] =
"ISO8859-2";
369 locMap[
"pl"] =
"ISO8859-2";
370 locMap[
"pl_PL"] =
"ISO8859-2";
371 locMap[
"polish"] =
"ISO8859-2";
372 locMap[
"ro"] =
"ISO8859-2";
373 locMap[
"ro_RO"] =
"ISO8859-2";
374 locMap[
"rumanian"] =
"ISO8859-2";
375 locMap[
"serbocroatian"] =
"ISO8859-2";
376 locMap[
"sh"] =
"ISO8859-2";
377 locMap[
"sh_SP"] =
"ISO8859-2";
378 locMap[
"sh_YU"] =
"ISO8859-2";
379 locMap[
"sk"] =
"ISO8859-2";
380 locMap[
"sk_SK"] =
"ISO8859-2";
381 locMap[
"sl"] =
"ISO8859-2";
382 locMap[
"sl_CS"] =
"ISO8859-2";
383 locMap[
"sl_SI"] =
"ISO8859-2";
384 locMap[
"slovak"] =
"ISO8859-2";
385 locMap[
"slovene"] =
"ISO8859-2";
386 locMap[
"sr_SP"] =
"ISO8859-2";
388 locMap[
"eo"] =
"ISO8859-3";
390 locMap[
"ee"] =
"ISO8859-4";
391 locMap[
"ee_EE"] =
"ISO8859-4";
393 locMap[
"mk"] =
"ISO8859-5";
394 locMap[
"mk_MK"] =
"ISO8859-5";
395 locMap[
"sp"] =
"ISO8859-5";
396 locMap[
"sp_YU"] =
"ISO8859-5";
398 locMap[
"ar_AA"] =
"ISO8859-6";
399 locMap[
"ar_SA"] =
"ISO8859-6";
400 locMap[
"arabic"] =
"ISO8859-6";
402 locMap[
"el"] =
"ISO8859-7";
403 locMap[
"el_GR"] =
"ISO8859-7";
404 locMap[
"greek"] =
"ISO8859-7";
406 locMap[
"hebrew"] =
"ISO8859-8";
407 locMap[
"he"] =
"ISO8859-8";
408 locMap[
"he_IL"] =
"ISO8859-8";
409 locMap[
"iw"] =
"ISO8859-8";
410 locMap[
"iw_IL"] =
"ISO8859-8";
412 locMap[
"tr"] =
"ISO8859-9";
413 locMap[
"tr_TR"] =
"ISO8859-9";
414 locMap[
"turkish"] =
"ISO8859-9";
416 locMap[
"lt"] =
"ISO8859-13";
417 locMap[
"lt_LT"] =
"ISO8859-13";
418 locMap[
"lv"] =
"ISO8859-13";
419 locMap[
"lv_LV"] =
"ISO8859-13";
421 locMap[
"et"] =
"ISO8859-15";
422 locMap[
"et_EE"] =
"ISO8859-15";
423 locMap[
"br_FR"] =
"ISO8859-15";
424 locMap[
"ca_ES"] =
"ISO8859-15";
425 locMap[
"de"] =
"ISO8859-15";
426 locMap[
"de_AT"] =
"ISO8859-15";
427 locMap[
"de_BE"] =
"ISO8859-15";
428 locMap[
"de_DE"] =
"ISO8859-15";
429 locMap[
"de_LU"] =
"ISO8859-15";
430 locMap[
"en_IE"] =
"ISO8859-15";
431 locMap[
"es"] =
"ISO8859-15";
432 locMap[
"es_ES"] =
"ISO8859-15";
433 locMap[
"eu_ES"] =
"ISO8859-15";
434 locMap[
"fi"] =
"ISO8859-15";
435 locMap[
"fi_FI"] =
"ISO8859-15";
436 locMap[
"finnish"] =
"ISO8859-15";
437 locMap[
"fr"] =
"ISO8859-15";
438 locMap[
"fr_FR"] =
"ISO8859-15";
439 locMap[
"fr_BE"] =
"ISO8859-15";
440 locMap[
"fr_LU"] =
"ISO8859-15";
441 locMap[
"french"] =
"ISO8859-15";
442 locMap[
"ga_IE"] =
"ISO8859-15";
443 locMap[
"gl_ES"] =
"ISO8859-15";
444 locMap[
"it"] =
"ISO8859-15";
445 locMap[
"it_IT"] =
"ISO8859-15";
446 locMap[
"oc_FR"] =
"ISO8859-15";
447 locMap[
"nl"] =
"ISO8859-15";
448 locMap[
"nl_BE"] =
"ISO8859-15";
449 locMap[
"nl_NL"] =
"ISO8859-15";
450 locMap[
"pt"] =
"ISO8859-15";
451 locMap[
"pt_PT"] =
"ISO8859-15";
452 locMap[
"sv_FI"] =
"ISO8859-15";
453 locMap[
"wa_BE"] =
"ISO8859-15";
455 locMap[
"uk"] =
"KOI8-U";
456 locMap[
"uk_UA"] =
"KOI8-U";
457 locMap[
"ru_YA"] =
"KOI8-U";
458 locMap[
"ukrainian"] =
"KOI8-U";
459 locMap[
"ru_RU"] =
"KOI8-U";
461 locMap[
"be"] =
"KOI8-R";
462 locMap[
"be_BY"] =
"KOI8-R";
463 locMap[
"bg"] =
"KOI8-R";
464 locMap[
"bg_BG"] =
"KOI8-R";
465 locMap[
"bulgarian"] =
"KOI8-R";
466 locMap[
"ba_RU"] =
"KOI8-R";
467 locMap[
"ky"] =
"KOI8-R";
468 locMap[
"ky_KG"] =
"KOI8-R";
469 locMap[
"kk"] =
"KOI8-R";
470 locMap[
"kk_KZ"] =
"KOI8-R";
472 QLocale locale(
qApp->Settings()->GetLocale());
473 return locMap.value(locale.name().toStdString(),
"ISO8859-1");
std::list< DRW_AppId > appIds
std::list< DRW_Dimstyle > dimStyles
std::list< DRW_Vport > VPorts
std::list< dx_ifaceBlock * > blocks
std::list< DRW_LType > lineTypes
std::list< DRW_Layer > layers
std::list< DRW_Textstyle > textStyles
std::list< DRW_Entity * > ent
virtual void writeAppId()
void AddBlock(dx_ifaceBlock *block)
virtual void writeVports()
virtual void writeDimstyles()
void AddEntity(DRW_Entity *e)
virtual void writeEntities()
virtual void writeLTypes()
virtual void writeHeader(DRW_Header &data)
virtual void writeLayers()
bool fileExport(bool binary)
void writeEntity(DRW_Entity *e)
UTF8STRING AddFont(const QFont &f)
dx_iface(const std::string &file, DRW::Version v, VarMeasurement varMeasurement, VarInsunits varInsunits)
virtual void writeBlockRecords()
void InitHeader(VarMeasurement varMeasurement, VarInsunits varInsunits)
virtual void writeBlocks()
virtual void writeTextstyles()
static std::string LocaleToISO()