mirror of
https://github.com/qgis/QGIS.git
synced 2025-03-12 00:02:25 -04:00
Add DXF server export params NO_MTEXT and FORCE_2D
This commit is contained in:
parent
23fb486965
commit
d10ec078d1
@ -1480,6 +1480,32 @@ namespace QgsWms
|
||||
return filters;
|
||||
}
|
||||
|
||||
bool QgsWmsParameters::force2D() const
|
||||
{
|
||||
bool force2D = false;
|
||||
const QMap<DxfFormatOption, QString> options = dxfFormatOptions();
|
||||
|
||||
if ( options.contains( DxfFormatOption::FORCE_2D ) )
|
||||
{
|
||||
force2D = QVariant( options[ DxfFormatOption::FORCE_2D ] ).toBool();
|
||||
}
|
||||
|
||||
return force2D;
|
||||
}
|
||||
|
||||
bool QgsWmsParameters::noMText() const
|
||||
{
|
||||
bool noMText = false;
|
||||
const QMap<DxfFormatOption, QString> options = dxfFormatOptions();
|
||||
|
||||
if ( options.contains( DxfFormatOption::NO_MTEXT ) )
|
||||
{
|
||||
noMText = QVariant( options[ DxfFormatOption::NO_MTEXT ] ).toBool();
|
||||
}
|
||||
|
||||
return noMText;
|
||||
}
|
||||
|
||||
QList<QgsWmsParametersLayer> QgsWmsParameters::layersParameters() const
|
||||
{
|
||||
const QStringList layers = allLayersNickname();
|
||||
|
@ -349,7 +349,9 @@ namespace QgsWms
|
||||
MODE,
|
||||
LAYERATTRIBUTES,
|
||||
USE_TITLE_AS_LAYERNAME,
|
||||
CODEC
|
||||
CODEC,
|
||||
NO_MTEXT,
|
||||
FORCE_2D
|
||||
};
|
||||
Q_ENUM( DxfFormatOption )
|
||||
|
||||
@ -1309,6 +1311,22 @@ namespace QgsWms
|
||||
*/
|
||||
QMap<QString, QString> dimensionValues() const;
|
||||
|
||||
/**
|
||||
* \returns true if the FORCE_MTEXT parameter is set and the DXF should
|
||||
* be produced with MTEXT instead of TEXT.
|
||||
*
|
||||
* \since QGIS 3.12
|
||||
*/
|
||||
bool noMText() const;
|
||||
|
||||
/**
|
||||
* \returns true if the FORCE_2D parameter is set and the DXF should
|
||||
* be produced in 2D.
|
||||
*
|
||||
* \since QGIS 3.12
|
||||
*/
|
||||
bool force2D() const;
|
||||
|
||||
private:
|
||||
static bool isExternalLayer( const QString &name );
|
||||
|
||||
@ -1325,6 +1343,7 @@ namespace QgsWms
|
||||
|
||||
QMultiMap<QString, QgsWmsParametersFilter> layerFilters( const QStringList &layers ) const;
|
||||
|
||||
|
||||
QMap<QgsWmsParameter::Name, QgsWmsParameter> mWmsParameters;
|
||||
QMap<QString, QMap<QString, QString> > mExternalWMSParameters;
|
||||
QList<QgsProjectVersion> mVersions;
|
||||
|
@ -848,6 +848,13 @@ namespace QgsWms
|
||||
dxf->setSymbologyScale( mWmsParameters.dxfScale() );
|
||||
}
|
||||
|
||||
dxf->setForce2d( mWmsParameters.force2D() );
|
||||
QgsDxfExport::Flags flags;
|
||||
if ( mWmsParameters.noMText() )
|
||||
flags.setFlag( QgsDxfExport::Flag::FlagNoMText );
|
||||
|
||||
dxf->setFlags( flags );
|
||||
|
||||
return dxf;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user