Bug Fix: Extra line in polygon of elements and arcs and ellipses added.

Arcs and ellipses are approximated with circles at present.
Also, element rotation is not supported right now. Needs to be added.



git-svn-id: svn+ssh://svn.tuxfamily.org/svnroot/qet/qet/trunk@2733 bfdf4180-ca20-0410-9c96-a3a8aa849046
This commit is contained in:
abhishekm71
2014-01-11 08:31:39 +00:00
parent ea953c4c4c
commit 8c86ced6df
4 changed files with 54 additions and 8 deletions

View File

@@ -462,6 +462,26 @@ void ExportDialog::generateDxf(Diagram *diagram, int width, int height, bool kee
y1 = y2;
}
}
// Draw arcs and ellipses
QList<QVector<qreal> *> elmt_arc = elmt -> arcs();
foreach(QVector<qreal> *arc, elmt_arc) {
if (arc -> size() == 0)
continue;
qreal x = (hot_spot_x + arc -> at(0)) * Createdxf::xScale;
qreal y = Createdxf::sheetHeight - (hot_spot_y + arc -> at(1)) * Createdxf::yScale;
qreal w = arc -> at(2) * Createdxf::xScale;
qreal h = arc -> at(3) * Createdxf::yScale;
qreal startAngle = arc -> at(4);
qreal spanAngle = arc -> at(5);
// approximate this to center_x, center_y, radius, start angle and end angle.
qreal center_x = x + w/2;
qreal center_y = y - w/2;
qreal radius = (w+h)/4;
qreal endAngle = startAngle + spanAngle;
Createdxf::drawArc(file_path, center_x, center_y, radius, endAngle, startAngle, 0);
}
}
//Draw conductors