QGIS/python/core/dxf/qgsdxfexport.sip

94 lines
4.2 KiB
Plaintext
Raw Normal View History

2014-01-27 09:22:24 +01:00
/***************************************************************************
qgsdxfexport.sip
----------------
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. *
* *
***************************************************************************/
class QgsDxfExport
{
%TypeHeaderCode
#include <qgsdxfexport.h>
%End
public:
enum SymbologyExport
{
2014-06-02 21:00:51 +02:00
NoSymbology, //export only data
2014-01-27 09:22:24 +01:00
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();
void addLayers( const QList< QPair<QgsVectorLayer *, int > > &layers );
int writeToFile( QIODevice *d, QString codec ); //maybe add progress dialog? other parameters (e.g. scale, dpi)?
2014-01-27 09:22:24 +01:00
void setSymbologyScaleDenominator( double d );
double symbologyScaleDenominator() const;
void setMapUnits( QGis::UnitType u );
QGis::UnitType mapUnits() const;
void setSymbologyExport( QgsDxfExport::SymbologyExport e );
QgsDxfExport::SymbologyExport symbologyExport() const;
void setExtent( const QgsRectangle &r );
2014-01-27 09:22:24 +01:00
QgsRectangle extent() const;
//get closest entry in dxf palette
static int closestColorMatch( QRgb pixel );
QString layerName( const QString &id, const QgsFeature &f ) const;
2014-01-27 09:22:24 +01:00
//! @note available in python bindings as writeGroupInt
void writeGroup( int code, int i ) /PyName=writeGroupInt/;
//! @note available in python bindings as writeGroupDouble
void writeGroup( int code, double d ) /PyName=writeGroupDouble/;
void writeGroup( int code, const QString &s );
2014-01-27 09:22:24 +01:00
void writeGroupCode( int code );
void writeInt( int i );
void writeDouble( double d );
void writeString( const QString &s );
void writeGroup( int code, const QgsPoint &p, double z = 0.0, bool skipz = false ) /PyName=writeGroupPoint/;
void writeGroup( QColor color, int exactMatch = 62, int rgbCode = 420, int transparencyCode = 440 );
int writeHandle( int code = 5, int handle = 0 );
2014-01-27 09:22:24 +01:00
//draw dxf primitives
void writePolyline( const QgsPolyline &line, const QString &layer, const QString &lineStyleName, QColor color,
2014-01-27 09:22:24 +01:00
double width = -1, bool polygon = false );
void writePolygon( const QgsPolygon &polygon, const QString &layer, const QString &hatchPattern, QColor color );
void writeSolid( const QString &layer, QColor color, const QgsPoint &pt1, const QgsPoint &pt2, const QgsPoint &pt3, const QgsPoint &pt4 );
2014-01-27 09:22:24 +01:00
//write line (as a polyline)
void writeLine( const QgsPoint &pt1, const QgsPoint &pt2, const QString &layer, const QString &lineStyleName, QColor color, double width = -1 );
void writePoint( const QString &layer, QColor color, const QgsPoint &pt );
2014-01-27 09:22:24 +01:00
void writeFilledCircle( const QString &layer, QColor color, const QgsPoint &pt, double radius );
void writeCircle( const QString &layer, QColor color, const QgsPoint &pt, double radius, const QString &lineStyleName, double width );
2014-01-27 09:22:24 +01:00
void writeText( const QString &layer, const QString &text, const QgsPoint &pt, double size, double angle, QColor color );
2014-01-27 09:22:24 +01:00
void writeMText( const QString &layer, const QString &text, const QgsPoint &pt, double width, double angle, QColor color );
2014-01-27 09:22:24 +01:00
static double mapUnitScaleFactor( double scaleDenominator, QgsSymbolV2::OutputUnit symbolUnits, QGis::UnitType mapUnits );
static QString dxfLayerName( const QString &name );
2014-01-27 09:22:24 +01:00
};