| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,160 @@ | ||
| /*************************************************************************** | ||
| qgsdxfexport.h | ||
| -------------- | ||
| begin : September 2013 | ||
| copyright : (C) 2013 by Marco Hugentobler | ||
| email : marco at sourcepole dot ch | ||
| ***************************************************************************/ | ||
|
|
||
| /*************************************************************************** | ||
| * * | ||
| * This program is free software; you can redistribute it and/or modify * | ||
| * it under the terms of the GNU General Public License as published by * | ||
| * the Free Software Foundation; either version 2 of the License, or * | ||
| * (at your option) any later version. * | ||
| * * | ||
| ***************************************************************************/ | ||
|
|
||
| #ifndef QGSDXFEXPORT_H | ||
| #define QGSDXFEXPORT_H | ||
|
|
||
| #include "qgsgeometry.h" | ||
| #include "qgssymbolv2.h" | ||
| #include <QColor> | ||
| #include <QList> | ||
| #include <QTextStream> | ||
|
|
||
| class QgsMapLayer; | ||
| class QgsPoint; | ||
| class QgsSymbolLayerV2; | ||
| class QIODevice; | ||
|
|
||
| class CORE_EXPORT QgsDxfExport | ||
| { | ||
| public: | ||
| enum SymbologyExport | ||
| { | ||
| NoSymbology = 0, //export only data | ||
| FeatureSymbology, //Keeps the number of features and export symbology per feature (using the first symbol level) | ||
| SymbolLayerSymbology //Exports one feature per symbol layer (considering symbol levels) | ||
| }; | ||
|
|
||
| QgsDxfExport(); | ||
| QgsDxfExport( const QgsDxfExport& dxfExport ); | ||
| ~QgsDxfExport(); | ||
| QgsDxfExport& operator=( const QgsDxfExport& dxfExport ); | ||
|
|
||
| void addLayers( QList< QgsMapLayer* >& layers ) { mLayers = layers; } | ||
| int writeToFile( QIODevice* d ); //maybe add progress dialog? //other parameters (e.g. scale, dpi)? | ||
|
|
||
| void setSymbologyScaleDenominator( double d ) { mSymbologyScaleDenominator = d; } | ||
| double symbologyScaleDenominator() const { return mSymbologyScaleDenominator; } | ||
|
|
||
| void setMapUnits( QGis::UnitType u ) { mMapUnits = u; } | ||
| QGis::UnitType mapUnits() const { return mMapUnits; } | ||
|
|
||
| void setSymbologyExport( SymbologyExport e ) { mSymbologyExport = e; } | ||
| SymbologyExport symbologyExport() const { return mSymbologyExport; } | ||
|
|
||
| //get closest entry in dxf palette | ||
| static int closestColorMatch( QRgb pixel ); | ||
|
|
||
| void writeGroup( int code, int i ); | ||
| void writeGroup( int code, double d ); | ||
| void writeGroup( int code, const QString& s ); | ||
| void writeGroupCode( int code ); | ||
| void writeInt( int i ); | ||
| void writeDouble( double d ); | ||
| void writeString( const QString& s ); | ||
|
|
||
| //draw dxf primitives | ||
| void writePolyline( const QgsPolyline& line, const QString& layer, const QString& lineStyleName, int color, | ||
| double width = -1, bool polygon = false ); | ||
|
|
||
| void writeSolid( const QString& layer, int color, const QgsPoint& pt1, const QgsPoint& pt2, const QgsPoint& pt3, const QgsPoint& pt4 ); | ||
|
|
||
| //write line (as a polyline) | ||
| void writeLine( const QgsPoint& pt1, const QgsPoint& pt2, const QString& layer, const QString& lineStyleName, int color, double width = -1 ); | ||
|
|
||
| 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; | ||
| /**Scale for symbology export (used if symbols units are mm)*/ | ||
| double mSymbologyScaleDenominator; | ||
| SymbologyExport mSymbologyExport; | ||
| QGis::UnitType mMapUnits; | ||
|
|
||
| QTextStream mTextStream; | ||
|
|
||
| static double mDxfColors[][3]; | ||
|
|
||
| int mSymbolLayerCounter; //internal counter | ||
| int mNextHandleId; | ||
| int mBlockCounter; | ||
|
|
||
| QHash< const QgsSymbolLayerV2*, QString > mLineStyles; //symbol layer name types | ||
| QHash< const QgsSymbolLayerV2*, QString > mPointSymbolBlocks; //reference to point symbol blocks | ||
|
|
||
| //AC1009 | ||
| void writeHeader(); | ||
| void writeTables(); | ||
| void writeBlocks(); | ||
| void writeEntities(); | ||
| void writeEntitiesSymbolLevels( QgsVectorLayer* layer ); | ||
| void writeEndFile(); | ||
|
|
||
| void startSection(); | ||
| void endSection(); | ||
|
|
||
| void writePoint( const QgsPoint& pt, const QString& layer, int color, const QgsFeature* f, const QgsSymbolLayerV2* symbolLayer, const QgsSymbolV2* symbol ); | ||
| void writeVertex( const QgsPoint& pt, const QString& layer ); | ||
| void writeDefaultLinestyles(); | ||
| void writeSymbolLayerLinestyle( const QgsSymbolLayerV2* symbolLayer ); | ||
| void writeLinestyle( const QString& styleName, const QVector<qreal>& pattern, QgsSymbolV2::OutputUnit u ); | ||
|
|
||
| //AC1018 | ||
| void writeHeaderAC1018( QTextStream& stream ); | ||
| void writeTablesAC1018( QTextStream& stream ); | ||
| void writeEntitiesAC1018( QTextStream& stream ); | ||
| void writeEntitiesSymbolLevelsAC1018( QTextStream& stream, QgsVectorLayer* layer ); | ||
| void writeSymbolLayerLinestyleAC1018( QTextStream& stream, const QgsSymbolLayerV2* symbolLayer ); | ||
| void writeLinestyleAC1018( QTextStream& stream, const QString& styleName, const QVector<qreal>& pattern, QgsSymbolV2::OutputUnit u ); | ||
| void writeVertexAC1018( QTextStream& stream, const QgsPoint& pt ); | ||
| void writePolylineAC1018( QTextStream& stream, const QgsPolyline& line, const QString& layer, const QString& lineStyleName, int color, | ||
| double width = -1, bool polygon = false ); | ||
|
|
||
|
|
||
| QgsRectangle dxfExtent() const; | ||
|
|
||
| void addFeature( const QgsFeature& fet, const QString& layer, const QgsSymbolLayerV2* symbolLayer, const QgsSymbolV2* symbol ); | ||
| double scaleToMapUnits( double value, QgsSymbolV2::OutputUnit symbolUnits, QGis::UnitType mapUnits ) const; | ||
|
|
||
| //returns dxf palette index from symbol layer color | ||
| static int colorFromSymbolLayer( const QgsSymbolLayerV2* symbolLayer ); | ||
| double widthFromSymbolLayer( const QgsSymbolLayerV2* symbolLayer ) const; | ||
| QString lineStyleFromSymbolLayer( const QgsSymbolLayerV2* symbolLayer ); | ||
|
|
||
| //functions for dxf palette | ||
| static int color_distance( QRgb p1, int index ); | ||
| static QRgb createRgbEntry( qreal r, qreal g, qreal b ); | ||
|
|
||
| //helper functions for symbology export | ||
| QgsRenderContext renderContext() const; | ||
| void startRender( QgsVectorLayer* vl ) const; | ||
| void stopRender( QgsVectorLayer* vl ) const; | ||
| static double mapUnitScaleFactor( double scaleDenominator, QgsSymbolV2::OutputUnit symbolUnits, QGis::UnitType mapUnits ); | ||
| QList< QPair< QgsSymbolLayerV2*, QgsSymbolV2* > > symbolLayers(); | ||
| static int nLineTypes( const QList< QPair< QgsSymbolLayerV2*, QgsSymbolV2*> >& symbolLayers ); | ||
| static bool hasDataDefinedProperties( const QgsSymbolLayerV2* sl, const QgsSymbolV2* symbol ); | ||
| double dashSize() const; | ||
| double dotSize() const; | ||
| double dashSeparatorSize() const; | ||
| double sizeToMapUnits( double s ) const; | ||
| static QString lineNameFromPenStyle( Qt::PenStyle style ); | ||
| }; | ||
|
|
||
| #endif // QGSDXFEXPORT_H |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,100 @@ | ||
| /*************************************************************************** | ||
| qgsdxpaintdevice.cpp | ||
| -------------------- | ||
| begin : November 2013 | ||
| copyright : (C) 2013 by Marco Hugentobler | ||
| email : marco at sourcepole dot ch | ||
| ***************************************************************************/ | ||
|
|
||
| /*************************************************************************** | ||
| * * | ||
| * This program is free software; you can redistribute it and/or modify * | ||
| * it under the terms of the GNU General Public License as published by * | ||
| * the Free Software Foundation; either version 2 of the License, or * | ||
| * (at your option) any later version. * | ||
| * * | ||
| ***************************************************************************/ | ||
|
|
||
| #include "qgsdxfpaintdevice.h" | ||
|
|
||
| QgsDxfPaintDevice::QgsDxfPaintDevice( QgsDxfExport* dxf ): QPaintDevice(), mPaintEngine( 0 ) | ||
| { | ||
| mPaintEngine = new QgsDxfPaintEngine( this, dxf ); | ||
| } | ||
|
|
||
| QgsDxfPaintDevice::~QgsDxfPaintDevice() | ||
| { | ||
| delete mPaintEngine; | ||
| } | ||
|
|
||
| QPaintEngine* QgsDxfPaintDevice::paintEngine() const | ||
| { | ||
| return mPaintEngine; | ||
| } | ||
|
|
||
| int QgsDxfPaintDevice::metric( PaintDeviceMetric metric ) const | ||
| { | ||
| switch ( metric ) | ||
| { | ||
| case QPaintDevice::PdmWidth: | ||
| return mDrawingSize.width(); | ||
| case QPaintDevice::PdmHeight: | ||
| return mDrawingSize.height(); | ||
| case QPaintDevice::PdmWidthMM: | ||
| return mDrawingSize.width(); | ||
| case QPaintDevice::PdmHeightMM: | ||
| return mDrawingSize.height(); | ||
| case QPaintDevice::PdmNumColors: | ||
| return INT_MAX; | ||
| case QPaintDevice::PdmDepth: | ||
| return 32; | ||
| case QPaintDevice::PdmDpiX: | ||
| case QPaintDevice::PdmDpiY: | ||
| case QPaintDevice::PdmPhysicalDpiX: | ||
| case QPaintDevice::PdmPhysicalDpiY: | ||
| return 96; | ||
| } | ||
| return 0; | ||
| } | ||
|
|
||
| double QgsDxfPaintDevice::widthScaleFactor() const | ||
| { | ||
| if ( !mDrawingSize.isValid() || mRectangle.isEmpty() ) | ||
| { | ||
| return 1.0; | ||
| } | ||
|
|
||
| double widthFactor = mRectangle.width() / mDrawingSize.width(); | ||
| double heightFactor = mRectangle.height() / mDrawingSize.height(); | ||
| return ( widthFactor + heightFactor ) / 2.0; | ||
| } | ||
|
|
||
| QPointF QgsDxfPaintDevice::dxfCoordinates( const QPointF& pt ) const | ||
| { | ||
| if ( !mDrawingSize.isValid() || mRectangle.isEmpty() ) | ||
| { | ||
| return QPointF( pt.x(), pt.y() ); | ||
| } | ||
|
|
||
| double x = mRectangle.left() + pt.x() * ( mRectangle.width() / mDrawingSize.width() ); | ||
| double y = mRectangle.bottom() - pt.y() * ( mRectangle.height() / mDrawingSize.height() ); | ||
| return QPointF( x, y ); | ||
| } | ||
|
|
||
| void QgsDxfPaintDevice::setLayer( const QString& layer ) | ||
| { | ||
| if ( mPaintEngine ) | ||
| { | ||
| mPaintEngine->setLayer( layer ); | ||
| } | ||
| } | ||
|
|
||
| void QgsDxfPaintDevice::setShift( const QPointF& shift ) | ||
| { | ||
| if ( mPaintEngine ) | ||
| { | ||
| mPaintEngine->setShift( shift ); | ||
| } | ||
| } | ||
|
|
||
|
|
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,63 @@ | ||
| /*************************************************************************** | ||
| qgsdxpaintdevice.h | ||
| ------------------ | ||
| begin : November 2013 | ||
| copyright : (C) 2013 by Marco Hugentobler | ||
| email : marco at sourcepole dot ch | ||
| ***************************************************************************/ | ||
|
|
||
| /*************************************************************************** | ||
| * * | ||
| * This program is free software; you can redistribute it and/or modify * | ||
| * it under the terms of the GNU General Public License as published by * | ||
| * the Free Software Foundation; either version 2 of the License, or * | ||
| * (at your option) any later version. * | ||
| * * | ||
| ***************************************************************************/ | ||
|
|
||
| #ifndef QGSDXFPAINTDEVICE_H | ||
| #define QGSDXFPAINTDEVICE_H | ||
|
|
||
| #include <QPaintDevice> | ||
| #include "qgsdxfpaintengine.h" | ||
|
|
||
| class QgsDxfExport; | ||
| class QPaintEngine; | ||
|
|
||
| /**A paint device for drawing into dxf files*/ | ||
|
|
||
| class CORE_EXPORT QgsDxfPaintDevice: public QPaintDevice | ||
| { | ||
| public: | ||
| QgsDxfPaintDevice( QgsDxfExport* dxf ); | ||
| ~QgsDxfPaintDevice(); | ||
|
|
||
| QPaintEngine* paintEngine() const; | ||
|
|
||
| void setDrawingSize( const QSizeF& size ) { mDrawingSize = size; } | ||
| void setOutputSize( const QRectF& r ) { mRectangle = r; } | ||
|
|
||
| /**Returns scale factor for line width*/ | ||
| double widthScaleFactor() const; | ||
|
|
||
| /**Converts a point from device coordinates to dxf coordinates*/ | ||
| QPointF dxfCoordinates( const QPointF& pt ) const; | ||
|
|
||
| /*int height() const { return mDrawingSize.height(); } | ||
| int width() const { return mDrawingSize.width(); }*/ | ||
|
|
||
| int metric( PaintDeviceMetric metric ) const; | ||
|
|
||
| void setLayer( const QString& layer ); | ||
|
|
||
| void setShift( const QPointF& shift ); | ||
|
|
||
|
|
||
| private: | ||
| QgsDxfPaintEngine* mPaintEngine; | ||
|
|
||
| QSizeF mDrawingSize; //size (in source coordinates) | ||
| QRectF mRectangle; //size (in dxf coordinates) | ||
| }; | ||
|
|
||
| #endif // QGSDXFPAINTDEVICE_H |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,171 @@ | ||
| /*************************************************************************** | ||
| qgsdxpaintengine.cpp | ||
| -------------------- | ||
| begin : November 2013 | ||
| copyright : (C) 2013 by Marco Hugentobler | ||
| email : marco at sourcepole dot ch | ||
| ***************************************************************************/ | ||
|
|
||
| /*************************************************************************** | ||
| * * | ||
| * This program is free software; you can redistribute it and/or modify * | ||
| * it under the terms of the GNU General Public License as published by * | ||
| * the Free Software Foundation; either version 2 of the License, or * | ||
| * (at your option) any later version. * | ||
| * * | ||
| ***************************************************************************/ | ||
|
|
||
| #include "qgsdxfpaintengine.h" | ||
| #include "qgsdxfexport.h" | ||
| #include "qgsdxfpaintdevice.h" | ||
| #include "qgslogger.h" | ||
|
|
||
| QgsDxfPaintEngine::QgsDxfPaintEngine( const QgsDxfPaintDevice* dxfDevice, QgsDxfExport* dxf ): QPaintEngine( QPaintEngine::AllFeatures /*QPaintEngine::PainterPaths | QPaintEngine::PaintOutsidePaintEvent*/ ) | ||
| , mPaintDevice( dxfDevice ), mDxf( dxf ) | ||
| { | ||
|
|
||
| } | ||
|
|
||
| QgsDxfPaintEngine::~QgsDxfPaintEngine() | ||
| { | ||
|
|
||
| } | ||
|
|
||
| bool QgsDxfPaintEngine::begin( QPaintDevice* pdev ) | ||
| { | ||
| Q_UNUSED( pdev ); | ||
| return true; | ||
| } | ||
|
|
||
| bool QgsDxfPaintEngine::end() | ||
| { | ||
| return true; | ||
| } | ||
|
|
||
| QPaintEngine::Type QgsDxfPaintEngine::type() const | ||
| { | ||
| return QPaintEngine::User; | ||
| } | ||
|
|
||
| void QgsDxfPaintEngine::drawPixmap( const QRectF& r, const QPixmap& pm, const QRectF& sr ) | ||
| { | ||
| Q_UNUSED( r ); Q_UNUSED( pm ); Q_UNUSED( sr ); | ||
| } | ||
|
|
||
| void QgsDxfPaintEngine::updateState( const QPaintEngineState& state ) | ||
| { | ||
| if ( state.state() & QPaintEngine::DirtyTransform ) | ||
| { | ||
| mTransform = state.transform(); | ||
| } | ||
| if ( state.state() & QPaintEngine::DirtyPen ) | ||
| { | ||
| mPen = state.pen(); | ||
| } | ||
| } | ||
|
|
||
| void QgsDxfPaintEngine::drawPolygon( const QPointF* points, int pointCount, PolygonDrawMode mode ) | ||
| { | ||
| if ( !mDxf || !mPaintDevice ) | ||
| { | ||
| return; | ||
| } | ||
|
|
||
| QgsPolyline polyline( pointCount ); | ||
| for ( int i = 0; i < pointCount; ++i ) | ||
| { | ||
| polyline[i] = toDxfCoordinates( points[i] ); | ||
| } | ||
|
|
||
| mDxf->writePolyline( polyline, mLayer, "CONTINUOUS", currentPenColor(), currentWidth(), mode != QPaintEngine::PolylineMode ); | ||
| } | ||
|
|
||
| void QgsDxfPaintEngine::drawRects( const QRectF* rects, int rectCount ) | ||
| { | ||
| if ( !mDxf || !mPaintDevice || !rects ) | ||
| { | ||
| return; | ||
| } | ||
|
|
||
| for ( int i = 0; i < rectCount; ++i ) | ||
| { | ||
| double left = rects[i].left(); | ||
| double right = rects[i].right(); | ||
| double top = rects[i].top(); | ||
| double bottom = rects[i].bottom(); | ||
| QgsPoint pt1 = toDxfCoordinates( QPointF( left, bottom ) ); | ||
| QgsPoint pt2 = toDxfCoordinates( QPointF( right, bottom ) ); | ||
| QgsPoint pt3 = toDxfCoordinates( QPointF( left, top ) ); | ||
| QgsPoint pt4 = toDxfCoordinates( QPointF( right, top ) ); | ||
| mDxf->writeSolid( mLayer, currentPenColor(), pt1, pt2, pt3, pt4 ); | ||
| } | ||
| } | ||
|
|
||
| void QgsDxfPaintEngine::drawEllipse( const QRectF& rect ) | ||
| { | ||
| 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 | ||
| } | ||
|
|
||
| void QgsDxfPaintEngine::drawPath( const QPainterPath& path ) | ||
| { | ||
| QList<QPolygonF> polygonList = path.toFillPolygons(); | ||
| QList<QPolygonF>::const_iterator pIt = polygonList.constBegin(); | ||
| for ( ; pIt != polygonList.constEnd(); ++pIt ) | ||
| { | ||
| drawPolygon( pIt->constData(), pIt->size(), pIt->isClosed() ? QPaintEngine::OddEvenMode : QPaintEngine::PolylineMode ); | ||
| } | ||
| } | ||
|
|
||
| void QgsDxfPaintEngine::drawLines( const QLineF* lines, int lineCount ) | ||
| { | ||
| if ( !mDxf || !mPaintDevice || !lines ) | ||
| { | ||
| return; | ||
| } | ||
|
|
||
| for ( int i = 0; i < lineCount; ++i ) | ||
| { | ||
| QgsPoint pt1 = toDxfCoordinates( lines[i].p1() ); | ||
| QgsPoint pt2 = toDxfCoordinates( lines[i].p2() ); | ||
| mDxf->writeLine( pt1, pt2, mLayer, "CONTINUOUS", currentPenColor(), currentWidth() ); | ||
| } | ||
| } | ||
|
|
||
| QgsPoint QgsDxfPaintEngine::toDxfCoordinates( const QPointF& pt ) const | ||
| { | ||
| if ( !mPaintDevice || !mDxf ) | ||
| { | ||
| return QgsPoint( pt.x(), pt.y() ); | ||
| } | ||
|
|
||
| QPointF dxfPt = mPaintDevice->dxfCoordinates( mTransform.map( pt ) ) + mShift; | ||
| return QgsPoint( dxfPt.x(), dxfPt.y() ); | ||
| } | ||
|
|
||
| int QgsDxfPaintEngine::currentPenColor() const | ||
| { | ||
| if ( !mDxf ) | ||
| { | ||
| return 0; | ||
| } | ||
|
|
||
| return mDxf->closestColorMatch( mPen.color().rgb() ); | ||
| } | ||
|
|
||
| double QgsDxfPaintEngine::currentWidth() const | ||
| { | ||
| if ( !mPaintDevice ) | ||
| { | ||
| return 1; | ||
| } | ||
|
|
||
| return mPen.widthF() * mPaintDevice->widthScaleFactor(); | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,66 @@ | ||
| /*************************************************************************** | ||
| qgsdxpaintengine.h | ||
| ------------------ | ||
| begin : November 2013 | ||
| copyright : (C) 2013 by Marco Hugentobler | ||
| email : marco at sourcepole dot ch | ||
| ***************************************************************************/ | ||
|
|
||
| /*************************************************************************** | ||
| * * | ||
| * This program is free software; you can redistribute it and/or modify * | ||
| * it under the terms of the GNU General Public License as published by * | ||
| * the Free Software Foundation; either version 2 of the License, or * | ||
| * (at your option) any later version. * | ||
| * * | ||
| ***************************************************************************/ | ||
|
|
||
| #ifndef QGSDXFPAINTENGINE_H | ||
| #define QGSDXFPAINTENGINE_H | ||
|
|
||
| #include <QPaintEngine> | ||
|
|
||
| class QgsDxfExport; | ||
| class QgsDxfPaintDevice; | ||
| class QgsPoint; | ||
|
|
||
| class CORE_EXPORT QgsDxfPaintEngine: public QPaintEngine | ||
| { | ||
| public: | ||
| QgsDxfPaintEngine( const QgsDxfPaintDevice* dxfDevice, QgsDxfExport* dxf ); | ||
| ~QgsDxfPaintEngine(); | ||
|
|
||
| bool begin( QPaintDevice* pdev ); | ||
| bool end(); | ||
| QPaintEngine::Type type() const; | ||
| void updateState( const QPaintEngineState& state ); | ||
|
|
||
| void drawPixmap( const QRectF& r, const QPixmap& pm, const QRectF& sr ); | ||
|
|
||
| void drawPolygon( const QPointF * points, int pointCount, PolygonDrawMode mode ); | ||
| void drawRects( const QRectF * rects, int rectCount ); | ||
| void drawEllipse( const QRectF& rect ); | ||
| void drawPath( const QPainterPath& path ); | ||
| void drawLines( const QLineF* lines, int lineCount ); | ||
|
|
||
| void setLayer( const QString& layer ) { mLayer = layer; } | ||
| QString layer() const { return mLayer; } | ||
|
|
||
| void setShift( const QPointF& shift ) { mShift = shift; } | ||
|
|
||
| private: | ||
| const QgsDxfPaintDevice* mPaintDevice; | ||
| QgsDxfExport* mDxf; | ||
|
|
||
| //painter state information | ||
| QTransform mTransform; | ||
| QPen mPen; | ||
| QString mLayer; | ||
| QPointF mShift; | ||
|
|
||
| QgsPoint toDxfCoordinates( const QPointF& pt ) const; | ||
| int currentPenColor() const; | ||
| double currentWidth() const; | ||
| }; | ||
|
|
||
| #endif // QGSDXFPAINTENGINE_H |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,124 @@ | ||
| <?xml version="1.0" encoding="UTF-8"?> | ||
| <ui version="4.0"> | ||
| <class>QgsDxfExportDialogBase</class> | ||
| <widget class="QDialog" name="QgsDxfExportDialogBase"> | ||
| <property name="geometry"> | ||
| <rect> | ||
| <x>0</x> | ||
| <y>0</y> | ||
| <width>377</width> | ||
| <height>292</height> | ||
| </rect> | ||
| </property> | ||
| <property name="windowTitle"> | ||
| <string>DXF export</string> | ||
| </property> | ||
| <layout class="QGridLayout" name="gridLayout_2"> | ||
| <item row="0" column="0"> | ||
| <layout class="QGridLayout" name="gridLayout"> | ||
| <item row="0" column="1"> | ||
| <widget class="QLineEdit" name="mFileLineEdit"/> | ||
| </item> | ||
| <item row="1" column="0"> | ||
| <widget class="QLabel" name="mSymbologyModeLabel"> | ||
| <property name="text"> | ||
| <string>Symbology mode</string> | ||
| </property> | ||
| </widget> | ||
| </item> | ||
| <item row="2" column="0"> | ||
| <widget class="QLabel" name="mSymbologyScaleLabel"> | ||
| <property name="text"> | ||
| <string>Symbology scale</string> | ||
| </property> | ||
| </widget> | ||
| </item> | ||
| <item row="0" column="0"> | ||
| <widget class="QLabel" name="mSaveAsLabel"> | ||
| <property name="text"> | ||
| <string>Save as</string> | ||
| </property> | ||
| </widget> | ||
| </item> | ||
| <item row="0" column="2"> | ||
| <widget class="QToolButton" name="mFileSelectionButton"> | ||
| <property name="text"> | ||
| <string>...</string> | ||
| </property> | ||
| </widget> | ||
| </item> | ||
| <item row="1" column="1" colspan="2"> | ||
| <widget class="QComboBox" name="mSymbologyModeComboBox"> | ||
| <item> | ||
| <property name="text"> | ||
| <string>No symbology</string> | ||
| </property> | ||
| </item> | ||
| <item> | ||
| <property name="text"> | ||
| <string>Feature symbology</string> | ||
| </property> | ||
| </item> | ||
| <item> | ||
| <property name="text"> | ||
| <string>Symbol layer symbology</string> | ||
| </property> | ||
| </item> | ||
| </widget> | ||
| </item> | ||
| <item row="2" column="1" colspan="2"> | ||
| <widget class="QLineEdit" name="mSymbologyScaleLineEdit"/> | ||
| </item> | ||
| <item row="3" column="0" colspan="3"> | ||
| <widget class="QListWidget" name="mLayersListWidget"/> | ||
| </item> | ||
| </layout> | ||
| </item> | ||
| <item row="1" column="0"> | ||
| <widget class="QDialogButtonBox" name="buttonBox"> | ||
| <property name="orientation"> | ||
| <enum>Qt::Horizontal</enum> | ||
| </property> | ||
| <property name="standardButtons"> | ||
| <set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set> | ||
| </property> | ||
| </widget> | ||
| </item> | ||
| </layout> | ||
| </widget> | ||
| <resources/> | ||
| <connections> | ||
| <connection> | ||
| <sender>buttonBox</sender> | ||
| <signal>accepted()</signal> | ||
| <receiver>QgsDxfExportDialogBase</receiver> | ||
| <slot>accept()</slot> | ||
| <hints> | ||
| <hint type="sourcelabel"> | ||
| <x>248</x> | ||
| <y>254</y> | ||
| </hint> | ||
| <hint type="destinationlabel"> | ||
| <x>157</x> | ||
| <y>274</y> | ||
| </hint> | ||
| </hints> | ||
| </connection> | ||
| <connection> | ||
| <sender>buttonBox</sender> | ||
| <signal>rejected()</signal> | ||
| <receiver>QgsDxfExportDialogBase</receiver> | ||
| <slot>reject()</slot> | ||
| <hints> | ||
| <hint type="sourcelabel"> | ||
| <x>316</x> | ||
| <y>260</y> | ||
| </hint> | ||
| <hint type="destinationlabel"> | ||
| <x>286</x> | ||
| <y>274</y> | ||
| </hint> | ||
| </hints> | ||
| </connection> | ||
| </connections> | ||
| </ui> |