[qet] [4253] QXFtoQET

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


Revision: 4253
Author:   rdsivd
Date:     2015-11-08 11:12:04 +0100 (Sun, 08 Nov 2015)
Log Message:
-----------
QXFtoQET
fix bug in elliose function

Modified Paths:
--------------
    branches/dxftoqet2/dxftoqet_mainwindow.ui
    branches/dxftoqet2/src/dxf/dxf_ellipse.cpp
    branches/dxftoqet2/src/dxf/dxf_ellipse.h

Modified: branches/dxftoqet2/dxftoqet_mainwindow.ui
===================================================================
--- branches/dxftoqet2/dxftoqet_mainwindow.ui	2015-11-08 03:27:14 UTC (rev 4252)
+++ branches/dxftoqet2/dxftoqet_mainwindow.ui	2015-11-08 10:12:04 UTC (rev 4253)
@@ -757,7 +757,7 @@
               <string notr="true">BACKGROUND:rgb(225, 225, 225)</string>
              </property>
              <property name="currentIndex">
-              <number>3</number>
+              <number>2</number>
              </property>
              <widget class="QWidget" name="tab_dxf_sections">
               <attribute name="title">
@@ -1861,7 +1861,7 @@
                   </property>
                  </widget>
                 </item>
-                <item row="12" column="2" alignment="Qt::AlignHCenter">
+                <item row="12" column="2">
                  <widget class="QLabel" name="label_44">
                   <property name="sizePolicy">
                    <sizepolicy hsizetype="Preferred" vsizetype="Preferred">
@@ -2271,8 +2271,11 @@
                 </item>
                 <item row="13" column="0">
                  <widget class="QLabel" name="label_35">
+                  <property name="styleSheet">
+                   <string notr="true">BACKGROUND:rgb(165, 198, 130)</string>
+                  </property>
                   <property name="text">
-                   <string>INSERT</string>
+                   <string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p align=&quot;center&quot;&gt;INSERT&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
                   </property>
                  </widget>
                 </item>

Modified: branches/dxftoqet2/src/dxf/dxf_ellipse.cpp
===================================================================
--- branches/dxftoqet2/src/dxf/dxf_ellipse.cpp	2015-11-08 03:27:14 UTC (rev 4252)
+++ branches/dxftoqet2/src/dxf/dxf_ellipse.cpp	2015-11-08 10:12:04 UTC (rev 4253)
@@ -15,11 +15,30 @@
 	pow_major_x= (-major_radius_x);
 	pow_major_y= (+major_radius_y);
 
-	rotation=180*((major_radius_y/major_radius_x)/3.141592654);
+	if (major_radius_x==0)
+	{
+		major_x=1;
+	}
+	else
+	{
+		major_radius_x=major_x;
+	}
 
+	rotation=180*((major_radius_y/major_x)/3.141592654);
 
-	width=(qSqrt(qPow(pow_major_x,2) - qPow(pow_major_y,2)));
+	if (((qPow(pow_major_x,2) - qPow(pow_major_y,2)))<0)
+	{
+		width=(qSqrt(-(qPow(pow_major_x,2) - qPow(pow_major_y,2))));
+	}
+	else
+	{
+		width=(qSqrt(qPow(pow_major_x,2) - qPow(pow_major_y,2)));
+	}
 
+
+
+	//width=(qSqrt(qPow(pow_major_x,2) - qPow(pow_major_y,2)));
+
 	height=(width*ratio_of_minor);
 
 	Pstart=(180*(start/3.141592654));

Modified: branches/dxftoqet2/src/dxf/dxf_ellipse.h
===================================================================
--- branches/dxftoqet2/src/dxf/dxf_ellipse.h	2015-11-08 03:27:14 UTC (rev 4252)
+++ branches/dxftoqet2/src/dxf/dxf_ellipse.h	2015-11-08 10:12:04 UTC (rev 4253)
@@ -33,6 +33,7 @@
 	float center_x;//10
 	float center_y;//20
 	float major_radius_x;//11
+	float major_x;
 	float major_radius_y;//21
 	float ratio_of_minor;//40
 	float start;//41


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