QGIS API Documentation 4.3.0-Master (2b7e6c9893e)
Loading...
Searching...
No Matches
qgsvectorfieldtracessettings.cpp
Go to the documentation of this file.
1/***************************************************************************
2 qgsvectorfieldtracessettings.cpp
3 ---------------------
4 begin : September 2026
5 copyright : (C) 2026 by Stefanos Natsis
6 email : uclaros at gmail dot com
7 ***************************************************************************
8 * *
9 * This program is free software; you can redistribute it and/or modify *
10 * it under the terms of the GNU General Public License as published by *
11 * the Free Software Foundation; either version 2 of the License, or *
12 * (at your option) any later version. *
13 * *
14 ***************************************************************************/
15
17
18#include <QString>
19
20using namespace Qt::StringLiterals;
21
22void QgsVectorFieldTracesSettings::readXml( const QDomElement &elem )
23{
24 mMaximumTailLength = elem.attribute( u"maximum-tail-length"_s ).toInt();
25 mMaximumTailLengthUnit = static_cast<Qgis::RenderUnit>( elem.attribute( u"maximum-tail-length-unit"_s ).toInt() );
26 mParticlesCount = elem.attribute( u"particles-count"_s ).toInt();
27}
28
29QDomElement QgsVectorFieldTracesSettings::writeXml( QDomDocument &doc ) const
30{
31 QDomElement elem = doc.createElement( u"vector-traces-settings"_s );
32 elem.setAttribute( u"maximum-tail-length"_s, mMaximumTailLength );
33 elem.setAttribute( u"maximum-tail-length-unit"_s, static_cast< int >( mMaximumTailLengthUnit ) );
34 elem.setAttribute( u"particles-count"_s, mParticlesCount );
35
36 return elem;
37}
38
40{
41 return mMaximumTailLengthUnit;
42}
43
48
50{
51 return mMaximumTailLength;
52}
53
58
60{
61 return mParticlesCount;
62}
63
65{
66 mParticlesCount = value;
67}
RenderUnit
Rendering size units.
Definition qgis.h:5704
Qgis::RenderUnit maximumTailLengthUnit() const
Returns the maximum tail length unit.
int particlesCount() const
Returns particles count.
QDomElement writeXml(QDomDocument &doc) const
Writes configuration to a new DOM element.
void readXml(const QDomElement &elem)
Reads configuration from the given DOM element.
void setMaximumTailLengthUnit(Qgis::RenderUnit maximumTailLengthUnit)
Sets the maximum tail length unit.
double maximumTailLength() const
Returns the maximum tail length.
void setParticlesCount(int value)
Sets particles count.
void setMaximumTailLength(double maximumTailLength)
Sets the maximums tail length.