mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2026-01-08 14:49:58 +01:00
Add some colors for basic shapes inside dxf, thanks Gabberworld for this
patch git-svn-id: svn+ssh://svn.tuxfamily.org/svnroot/qet/qet/trunk@5238 bfdf4180-ca20-0410-9c96-a3a8aa849046
This commit is contained in:
@@ -666,13 +666,14 @@ QDomElement QetShapeItem::toXml(QDomDocument &document) const
|
||||
* @param filepath file path of the the dxf document
|
||||
* @return true if draw success
|
||||
*/
|
||||
bool QetShapeItem::toDXF(const QString &filepath)
|
||||
bool QetShapeItem::toDXF(const QString &filepath,const QPen &pen)
|
||||
{
|
||||
switch (m_shapeType)
|
||||
|
||||
switch (m_shapeType)
|
||||
{
|
||||
case Line: Createdxf::drawLine (filepath, QLineF(mapToScene(m_P1), mapToScene(m_P2)), 0); return true;
|
||||
case Rectangle: Createdxf::drawRectangle(filepath, QRectF(mapToScene(m_P1), mapToScene(m_P2)).normalized(), 0); return true;
|
||||
case Ellipse: Createdxf::drawEllipse (filepath, QRectF(mapToScene(m_P1), mapToScene(m_P2)).normalized(), 0); return true;
|
||||
case Line: Createdxf::drawLine (filepath, QLineF(mapToScene(m_P1), mapToScene(m_P2)), Createdxf::getcolorCode(pen.color().red(),pen.color().green(),pen.color().blue())); return true;
|
||||
case Rectangle: Createdxf::drawRectangle(filepath, QRectF(mapToScene(m_P1), mapToScene(m_P2)).normalized(), Createdxf::getcolorCode(pen.color().red(),pen.color().green(),pen.color().blue())); return true;
|
||||
case Ellipse: Createdxf::drawEllipse (filepath, QRectF(mapToScene(m_P1), mapToScene(m_P2)).normalized(), Createdxf::getcolorCode(pen.color().red(),pen.color().green(),pen.color().blue())); return true;
|
||||
default: return false;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user