QGIS/python/core/dxf/qgsdxfexport.sip.in

443 lines
9.8 KiB
Plaintext
Raw Normal View History

2017-06-06 15:50:31 +02:00
/************************************************************************
* This file has been generated automatically from *
* *
* src/core/dxf/qgsdxfexport.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
************************************************************************/
2014-01-27 09:22:24 +01:00
2014-01-27 09:22:24 +01:00
class QgsDxfExport
{
2017-06-06 15:50:31 +02:00
2014-01-27 09:22:24 +01:00
%TypeHeaderCode
2017-06-06 15:50:31 +02:00
#include "qgsdxfexport.h"
2014-01-27 09:22:24 +01:00
%End
public:
struct DxfLayer
{
2018-02-12 11:29:41 -04:00
DxfLayer( QgsVectorLayer *vl, int layerOutputAttributeIndex = -1 );
2018-02-12 11:29:41 -04:00
QgsVectorLayer *layer() const;
%Docstring
Return the layer
%End
int layerOutputAttributeIndex() const;
%Docstring
Return the attribute index used to split into multiple layers.
The attribute value is used for layer names.
%End
};
2014-01-27 09:22:24 +01:00
enum SymbologyExport
{
2017-06-06 15:50:31 +02:00
NoSymbology,
FeatureSymbology,
SymbolLayerSymbology
2014-01-27 09:22:24 +01:00
};
enum Flag
{
FlagNoMText,
};
typedef QFlags<QgsDxfExport::Flag> Flags;
2014-01-27 09:22:24 +01:00
QgsDxfExport();
%Docstring
2017-12-15 10:36:55 -04:00
Constructor for QgsDxfExport.
%End
2014-01-27 09:22:24 +01:00
void setMapSettings( const QgsMapSettings &settings );
2017-06-06 15:50:31 +02:00
%Docstring
2017-12-15 10:36:55 -04:00
Set map settings and assign layer name attributes
2017-12-15 21:36:08 -04:00
2017-12-15 10:36:55 -04:00
:param settings: map settings to apply
2017-06-06 15:50:31 +02:00
%End
void setFlags( QgsDxfExport::Flags flags );
%Docstring
2017-12-15 10:36:55 -04:00
Sets the export flags.
.. versionadded:: 3.0
2017-12-15 10:36:55 -04:00
.. seealso:: :py:func:`flags`
%End
QgsDxfExport::Flags flags() const;
%Docstring
2017-12-15 10:36:55 -04:00
Returns the export flags.
.. versionadded:: 3.0
2017-12-15 10:36:55 -04:00
.. seealso:: :py:func:`setFlags`
%End
void addLayers( const QList< QgsDxfExport::DxfLayer > &layers );
2017-06-06 15:50:31 +02:00
%Docstring
2017-12-15 10:36:55 -04:00
Add layers to export
2017-12-15 21:36:08 -04:00
2017-12-15 10:36:55 -04:00
:param layers: list of layers and corresponding attribute indexes that determine the layer name (-1 for original layer name or title)
2017-12-05 20:04:14 -04:00
.. seealso:: :py:func:`setLayerTitleAsName`
2017-06-06 15:50:31 +02:00
%End
int writeToFile( QIODevice *d, const QString &codec ); //maybe add progress dialog? other parameters (e.g. scale, dpi)?
2015-12-11 23:16:08 +01:00
void setSymbologyScale( double scale );
2017-06-06 15:50:31 +02:00
%Docstring
2017-12-15 10:36:55 -04:00
Set reference ``scale`` for output.
The ``scale`` value indicates the scale denominator, e.g. 1000.0 for a 1:1000 map.
.. versionadded:: 3.0
2017-12-15 10:36:55 -04:00
.. seealso:: :py:func:`symbologyScale`
2017-06-06 15:50:31 +02:00
%End
2015-12-11 23:16:08 +01:00
double symbologyScale() const;
2017-06-06 15:50:31 +02:00
%Docstring
2017-12-15 10:36:55 -04:00
Returns the reference scale for output.
The scale value indicates the scale denominator, e.g. 1000.0 for a 1:1000 map.
.. versionadded:: 3.0
2017-12-15 10:36:55 -04:00
.. seealso:: :py:func:`setSymbologyScale`
2017-06-06 15:50:31 +02:00
%End
2014-01-27 09:22:24 +01:00
QgsUnitTypes::DistanceUnit mapUnits() const;
2017-06-06 15:50:31 +02:00
%Docstring
2017-12-15 10:36:55 -04:00
Retrieve map units
:return: unit
2017-06-06 15:50:31 +02:00
%End
2014-01-27 09:22:24 +01:00
void setDestinationCrs( const QgsCoordinateReferenceSystem &crs );
2017-06-06 15:50:31 +02:00
%Docstring
2017-12-15 10:36:55 -04:00
Set destination CRS
.. seealso:: :py:func:`destinationCrs`
2017-12-15 10:36:55 -04:00
2017-06-06 15:50:31 +02:00
.. versionadded:: 3.0
%End
QgsCoordinateReferenceSystem destinationCrs() const;
2017-06-06 15:50:31 +02:00
%Docstring
2017-12-15 10:36:55 -04:00
Returns the destination CRS, or an invalid CRS if no reprojection will be done.
.. seealso:: :py:func:`setDestinationCrs`
2017-12-15 10:36:55 -04:00
2017-06-06 15:50:31 +02:00
.. versionadded:: 3.0
%End
2014-01-27 09:22:24 +01:00
void setSymbologyExport( QgsDxfExport::SymbologyExport e );
2017-06-06 15:50:31 +02:00
%Docstring
2017-12-15 10:36:55 -04:00
Set symbology export mode
2017-12-15 21:36:08 -04:00
2017-12-15 10:36:55 -04:00
:param e: the mode
2017-06-06 15:50:31 +02:00
%End
2015-12-11 23:16:08 +01:00
2014-01-27 09:22:24 +01:00
QgsDxfExport::SymbologyExport symbologyExport() const;
2017-06-06 15:50:31 +02:00
%Docstring
2017-12-15 10:36:55 -04:00
Get symbology export mode
:return: mode
2017-12-05 20:04:14 -04:00
.. seealso:: :py:func:`setSymbologyExport`
2017-06-06 15:50:31 +02:00
%End
2014-01-27 09:22:24 +01:00
void setExtent( const QgsRectangle &r );
2017-06-06 15:50:31 +02:00
%Docstring
2017-12-15 10:36:55 -04:00
Set extent of area to export
2017-12-15 21:36:08 -04:00
2017-12-15 10:36:55 -04:00
:param r: area to export
2017-06-06 15:50:31 +02:00
%End
2015-12-11 23:16:08 +01:00
2014-01-27 09:22:24 +01:00
QgsRectangle extent() const;
2017-06-06 15:50:31 +02:00
%Docstring
2017-12-15 10:36:55 -04:00
Get extent of area to export
:return: area to export
2017-12-05 20:04:14 -04:00
.. seealso:: :py:func:`setExtent`
2017-06-06 15:50:31 +02:00
%End
2014-01-27 09:22:24 +01:00
2015-12-11 23:16:08 +01:00
void setLayerTitleAsName( bool layerTitleAsName );
2017-06-06 15:50:31 +02:00
%Docstring
2017-12-15 10:36:55 -04:00
Enable use of title (where set) instead of layer name,
when attribute index of corresponding layer index is -1
2017-12-15 21:36:08 -04:00
2017-12-15 10:36:55 -04:00
:param layerTitleAsName: flag
2017-12-05 20:04:14 -04:00
.. seealso:: :py:func:`addLayers`
2017-06-06 15:50:31 +02:00
%End
2015-12-11 23:16:08 +01:00
bool layerTitleAsName();
2017-06-06 15:50:31 +02:00
%Docstring
2017-12-15 10:36:55 -04:00
Retrieve whether layer title (where set) instead of name shall be use
:return: flag
2017-12-05 20:04:14 -04:00
.. seealso:: :py:func:`setLayerTitleAsName`
2017-06-06 15:50:31 +02:00
%End
2015-12-11 23:16:08 +01:00
void setForce2d( bool force2d );
%Docstring
2017-12-15 10:36:55 -04:00
Force 2d output (eg. to support linewidth in polylines)
2017-12-15 21:36:08 -04:00
2017-12-15 10:36:55 -04:00
:param force2d: flag
2017-12-05 20:04:14 -04:00
.. seealso:: :py:func:`force2d`
%End
bool force2d();
%Docstring
2017-12-15 10:36:55 -04:00
Retrieve whether the output should be forced to 2d
:return: flag
2017-12-05 20:04:14 -04:00
.. seealso:: :py:func:`setForce2d`
%End
2016-04-13 20:41:32 +02:00
static int closestColorMatch( QRgb color );
2017-06-06 15:50:31 +02:00
%Docstring
2017-12-15 10:36:55 -04:00
Get DXF palette index of nearest entry for given color
2017-12-15 21:36:08 -04:00
:param color:
2017-06-06 15:50:31 +02:00
%End
2014-01-27 09:22:24 +01:00
QString layerName( const QString &id, const QgsFeature &f ) const;
2017-06-06 15:50:31 +02:00
%Docstring
2017-12-15 10:36:55 -04:00
Get layer name for feature
2017-12-15 21:36:08 -04:00
2017-12-15 10:36:55 -04:00
:param id: layer id of layer
:param f: feature of layer
:return: layer name for feature
2017-06-06 15:50:31 +02:00
%End
2015-12-11 23:16:08 +01:00
QString layerName( QgsVectorLayer *vl ) const;
2017-06-06 15:50:31 +02:00
%Docstring
2017-12-15 10:36:55 -04:00
Get name for layer respecting the use layer title as layer name mode
2017-12-15 21:36:08 -04:00
2017-12-15 10:36:55 -04:00
:param vl: the vector layer
:return: name of layer
2017-12-05 20:04:14 -04:00
.. seealso:: :py:func:`setLayerTitleAsName`
2017-06-06 15:50:31 +02:00
%End
2015-12-11 23:16:08 +01:00
2014-01-27 09:22:24 +01:00
void writeGroup( int code, int i ) /PyName=writeGroupInt/;
2017-06-06 15:50:31 +02:00
%Docstring
2017-12-15 10:36:55 -04:00
Write a tuple of group code and integer value
2017-12-15 21:36:08 -04:00
2017-12-15 10:36:55 -04:00
:param code: group code
:param i: integer value
2017-06-06 15:50:31 +02:00
.. note::
available in Python bindings as writeGroupInt
%End
2015-12-11 23:16:08 +01:00
2014-01-27 09:22:24 +01:00
void writeGroup( int code, double d ) /PyName=writeGroupDouble/;
2017-06-06 15:50:31 +02:00
%Docstring
2017-12-15 10:36:55 -04:00
Write a group code with a floating point value
2017-12-15 21:36:08 -04:00
2017-12-15 10:36:55 -04:00
:param code: group code
:param d: floating point value
2017-06-06 15:50:31 +02:00
.. note::
available in Python bindings as writeGroupDouble
%End
2015-12-11 23:16:08 +01:00
void writeGroup( int code, const QString &s );
2017-06-06 15:50:31 +02:00
%Docstring
2017-12-15 10:36:55 -04:00
Write a group code with a string value
2017-12-15 21:36:08 -04:00
2017-12-15 10:36:55 -04:00
:param code: group code
:param s: string value
2017-06-06 15:50:31 +02:00
%End
2015-12-11 23:16:08 +01:00
void writeGroup( int code, const QgsPoint &p ) /PyName=writeGroupPointV2/;
2017-06-06 15:50:31 +02:00
%Docstring
2017-12-15 10:36:55 -04:00
Write a group code with a point
2017-12-15 21:36:08 -04:00
2017-12-15 10:36:55 -04:00
:param code: group code
:param p: point value
2017-06-06 15:50:31 +02:00
.. note::
available in Python bindings as writeGroupPointV2
2017-12-15 10:36:55 -04:00
2017-06-06 15:50:31 +02:00
.. versionadded:: 2.15
%End
void writeGroup( const QColor &color, int exactMatch = 62, int rgbCode = 420, int transparencyCode = 440 );
2017-06-06 15:50:31 +02:00
%Docstring
2017-12-15 10:36:55 -04:00
Write a group code with color value
2017-12-15 21:36:08 -04:00
2017-12-15 10:36:55 -04:00
:param color: color
:param exactMatch: group code to use if the color has an exact match in the dxf palette
:param rgbCode: group code to use if the color doesn't have an exact match or has a transparency component
:param transparencyCode: group code to use for transparency component
2017-06-06 15:50:31 +02:00
.. note::
available in Python bindings as writeGroupPoint
%End
2015-12-11 23:16:08 +01:00
2014-01-27 09:22:24 +01:00
void writeGroupCode( int code );
2017-06-06 15:50:31 +02:00
%Docstring
2017-12-15 10:36:55 -04:00
Write a group code
2017-12-15 21:36:08 -04:00
2017-12-15 10:36:55 -04:00
:param code: group code value
2017-06-06 15:50:31 +02:00
%End
2015-12-11 23:16:08 +01:00
2014-01-27 09:22:24 +01:00
void writeInt( int i );
2017-06-06 15:50:31 +02:00
%Docstring
2017-12-15 10:36:55 -04:00
Write an integer value
2017-12-15 21:36:08 -04:00
2017-12-15 10:36:55 -04:00
:param i: integer value
2017-06-06 15:50:31 +02:00
%End
2015-12-11 23:16:08 +01:00
2014-01-27 09:22:24 +01:00
void writeDouble( double d );
2017-06-06 15:50:31 +02:00
%Docstring
2017-12-15 10:36:55 -04:00
Write a floating point value
2017-12-15 21:36:08 -04:00
2017-12-15 10:36:55 -04:00
:param d: floating point value
2017-06-06 15:50:31 +02:00
%End
2015-12-11 23:16:08 +01:00
void writeString( const QString &s );
2017-06-06 15:50:31 +02:00
%Docstring
2017-12-15 10:36:55 -04:00
Write a string value
2017-12-15 21:36:08 -04:00
2017-12-15 10:36:55 -04:00
:param s: string value
2017-06-06 15:50:31 +02:00
%End
int writeHandle( int code = 5, int handle = 0 );
2017-06-06 15:50:31 +02:00
%Docstring
2017-12-15 10:36:55 -04:00
Write a tuple of group code and a handle
2017-12-15 21:36:08 -04:00
2017-12-15 10:36:55 -04:00
:param code: group code to use
:param handle: handle to use (0 generates a new handle)
:return: the used handle
2017-06-06 15:50:31 +02:00
%End
2014-01-27 09:22:24 +01:00
void writeLine( const QgsPoint &pt1, const QgsPoint &pt2, const QString &layer, const QString &lineStyleName, const QColor &color, double width = -1 );
2017-06-06 15:50:31 +02:00
%Docstring
2017-12-15 10:36:55 -04:00
Write line (as a polyline)
2017-06-06 15:50:31 +02:00
.. versionadded:: 2.15
%End
void writePoint( const QString &layer, const QColor &color, const QgsPoint &pt ) /PyName=writePointV2/;
2017-06-06 15:50:31 +02:00
%Docstring
2017-12-15 10:36:55 -04:00
Write point
.. note::
available in Python bindings as writePointV2
2017-12-15 10:36:55 -04:00
2017-06-06 15:50:31 +02:00
.. versionadded:: 2.15
%End
void writeFilledCircle( const QString &layer, const QColor &color, const QgsPoint &pt, double radius ) /PyName=writeFillCircleV2/;
2017-06-06 15:50:31 +02:00
%Docstring
2017-12-15 10:36:55 -04:00
Write filled circle (as hatch)
.. note::
available in Python bindings as writePointV2
2017-12-15 10:36:55 -04:00
2017-06-06 15:50:31 +02:00
.. versionadded:: 2.15
%End
void writeCircle( const QString &layer, const QColor &color, const QgsPoint &pt, double radius, const QString &lineStyleName, double width ) /PyName=writeCircleV2/;
2017-06-06 15:50:31 +02:00
%Docstring
2017-12-15 10:36:55 -04:00
Write circle (as polyline)
.. note::
available in Python bindings as writeCircleV2
2017-12-15 10:36:55 -04:00
2017-06-06 15:50:31 +02:00
.. versionadded:: 2.15
%End
2014-01-27 09:22:24 +01:00
void writeText( const QString &layer, const QString &text, const QgsPoint &pt, double size, double angle, const QColor &color ) /PyName=writeTextV2/;
2017-06-06 15:50:31 +02:00
%Docstring
2017-12-15 10:36:55 -04:00
Write text (TEXT)
.. note::
available in Python bindings as writeTextV2
2017-12-15 10:36:55 -04:00
2017-06-06 15:50:31 +02:00
.. versionadded:: 2.15
%End
void writeMText( const QString &layer, const QString &text, const QgsPoint &pt, double width, double angle, const QColor &color );
2017-06-06 15:50:31 +02:00
%Docstring
2017-12-15 10:36:55 -04:00
Write mtext (MTEXT)
.. note::
available in Python bindings as writeMTextV2
2017-12-15 10:36:55 -04:00
2017-06-06 15:50:31 +02:00
.. versionadded:: 2.15
%End
2014-01-27 09:22:24 +01:00
static double mapUnitScaleFactor( double scale, QgsUnitTypes::RenderUnit symbolUnits, QgsUnitTypes::DistanceUnit mapUnits );
2017-06-06 15:50:31 +02:00
%Docstring
2017-12-15 10:36:55 -04:00
Calculates a scaling factor to convert from map units to a specified symbol unit.
The ``scale`` parameter indicates the scale denominator, e.g. 1000.0 for a 1:1000 map.
2017-06-06 15:50:31 +02:00
%End
2014-01-27 09:22:24 +01:00
static QString dxfLayerName( const QString &name );
2017-06-06 15:50:31 +02:00
%Docstring
Return cleaned layer name for use in DXF
%End
2014-01-27 09:22:24 +01:00
2015-12-11 23:16:08 +01:00
static QString dxfEncoding( const QString &name );
2017-06-06 15:50:31 +02:00
%Docstring
return DXF encoding for Qt encoding
%End
2015-12-11 23:16:08 +01:00
static QStringList encodings();
2017-06-06 15:50:31 +02:00
%Docstring
return list of available DXF encodings
%End
2015-12-11 23:16:08 +01:00
void registerDxfLayer( const QString &layerId, QgsFeatureId fid, const QString &layer );
2017-06-06 15:50:31 +02:00
%Docstring
2017-12-15 10:36:55 -04:00
Register name of layer for feature
2017-12-15 21:36:08 -04:00
2017-12-15 10:36:55 -04:00
:param layerId: id of layer
:param fid: id of feature
:param layer: dxf layer of feature
2017-06-06 15:50:31 +02:00
%End
2016-04-13 20:41:32 +02:00
2014-01-27 09:22:24 +01:00
};
2017-06-06 15:50:31 +02:00
QFlags<QgsDxfExport::Flag> operator|(QgsDxfExport::Flag f1, QFlags<QgsDxfExport::Flag> f2);
2017-06-06 15:50:31 +02:00
/************************************************************************
* This file has been generated automatically from *
* *
* src/core/dxf/qgsdxfexport.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
************************************************************************/