[ Thread Index |
Date Index
| More lists.tuxfamily.org/qet Archives
]
Revision: 3330
Author: rdsivd
Date: 2014-09-24 22:15:01 +0200 (Wed, 24 Sep 2014)
Log Message:
-----------
Modified Paths:
--------------
branches/dxftoelmt/ImportDXF.pro
branches/dxftoelmt/src/ui/dxf_attdef.cpp
branches/dxftoelmt/src/ui/dxf_attdef.h
branches/dxftoelmt/src/ui/dxf_attrib.cpp
branches/dxftoelmt/src/ui/dxf_attrib.h
branches/dxftoelmt/src/ui/dxf_line.cpp
branches/dxftoelmt/src/ui/dxf_line.h
branches/dxftoelmt/src/ui/dxftoelmt.cpp
branches/dxftoelmt/src/ui/dxftoelmt.h
branches/dxftoelmt/src/ui/mainwindow.ui
Added Paths:
-----------
branches/dxftoelmt/src/ui/dxf_check_ltype.cpp
branches/dxftoelmt/src/ui/dxf_check_ltype.h
branches/dxftoelmt/src/ui/dxf_check_string_chars.cpp
branches/dxftoelmt/src/ui/dxf_check_string_chars.h
Modified: branches/dxftoelmt/ImportDXF.pro
===================================================================
--- branches/dxftoelmt/ImportDXF.pro 2014-09-24 09:38:16 UTC (rev 3329)
+++ branches/dxftoelmt/ImportDXF.pro 2014-09-24 20:15:01 UTC (rev 3330)
@@ -38,7 +38,9 @@
src/ui/dxf_text.cpp \
src/ui/dxf_vertex.cpp \
src/ui/dxf_xline.cpp \
- src/ui/dxf_elmt_output.cpp
+ src/ui/dxf_elmt_output.cpp \
+ src/ui/dxf_check_string_chars.cpp \
+ src/ui/dxf_check_ltype.cpp
HEADERS += src/ui_mainwindow.h \
src/ui/mainwindow.h \
@@ -64,7 +66,9 @@
src/ui/dxf_text.h \
src/ui/dxf_vertex.h \
src/ui/dxf_xline.h \
- src/ui/dxf_elmt_output.h
+ src/ui/dxf_elmt_output.h \
+ src/ui/dxf_check_string_chars.h \
+ src/ui/dxf_check_ltype.h
FORMS += src/ui/mainwindow.ui
Modified: branches/dxftoelmt/src/ui/dxf_attdef.cpp
===================================================================
--- branches/dxftoelmt/src/ui/dxf_attdef.cpp 2014-09-24 09:38:16 UTC (rev 3329)
+++ branches/dxftoelmt/src/ui/dxf_attdef.cpp 2014-09-24 20:15:01 UTC (rev 3330)
@@ -2,4 +2,117 @@
DXF_Attdef::DXF_Attdef()
{
+
+
+
+
}
+
+void DXF_Attdef::ConvertAttdef(int Counter, int BlockCount, int Entitieswitch, struct _ReadLineDXF LineTable4[], struct _LType_ACAD LTypeDXF[], struct _Layer_ACAD LayerDXF[], struct _Block_ACAD BlockList[])
+{
+
+
+
+ for (x=0;x<Counter;x++)
+ {
+ if (LineTable4[x].Line1.contains(" 10", Qt::CaseSensitive) )
+ {
+ attx=LineTable4[x].Line2.toDouble();
+ }
+
+ if (LineTable4[x].Line1.contains(" 20", Qt::CaseSensitive))
+ {
+ atty=-(LineTable4[x].Line2.toDouble());
+ }
+
+ if (LineTable4[x].Line1.contains(" 40", Qt::CaseSensitive))
+ {
+ attheight=LineTable4[x].Line2.toDouble();
+ }
+
+
+ if (LineTable4[x].Line1.contains(" 50", Qt::CaseSensitive))
+ {
+ attrotation=LineTable4[x].Line2.toDouble();
+ }
+
+
+ if (LineTable4[x].Line1.contains(" 1", Qt::CaseSensitive))
+ {
+ atttext=LineTable4[x].Line2;
+ }
+
+ if (LineTable4[x].Line1.contains(" 2", Qt::CaseSensitive))
+ {
+ atttag=LineTable4[x].Line2;
+ }
+
+
+
+
+ }
+
+
+ dxf_check_string_chars CheckText1;
+
+ CheckText1.TextToCheck=atttext;
+
+ atttext=CheckText1.CheckText();
+
+ /* <input x="-23" y="15.5" size="9" rotation="90" rotate="true" text="_" tagg="label"/> */
+
+ xattext=QString::number(attx+0.5,'f',0);
+ yattext=QString::number(atty+0.5,'f',0);
+ hattext=QString::number(attheight+0.5,'f',0);
+
+
+ Lineout=" ";
+ Lineout.append(" ");
+ Lineout.append(" ");
+ Lineout.append("<input x=");
+ Lineout.append(QChar(34));
+ Lineout.append(xattext);
+ Lineout.append(QChar(34));
+
+ Lineout.append(" y=");
+ Lineout.append(QChar(34));
+ Lineout.append(yattext);
+ Lineout.append(QChar(34));
+
+ Lineout.append(" size=");
+ Lineout.append(QChar(34));
+ Lineout.append(hattext);
+ Lineout.append(QChar(34));
+
+ Lineout.append(" rotation=");
+ Lineout.append(QChar(34));
+ Lineout.append(rattext);
+ Lineout.append(QChar(34));
+
+ Lineout.append(" rotate=");
+ Lineout.append(QChar(34));
+ Lineout.append("true");
+ Lineout.append(QChar(34));
+
+
+ Lineout.append(" text=");
+ Lineout.append(QChar(34));
+ Lineout.append(atttext);
+ Lineout.append(QChar(34));
+
+ Lineout.append(" tagg=");
+ Lineout.append(QChar(34));
+ Lineout.append(atttag);
+ Lineout.append(QChar(34));
+
+ Lineout.append(" />");
+ Lineout.append('\n');
+
+ if (Entitieswitch==1)
+ {
+ BlockList[0].BlockDef.append(Lineout);
+
+ }
+
+ return ;
+}
Modified: branches/dxftoelmt/src/ui/dxf_attdef.h
===================================================================
--- branches/dxftoelmt/src/ui/dxf_attdef.h 2014-09-24 09:38:16 UTC (rev 3329)
+++ branches/dxftoelmt/src/ui/dxf_attdef.h 2014-09-24 20:15:01 UTC (rev 3330)
@@ -3,11 +3,30 @@
#include <QtCore>
#include <dxf_data.h>
+#include "dxf_check_string_chars.h"
class DXF_Attdef: public DXF_Data
{
public:
+
+ int x;
+
+ double attx;
+ double atty;
+ double attheight;
+ double attrotation;
+
+ QString Lineout;
+ QString xattext;
+ QString yattext;
+ QString hattext;
+ QString rattext;
+ QString atttext;
+ QString atttag;
+
DXF_Attdef();
+
+ void ConvertAttdef(int Counter, int BlockCount, int Entitieswitch, struct _ReadLineDXF LineTable4[2000], struct _LType_ACAD LTypeDXF[200], struct _Layer_ACAD LayerDXF[200],struct _Block_ACAD BlockList[2000]);
};
#endif // DXF_ATTDEF_H
Modified: branches/dxftoelmt/src/ui/dxf_attrib.cpp
===================================================================
--- branches/dxftoelmt/src/ui/dxf_attrib.cpp 2014-09-24 09:38:16 UTC (rev 3329)
+++ branches/dxftoelmt/src/ui/dxf_attrib.cpp 2014-09-24 20:15:01 UTC (rev 3330)
@@ -3,3 +3,113 @@
DXF_Attrib::DXF_Attrib()
{
}
+
+
+void DXF_Attrib::ConvertAttrib(int Counter, int BlockCount, int Entitieswitch, struct _ReadLineDXF LineTable4[], struct _LType_ACAD LTypeDXF[], struct _Layer_ACAD LayerDXF[], struct _Block_ACAD BlockList[])
+{
+
+
+
+ for (x=0;x<Counter;x++)
+ {
+ if (LineTable4[x].Line1.contains(" 10", Qt::CaseSensitive) )
+ {
+ attx=LineTable4[x].Line2.toDouble();
+ }
+
+ if (LineTable4[x].Line1.contains(" 20", Qt::CaseSensitive))
+ {
+ atty=-(LineTable4[x].Line2.toDouble());
+ }
+
+ if (LineTable4[x].Line1.contains(" 40", Qt::CaseSensitive))
+ {
+ attheight=LineTable4[x].Line2.toDouble();
+ }
+
+
+ if (LineTable4[x].Line1.contains(" 50", Qt::CaseSensitive))
+ {
+ attrotation=LineTable4[x].Line2.toDouble();
+ }
+
+
+ if (LineTable4[x].Line1.contains(" 1", Qt::CaseSensitive))
+ {
+ atttext=LineTable4[x].Line2;
+ }
+
+ if (LineTable4[x].Line1.contains(" 2", Qt::CaseSensitive))
+ {
+ atttag=LineTable4[x].Line2;
+ }
+
+
+
+
+ }
+
+
+ dxf_check_string_chars CheckText1;
+
+ CheckText1.TextToCheck=atttext;
+
+ atttext=CheckText1.CheckText();
+
+ /* <input x="-23" y="15.5" size="9" rotation="90" rotate="true" text="_" tagg="label"/> */
+
+ xattext=QString::number(attx+0.5,'f',0);
+ yattext=QString::number(atty+0.5,'f',0);
+ hattext=QString::number(attheight+0.5,'f',0);
+
+
+ Lineout=" ";
+ Lineout.append(" ");
+ Lineout.append(" ");
+ Lineout.append("<input x=");
+ Lineout.append(QChar(34));
+ Lineout.append(xattext);
+ Lineout.append(QChar(34));
+
+ Lineout.append(" y=");
+ Lineout.append(QChar(34));
+ Lineout.append(yattext);
+ Lineout.append(QChar(34));
+
+ Lineout.append(" size=");
+ Lineout.append(QChar(34));
+ Lineout.append(hattext);
+ Lineout.append(QChar(34));
+
+ Lineout.append(" rotation=");
+ Lineout.append(QChar(34));
+ Lineout.append(rattext);
+ Lineout.append(QChar(34));
+
+ Lineout.append(" rotate=");
+ Lineout.append(QChar(34));
+ Lineout.append("true");
+ Lineout.append(QChar(34));
+
+
+ Lineout.append(" text=");
+ Lineout.append(QChar(34));
+ Lineout.append(atttext);
+ Lineout.append(QChar(34));
+
+ Lineout.append(" tagg=");
+ Lineout.append(QChar(34));
+ Lineout.append(atttag);
+ Lineout.append(QChar(34));
+
+ Lineout.append(" />");
+ Lineout.append('\n');
+
+ if (Entitieswitch==1)
+ {
+ BlockList[0].BlockDef.append(Lineout);
+
+ }
+
+ return ;
+}
Modified: branches/dxftoelmt/src/ui/dxf_attrib.h
===================================================================
--- branches/dxftoelmt/src/ui/dxf_attrib.h 2014-09-24 09:38:16 UTC (rev 3329)
+++ branches/dxftoelmt/src/ui/dxf_attrib.h 2014-09-24 20:15:01 UTC (rev 3330)
@@ -3,11 +3,35 @@
#include <QtCore>
#include <dxf_data.h>
+#include "dxf_check_string_chars.h"
class DXF_Attrib: public DXF_Data
{
public:
+
+ int x;
+
+ double attx;
+ double atty;
+ double attheight;
+ double attrotation;
+
+ QString Lineout;
+ QString xattext;
+ QString yattext;
+ QString hattext;
+ QString rattext;
+ QString atttext;
+ QString atttag;
+
+
+
+
+
DXF_Attrib();
+
+ void ConvertAttrib(int Counter, int BlockCount, int Entitieswitch, struct _ReadLineDXF LineTable4[2000], struct _LType_ACAD LTypeDXF[200], struct _Layer_ACAD LayerDXF[200],struct _Block_ACAD BlockList[2000]);
+
};
#endif // DXF_ATTRIB_H
Added: branches/dxftoelmt/src/ui/dxf_check_ltype.cpp
===================================================================
--- branches/dxftoelmt/src/ui/dxf_check_ltype.cpp (rev 0)
+++ branches/dxftoelmt/src/ui/dxf_check_ltype.cpp 2014-09-24 20:15:01 UTC (rev 3330)
@@ -0,0 +1,73 @@
+#include "dxf_check_ltype.h"
+
+dxf_check_ltype::dxf_check_ltype()
+{
+}
+
+QString dxf_check_ltype::Check_LType(_LType_ACAD LTypeDXF[], _Layer_ACAD LayerDXF[])
+{
+
+ if (LType_to_check=="")
+ {
+ for(x=0;x<LayerCount+1;x++)
+ {
+ if (LayerDXF[x].LayerName.contains(Layer_name_to_check))
+ {
+ LineStyle1=LayerDXF[x].LayerLineType;
+
+ }
+ else
+ {
+ LineStyle1="normal";
+ }
+
+ }
+
+
+
+
+
+
+
+ }
+ else
+ {
+
+ }
+
+
+
+
+
+
+
+
+}
+/* find out line type */
+
+/*if (LineTypeOFLine == "")
+{
+
+ for (y=0;y<LayerCount1+1;y++)
+ {
+
+
+ if (LayerDXF[y].LayerName.contains(LayerNameOFLine))
+ {
+ LineStyle1=LType1.GetLineType(LayerDXF[y].LayerLineType);
+ y=LayerCount1+2;
+ }
+ else
+ {
+ LineStyle1="normal";
+ }
+ }
+
+}
+else
+{
+ LineStyle1=LType1.GetLineType(LineTypeOFLine);
+
+}*/
+
+/* create qet elmt code */
Added: branches/dxftoelmt/src/ui/dxf_check_ltype.h
===================================================================
--- branches/dxftoelmt/src/ui/dxf_check_ltype.h (rev 0)
+++ branches/dxftoelmt/src/ui/dxf_check_ltype.h 2014-09-24 20:15:01 UTC (rev 3330)
@@ -0,0 +1,24 @@
+#ifndef DXF_CHECK_LTYPE_H
+#define DXF_CHECK_LTYPE_H
+
+#include <QtCore>
+#include <dxf_data.h>
+
+class dxf_check_ltype: public DXF_Data
+{
+ public:
+
+ int x;
+ int LTypeCount;
+ int LayerCount;
+
+ QString LType_to_check;
+ QString Layer_name_to_check;
+
+ dxf_check_ltype();
+
+ QString Check_LType(struct _LType_ACAD LTypeDXF[200], struct _Layer_ACAD LayerDXF[200]);
+
+};
+
+#endif // DXF_CHECK_LTYPE_H
Added: branches/dxftoelmt/src/ui/dxf_check_string_chars.cpp
===================================================================
--- branches/dxftoelmt/src/ui/dxf_check_string_chars.cpp (rev 0)
+++ branches/dxftoelmt/src/ui/dxf_check_string_chars.cpp 2014-09-24 20:15:01 UTC (rev 3330)
@@ -0,0 +1,58 @@
+#include "dxf_check_string_chars.h"
+
+dxf_check_string_chars::dxf_check_string_chars()
+{
+}
+
+QString dxf_check_string_chars::CheckText()
+{
+
+ if(TextToCheck.contains("<"))
+ {
+ TextToCheck.replace("<","<");
+ }
+ if(TextToCheck.contains(">"))
+ {
+ TextToCheck.replace(">",">");
+ }
+ if(TextToCheck.contains("&"))
+ {
+ TextToCheck.replace("&","&");
+ }
+ if(TextToCheck.contains(QChar(39)))
+ {
+ TextToCheck.replace(QChar(39),"'");
+ }
+ if(TextToCheck.contains(QChar(34)))
+ {
+ TextToCheck.replace(QChar(34),""");
+ }
+
+ if(TextToCheck.contains("/"))
+ {
+ TextToCheck.replace("/","-");
+ }
+
+ if(TextToCheck.contains(QChar(92)))
+ {
+ TextToCheck.replace(QChar(92),"-");
+ }
+
+ if(TextToCheck.contains("*"))
+ {
+ TextToCheck.replace("*","x");
+ }
+
+ if(TextToCheck.contains("?"))
+ {
+ TextToCheck.replace("?","...");
+ }
+
+ if(TextToCheck.contains("|"))
+ {
+ TextToCheck.replace("|","-");
+ }
+
+
+ return TextToCheck;
+}
Added: branches/dxftoelmt/src/ui/dxf_check_string_chars.h
===================================================================
--- branches/dxftoelmt/src/ui/dxf_check_string_chars.h (rev 0)
+++ branches/dxftoelmt/src/ui/dxf_check_string_chars.h 2014-09-24 20:15:01 UTC (rev 3330)
@@ -0,0 +1,19 @@
+#ifndef DXF_CHECK_STRING_CHARS_H
+#define DXF_CHECK_STRING_CHARS_H
+
+#include <QtCore>
+#include <dxf_data.h>
+
+class dxf_check_string_chars : public DXF_Data
+{
+ public:
+
+ QString TextToCheck;
+
+ dxf_check_string_chars();
+
+ QString CheckText();
+
+};
+
+#endif // DXF_CHECK_STRING_CHARS_H
Modified: branches/dxftoelmt/src/ui/dxf_line.cpp
===================================================================
--- branches/dxftoelmt/src/ui/dxf_line.cpp 2014-09-24 09:38:16 UTC (rev 3329)
+++ branches/dxftoelmt/src/ui/dxf_line.cpp 2014-09-24 20:15:01 UTC (rev 3330)
@@ -1,7 +1,7 @@
#include "dxf_line.h"
-#include "dxf_ltype.h"
+
DXF_Line::DXF_Line ()
{
@@ -10,7 +10,7 @@
void DXF_Line::ConvertLine (int Counter, int BlockCount, int Entitieswitch, struct _ReadLineDXF LineTable4[], struct _LType_ACAD LTypeDXF[], struct _Layer_ACAD LayerDXF[], struct _Block_ACAD BlockList[])
{
- DXF_LType LType1;
+ //DXF_LType LType1;
int x;
int y;
@@ -55,6 +55,14 @@
}
+ dxf_check_ltype Check_LineType;
+
+ Check_LineType.LayerCount=LayerCount1;
+ Check_LineType.LTypeCount=LTypeCount1;
+
+ //LineStyle1= Check_LineType.Check_LType(LTypeDXF, LayerDXF);
+
+
/* find out line type */
/*if (LineTypeOFLine == "")
Modified: branches/dxftoelmt/src/ui/dxf_line.h
===================================================================
--- branches/dxftoelmt/src/ui/dxf_line.h 2014-09-24 09:38:16 UTC (rev 3329)
+++ branches/dxftoelmt/src/ui/dxf_line.h 2014-09-24 20:15:01 UTC (rev 3330)
@@ -3,6 +3,8 @@
#include <QtCore>
#include <dxf_data.h>
+#include "dxf_check_ltype.h"
+#include "dxf_ltype.h"
Modified: branches/dxftoelmt/src/ui/dxftoelmt.cpp
===================================================================
--- branches/dxftoelmt/src/ui/dxftoelmt.cpp 2014-09-24 09:38:16 UTC (rev 3329)
+++ branches/dxftoelmt/src/ui/dxftoelmt.cpp 2014-09-24 20:15:01 UTC (rev 3330)
@@ -405,9 +405,9 @@
Line2=ReadLine;
dxfLineCounter=dxfLineCounter+2;
- //LineTable4[LineCount4].Line1=Line1;
- //LineTable4[LineCount4].Line2=Line2;
- //LineCount4=LineCount4+1;
+ LineTable4[LineCount4].Line1=Line1;
+ LineTable4[LineCount4].Line2=Line2;
+ LineCount4=LineCount4+1;
//switch10=(Line1.contains(" 0",Qt::CaseSensitive) and 0);
@@ -426,9 +426,9 @@
Line2=ReadLine;
dxfLineCounter=dxfLineCounter+2;
- //LineTable4[LineCount4].Line1=Line1;
- //LineTable4[LineCount4].Line2=Line2;
- //LineCount4=LineCount4+1;
+ LineTable4[LineCount4].Line1=Line1;
+ LineTable4[LineCount4].Line2=Line2;
+ LineCount4=LineCount4+1;
//switch10=(Line1.contains(" 0",Qt::CaseSensitive)and 0);
Control10=Line1.toDouble();
if (Control10==0)
@@ -437,7 +437,11 @@
}
}
+ DXF_Attrib Load_Attrib;
+ Load_Attrib.ConvertAttrib (LineCount4, BlockCount, Entitieswitch, LineTable4,LTypeDXF, LayerDXF, BlockList);
+
+ LineCount4=1;
}
Aantal_Tekens = Line2.length();
@@ -450,9 +454,9 @@
Line2=ReadLine;
dxfLineCounter=dxfLineCounter+2;
- //LineTable4[LineCount4].Line1=Line1;
- //LineTable4[LineCount4].Line2=Line2;
- //LineCount4=LineCount4+1;
+ LineTable4[LineCount4].Line1=Line1;
+ LineTable4[LineCount4].Line2=Line2;
+ LineCount4=LineCount4+1;
//switch10=(Line1.contains(" 0",Qt::CaseSensitive) and 0);
@@ -471,9 +475,9 @@
Line2=ReadLine;
dxfLineCounter=dxfLineCounter+2;
- //LineTable4[LineCount4].Line1=Line1;
- //LineTable4[LineCount4].Line2=Line2;
- //LineCount4=LineCount4+1;
+ LineTable4[LineCount4].Line1=Line1;
+ LineTable4[LineCount4].Line2=Line2;
+ LineCount4=LineCount4+1;
//switch10=(Line1.contains(" 0",Qt::CaseSensitive)and 0);
Control10=Line1.toDouble();
@@ -484,6 +488,11 @@
}
+ DXF_Attdef Load_Attdef;
+
+ Load_Attdef.ConvertAttdef(LineCount4, BlockCount, Entitieswitch, LineTable4,LTypeDXF, LayerDXF, BlockList);
+
+ LineCount4=1;
}
Aantal_Tekens = Line2.length();
@@ -681,6 +690,10 @@
DXF_Line Load_Line;
+ Load_Line.LayerCount1=LineCount3;
+ Load_Line.LTypeCount1=LineCount2;
+
+
Load_Line.ConvertLine(LineCount4, BlockCount, Entitieswitch, LineTable4,LTypeDXF, LayerDXF, BlockList);
LineCount4=1;
Modified: branches/dxftoelmt/src/ui/dxftoelmt.h
===================================================================
--- branches/dxftoelmt/src/ui/dxftoelmt.h 2014-09-24 09:38:16 UTC (rev 3329)
+++ branches/dxftoelmt/src/ui/dxftoelmt.h 2014-09-24 20:15:01 UTC (rev 3330)
@@ -16,8 +16,11 @@
#include "dxf_line.h"
#include "dxf_circle.h"
#include "dxf_arc.h"
+#include "dxf_attdef.h"
+#include "dxf_attrib.h"
#include "dxf_elmt_output.h"
+
class dxfTOelmt : public DXF_Data
{
public:
Modified: branches/dxftoelmt/src/ui/mainwindow.ui
===================================================================
--- branches/dxftoelmt/src/ui/mainwindow.ui 2014-09-24 09:38:16 UTC (rev 3329)
+++ branches/dxftoelmt/src/ui/mainwindow.ui 2014-09-24 20:15:01 UTC (rev 3330)
@@ -6,8 +6,8 @@
<rect>
<x>0</x>
<y>0</y>
- <width>758</width>
- <height>488</height>
+ <width>901</width>
+ <height>669</height>
</rect>
</property>
<property name="windowTitle">
@@ -16,6 +16,13 @@
<widget class="QWidget" name="centralWidget">
<layout class="QVBoxLayout" name="verticalLayout">
<item>
+ <widget class="QLabel" name="label_3">
+ <property name="text">
+ <string>Binary DXF can not be converted !!!</string>
+ </property>
+ </widget>
+ </item>
+ <item>
<layout class="QGridLayout" name="gridLayout_2">
<item row="3" column="1">
<widget class="QLineEdit" name="SectionCount1">
@@ -120,7 +127,7 @@
<rect>
<x>0</x>
<y>0</y>
- <width>758</width>
+ <width>901</width>
<height>23</height>
</rect>
</property>