[qet] [4163] update DXFtoQET converter:

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


Revision: 4163
Author:   rdsivd
Date:     2015-08-26 23:17:55 +0200 (Wed, 26 Aug 2015)
Log Message:
-----------
update DXFtoQET converter:
function moved from version 1 to this version

ARC
CIRCLE
ATTDEF
LINE

CSV file conversion max 20 colums and 10000 lines

Modified Paths:
--------------
    branches/dxftoqet2/dxf_create_elmt.cpp
    branches/dxftoqet2/dxf_create_elmt.h
    branches/dxftoqet2/dxftoqet_mainwindow.ui
    branches/dxftoqet2/src/dxf/dxf_circle.cpp
    branches/dxftoqet2/src/dxf/dxf_circle.h
    branches/dxftoqet2/src/dxf_base_types/dxf_base_circle.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-08-26 18:32:55 UTC (rev 4162)
+++ branches/dxftoqet2/dxf_create_elmt.cpp	2015-08-26 21:17:55 UTC (rev 4163)
@@ -5,6 +5,8 @@
 
 extern struct DXF_entities_arc DXF_input_entities_arc[1000];
 extern struct DXF_entities_line DXF_input_entities_line[100000];
+extern struct DXF_entities_attdef DXF_input_entities_attdef[1000];
+extern struct DXF_entities_circle DXF_input_entities_circle[1000];
 
 DXF_create_elmt::DXF_create_elmt(QWidget *parent) :
 	QMainWindow(parent)
@@ -218,7 +220,21 @@
 
 	Result.append(Make_ARC());
 
+	/* ATTDEF */
 
+	Count_entitie_attdef=DXF_main_base[0].DXF_entities_attdef_count;
+
+	Result.append(Make_ATTDEF());
+
+	/* CIRCLE */
+
+	Count_entitie_circle=DXF_main_base[0].DXF_entities_circle_count;
+
+	Result.append(Make_CIRCLE());
+
+
+	/* Close elmt description */
+
 	Result.append(Create_ELMT.DescriptionEnd());
 	Result.append(Create_ELMT.DefinitionEnd());
 
@@ -327,3 +343,68 @@
 	 return Result_arc;
 
  }
+
+ QString DXF_create_elmt::Make_ATTDEF()
+ {
+
+	 dxf_attdef dxb_attdef2;
+	 DXF_Text_control db_txt_check;
+
+	 Result_attdef ="";
+
+	 Count_lines=0;
+
+	 while (Count_lines<=Count_entitie_attdef)
+	 {
+
+		dxb_attdef2.x=DXF_input_entities_attdef[Count_lines].DXF_entities_attdef_code_10;
+		dxb_attdef2.y=DXF_input_entities_attdef[Count_lines].DXF_entities_attdef_code_20;
+		dxb_attdef2.rotate=DXF_input_entities_attdef[Count_lines].DXF_entities_attdef_code_50;
+		dxb_attdef2.size=DXF_input_entities_attdef[Count_lines].DXF_entities_attdef_code_40;
+		dxb_attdef2.tag=DXF_input_entities_attdef[Count_lines].DXF_entities_attdef_code_2;
+
+		db_txt_check.TextToCheck=DXF_input_entities_attdef[Count_lines].DXF_entities_attdef_code_1;
+
+		dxb_attdef2.text=db_txt_check.Text_control();
+
+		Result_attdef.append(dxb_attdef2.Create_ATTDEF());
+
+		Count_lines=Count_lines+1;
+
+
+	 }
+
+	 return Result_attdef;
+ }
+
+QString DXF_create_elmt::Make_CIRCLE()
+{
+	dxf_circle db_circle;
+
+	Result_circle="";
+
+	Count_lines=0;
+
+	while (Count_lines<=Count_entitie_circle)
+	{
+
+	   db_circle.x=DXF_input_entities_circle[Count_lines].DXF_entities_circle_code_10;
+	   db_circle.y=-DXF_input_entities_circle[Count_lines].DXF_entities_circle_code_20;
+	   db_circle.diameter=DXF_input_entities_circle[Count_lines].DXF_entities_circle_code_40*2;
+
+
+	   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;
+
+	   Result_circle.append(db_circle.Create_CIRCLE());
+
+	   Count_lines=Count_lines+1;
+
+
+	}
+
+
+	return Result_circle;
+
+}

Modified: branches/dxftoqet2/dxf_create_elmt.h
===================================================================
--- branches/dxftoqet2/dxf_create_elmt.h	2015-08-26 18:32:55 UTC (rev 4162)
+++ branches/dxftoqet2/dxf_create_elmt.h	2015-08-26 21:17:55 UTC (rev 4163)
@@ -11,6 +11,7 @@
 #include "dxf/dxf_point.h"
 #include "dxf/dxf_attdef.h"
 #include "dxf/dxf_arc.h"
+#include "dxf/dxf_circle.h"
 
 class DXF_create_elmt : public QMainWindow
 {
@@ -23,12 +24,16 @@
 	QString Make_ARC();
 	QString Make_input();
 	QString Make_terminal();
+	QString Make_ATTDEF();
+	QString Make_CIRCLE();
 
 	QString Result;
 	QString Result_line;
 	QString Result_arc;
 	QString Result_input;
 	QString Result_terminal;
+	QString Result_attdef;
+	QString Result_circle;
 
 
 	double DXF_LIMMAX_x;
@@ -43,6 +48,8 @@
 
 	int Count_entitie_line;
 	int Count_entitie_arc;
+	int Count_entitie_attdef;
+	int Count_entitie_circle;
 
 	int Count_lines;
 	int Count_for;

Modified: branches/dxftoqet2/dxftoqet_mainwindow.ui
===================================================================
--- branches/dxftoqet2/dxftoqet_mainwindow.ui	2015-08-26 18:32:55 UTC (rev 4162)
+++ branches/dxftoqet2/dxftoqet_mainwindow.ui	2015-08-26 21:17:55 UTC (rev 4163)
@@ -12,7 +12,7 @@
    </rect>
   </property>
   <property name="sizePolicy">
-   <sizepolicy hsizetype="Preferred" vsizetype="Preferred">
+   <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
     <horstretch>0</horstretch>
     <verstretch>0</verstretch>
    </sizepolicy>
@@ -743,7 +743,7 @@
               <rect>
                <x>10</x>
                <y>10</y>
-               <width>711</width>
+               <width>871</width>
                <height>601</height>
               </rect>
              </property>
@@ -757,7 +757,7 @@
               <string notr="true">BACKGROUND:rgb(225, 225, 225)</string>
              </property>
              <property name="currentIndex">
-              <number>3</number>
+              <number>0</number>
              </property>
              <widget class="QWidget" name="tab_dxf_sections">
               <attribute name="title">
@@ -1303,7 +1303,7 @@
                 <rect>
                  <x>10</x>
                  <y>10</y>
-                 <width>681</width>
+                 <width>697</width>
                  <height>532</height>
                 </rect>
                </property>
@@ -1843,6 +1843,9 @@
                 </item>
                 <item row="7" column="0">
                  <widget class="QLabel" name="label_29">
+                  <property name="styleSheet">
+                   <string notr="true">BACKGROUND:rgb(165, 198, 130)</string>
+                  </property>
                   <property name="text">
                    <string>CIRCLE</string>
                   </property>
@@ -1990,6 +1993,9 @@
                 </item>
                 <item row="4" column="0">
                  <widget class="QLabel" name="label_22">
+                  <property name="styleSheet">
+                   <string notr="true">BACKGROUND:rgb(165, 198, 130)</string>
+                  </property>
                   <property name="text">
                    <string>ATTDEF</string>
                   </property>
@@ -2089,6 +2095,9 @@
                 </item>
                 <item row="2" column="2">
                  <widget class="QLabel" name="label_38">
+                  <property name="styleSheet">
+                   <string notr="true">BACKGROUND:rgb(165, 198, 130)</string>
+                  </property>
                   <property name="text">
                    <string>LINE</string>
                   </property>
@@ -2116,6 +2125,9 @@
                 </item>
                 <item row="3" column="0">
                  <widget class="QLabel" name="label_26">
+                  <property name="styleSheet">
+                   <string notr="true">BACKGROUND:rgb(165, 198, 130)</string>
+                  </property>
                   <property name="text">
                    <string>ARC</string>
                   </property>
@@ -2208,20 +2220,43 @@
                   </property>
                  </widget>
                 </item>
-                <item row="3" column="6">
-                 <widget class="QLabel" name="label_77">
+                <item row="13" column="7">
+                 <spacer name="horizontalSpacer_10">
+                  <property name="orientation">
+                   <enum>Qt::Horizontal</enum>
+                  </property>
+                  <property name="sizeHint" stdset="0">
+                   <size>
+                    <width>40</width>
+                    <height>20</height>
+                   </size>
+                  </property>
+                 </spacer>
+                </item>
+                <item row="8" column="6" rowspan="5" colspan="2">
+                 <widget class="QPlainTextEdit" name="plainTextEdit">
+                  <property name="plainText">
+                   <string>When there are items 'Out Range' send me a email with a screen snapshot of this page</string>
+                  </property>
+                  <property name="placeholderText">
+                   <string/>
+                  </property>
+                 </widget>
+                </item>
+                <item row="5" column="6" colspan="2">
+                 <widget class="QLabel" name="label_81">
                   <property name="styleSheet">
-                   <string notr="true">BACKGROUND:rgb(7, 200, 4)</string>
+                   <string notr="true">BACKGROUND:rgb(165, 198, 130)</string>
                   </property>
                   <property name="text">
-                   <string>In range</string>
+                   <string>Converted</string>
                   </property>
                   <property name="alignment">
                    <set>Qt::AlignCenter</set>
                   </property>
                  </widget>
                 </item>
-                <item row="4" column="6">
+                <item row="4" column="6" colspan="2">
                  <widget class="QLabel" name="label_78">
                   <property name="styleSheet">
                    <string notr="true">BACKGROUND:rgb(225, 0, 0)</string>
@@ -2234,27 +2269,17 @@
                   </property>
                  </widget>
                 </item>
-                <item row="13" column="7">
-                 <spacer name="horizontalSpacer_10">
-                  <property name="orientation">
-                   <enum>Qt::Horizontal</enum>
+                <item row="3" column="6" colspan="2">
+                 <widget class="QLabel" name="label_77">
+                  <property name="styleSheet">
+                   <string notr="true">BACKGROUND:rgb(7, 200, 4)</string>
                   </property>
-                  <property name="sizeHint" stdset="0">
-                   <size>
-                    <width>40</width>
-                    <height>20</height>
-                   </size>
+                  <property name="text">
+                   <string>In range</string>
                   </property>
-                 </spacer>
-                </item>
-                <item row="5" column="6" rowspan="6" colspan="2">
-                 <widget class="QPlainTextEdit" name="plainTextEdit">
-                  <property name="plainText">
-                   <string>When there are items 'Out Range' send me a email with a screen snapshot of this page</string>
+                  <property name="alignment">
+                   <set>Qt::AlignCenter</set>
                   </property>
-                  <property name="placeholderText">
-                   <string/>
-                  </property>
                  </widget>
                 </item>
                </layout>
@@ -2464,13 +2489,29 @@
               <rect>
                <x>20</x>
                <y>410</y>
-               <width>781</width>
+               <width>691</width>
                <height>192</height>
               </rect>
              </property>
             </widget>
+            <widget class="QPlainTextEdit" name="plainTextEdit_2">
+             <property name="geometry">
+              <rect>
+               <x>720</x>
+               <y>410</y>
+               <width>141</width>
+               <height>191</height>
+              </rect>
+             </property>
+             <property name="plainText">
+              <string>Use colum :
+1 = use colum thise colum for conversion
+2= do not use this colum for conversion</string>
+             </property>
+            </widget>
             <zorder>CSV_Tablesettings</zorder>
             <zorder>layoutWidget</zorder>
+            <zorder>plainTextEdit_2</zorder>
            </widget>
            <widget class="QWidget" name="tab_log">
             <attribute name="title">

Modified: branches/dxftoqet2/src/dxf/dxf_circle.cpp
===================================================================
--- branches/dxftoqet2/src/dxf/dxf_circle.cpp	2015-08-26 18:32:55 UTC (rev 4162)
+++ branches/dxftoqet2/src/dxf/dxf_circle.cpp	2015-08-26 21:17:55 UTC (rev 4163)
@@ -7,6 +7,27 @@
 
 QString dxf_circle::Create_CIRCLE()
 {
+	dxf_base_circle db_circle;
+	DXF_Ltype_control db_line_ltype_control;
 
+	Result_circle="";
 
+	db_line_ltype_control.FindLT=ltype;
+	db_line_ltype_control.Layer=layer;
+
+	db_circle.QET_line_style=db_line_ltype_control.Ltype_control();
+
+	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_diameter=diameter;
+
+
+	Result_circle.append(db_circle.Create_circle());
+
+	return Result_circle;
 }

Modified: branches/dxftoqet2/src/dxf/dxf_circle.h
===================================================================
--- branches/dxftoqet2/src/dxf/dxf_circle.h	2015-08-26 18:32:55 UTC (rev 4162)
+++ branches/dxftoqet2/src/dxf/dxf_circle.h	2015-08-26 21:17:55 UTC (rev 4163)
@@ -2,6 +2,8 @@
 #define DXF_CIRCLE_H
 
 #include <QMainWindow>
+#include "dxf_base_types/dxf_base_circle.h"
+#include "dxf_control/dxf_ltype_control.h"
 
 class dxf_circle : public QMainWindow
 {
@@ -9,8 +11,23 @@
 	public:
 	explicit dxf_circle(QWidget *parent = 0);
 
+	QString layer;				//8
+	QString ltype;				//6
 
+	double x;					//10
+	double y;					//20
+	double diameter;
 
+	QString antialias;
+	QString style;
+	QString line_style;
+	QString line_weight;
+	QString filling;
+	QString color;
+
+	QString Result_circle;
+
+
 	QString Create_CIRCLE();
 
 	signals:

Modified: branches/dxftoqet2/src/dxf_base_types/dxf_base_circle.cpp
===================================================================
--- branches/dxftoqet2/src/dxf_base_types/dxf_base_circle.cpp	2015-08-26 18:32:55 UTC (rev 4162)
+++ branches/dxftoqet2/src/dxf_base_types/dxf_base_circle.cpp	2015-08-26 21:17:55 UTC (rev 4163)
@@ -62,5 +62,5 @@
 	Result_circle.append(" />");
 	Result_circle.append('\n');
 
-
+	return Result_circle;
 }

Modified: branches/dxftoqet2/src/dxf_data.h
===================================================================
--- branches/dxftoqet2/src/dxf_data.h	2015-08-26 18:32:55 UTC (rev 4162)
+++ branches/dxftoqet2/src/dxf_data.h	2015-08-26 21:17:55 UTC (rev 4163)
@@ -1068,7 +1068,9 @@
 		double DXF_entities_attdef_code_20;
 		double DXF_entities_attdef_code_30;
 		double DXF_entities_attdef_code_40;
+		double DXF_entities_attdef_code_50;
 
+
 		int16_t DXF_entities_attdef_code_70;
 
 		QString DXF_entities_attdef_code_100[3];
@@ -1135,6 +1137,8 @@
 		double DXF_entities_circle_code_30;
 		double DXF_entities_circle_code_31;
 
+		double DXF_entities_circle_code_40;
+
 		int16_t DXF_entities_circle_code_62;
 
 		QString DXF_entities_circle_code_100[3];

Modified: branches/dxftoqet2/src/dxf_split.cpp
===================================================================
--- branches/dxftoqet2/src/dxf_split.cpp	2015-08-26 18:32:55 UTC (rev 4162)
+++ branches/dxftoqet2/src/dxf_split.cpp	2015-08-26 21:17:55 UTC (rev 4163)
@@ -12661,6 +12661,7 @@
 
 									line5=DXF_main_base[0].dxf_input[for_count1].toInt();
 									line6=DXF_main_base[0].dxf_input[for_count1+1];
+									DXF_input_entities_attdef[entities_ATTDEF_count2].DXF_entities_attdef_code_50=0;
 
 
 
@@ -12925,6 +12926,29 @@
 
 											break;
 
+										case 50:
+
+											if(sw_entities_attdef[50]==0)
+											{
+												DXF_input_entities_attdef[entities_ATTDEF_count2].DXF_entities_attdef_code_50=line6.toDouble();
+												sw_entities_attdef[50]=1;
+											}
+											else
+											{
+												Log_1.append("Find in ENTITIES code ATTDEF \n");
+												Log_1.append("Line :" );
+												Log_1.append(QString::number( for_count1));
+												Log_1.append(" ");
+												Log_1.append("Code :" );
+												Log_1.append(QString::number( line5));
+												Log_1.append(" : ");
+												Log_1.append(line6);
+												Log_1.append(" ");
+												Log_1.append("\n");
+											}
+
+											break;
+
 										case 70:
 
 											if(sw_entities_attdef[70]==0)
@@ -13641,8 +13665,32 @@
 
 											break;
 
+										case 40:
 
+											if(sw_entities_circle[40]==0)
+											{
+												DXF_input_entities_circle[entities_CIRCLE_count2].DXF_entities_circle_code_40=line6.toDouble();
+												sw_entities_circle[40]=1;
+											}
+											else
+											{
+												Log_1.append("Find in ENTITIES code ");
+												Log_1.append(QString::number(entities_CIRCLE_count2));
+												Log_1.append(" CIRCLE \n");
+												Log_1.append("Line :" );
+												Log_1.append(QString::number( for_count1));
+												Log_1.append(" ");
+												Log_1.append("Code :" );
+												Log_1.append(QString::number( line5));
+												Log_1.append(" : ");
+												Log_1.append(line6);
+												Log_1.append(" ");
+												Log_1.append("\n");
+											}
 
+											break;
+
+
 										case 100:
 
 											if (entities_CIRCLE_count2_100>2)


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