[qet] [3334] dxfTOelmt converter added acad point as terminal

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


Revision: 3334
Author:   rdsivd
Date:     2014-09-26 17:48:38 +0200 (Fri, 26 Sep 2014)
Log Message:
-----------
dxfTOelmt converter added acad point as terminal

Modified Paths:
--------------
    branches/dxftoelmt/src/ui/dxf_data.h
    branches/dxftoelmt/src/ui/dxf_line.cpp
    branches/dxftoelmt/src/ui/dxf_point.cpp
    branches/dxftoelmt/src/ui/dxf_point.h
    branches/dxftoelmt/src/ui/dxf_polyline.cpp
    branches/dxftoelmt/src/ui/dxf_polyline.h
    branches/dxftoelmt/src/ui/dxftoelmt.cpp
    branches/dxftoelmt/src/ui/dxftoelmt.h

Modified: branches/dxftoelmt/src/ui/dxf_data.h
===================================================================
--- branches/dxftoelmt/src/ui/dxf_data.h	2014-09-26 08:48:55 UTC (rev 3333)
+++ branches/dxftoelmt/src/ui/dxf_data.h	2014-09-26 15:48:38 UTC (rev 3334)
@@ -57,6 +57,8 @@
 	struct _ReadLineDXF LineTable2[2000];
 	struct _ReadLineDXF LineTable3[2000];
 	struct _ReadLineDXF LineTable4[2000];
+	struct _ReadLineDXF LineTable5[2000];
+	struct _ReadLineDXF LineTable6[2000];
 
 	struct _PolyTable PTable[2000];
 
@@ -68,6 +70,8 @@
 	int LineCount2;
 	int LineCount3;
 	int LineCount4;
+	int LineCount5;
+	int LineCount6;
 
 	int switch1;
 	int switch2;
@@ -79,6 +83,8 @@
 	int switch8;
 	int switch9;
 	int switch10;
+	int switch11;
+	int switch12;
 
 
 
@@ -89,7 +95,10 @@
 
 	double Control2;
 	double Control10;
+	double Control11;
+	double Control12;
 
+
 	QString LineStyle1;
 
 	QString FileOutputElmt;

Modified: branches/dxftoelmt/src/ui/dxf_line.cpp
===================================================================
--- branches/dxftoelmt/src/ui/dxf_line.cpp	2014-09-26 08:48:55 UTC (rev 3333)
+++ branches/dxftoelmt/src/ui/dxf_line.cpp	2014-09-26 15:48:38 UTC (rev 3334)
@@ -18,8 +18,8 @@
 
 	LineStyle1="normal";
 
-	/* get line parameters */
 
+
 	for (x=0;x<Counter;x++)
 	{
 

Modified: branches/dxftoelmt/src/ui/dxf_point.cpp
===================================================================
--- branches/dxftoelmt/src/ui/dxf_point.cpp	2014-09-26 08:48:55 UTC (rev 3333)
+++ branches/dxftoelmt/src/ui/dxf_point.cpp	2014-09-26 15:48:38 UTC (rev 3334)
@@ -3,3 +3,100 @@
 DXF_Point::DXF_Point()
 {
 }
+
+void DXF_Point::ConvertPoint (int Counter, int BlockCount, int Entitieswitch, struct _ReadLineDXF  LineTable4[], struct _LType_ACAD LTypeDXF[], struct _Layer_ACAD  LayerDXF[], struct _Block_ACAD BlockList[])
+{
+
+	int x;
+
+	for (x=0;x<Counter;x++)
+	{
+
+		if (LineTable4[x].Line1.contains(" 10", Qt::CaseSensitive))
+	   {
+			lijn_x1=LineTable4[x].Line2.toDouble();
+		}
+
+		if (LineTable4[x].Line1.contains(" 20", Qt::CaseSensitive))
+		{
+			lijn_y1=-(LineTable4[x].Line2.toDouble());
+		}
+
+		/*if (LineTable4[x].Line1.contains(" 11", Qt::CaseSensitive))
+	   {
+			lijn_x2=LineTable4[x].Line2.toDouble();
+		}
+
+		if (LineTable4[x].Line1.contains(" 21", Qt::CaseSensitive))
+		{
+			lijn_y2=-LineTable4[x].Line2.toDouble();
+		}
+
+		if (LineTable4[x].Line1.contains("  6", Qt::CaseSensitive))
+		{
+			LineTypeOFLine=LineTable4[x].Line2;
+		}
+
+		if (LineTable4[x].Line1.contains("  8", Qt::CaseSensitive))
+		{
+			LayerNameOFLine=LineTable4[x].Line2;
+		}*/
+
+	}
+
+	if (lijn_x1>0 and lijn_y1<0)
+	{
+		PointOrient="n";
+	}
+
+	if (lijn_x1>0 and lijn_y1>0)
+	{
+		PointOrient="o";
+	}
+
+
+	if (lijn_x1<0 and lijn_y1>0)
+	{
+		PointOrient="s";
+	}
+
+
+	if (lijn_x1<0 and lijn_y1<0)
+	{
+		PointOrient="w";
+	}
+
+
+	Lineout="   ";
+	Lineout.append("   ");
+	Lineout.append("   ");
+	Lineout.append("<terminal x=");
+
+	Lineout.append(QChar(34));
+	Lineout.append("0");
+	Lineout.append(QChar(34));
+
+	Lineout.append(" y=");
+
+	Lineout.append(QChar(34));
+	Lineout.append("0");
+	Lineout.append(QChar(34));
+
+	Lineout.append(" orientation=");
+
+	Lineout.append(QChar(34));
+	Lineout.append(PointOrient);
+	Lineout.append(QChar(34));
+
+	Lineout.append(" />");
+	Lineout.append('\n');
+
+	if (Entitieswitch==1)
+	{
+		BlockList[0].BlockDef.append(Lineout);
+
+	}
+
+	return ;
+
+}

Modified: branches/dxftoelmt/src/ui/dxf_point.h
===================================================================
--- branches/dxftoelmt/src/ui/dxf_point.h	2014-09-26 08:48:55 UTC (rev 3333)
+++ branches/dxftoelmt/src/ui/dxf_point.h	2014-09-26 15:48:38 UTC (rev 3334)
@@ -7,7 +7,32 @@
 class DXF_Point: public DXF_Data
 {
 	public:
+
+	int LineCount;
+	int LTypeCount1;
+	int LayerCount1;
+	int Entities1;
+
+	double lijn_x1;
+	double lijn_x2;
+	double lijn_y1;
+	double lijn_y2;
+
+
+	QString line_x1;
+	QString line_y1;
+	QString line_x2;
+	QString line_y2;
+
+	QString Lineout;
+
+	QString LineTypeOFLine;
+	QString LayerNameOFLine;
+	QString PointOrient;
+
 	DXF_Point();
+
+	void ConvertPoint (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_POINT_H

Modified: branches/dxftoelmt/src/ui/dxf_polyline.cpp
===================================================================
--- branches/dxftoelmt/src/ui/dxf_polyline.cpp	2014-09-26 08:48:55 UTC (rev 3333)
+++ branches/dxftoelmt/src/ui/dxf_polyline.cpp	2014-09-26 15:48:38 UTC (rev 3334)
@@ -3,3 +3,18 @@
 DXF_Polyline::DXF_Polyline()
 {
 }
+
+void DXF_Polyline::PolyLineBegin()
+{
+
+}
+
+void DXF_Polyline::PolyLineVector()
+{
+
+}
+
+void DXF_Polyline::PolyLineEnd()
+{
+
+}

Modified: branches/dxftoelmt/src/ui/dxf_polyline.h
===================================================================
--- branches/dxftoelmt/src/ui/dxf_polyline.h	2014-09-26 08:48:55 UTC (rev 3333)
+++ branches/dxftoelmt/src/ui/dxf_polyline.h	2014-09-26 15:48:38 UTC (rev 3334)
@@ -7,7 +7,14 @@
 class DXF_Polyline: public DXF_Data
 {
 	public:
+
+
 	DXF_Polyline();
+
+	void PolyLineBegin();
+	void PolyLineVector();
+	void PolyLineEnd();
+
 };
 
 #endif // DXF_POLYLINE_H

Modified: branches/dxftoelmt/src/ui/dxftoelmt.cpp
===================================================================
--- branches/dxftoelmt/src/ui/dxftoelmt.cpp	2014-09-26 08:48:55 UTC (rev 3333)
+++ branches/dxftoelmt/src/ui/dxftoelmt.cpp	2014-09-26 15:48:38 UTC (rev 3334)
@@ -386,7 +386,12 @@
 							{
 								switch10=true;
 							}
+							if (LineCount4>=2000)
+							{
+								switch10=1;
 
+							}
+
 						}
 
 						DXF_Arc Load_Arc;
@@ -437,8 +442,14 @@
 							{
 								switch10=true;
 							}
+							if (LineCount4>=2000)
+							{
+								switch10=1;
 
+							}
+
 						}
+
 						DXF_Attrib Load_Attrib;
 
 						Load_Attrib.ConvertAttrib (LineCount4, BlockCount, Entitieswitch, LineTable4,LTypeDXF, LayerDXF, BlockList);
@@ -487,7 +498,12 @@
 							{
 								switch10=true;
 							}
+							if (LineCount4>=2000)
+							{
+								switch10=1;
 
+							}
+
 						}
 
 						DXF_Attdef Load_Attdef;
@@ -538,7 +554,12 @@
 							{
 								switch10=true;
 							}
+							if (LineCount4>=2000)
+							{
+								switch10=1;
 
+							}
+
 						}
 
 						DXF_Circle Load_Circle;
@@ -850,12 +871,12 @@
 						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)
 						{
@@ -871,10 +892,10 @@
 							Line2=ReadLine;
 							dxfLineCounter=dxfLineCounter+2;
 
-							//LineTable4[LineCount4].Line1=Line1;
-							//LineTable4[LineCount4].Line2=Line2;
-							//LineCount4=LineCount4+1;
-							//switch10=(Line1.contains(" 0",Qt::CaseSensitive)and 0);
+							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)
@@ -884,10 +905,25 @@
 
 						}
 
+
+
+						DXF_Point Load_Point;
+
+						Load_Point.LayerCount1=LayerCount;
+						Load_Point.LTypeCount1=LtypeCount;
+
+
+						Load_Point.ConvertPoint(LineCount4, BlockCount, Entitieswitch, LineTable4,LTypeDXF, LayerDXF, BlockList);
+
+						LineCount4=1;
+
+
 					}
 
 					Aantal_Tekens = Line2.length();
 					switch10=0;
+					switch11=0;
+					switch12=0;
 					if (Line1.contains(" 0",Qt::CaseSensitive)and Line2.contains("POLYLINE", Qt::CaseSensitive)and Aantal_Tekens==8)
 					{
 						ReadLine=in.readLine();
@@ -896,12 +932,10 @@
 						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)
 						{
@@ -917,19 +951,130 @@
 							Line2=ReadLine;
 							dxfLineCounter=dxfLineCounter+2;
 
-							//LineTable4[LineCount4].Line1=Line1;
-							//LineTable4[LineCount4].Line2=Line2;
-							//LineCount4=LineCount4+1;
-							//switch10=(Line1.contains(" 0",Qt::CaseSensitive)and 0);
+							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)
 							{
 								switch10=true;
 							}
+							if (LineCount4>=2000)
+							{
+								switch10=1;
 
+							}
+
 						}
 
+						// poly begin oproepen
+
+						if (Line1.contains(" 0",Qt::CaseSensitive)and Line2.contains("VERTEX", Qt::CaseSensitive)and Aantal_Tekens==8)
+						{
+							ReadLine=in.readLine();
+							Line1=ReadLine;
+							ReadLine=in.readLine();
+							Line2=ReadLine;
+							dxfLineCounter=dxfLineCounter+2;
+
+							LineTable5[LineCount5].Line1=Line1;
+							LineTable5[LineCount5].Line2=Line2;
+							LineCount5=LineCount5+1;
+
+							Control11=Line1.toDouble();
+							if (Control11==0)
+							{
+								switch11=true;
+							}
+
+
+							while (switch11==false)
+							{
+								ReadLine=in.readLine();
+								Line1=ReadLine;
+								ReadLine=in.readLine();
+								Line2=ReadLine;
+								dxfLineCounter=dxfLineCounter+2;
+
+								LineTable5[LineCount5].Line1=Line1;
+								LineTable5[LineCount5].Line2=Line2;
+								LineCount5=LineCount5+1;
+								switch11=(Line1.contains(" 0",Qt::CaseSensitive)and 0);
+
+								Control11=Line1.toDouble();
+								if (Control11==0)
+								{
+									switch11=true;
+								}
+								if (LineCount5=2000)
+								{
+									switch11=1;
+
+								}
+
+							}
+						}
+
+
+						// poly vector oproepen
+
+						if (Line1.contains(" 0",Qt::CaseSensitive)and Line2.contains("SEQEND", Qt::CaseSensitive)and Aantal_Tekens==6)
+						{
+							ReadLine=in.readLine();
+							Line1=ReadLine;
+							ReadLine=in.readLine();
+							Line2=ReadLine;
+							dxfLineCounter=dxfLineCounter+2;
+
+							LineTable6[LineCount6].Line1=Line1;
+							LineTable6[LineCount6].Line2=Line2;
+							LineCount6=LineCount6+1;
+
+							Control12=Line1.toDouble();
+							if (Control12==0)
+							{
+								switch12=true;
+							}
+
+
+							while (switch12==false)
+							{
+								ReadLine=in.readLine();
+								Line1=ReadLine;
+								ReadLine=in.readLine();
+								Line2=ReadLine;
+								dxfLineCounter=dxfLineCounter+2;
+
+								LineTable6[LineCount6].Line1=Line1;
+								LineTable6[LineCount6].Line2=Line2;
+								LineCount6=LineCount6+1;
+								switch12=(Line1.contains(" 0",Qt::CaseSensitive)and 0);
+
+								Control12=Line1.toDouble();
+								if (Control12==0)
+								{
+									switch12=true;
+								}
+								if (LineCount6>=2000)
+								{
+									switch10=1;
+
+								}
+
+							}
+						}
+
+
+						//end polyline oproepen
+
+
+
+
+
+
+
 					}
 
 					Aantal_Tekens = Line2.length();

Modified: branches/dxftoelmt/src/ui/dxftoelmt.h
===================================================================
--- branches/dxftoelmt/src/ui/dxftoelmt.h	2014-09-26 08:48:55 UTC (rev 3333)
+++ branches/dxftoelmt/src/ui/dxftoelmt.h	2014-09-26 15:48:38 UTC (rev 3334)
@@ -19,6 +19,8 @@
 #include "dxf_attdef.h"
 #include "dxf_attrib.h"
 #include "dxf_elmt_output.h"
+#include "dxf_polyline.h"
+#include "dxf_point.h"
 
 
 class dxfTOelmt : public DXF_Data


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