[qet] [4235] DXFtoQET

[ Thread Index | Date Index | More lists.tuxfamily.org/qet Archives ]


Revision: 4235
Author:   rdsivd
Date:     2015-10-05 21:42:12 +0200 (Mon, 05 Oct 2015)
Log Message:
-----------
DXFtoQET
update block conversion DXF LINE and DXF ARC

Modified Paths:
--------------
    branches/dxftoqet2/dxf_create_elmt.cpp
    branches/dxftoqet2/dxf_create_elmt.h
    branches/dxftoqet2/src/dxf_data.h
    branches/dxftoqet2/src/dxf_split.cpp
    branches/dxftoqet2/src/dxf_split.h

Modified: branches/dxftoqet2/dxf_create_elmt.cpp
===================================================================
--- branches/dxftoqet2/dxf_create_elmt.cpp	2015-10-04 20:37:04 UTC (rev 4234)
+++ branches/dxftoqet2/dxf_create_elmt.cpp	2015-10-05 19:42:12 UTC (rev 4235)
@@ -14,6 +14,7 @@
 extern struct DXF_entities_insert DXF_input_entities_insert[1000];
 
 extern struct DXF_block_line DXF_input_block_line[100][50];
+extern struct DXF_block_arc DXF_input_block_arc[100][50];
 
 DXF_create_elmt::DXF_create_elmt(QWidget *parent) :
 	QMainWindow(parent)
@@ -599,6 +600,10 @@
 
 			Result_insert.append(Make_Block_LINES());
 
+			/* Block LINES */
+
+			Result_insert.append(Make_Block_ARC());
+
 			/* end of block */
 
 			Count_lines=Count_lines+1;
@@ -625,8 +630,8 @@
 
 			  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.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.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;;
 
@@ -641,3 +646,36 @@
 
 	   return Result_Block_Lines;
    }
+
+   QString DXF_create_elmt::Make_Block_ARC()
+   {
+	   Result_Block_Arc="";
+	   Count_lines_block2=0;
+
+	   dxf_arc dxb_arc;
+
+	   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.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;
+
+
+
+			Result_Block_Arc.append(dxb_arc.Create_ARC());
+
+
+			Count_lines_block2=Count_lines_block2+1;
+
+	   }
+
+
+	   return Result_Block_Arc;
+   }

Modified: branches/dxftoqet2/dxf_create_elmt.h
===================================================================
--- branches/dxftoqet2/dxf_create_elmt.h	2015-10-04 20:37:04 UTC (rev 4234)
+++ branches/dxftoqet2/dxf_create_elmt.h	2015-10-05 19:42:12 UTC (rev 4235)
@@ -36,6 +36,14 @@
 	QString Make_INSERT();
 
 	QString Make_Block_LINES();
+	QString Make_Block_ARC();
+	QString Make_Block_ATTDEF();
+	QString Make_Block_ATTR();
+	QString Make_Block_CIRCLE();
+	QString Make_Block_POINT();
+	QString Make_block_TEXT();
+	QString Make_block_ELLIPSE();
+	QString Make_Block_INSERT();
 
 	QString Result;
 	QString Result_line;
@@ -52,6 +60,7 @@
 	QString Result_insert;
 
 	QString Result_Block_Lines;
+	QString Result_Block_Arc;
 
 
 	double DXF_LIMMAX_x;

Modified: branches/dxftoqet2/src/dxf_data.h
===================================================================
--- branches/dxftoqet2/src/dxf_data.h	2015-10-04 20:37:04 UTC (rev 4234)
+++ branches/dxftoqet2/src/dxf_data.h	2015-10-05 19:42:12 UTC (rev 4235)
@@ -827,7 +827,12 @@
 		double DXF_block_arc_code_31;
 		double DXF_block_arc_code_32;
 
+		double DXF_block_arc_code_50;
+		double DXF_block_arc_code_51;
 
+		double DXF_block_arc_code_40;
+		double DXF_block_arc_code_48;
+
 		int16_t DXF_block_arc_code_62;
 
 		int16_t DXF_block_arc_code_70;
@@ -837,7 +842,8 @@
 		int32_t DXF_block_arc_code_91;
 		int32_t DXF_block_arc_code_92;
 
-		QString DXF_block_arc_code_100[2];
+		QString DXF_block_arc_code_100[4];
+		QString DXF_block_arc_code_102[2];
 
 
 		int16_t DXF_block_arc_code_280;
@@ -846,9 +852,11 @@
 		int16_t DXF_block_arc_code_283;
 
 		QString DXF_block_arc_code_310;
-		QString DXF_block_arc_code_330;
+		QString DXF_block_arc_code_330[2];
 		QString DXF_block_arc_code_340;
 		QString DXF_block_arc_code_360;
+
+		int16_t DXF_block_arc_code_370;
 	};
 
 	struct DXF_block_attdef

Modified: branches/dxftoqet2/src/dxf_split.cpp
===================================================================
--- branches/dxftoqet2/src/dxf_split.cpp	2015-10-04 20:37:04 UTC (rev 4234)
+++ branches/dxftoqet2/src/dxf_split.cpp	2015-10-05 19:42:12 UTC (rev 4235)
@@ -8560,6 +8560,8 @@
 													count_block_arc_14=0;
 													count_block_arc_24=0;
 													count_block_arc_100=0;
+													count_block_arc_102=0;
+													count_block_arc_330=0;
 
 													while (block_st5==0 and block_count5<49)
 													{
@@ -8602,6 +8604,23 @@
 
 																break;
 
+
+															case 6:
+
+																if(sw_block_line[6]==0)
+																{
+																	DXF_input_block_arc[block_count1][block_arc_count].DXF_block_arc_code_6=line8;
+																	sw_block_line[6]=1;
+																}
+																else
+																{
+																	Log_1.append(found_block_arc());
+
+																}
+
+																break;
+
+
 															case 8:
 
 																if(sw_block_line[8]==0)
@@ -8808,6 +8827,81 @@
 
 																break;
 
+															case 40:
+
+																if(sw_block_line[40]==0)
+																{
+																	DXF_input_block_arc[block_count1][block_arc_count].DXF_block_arc_code_40=line8.toDouble();
+																	sw_block_line[40]=1;
+																}
+																else
+																{
+																	Log_1.append(found_block_arc());
+
+																}
+
+																break;
+
+															case 48:
+
+																if(sw_block_line[48]==0)
+																{
+																	DXF_input_block_arc[block_count1][block_arc_count].DXF_block_arc_code_48=line8.toDouble();
+																	sw_block_line[48]=1;
+																}
+																else
+																{
+																	Log_1.append(found_block_arc());
+
+																}
+
+																break;
+
+															case 50:
+
+																if(sw_block_line[50]==0)
+																{
+																	DXF_input_block_arc[block_count1][block_arc_count].DXF_block_arc_code_50=line8.toDouble();
+																	sw_block_line[50]=1;
+																}
+																else
+																{
+																	Log_1.append(found_block_arc());
+
+																}
+
+																break;
+
+															case 51:
+
+																if(sw_block_line[51]==0)
+																{
+																	DXF_input_block_arc[block_count1][block_arc_count].DXF_block_arc_code_51=line8.toDouble();
+																	sw_block_line[51]=1;
+																}
+																else
+																{
+																	Log_1.append(found_block_arc());
+
+																}
+
+																break;
+
+															case 62:
+
+																if(sw_block_line[62]==0)
+																{
+																	DXF_input_block_arc[block_count1][block_arc_count].DXF_block_arc_code_62=line8.toInt();
+																	sw_block_line[62]=1;
+																}
+																else
+																{
+																	Log_1.append(found_block_arc());
+
+																}
+
+																break;
+
 															case 70:
 
 																if(sw_block_line[70]==0)
@@ -8898,19 +8992,21 @@
 
 																break;
 
-															case 100:
+															case 102:
 
-																if (count_block_arc_100>1)
+																if (count_block_arc_102>3)
 																{
 																	Log_1.append(found_block_line());
 																}
 																else
 																{
-																	DXF_input_block_arc[block_count1][block_arc_count].DXF_block_arc_code_100[count_block_arc_100]=line8;
-																	count_block_arc_100=count_block_arc_100+1;
+																	DXF_input_block_arc[block_count1][block_arc_count].DXF_block_arc_code_102[count_block_arc_102]=line8;
+																	count_block_arc_102=count_block_arc_102+1;
 																}
 																break;
 
+																int count_block_arc_100;
+
 															case 280:
 
 																if(sw_block_line[280]==0)
@@ -8988,17 +9084,15 @@
 
 															case 330:
 
-																if(sw_block_line[330]==0)
+																if (count_block_arc_330>1)
 																{
-																	DXF_input_block_arc[block_count1][block_arc_count].DXF_block_arc_code_330=line8;
-																	sw_block_line[330]=1;
+																	Log_1.append(found_block_line());
 																}
 																else
 																{
-																	Log_1.append(found_block_arc());
-
+																	DXF_input_block_arc[block_count1][block_arc_count].DXF_block_arc_code_330[count_block_arc_330]=line8;
+																	count_block_arc_330=count_block_arc_330+1;
 																}
-
 																break;
 
 															case 340:
@@ -9031,6 +9125,21 @@
 
 																break;
 
+															case 370:
+
+																if(sw_block_line[370]==0)
+																{
+																	DXF_input_block_arc[block_count1][block_arc_count].DXF_block_arc_code_370=line8.toInt();
+																	sw_block_line[370]=1;
+																}
+																else
+																{
+																	Log_1.append(found_block_arc());
+
+																}
+
+																break;
+
 															default:
 																Log_1.append(found_block_arc());
 

Modified: branches/dxftoqet2/src/dxf_split.h
===================================================================
--- branches/dxftoqet2/src/dxf_split.h	2015-10-04 20:37:04 UTC (rev 4234)
+++ branches/dxftoqet2/src/dxf_split.h	2015-10-05 19:42:12 UTC (rev 4235)
@@ -291,6 +291,8 @@
 	int count_block_arc_14;
 	int count_block_arc_24;
 	int count_block_arc_100;
+	int count_block_arc_102;
+	int count_block_arc_330;
 
 	int count_block_attdef_14;
 	int count_block_attdef_24;


Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/