[ Thread Index |
Date Index
| More lists.tuxfamily.org/qet Archives
]
Revision: 3404
Author: rdsivd
Date: 2014-10-26 18:15:40 +0100 (Sun, 26 Oct 2014)
Log Message:
-----------
dxfTOelmt
deactived ellipse function and adapthing converter view
Modified Paths:
--------------
branches/dxftoelmt/ImportDXF.pro
branches/dxftoelmt/src/ui/dxf_ellipse.cpp
branches/dxftoelmt/src/ui/mainwindow.ui
branches/dxftoelmt/src/ui_mainwindow.h
Modified: branches/dxftoelmt/ImportDXF.pro
===================================================================
--- branches/dxftoelmt/ImportDXF.pro 2014-10-26 13:36:11 UTC (rev 3403)
+++ branches/dxftoelmt/ImportDXF.pro 2014-10-26 17:15:40 UTC (rev 3404)
@@ -72,7 +72,8 @@
src/ui/dxf_check_string_chars.h \
src/ui/dxf_check_ltype.h \
src/ui/dxf_solid.h \
- src/ui/dxf_block.h
+ src/ui/dxf_block.h \
+ src/ui_mainwindow.h
FORMS += src/ui/mainwindow.ui
Modified: branches/dxftoelmt/src/ui/dxf_ellipse.cpp
===================================================================
--- branches/dxftoelmt/src/ui/dxf_ellipse.cpp 2014-10-26 13:36:11 UTC (rev 3403)
+++ branches/dxftoelmt/src/ui/dxf_ellipse.cpp 2014-10-26 17:15:40 UTC (rev 3404)
@@ -23,52 +23,65 @@
QString Hoek2;
- double center_x;
- double center_y;
- double major_radius_x;
- double major_radius_y;
- double ratio_of_minor;
- double start;
- double end;
- double end2;
+ float center_x;
+ float center_y;
+ float major_radius_x;
+ float major_radius_y;
+ float ratio_of_minor;
+ float start;
+ float end;
+ float end2;
- double begin1;
- double einde1;
+ float begin1;
+ float einde1;
- double begin;
- double einde;
+ float begin;
+ float einde;
- double hoek;
+ float hoek;
- double width;
- double height;
+ float width;
+ float height;
- /*double N;
- double O;
- double J;
- double K;
- double L;
- double M;
- double R;
- double S;
- double T;
- double U;
- double V;
- double W;*/
- double hoek2;
+ float N;
+ float O;
+ float J;
+ float K;
+ float L;
+ float M;
+ float R;
+ float S;
+ float T;
+ float U;
+ float V;
+ float W;
+ float hoek2;
- double a;
- double b;
- double i;
- double j;
- double Pstart;
- double Pend2;
+ float a;
+ float b;
+ float i2;
+ float j2;
+ float Pstart;
+ float Pend2;
+ float startcos;
+ float startsin;
+ float endcos;
+ float endsin;
+ float powwidth;
+ float powheight;
+ float sqrtwidth;
+ float sqrtheight;
+
+ float s1;
+ float e1;
+
+
a=0;
b=0;
- i=0;
- j=0;
+ i2=0;
+ j2=0;
Pstart=0;
Pend2=0;
hoek2=0;
@@ -87,34 +100,34 @@
{
if (LineTable4[x].Line1.contains(" 10", Qt::CaseSensitive) )
{
- center_x=LineTable4[x].Line2.toDouble();
+ center_x=LineTable4[x].Line2.toFloat();
}
if (LineTable4[x].Line1.contains(" 20", Qt::CaseSensitive))
{
- center_y=-(LineTable4[x].Line2.toDouble());
+ center_y=-(LineTable4[x].Line2.toFloat());
}
if (LineTable4[x].Line1.contains(" 11", Qt::CaseSensitive))
{
- major_radius_x=LineTable4[x].Line2.toDouble();
+ major_radius_x=LineTable4[x].Line2.toFloat();
}
if (LineTable4[x].Line1.contains(" 21", Qt::CaseSensitive))
{
- major_radius_y=-LineTable4[x].Line2.toDouble();
+ major_radius_y=-LineTable4[x].Line2.toFloat();
}
if (LineTable4[x].Line1.contains(" 40", Qt::CaseSensitive))
{
- ratio_of_minor=LineTable4[x].Line2.toDouble();
+ ratio_of_minor=LineTable4[x].Line2.toFloat();
}
if (LineTable4[x].Line1.contains(" 41", Qt::CaseSensitive))
{
- start=LineTable4[x].Line2.toDouble();
+ start=LineTable4[x].Line2.toFloat();
}
if (LineTable4[x].Line1.contains(" 42", Qt::CaseSensitive))
{
- end2=LineTable4[x].Line2.toDouble();
+ end2=LineTable4[x].Line2.toFloat();
//end=2*end2;
}
@@ -141,29 +154,59 @@
LineStyle1= Check_LineType.Check_LType(LTypeDXF, LayerDXF);
- width=2*(sqrt(pow((major_radius_x-center_x),2)-pow((major_radius_y-center_y),2)));
- height=2*(sqrt(pow((major_radius_x-center_x),2)-pow((major_radius_y-center_y),2)) *ratio_of_minor);
+ powwidth=pow((major_radius_x-center_x),2)-pow((major_radius_y-center_y),2);
+ powheight=(pow(((major_radius_x*ratio_of_minor)-center_x),2)-pow(((major_radius_y*ratio_of_minor)-center_y),2)) ;
+
+ if (powwidth<0)
+ {
+ sqrtwidth=sqrt(-powwidth);
+ }
+
+ else
+ {
+ sqrtwidth=sqrt(powwidth);
+ }
+
+ if (powheight<0)
+ {
+ sqrtheight=sqrt(-powheight);
+ }
+
+ else
+ {
+ sqrtheight=sqrt(powheight);
+ }
+
+
+ width=2*sqrtwidth;
+ height=2*sqrtheight;
+
a=width/2;
b=height/2;
- i=1;
- j=0.1;
+ i2=1;
+ j2=0.1;
Pstart=0;
Pend2=0;
- Pstart=center_x+a*acos(start)*i+center_y+b*asin(start)*j;
+ startcos=qAcos(start);
+ startsin=qAsin(start);
+ endcos=qCos(end2);
+ endsin=qSin(end2);
- Pend2=center_x+a*acos(end2)*i+center_y+b*asin(end2)*j;
+ Pstart=((major_radius_x*startcos))+((major_radius_y*startsin));
- begin=Pstart;
- hoek=-Pend2;
+ Pend2=major_radius_x+a*endcos+b*endsin;
+ //begin=Pstart;
+ //hoek=-Pend2;
+
/* hoek ACAD omrekenen naar QET */
- /*begin1=450-start;
- einde1=450-end;
+ /*begin1=450-Pstart;
+ einde1=450-Pend2;
if (begin1>360)
@@ -220,9 +263,13 @@
O=N;
}
- J=end-start+N;
- K=360-end;
- L=360-start;
+ //J=end_angle-start_angle+N;
+ //K=360-end_angle;
+ //L=360-start_angle;
+
+ J=Pend2-Pstart+N;
+ K=360-Pend2;
+ L=360-Pstart;
M=K-L;
R=-O;
S=J-O;
@@ -267,6 +314,7 @@
hoek=hoek2;*/
+
//<arc x="27.00" y="5.40" antialias="false" width="4.20" height="4.20" style="line-style:normal;line-weight:thin;filling:none;color:black" start="30" angle="299" />
//width=2*(sqrt(pow((major_radius_x-center_x),2)-pow((major_radius_y-center_y),2)));
@@ -280,9 +328,14 @@
breedte=QString::number (width,'f',2);
hoogte=QString::number (height ,'f',2);
- BeginHoek=QString::number ((begin ),'f',0);
- Hoek2=QString::number ((hoek),'f',0);
+ s1=(start/((2*3.15)/360));
+ e1=(end2/((2*3.15)/360));
+
+ //BeginHoek=QString::number ((s1 ),'f',0);
+ BeginHoek=QString::number(Pstart,'f',0);
+ Hoek2=QString::number (-(e1-s1),'f',0);
+
if(BeginHoek=="nan")
{
BeginHoek="0";
Modified: branches/dxftoelmt/src/ui/mainwindow.ui
===================================================================
--- branches/dxftoelmt/src/ui/mainwindow.ui 2014-10-26 13:36:11 UTC (rev 3403)
+++ branches/dxftoelmt/src/ui/mainwindow.ui 2014-10-26 17:15:40 UTC (rev 3404)
@@ -21,10 +21,10 @@
<property name="horizontalSpacing">
<number>6</number>
</property>
- <item row="3" column="3">
+ <item row="4" column="3">
<widget class="QLineEdit" name="ExportFile"/>
</item>
- <item row="4" column="1">
+ <item row="5" column="1">
<widget class="QLineEdit" name="SectionCount1">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
@@ -34,31 +34,34 @@
</property>
</widget>
</item>
- <item row="4" column="2">
+ <item row="5" column="3">
+ <widget class="QLineEdit" name="m_elmt_name_le"/>
+ </item>
+ <item row="5" column="2">
<widget class="QLabel" name="label_4">
<property name="text">
<string>element name :</string>
</property>
</widget>
</item>
- <item row="2" column="1">
+ <item row="3" column="1">
<widget class="QLineEdit" name="LineCountDXF"/>
</item>
- <item row="4" column="0">
+ <item row="5" column="0">
<widget class="QLabel" name="labelSectionCount">
<property name="text">
<string>Section count</string>
</property>
</widget>
</item>
- <item row="3" column="0">
+ <item row="4" column="0">
<widget class="QLabel" name="label">
<property name="text">
<string>Import file path :</string>
</property>
</widget>
</item>
- <item row="3" column="1">
+ <item row="4" column="1">
<widget class="QLineEdit" name="m_import_file_path_le">
<property name="maximumSize">
<size>
@@ -71,14 +74,7 @@
</property>
</widget>
</item>
- <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="5" column="0" colspan="2">
+ <item row="7" column="0" colspan="2">
<widget class="QTextEdit" name="ImportDXF">
<property name="sizePolicy">
<sizepolicy hsizetype="Minimum" vsizetype="Expanding">
@@ -88,46 +84,54 @@
</property>
</widget>
</item>
- <item row="3" column="2">
+ <item row="4" column="2">
<widget class="QLabel" name="label_2">
<property name="text">
<string>Export directory path :</string>
</property>
</widget>
</item>
- <item row="2" column="0">
+ <item row="3" column="0">
<widget class="QPushButton" name="m_load_dxf_pb">
<property name="text">
<string>Load DXF file</string>
</property>
</widget>
</item>
- <item row="4" column="3">
- <widget class="QLineEdit" name="m_elmt_name_le"/>
- </item>
- <item row="5" column="2" colspan="2">
+ <item row="7" column="2" colspan="2">
<widget class="QTextEdit" name="ExportToELMT">
<property name="lineWrapMode">
<enum>QTextEdit::NoWrap</enum>
</property>
</widget>
</item>
- <item row="5" column="4">
- <widget class="QTextEdit" name="ProcesLog"/>
+ <item row="7" column="4">
+ <widget class="QTextEdit" name="ProcesLog">
+ <property name="enabled">
+ <bool>true</bool>
+ </property>
+ </widget>
</item>
- <item row="0" column="0" colspan="4">
+ <item row="2" column="0" colspan="2">
<widget class="QLabel" name="label_3">
+ <property name="acceptDrops">
+ <bool>false</bool>
+ </property>
+ <property name="text">
+ <string>Binary DXF can not be converted !!!</string>
+ </property>
+ </widget>
+ </item>
+ <item row="3" column="2">
+ <widget class="QPushButton" name="m_save_elmt_pb">
<property name="sizePolicy">
- <sizepolicy hsizetype="Minimum" vsizetype="Preferred">
+ <sizepolicy hsizetype="Preferred" 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>
+ <string>save to elmt file</string>
</property>
</widget>
</item>
Modified: branches/dxftoelmt/src/ui_mainwindow.h
===================================================================
--- branches/dxftoelmt/src/ui_mainwindow.h 2014-10-26 13:36:11 UTC (rev 3403)
+++ branches/dxftoelmt/src/ui_mainwindow.h 2014-10-26 17:15:40 UTC (rev 3404)
@@ -70,10 +70,16 @@
gridLayout_2 = new QGridLayout();
gridLayout_2->setSpacing(6);
gridLayout_2->setObjectName(QString::fromUtf8("gridLayout_2"));
+
+ label_3 = new QLabel(centralWidget);
+ label_3->setObjectName(QString::fromUtf8("label_3"));
+
+ gridLayout_2->addWidget(label_3, 0, 0, 2, 1);
+
ImportDXF = new QTextEdit(centralWidget);
ImportDXF->setObjectName(QString::fromUtf8("ImportDXF"));
- gridLayout_2->addWidget(ImportDXF, 4, 0, 1, 2);
+ gridLayout_2->addWidget(ImportDXF, 4, 0, 1, 2);
SectionCount1 = new QLineEdit(centralWidget);
SectionCount1->setObjectName(QString::fromUtf8("SectionCount1"));
@@ -116,12 +122,7 @@
gridLayout_2->addWidget(label_4, 3, 2, 1, 1);
- label_3 = new QLabel(centralWidget);
- label_3->setObjectName(QString::fromUtf8("label_3"));
- gridLayout_2->addWidget(label_3, 0, 0, 0, 4);
-
-
m_elmt_name_le = new QLineEdit(centralWidget);
m_elmt_name_le->setObjectName(QString::fromUtf8("m_elmt_name_le"));
@@ -130,7 +131,7 @@
m_save_elmt_pb = new QPushButton(centralWidget);
m_save_elmt_pb->setObjectName(QString::fromUtf8("m_save_elmt_pb"));
- gridLayout_2->addWidget(m_save_elmt_pb, 1, 2, 1, 2);
+ gridLayout_2->addWidget(m_save_elmt_pb, 1, 2, 1, 1);
ExportToELMT = new QTextEdit(centralWidget);
ExportToELMT->setObjectName(QString::fromUtf8("ExportToELMT"));
@@ -143,12 +144,12 @@
ProcesLog->setObjectName(QString::fromUtf8("ExportToELMT"));
ProcesLog->setLineWrapMode(QTextEdit::NoWrap);
- gridLayout_2->addWidget(ProcesLog, 5, 4, 0, 0);
+ gridLayout_2->addWidget(ProcesLog, 4, 4, 1, 1);
m_load_dxf_pb = new QPushButton(centralWidget);
m_load_dxf_pb->setObjectName(QString::fromUtf8("m_load_dxf_pb"));
- gridLayout_2->addWidget(m_load_dxf_pb, 1, 0, 1, 2);
+ gridLayout_2->addWidget(m_load_dxf_pb, 1, 0, 1, 1);
verticalLayout->addLayout(gridLayout_2);