[qet] [4237] DXFtoQET update |
[ Thread Index |
Date Index
| More lists.tuxfamily.org/qet Archives
]
Revision: 4237
Author: rdsivd
Date: 2015-10-11 15:47:01 +0200 (Sun, 11 Oct 2015)
Log Message:
-----------
DXFtoQET update
Modified Paths:
--------------
branches/dxftoqet2/dxf_create_elmt.cpp
branches/dxftoqet2/dxf_create_elmt.h
branches/dxftoqet2/dxftoqet_mainwindow.cpp
branches/dxftoqet2/dxftoqet_mainwindow.ui
branches/dxftoqet2/src/dxf/dxf_arc.cpp
branches/dxftoqet2/src/dxf/dxf_circle.cpp
branches/dxftoqet2/src/dxf/dxf_line.cpp
branches/dxftoqet2/src/dxf/dxf_line.h
branches/dxftoqet2/src/dxf_base_types/dxf_base_polyline.cpp
branches/dxftoqet2/src/dxf_data.h
branches/dxftoqet2/src/dxf_split.cpp
Modified: branches/dxftoqet2/dxf_create_elmt.cpp
===================================================================
--- branches/dxftoqet2/dxf_create_elmt.cpp 2015-10-11 06:31:39 UTC (rev 4236)
+++ branches/dxftoqet2/dxf_create_elmt.cpp 2015-10-11 13:47:01 UTC (rev 4237)
@@ -18,6 +18,13 @@
extern struct DXF_block_line DXF_input_block_line[100][50];
extern struct DXF_block_arc DXF_input_block_arc[100][50];
+extern struct DXF_block_circle DXF_input_block_circle[100][50];
+extern struct DXF_block_ellipse DXF_input_block_ellipse[100][50];
+extern struct DXF_block_attdef DXF_input_block_attdef[100][50];
+extern struct DXF_block_attrib DXF_input_block_attrib[100][50];
+extern struct DXF_block_point DXF_input_block_point[100][50];
+extern struct DXF_block_seqend DXF_input_block_seqend[100][50];
+extern struct DXF_block_vertex DXF_input_block_vertex[100][50];
DXF_create_elmt::DXF_create_elmt(QWidget *parent) :
QMainWindow(parent)
@@ -303,6 +310,7 @@
dxb_line.y2=-DXF_input_entities_line[Count_lines].DXF_entities_line_code_21;
dxb_line.ltype=DXF_input_entities_line[Count_lines].DXF_entities_line_code_6;
dxb_line.layer=DXF_input_entities_line[Count_lines].DXF_entities_line_code_8;
+ dxb_line.color="black";
Result_line.append(dxb_line.Create_LINE());
@@ -474,8 +482,12 @@
db_circle.layer=DXF_input_entities_circle[Count_lines].DXF_entities_circle_code_8;
db_circle.ltype=DXF_input_entities_circle[Count_lines].DXF_entities_circle_code_6;
- //db_circle.color_dxf=-1;
+ db_circle.color="black";
+ db_circle.antialias="true";
+ db_circle.line_weight="thin";
+ db_circle.filling="none";
+
Result_circle.append(db_circle.Create_CIRCLE());
Count_lines=Count_lines+1;
@@ -633,6 +645,7 @@
return Result_polyline;
}
+
QString DXF_create_elmt::Make_INSERT()
{
Result_insert="";
@@ -652,11 +665,21 @@
x_insert=0;
y_insert=0;
+ x_insert_scale=1;
+ y_insert_scale=1;
+
Insert_block_nr=Count_lines;
x_insert=DXF_input_entities_insert[Count_lines].DXF_entities_insert_code_10;
y_insert=DXF_input_entities_insert[Count_lines].DXF_entities_insert_code_20;
+ x_insert_scale=DXF_input_entities_insert[Count_lines].DXF_entities_insert_code_41;
+ y_insert_scale=DXF_input_entities_insert[Count_lines].DXF_entities_insert_code_42;
+
+
+
+
+ xy_rotation=DXF_input_entities_insert[Count_lines].DXF_entities_insert_code_50;
Name_insert=DXF_input_entities_insert[Count_lines].DXF_entities_insert_code_2;
@@ -669,6 +692,10 @@
Result_insert.append(Make_Block_ARC());
+ /* Block ARC */
+
+ Result_insert.append(Make_Block_CIRCLE());
+
/* end of block */
Count_lines=Count_lines+1;
@@ -693,12 +720,13 @@
{
- dxb_line.x1=x_insert+DXF_input_block_line[Insert_block_nr][Count_lines_block2].DXF_block_line_code_10;
- dxb_line.x2=x_insert+DXF_input_block_line[Insert_block_nr][Count_lines_block2].DXF_block_line_code_11;
- dxb_line.y1=(-y_insert)+(-DXF_input_block_line[Insert_block_nr][Count_lines_block2].DXF_block_line_code_20);
- dxb_line.y2=(-y_insert)+(-DXF_input_block_line[Insert_block_nr][Count_lines_block2].DXF_block_line_code_21);
+ dxb_line.x1=x_insert+((DXF_input_block_line[Insert_block_nr][Count_lines_block2].DXF_block_line_code_10)*x_insert_scale);
+ dxb_line.x2=x_insert+((DXF_input_block_line[Insert_block_nr][Count_lines_block2].DXF_block_line_code_11)*x_insert_scale);
+ dxb_line.y1=(-y_insert)+(-(DXF_input_block_line[Insert_block_nr][Count_lines_block2].DXF_block_line_code_20*y_insert_scale));
+ dxb_line.y2=(-y_insert)+(-(DXF_input_block_line[Insert_block_nr][Count_lines_block2].DXF_block_line_code_21*y_insert_scale));
dxb_line.ltype=DXF_input_block_line[Insert_block_nr][Count_lines_block2].DXF_block_line_code_6;
- dxb_line.layer=DXF_input_block_line[Insert_block_nr][Count_lines_block2].DXF_block_line_code_8;;
+ dxb_line.layer=DXF_input_block_line[Insert_block_nr][Count_lines_block2].DXF_block_line_code_8;
+ dxb_line.color="red";
Result_Block_Lines.append(dxb_line.Create_LINE());
@@ -722,15 +750,17 @@
while(Count_lines_block2<DXF_main_base[0].DXF_block_arc_count[Insert_block_nr])
{
- dxb_arc.center_x=x_insert+DXF_input_block_arc[Insert_block_nr][Count_lines_block2].DXF_block_arc_code_10;
- dxb_arc.center_y=(-y_insert)+(-DXF_input_block_arc[Insert_block_nr][Count_lines_block2].DXF_block_arc_code_20);
- dxb_arc.radius=DXF_input_block_arc[Insert_block_nr][Count_lines_block2].DXF_block_arc_code_40;
+ dxb_arc.center_x=x_insert+(DXF_input_block_arc[Insert_block_nr][Count_lines_block2].DXF_block_arc_code_10*x_insert_scale);
+ dxb_arc.center_y=(-y_insert)+(-(DXF_input_block_arc[Insert_block_nr][Count_lines_block2].DXF_block_arc_code_20*y_insert_scale));
+ dxb_arc.radius=(DXF_input_block_arc[Insert_block_nr][Count_lines_block2].DXF_block_arc_code_40*x_insert_scale);
+
dxb_arc.start_angle=DXF_input_block_arc[Insert_block_nr][Count_lines_block2].DXF_block_arc_code_50;
dxb_arc.end_angle=DXF_input_block_arc[Insert_block_nr][Count_lines_block2].DXF_block_arc_code_51;
dxb_arc.layer=DXF_input_block_arc[Insert_block_nr][Count_lines_block2].DXF_block_arc_code_8;
dxb_arc.ltype=DXF_input_block_arc[Insert_block_nr][Count_lines_block2].DXF_block_arc_code_6;
dxb_arc.color_dxf=-1;
+ dxb_arc.color="red";
@@ -744,3 +774,37 @@
return Result_Block_Arc;
}
+
+ QString DXF_create_elmt::Make_Block_CIRCLE()
+ {
+ Result_Block_Circle="";
+ Count_lines_block2=0;
+
+ dxf_circle dxb_circle2;
+
+ while(Count_lines_block2<DXF_main_base[0].DXF_block_circle_count[Insert_block_nr])
+ {
+
+ dxb_circle2.x=x_insert+(DXF_input_block_circle[Insert_block_nr][Count_lines_block2].DXF_block_circle_code_10*x_insert_scale);
+ dxb_circle2.y=(-y_insert)+(-(DXF_input_block_circle[Insert_block_nr][Count_lines_block2].DXF_block_circle_code_20*y_insert_scale));
+ dxb_circle2.diameter=((DXF_input_block_circle[Insert_block_nr][Count_lines_block2].DXF_block_circle_code_40*2)*x_insert_scale);
+
+ dxb_circle2.layer=DXF_input_block_circle[Insert_block_nr][Count_lines_block2].DXF_block_circle_code_8;
+ dxb_circle2.ltype=DXF_input_block_circle[Insert_block_nr][Count_lines_block2].DXF_block_circle_code_6;
+ dxb_circle2.color="red";
+ dxb_circle2.antialias="true";
+ dxb_circle2.line_weight="thin";
+ dxb_circle2.filling="none";
+
+
+
+ Result_Block_Circle.append(dxb_circle2.Create_CIRCLE());
+
+
+ Count_lines_block2=Count_lines_block2+1;
+
+ }
+
+
+ return Result_Block_Circle;
+ }
Modified: branches/dxftoqet2/dxf_create_elmt.h
===================================================================
--- branches/dxftoqet2/dxf_create_elmt.h 2015-10-11 06:31:39 UTC (rev 4236)
+++ branches/dxftoqet2/dxf_create_elmt.h 2015-10-11 13:47:01 UTC (rev 4237)
@@ -64,6 +64,7 @@
QString Result_Block_Lines;
QString Result_Block_Arc;
+ QString Result_Block_Circle;
double DXF_LIMMAX_x;
@@ -101,6 +102,11 @@
double x_insert;
double y_insert;
+ double x_insert_scale;
+ double y_insert_scale;
+
+ double xy_rotation;
+
QString Name_insert;
Modified: branches/dxftoqet2/dxftoqet_mainwindow.cpp
===================================================================
--- branches/dxftoqet2/dxftoqet_mainwindow.cpp 2015-10-11 06:31:39 UTC (rev 4236)
+++ branches/dxftoqet2/dxftoqet_mainwindow.cpp 2015-10-11 13:47:01 UTC (rev 4237)
@@ -183,7 +183,7 @@
FileType=DXF_main_base[0].dxf_openfile.split(".").last();
FileName=DXF_main_base[0].dxf_openfile.split(".").first().toLower();
- DXF_main_base[0].dxf_openfile=FileName.replace("-","_");
+ DXF_main_base[0].dxf_openfile=FileName.remove(QRegExp("[+-/\_]"));
DXF_main_base[0].dxf_filetype=FileType;
Modified: branches/dxftoqet2/dxftoqet_mainwindow.ui
===================================================================
--- branches/dxftoqet2/dxftoqet_mainwindow.ui 2015-10-11 06:31:39 UTC (rev 4236)
+++ branches/dxftoqet2/dxftoqet_mainwindow.ui 2015-10-11 13:47:01 UTC (rev 4237)
@@ -1316,11 +1316,11 @@
<string>01 3dface();
02 3dsolid();
03 acad_proxy_entity();
-04 arc();
+04 arc(converted);
05 attdef();
06 attr();
07 body();
-08 circle();
+08 circle(converted);
09 dimension();
10 ellipse();
11 hatch();
@@ -1329,7 +1329,7 @@
14 insert();
15 leader();
16 light();
-17 line();
+17 line(converted);
18 lwpolyline();
19 mesh();
20 mline();
@@ -1861,8 +1861,14 @@
</property>
</widget>
</item>
- <item row="12" column="2">
+ <item row="12" column="2" alignment="Qt::AlignHCenter">
<widget class="QLabel" name="label_44">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Preferred" vsizetype="Preferred">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
<property name="styleSheet">
<string notr="true">BACKGROUND:rgb(165, 198, 130)</string>
</property>
Modified: branches/dxftoqet2/src/dxf/dxf_arc.cpp
===================================================================
--- branches/dxftoqet2/src/dxf/dxf_arc.cpp 2015-10-11 06:31:39 UTC (rev 4236)
+++ branches/dxftoqet2/src/dxf/dxf_arc.cpp 2015-10-11 13:47:01 UTC (rev 4237)
@@ -29,7 +29,7 @@
db_line.QET_line_weight="thin";
db_line.QET_filling="none";
- db_line.QET_color="black";
+ db_line.QET_color=color;
/*
h = (450° - acad°)/30
Modified: branches/dxftoqet2/src/dxf/dxf_circle.cpp
===================================================================
--- branches/dxftoqet2/src/dxf/dxf_circle.cpp 2015-10-11 06:31:39 UTC (rev 4236)
+++ branches/dxftoqet2/src/dxf/dxf_circle.cpp 2015-10-11 13:47:01 UTC (rev 4237)
@@ -20,10 +20,10 @@
db_circle.QET_x=x;
db_circle.QET_y=y;
- db_circle.QET_antialias="false";
- db_circle.QET_line_weight="thin";
- db_circle.QET_filling="none";
- db_circle.QET_color="black";
+ db_circle.QET_antialias=antialias;
+ db_circle.QET_line_weight=line_weight;
+ db_circle.QET_filling=filling;
+ db_circle.QET_color=color;
db_circle.QET_diameter=diameter;
Modified: branches/dxftoqet2/src/dxf/dxf_line.cpp
===================================================================
--- branches/dxftoqet2/src/dxf/dxf_line.cpp 2015-10-11 06:31:39 UTC (rev 4236)
+++ branches/dxftoqet2/src/dxf/dxf_line.cpp 2015-10-11 13:47:01 UTC (rev 4237)
@@ -33,7 +33,7 @@
db_line.QETline_weight="thin";
db_line.QETfilling="none";
- db_line.QETcolor="black";
+ db_line.QETcolor=color;
Result_line.append(db_line.CreateElmt());
Modified: branches/dxftoqet2/src/dxf/dxf_line.h
===================================================================
--- branches/dxftoqet2/src/dxf/dxf_line.h 2015-10-11 06:31:39 UTC (rev 4236)
+++ branches/dxftoqet2/src/dxf/dxf_line.h 2015-10-11 13:47:01 UTC (rev 4237)
@@ -25,10 +25,17 @@
QString handle; //5
QString softID; //330
- int16_t color; //62
+ //QET
+ QString antialias;
+ QString style;
+ QString line_style;
+ QString line_weight;
+ QString filling;
+ QString color;
+
QString Create_LINE();
signals:
Modified: branches/dxftoqet2/src/dxf_base_types/dxf_base_polyline.cpp
===================================================================
--- branches/dxftoqet2/src/dxf_base_types/dxf_base_polyline.cpp 2015-10-11 06:31:39 UTC (rev 4236)
+++ branches/dxftoqet2/src/dxf_base_types/dxf_base_polyline.cpp 2015-10-11 13:47:01 UTC (rev 4237)
@@ -65,14 +65,14 @@
Result_polyline.append(QString::number(count_segments));
Result_polyline.append("=");
Result_polyline.append(QChar(34));
- Result_polyline.append(QString::number(QET_x[count_segments],'f',2));
+ Result_polyline.append(QString::number(QET_x[count_segments],'f',0));
Result_polyline.append(QChar(34));
Result_polyline.append(" y");
Result_polyline.append(QString::number(count_segments));
Result_polyline.append("=");
Result_polyline.append(QChar(34));
- Result_polyline.append(QString::number(QET_y[count_segments],'f',2));
+ Result_polyline.append(QString::number(QET_y[count_segments],'f',0));
Result_polyline.append(QChar(34));
}
Modified: branches/dxftoqet2/src/dxf_data.h
===================================================================
--- branches/dxftoqet2/src/dxf_data.h 2015-10-11 06:31:39 UTC (rev 4236)
+++ branches/dxftoqet2/src/dxf_data.h 2015-10-11 13:47:01 UTC (rev 4237)
@@ -3075,6 +3075,13 @@
double DXF_entities_insert_code_30;
double DXF_entities_insert_code_31;
+ double DXF_entities_insert_code_40;
+ double DXF_entities_insert_code_41;
+ double DXF_entities_insert_code_42;
+ double DXF_entities_insert_code_43;
+
+ double DXF_entities_insert_code_50;
+
int16_t DXF_entities_insert_code_62;
int16_t DXF_entities_insert_code_66;
Modified: branches/dxftoqet2/src/dxf_split.cpp
===================================================================
--- branches/dxftoqet2/src/dxf_split.cpp 2015-10-11 06:31:39 UTC (rev 4236)
+++ branches/dxftoqet2/src/dxf_split.cpp 2015-10-11 13:47:01 UTC (rev 4237)
@@ -17658,6 +17658,9 @@
entities_INSERT_count2_100=0;
entities_INSERT_count2_102=0;
entities_INSERT_count2_330=0;
+ DXF_input_entities_insert[entities_INSERT_count2].DXF_entities_insert_code_41=1;
+ DXF_input_entities_insert[entities_INSERT_count2].DXF_entities_insert_code_42=1;
+ DXF_input_entities_insert[entities_INSERT_count2].DXF_entities_insert_code_43=1;
while (entities_st2==0 and entities_INSERT_count2<999)
{
@@ -17766,6 +17769,65 @@
break;
+ case 41:
+
+ if(sw_entities_insert[41]==0)
+ {
+ DXF_input_entities_insert[entities_INSERT_count2].DXF_entities_insert_code_41=line6.toDouble();
+ sw_entities_insert[41]=1;
+ }
+ else
+ {
+ //DXF_input_entities_insert[entities_INSERT_count2].DXF_entities_insert_code_41=1;
+ Log_1.append(found_entities_insert());
+ }
+
+ break;
+
+ case 42:
+
+ if(sw_entities_insert[42]==0)
+ {
+ DXF_input_entities_insert[entities_INSERT_count2].DXF_entities_insert_code_42=line6.toDouble();
+ sw_entities_insert[42]=1;
+ }
+ else
+ {
+ //DXF_input_entities_insert[entities_INSERT_count2].DXF_entities_insert_code_42=1;
+ Log_1.append(found_entities_insert());
+ }
+
+ break;
+
+ case 43:
+
+ if(sw_entities_insert[43]==0)
+ {
+ DXF_input_entities_insert[entities_INSERT_count2].DXF_entities_insert_code_43=line6.toDouble();
+ sw_entities_insert[43]=1;
+ }
+ else
+ {
+ //DXF_input_entities_insert[entities_INSERT_count2].DXF_entities_insert_code_43=1;
+ Log_1.append(found_entities_insert());
+ }
+
+ break;
+
+ case 50:
+
+ if(sw_entities_insert[50]==0)
+ {
+ DXF_input_entities_insert[entities_INSERT_count2].DXF_entities_insert_code_50=line6.toDouble();
+ sw_entities_insert[50]=1;
+ }
+ else
+ {
+ Log_1.append(found_entities_insert());
+ }
+
+ break;
+
case 66:
if(sw_entities_insert[66]==0)