[qet] [3332] Added Ltype to circle and line base types |
[ Thread Index |
Date Index
| More lists.tuxfamily.org/qet Archives
]
Revision: 3332
Author: rdsivd
Date: 2014-09-25 21:42:03 +0200 (Thu, 25 Sep 2014)
Log Message:
-----------
Added Ltype to circle and line base types
Modified Paths:
--------------
branches/dxftoelmt/src/ui/dxf_check_ltype.cpp
branches/dxftoelmt/src/ui/dxf_check_ltype.h
branches/dxftoelmt/src/ui/dxf_circle.cpp
branches/dxftoelmt/src/ui/dxf_circle.h
branches/dxftoelmt/src/ui/dxf_data.h
branches/dxftoelmt/src/ui/dxf_layer.cpp
branches/dxftoelmt/src/ui/dxf_layer.h
branches/dxftoelmt/src/ui/dxf_line.cpp
branches/dxftoelmt/src/ui/dxf_ltype.cpp
branches/dxftoelmt/src/ui/dxf_ltype.h
branches/dxftoelmt/src/ui/dxftoelmt.cpp
branches/dxftoelmt/src/ui/mainwindow.ui
branches/dxftoelmt/src/ui_mainwindow.h
Modified: branches/dxftoelmt/src/ui/dxf_check_ltype.cpp
===================================================================
--- branches/dxftoelmt/src/ui/dxf_check_ltype.cpp 2014-09-25 09:44:41 UTC (rev 3331)
+++ branches/dxftoelmt/src/ui/dxf_check_ltype.cpp 2014-09-25 19:42:03 UTC (rev 3332)
@@ -14,6 +14,7 @@
if (LayerDXF[x].LayerName.contains(Layer_name_to_check))
{
LineStyle1=LayerDXF[x].LayerLineType;
+ x=LayerCount+2;
}
else
@@ -23,51 +24,21 @@
}
-
-
-
-
-
-
}
else
{
+ LineStyle1=LType_to_check;
}
+ DXF_LType LineToCheck;
+ CheckLine=LineToCheck.GetLineType(LineStyle1);
+ return CheckLine;
-
-
-
}
-/* 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 */
Modified: branches/dxftoelmt/src/ui/dxf_check_ltype.h
===================================================================
--- branches/dxftoelmt/src/ui/dxf_check_ltype.h 2014-09-25 09:44:41 UTC (rev 3331)
+++ branches/dxftoelmt/src/ui/dxf_check_ltype.h 2014-09-25 19:42:03 UTC (rev 3332)
@@ -3,6 +3,7 @@
#include <QtCore>
#include <dxf_data.h>
+#include "dxf_ltype.h"
class dxf_check_ltype: public DXF_Data
{
@@ -14,6 +15,7 @@
QString LType_to_check;
QString Layer_name_to_check;
+ QString CheckLine;
dxf_check_ltype();
Modified: branches/dxftoelmt/src/ui/dxf_circle.cpp
===================================================================
--- branches/dxftoelmt/src/ui/dxf_circle.cpp 2014-09-25 09:44:41 UTC (rev 3331)
+++ branches/dxftoelmt/src/ui/dxf_circle.cpp 2014-09-25 19:42:03 UTC (rev 3332)
@@ -56,27 +56,16 @@
}
- /* find out line type */
+ dxf_check_ltype Check_LineType;
- /*if (LineTypeOFLine == "")
- {
+ Check_LineType.LayerCount=LayerCount1;
+ Check_LineType.LTypeCount=LTypeCount1;
+ Check_LineType.LType_to_check=LineTypeOFLine;
+ Check_LineType.Layer_name_to_check=LayerNameOFLine;
- for (y=0;y<LayerCount1+1;y++)
- {
+ LineStyle1= Check_LineType.Check_LType(LTypeDXF, LayerDXF);
- if (LayerDXF[y].LayerName.contains(LayerNameOFLine))
- {
- LineStyle=GetLineType(LayerDXF[y].LayerLineType);
- }
- }
- }
- else
- {
- LineStyle=GetLineType(LineTypeOFLine);
-
- }*/
-
Lineout=" ";
Lineout.append(" ");
Lineout.append(" ");
@@ -115,7 +104,7 @@
Lineout.append(" style=");
Lineout.append(QChar(34));
Lineout.append("line-style:");
- Lineout.append(LineStyle);
+ Lineout.append(LineStyle1);
Lineout.append(";");
Lineout.append("line-weight:thin;");
Lineout.append("filling:none;");
Modified: branches/dxftoelmt/src/ui/dxf_circle.h
===================================================================
--- branches/dxftoelmt/src/ui/dxf_circle.h 2014-09-25 09:44:41 UTC (rev 3331)
+++ branches/dxftoelmt/src/ui/dxf_circle.h 2014-09-25 19:42:03 UTC (rev 3332)
@@ -3,10 +3,16 @@
#include <QtCore>
#include <dxf_data.h>
+#include "dxf_check_ltype.h"
+#include "dxf_ltype.h"
class DXF_Circle: public DXF_Data
{
public:
+
+ int LTypeCount1;
+ int LayerCount1;
+
DXF_Circle();
void ConvertCircle(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]);
Modified: branches/dxftoelmt/src/ui/dxf_data.h
===================================================================
--- branches/dxftoelmt/src/ui/dxf_data.h 2014-09-25 09:44:41 UTC (rev 3331)
+++ branches/dxftoelmt/src/ui/dxf_data.h 2014-09-25 19:42:03 UTC (rev 3332)
@@ -82,7 +82,10 @@
+
int BlockCount;
+ int LtypeCount;
+ int LayerCount;
double Control2;
double Control10;
Modified: branches/dxftoelmt/src/ui/dxf_layer.cpp
===================================================================
--- branches/dxftoelmt/src/ui/dxf_layer.cpp 2014-09-25 09:44:41 UTC (rev 3331)
+++ branches/dxftoelmt/src/ui/dxf_layer.cpp 2014-09-25 19:42:03 UTC (rev 3332)
@@ -4,7 +4,7 @@
{
}
-void DXF_Layer::LoadLayerTable (int Counter, _ReadLineDXF LineTable3[],struct _Layer_ACAD LayerDXF[])
+int DXF_Layer::LoadLayerTable (int Counter, _ReadLineDXF LineTable3[],struct _Layer_ACAD LayerDXF[])
{
int x;
int x2;
@@ -47,7 +47,7 @@
}
if ((LineTable3[x].Line1.contains(" 6", Qt::CaseSensitive)) )
{
- LayerDXF[x2].LayerName= LineTable3[x].Line2;
+ LayerDXF[x2].LayerLineType= LineTable3[x].Line2;
switch6=true;
}
@@ -89,5 +89,5 @@
}
}
- return;
+ return x2;
}
Modified: branches/dxftoelmt/src/ui/dxf_layer.h
===================================================================
--- branches/dxftoelmt/src/ui/dxf_layer.h 2014-09-25 09:44:41 UTC (rev 3331)
+++ branches/dxftoelmt/src/ui/dxf_layer.h 2014-09-25 19:42:03 UTC (rev 3332)
@@ -9,7 +9,7 @@
public:
DXF_Layer();
- void LoadLayerTable (int Counter, struct _ReadLineDXF LineTable3[2000], struct _Layer_ACAD LayerDXF[200]);
+ int LoadLayerTable (int Counter, struct _ReadLineDXF LineTable3[2000], struct _Layer_ACAD LayerDXF[200]);
};
#endif // DXF_LAYER_H
Modified: branches/dxftoelmt/src/ui/dxf_line.cpp
===================================================================
--- branches/dxftoelmt/src/ui/dxf_line.cpp 2014-09-25 09:44:41 UTC (rev 3331)
+++ branches/dxftoelmt/src/ui/dxf_line.cpp 2014-09-25 19:42:03 UTC (rev 3332)
@@ -59,37 +59,16 @@
Check_LineType.LayerCount=LayerCount1;
Check_LineType.LTypeCount=LTypeCount1;
+ Check_LineType.LType_to_check=LineTypeOFLine;
+ Check_LineType.Layer_name_to_check=LayerNameOFLine;
- //LineStyle1= Check_LineType.Check_LType(LTypeDXF, LayerDXF);
+ LineStyle1= Check_LineType.Check_LType(LTypeDXF, LayerDXF);
- /* 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 */
Lineout.append(" ");
Modified: branches/dxftoelmt/src/ui/dxf_ltype.cpp
===================================================================
--- branches/dxftoelmt/src/ui/dxf_ltype.cpp 2014-09-25 09:44:41 UTC (rev 3331)
+++ branches/dxftoelmt/src/ui/dxf_ltype.cpp 2014-09-25 19:42:03 UTC (rev 3332)
@@ -6,7 +6,7 @@
}
-void DXF_LType::LoadLTypeTable(int Counter, struct _ReadLineDXF LineTable2[], _LType_ACAD LTypeDXF[])
+int DXF_LType::LoadLTypeTable(int Counter, struct _ReadLineDXF LineTable2[], _LType_ACAD LTypeDXF[])
{
int x;
int x2;
@@ -49,12 +49,11 @@
}
x=x+1;
- //switch7 = ((LineTable2[x].Line1.contains(" 0", Qt::CaseSensitive)) and (LineTable2[x].Line2.contains("LTYPE", Qt::CaseSensitive)));
if (x==Counter-1)
{
switch7=true;
- //x=x+5;
+
break;
}
else
@@ -84,7 +83,7 @@
break;
}
}
- return;
+ return x2;
}
QString DXF_LType::GetLineType (QString FindLT)
@@ -176,6 +175,10 @@
{
LTfound="dashdotted";
}
+ if (FindLT == "normal" )
+ {
+ LTfound="normal";
+ }
return LTfound;
}
Modified: branches/dxftoelmt/src/ui/dxf_ltype.h
===================================================================
--- branches/dxftoelmt/src/ui/dxf_ltype.h 2014-09-25 09:44:41 UTC (rev 3331)
+++ branches/dxftoelmt/src/ui/dxf_ltype.h 2014-09-25 19:42:03 UTC (rev 3332)
@@ -17,7 +17,7 @@
QString GetLineType (QString FindLT);
- void LoadLTypeTable (int Counter, struct _ReadLineDXF LineTable2[2000],struct _LType_ACAD LTypeDXF[200]);
+ int LoadLTypeTable (int Counter, struct _ReadLineDXF LineTable2[2000],struct _LType_ACAD LTypeDXF[200]);
};
Modified: branches/dxftoelmt/src/ui/dxftoelmt.cpp
===================================================================
--- branches/dxftoelmt/src/ui/dxftoelmt.cpp 2014-09-25 09:44:41 UTC (rev 3331)
+++ branches/dxftoelmt/src/ui/dxftoelmt.cpp 2014-09-25 19:42:03 UTC (rev 3332)
@@ -254,7 +254,8 @@
{
DXF_LType Load_LType;
- Load_LType.LoadLTypeTable(LineCount2, LineTable2,LTypeDXF );
+ LtypeCount= Load_LType.LoadLTypeTable(LineCount2, LineTable2,LTypeDXF );
+ switch3=false;
@@ -263,7 +264,8 @@
if (switch4==1)
{
DXF_Layer Load_Layer;
- Load_Layer.LoadLayerTable(LineCount3, LineTable3, LayerDXF);
+ LayerCount= Load_Layer.LoadLayerTable(LineCount3, LineTable3, LayerDXF);
+ switch4=false;
}
@@ -541,6 +543,9 @@
DXF_Circle Load_Circle;
+ Load_Circle.LayerCount1=LayerCount;
+ Load_Circle.LTypeCount1=LtypeCount;
+
Load_Circle.ConvertCircle(LineCount4, BlockCount, Entitieswitch, LineTable4,LTypeDXF, LayerDXF, BlockList);
LineCount4=1;
@@ -690,8 +695,8 @@
DXF_Line Load_Line;
- Load_Line.LayerCount1=LineCount3;
- Load_Line.LTypeCount1=LineCount2;
+ Load_Line.LayerCount1=LayerCount;
+ Load_Line.LTypeCount1=LtypeCount;
Load_Line.ConvertLine(LineCount4, BlockCount, Entitieswitch, LineTable4,LTypeDXF, LayerDXF, BlockList);
Modified: branches/dxftoelmt/src/ui/mainwindow.ui
===================================================================
--- branches/dxftoelmt/src/ui/mainwindow.ui 2014-09-25 09:44:41 UTC (rev 3331)
+++ branches/dxftoelmt/src/ui/mainwindow.ui 2014-09-25 19:42:03 UTC (rev 3332)
@@ -1,5 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
+ <author>Ronny Desmedt</author>
<class>MainWindow</class>
<widget class="QMainWindow" name="MainWindow">
<property name="geometry">
@@ -15,8 +16,17 @@
</property>
<widget class="QWidget" name="centralWidget">
<layout class="QVBoxLayout" name="verticalLayout">
- <item>
+ <item alignment="Qt::AlignHCenter">
<widget class="QLabel" name="label_3">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Minimum" vsizetype="Preferred">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="acceptDrops">
+ <bool>false</bool>
+ </property>
<property name="text">
<string>Binary DXF can not be converted !!!</string>
</property>
@@ -24,7 +34,7 @@
</item>
<item>
<layout class="QGridLayout" name="gridLayout_2">
- <item row="3" column="1">
+ <item row="4" column="1">
<widget class="QLineEdit" name="SectionCount1">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
@@ -34,21 +44,21 @@
</property>
</widget>
</item>
- <item row="2" column="0">
+ <item row="3" column="0">
<widget class="QLabel" name="label">
<property name="text">
<string>Import file path :</string>
</property>
</widget>
</item>
- <item row="2" column="2">
+ <item row="3" column="2">
<widget class="QLabel" name="label_2">
<property name="text">
<string>Export directory path :</string>
</property>
</widget>
</item>
- <item row="2" column="1">
+ <item row="3" column="1">
<widget class="QLineEdit" name="m_import_file_path_le">
<property name="maximumSize">
<size>
@@ -61,34 +71,34 @@
</property>
</widget>
</item>
- <item row="3" column="0">
+ <item row="4" column="0">
<widget class="QLabel" name="labelSectionCount">
<property name="text">
<string>Section count</string>
</property>
</widget>
</item>
- <item row="2" column="3">
+ <item row="3" column="3">
<widget class="QLineEdit" name="ExportFile"/>
</item>
- <item row="3" column="2">
+ <item row="4" column="2">
<widget class="QLabel" name="label_4">
<property name="text">
<string>element name :</string>
</property>
</widget>
</item>
- <item row="3" column="3">
+ <item row="4" column="3">
<widget class="QLineEdit" name="m_elmt_name_le"/>
</item>
- <item row="1" column="2" colspan="2">
+ <item row="2" column="2" colspan="2">
<widget class="QPushButton" name="m_save_elmt_pb">
<property name="text">
<string>save to elmt file</string>
</property>
</widget>
</item>
- <item row="4" column="0" colspan="2">
+ <item row="5" column="0" colspan="2">
<widget class="QTextEdit" name="ImportDXF">
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="Expanding">
@@ -98,7 +108,7 @@
</property>
</widget>
</item>
- <item row="4" column="2" colspan="2">
+ <item row="5" column="2" colspan="2">
<widget class="QTextEdit" name="ExportToELMT">
<property name="sizeAdjustPolicy">
<enum>QAbstractScrollArea::AdjustToContents</enum>
@@ -108,14 +118,14 @@
</property>
</widget>
</item>
- <item row="1" column="0">
+ <item row="2" column="0">
<widget class="QPushButton" name="m_load_dxf_pb">
<property name="text">
<string>Load DXF file</string>
</property>
</widget>
</item>
- <item row="1" column="1">
+ <item row="2" column="1">
<widget class="QLineEdit" name="LineCountDXF"/>
</item>
</layout>
Modified: branches/dxftoelmt/src/ui_mainwindow.h
===================================================================
--- branches/dxftoelmt/src/ui_mainwindow.h 2014-09-25 09:44:41 UTC (rev 3331)
+++ branches/dxftoelmt/src/ui_mainwindow.h 2014-09-25 19:42:03 UTC (rev 3332)
@@ -53,6 +53,7 @@
QMenuBar *menuBar;
QToolBar *mainToolBar;
QStatusBar *statusBar;
+ QLabel *label_3;
void setupUi(QMainWindow *MainWindow)
{