mirror of
https://github.com/qgis/QGIS.git
synced 2025-02-27 00:33:48 -05:00
Write dxf circle
This commit is contained in:
parent
ebbb976e8a
commit
668403ace5
@ -796,6 +796,17 @@ void QgsDxfExport::writePoint( const QString& layer, int color, const QgsPoint&
|
||||
writeGroup( 30, 0.0 );
|
||||
}
|
||||
|
||||
void QgsDxfExport::writeCircle( const QString& layer, int color, const QgsPoint& pt, double radius )
|
||||
{
|
||||
writeGroup( 0, "CIRCLE" );
|
||||
writeGroup( 8, layer );
|
||||
writeGroup( 62, color );
|
||||
writeGroup( 10, pt.x() );
|
||||
writeGroup( 20, pt.y() );
|
||||
writeGroup( 30, 0 );
|
||||
writeGroup( 40, radius );
|
||||
}
|
||||
|
||||
void QgsDxfExport::writeSolid( const QString& layer, int color, const QgsPoint& pt1, const QgsPoint& pt2, const QgsPoint& pt3, const QgsPoint& pt4 )
|
||||
{
|
||||
writeGroup( 0, "SOLID" );
|
||||
|
@ -29,7 +29,7 @@ class QgsPoint;
|
||||
class QgsSymbolLayerV2;
|
||||
class QIODevice;
|
||||
|
||||
class QgsDxfExport
|
||||
class CORE_EXPORT QgsDxfExport
|
||||
{
|
||||
public:
|
||||
enum SymbologyExport
|
||||
@ -78,6 +78,8 @@ class QgsDxfExport
|
||||
|
||||
void writePoint( const QString& layer, int color, const QgsPoint& pt );
|
||||
|
||||
void writeCircle( const QString& layer, int color, const QgsPoint& pt, double radius );
|
||||
|
||||
private:
|
||||
|
||||
QList< QgsMapLayer* > mLayers;
|
||||
|
@ -26,7 +26,7 @@ class QPaintEngine;
|
||||
|
||||
/**A paint device for drawing into dxf files*/
|
||||
|
||||
class QgsDxfPaintDevice: public QPaintDevice
|
||||
class CORE_EXPORT QgsDxfPaintDevice: public QPaintDevice
|
||||
{
|
||||
public:
|
||||
QgsDxfPaintDevice( QgsDxfExport* dxf );
|
||||
|
@ -103,7 +103,13 @@ void QgsDxfPaintEngine::drawRects( const QRectF* rects, int rectCount )
|
||||
|
||||
void QgsDxfPaintEngine::drawEllipse( const QRectF& rect )
|
||||
{
|
||||
//map to circle in case of square?
|
||||
QPoint midPoint(( rect.left() + rect.right() ) / 2.0, ( rect.top() + rect.bottom() ) / 2.0 );
|
||||
|
||||
//a circle
|
||||
if ( qgsDoubleNear( rect.width(), rect.height() ) )
|
||||
{
|
||||
mDxf->writeCircle( mLayer, currentPenColor(), toDxfCoordinates( midPoint ), rect.width() / 2.0 );
|
||||
}
|
||||
|
||||
//todo: create polyline for real ellises
|
||||
}
|
||||
|
@ -24,7 +24,7 @@ class QgsDxfExport;
|
||||
class QgsDxfPaintDevice;
|
||||
class QgsPoint;
|
||||
|
||||
class QgsDxfPaintEngine: public QPaintEngine
|
||||
class CORE_EXPORT QgsDxfPaintEngine: public QPaintEngine
|
||||
{
|
||||
public:
|
||||
QgsDxfPaintEngine( const QgsDxfPaintDevice* dxfDevice, QgsDxfExport* dxf );
|
||||
|
Loading…
x
Reference in New Issue
Block a user