QGIS API Documentation 3.99.0-Master (a8882ad4560)
Loading...
Searching...
No Matches
qgsmagneticmodel.h
Go to the documentation of this file.
1/***************************************************************************
2 qgsmagneticmodel.h
3 ---------------------------
4 begin : December 2025
5 copyright : (C) 2025 by Nyall Dawson
6 email : nyall dot dawson at gmail dot com
7 ***************************************************************************/
8
9/***************************************************************************
10 * *
11 * This program is free software; you can redistribute it and/or modify *
12 * it under the terms of the GNU General Public License as published by *
13 * the Free Software Foundation; either version 2 of the License, or *
14 * (at your option) any later version. *
15 * *
16 ***************************************************************************/
17
18#ifndef QGSMAGNETICMODEL_H
19#define QGSMAGNETICMODEL_H
20
21#include "qgsconfig.h"
22
23#include "qgis.h"
24#include "qgis_core.h"
25#include "qgis_sip.h"
26
27#ifndef SIP_RUN
28#ifdef WITH_GEOGRAPHICLIB
29namespace GeographicLib
30{
31 class MagneticModel;
32}
33#endif
34#endif
35
50class CORE_EXPORT QgsMagneticModel
51{
52 public:
53
60
67
86 QgsMagneticModel( const QString &name, const QString &path = QString(), int maxDegree = -1, int maxOrder = -1 );
88
89 QgsMagneticModel( const QgsMagneticModel &other ) = delete;
90 QgsMagneticModel &operator=( const QgsMagneticModel &other ) = delete;
91
100
107
113 QDateTime dateTime() const SIP_THROW( QgsNotSupportedException );
114
120 QString file() const SIP_THROW( QgsNotSupportedException );
121
128
134 QString name() const SIP_THROW( QgsNotSupportedException );
135
139 QString error() const { return mError; }
140
147 double minimumHeight() const SIP_THROW( QgsNotSupportedException );
148
155 double maximumHeight() const SIP_THROW( QgsNotSupportedException );
156
163 double minimumYear() const SIP_THROW( QgsNotSupportedException );
164
171 double maximumYear() const SIP_THROW( QgsNotSupportedException );
172
179 int degree() const SIP_THROW( QgsNotSupportedException );
180
187 int order() const SIP_THROW( QgsNotSupportedException );
188
207 bool declination( double years, double latitude, double longitude, double height, double &declination SIP_OUT ) const SIP_THROW( QgsNotSupportedException );
208
227 bool inclination( double years, double latitude, double longitude, double height, double &inclination SIP_OUT ) const SIP_THROW( QgsNotSupportedException );
228
248 bool getComponents( double years, double latitude, double longitude, double height, double &Bx SIP_OUT, double &By SIP_OUT, double &Bz SIP_OUT ) const SIP_THROW( QgsNotSupportedException );
249
272 bool getComponentsWithTimeDerivatives( double years, double latitude, double longitude, double height, double &Bx SIP_OUT, double &By SIP_OUT, double &Bz SIP_OUT, double &Bxt SIP_OUT, double &Byt SIP_OUT, double &Bzt SIP_OUT ) const SIP_THROW( QgsNotSupportedException );
273
291 static bool fieldComponents( double Bx, double By, double Bz, double &H SIP_OUT, double &F SIP_OUT, double &D SIP_OUT, double &I SIP_OUT ) SIP_THROW( QgsNotSupportedException );
292
317 static bool fieldComponentsWithTimeDerivatives( double Bx, double By, double Bz, double Bxt, double Byt, double Bzt, double &H SIP_OUT, double &F SIP_OUT, double &D SIP_OUT, double &I SIP_OUT, double &Ht SIP_OUT, double &Ft SIP_OUT, double &Dt SIP_OUT, double &It SIP_OUT ) SIP_THROW( QgsNotSupportedException );
318
319 private:
320
321#ifdef SIP_RUN
322 QgsMagneticModel( const QgsMagneticModel &other );
323#endif
324
325 QString mName;
326 QString mPath;
327
328#ifdef WITH_GEOGRAPHICLIB
329 std::unique_ptr< GeographicLib::MagneticModel > mModel;
330#endif
331 QString mError;
332
333};
334
335#endif // QGSMAGNETICMODEL_H
Represents a model of the Earth's magnetic field.
static QString defaultFilePath()
Returns the default path used by GeographicLib to search for magnetic models.
QString error() const
Returns a string for the last error encountered by the model.
QString description() const
Returns the description of the magnetic model, if available.
QString file() const
Returns the full file name for the magnetic model.
bool isValid() const
Returns true if the model is valid and can be used.
QString name() const
Returns the name of the magnetic model.
QString directory() const
Returns the full directory name containing the magnetic model file.
QgsMagneticModel & operator=(const QgsMagneticModel &other)=delete
QgsMagneticModel(const QgsMagneticModel &other)=delete
QDateTime dateTime() const
Returns the date of the magnetic model, if available.
static QString defaultModelName()
Returns the name of the default magnetic model used by GeographicLib.
QgsMagneticModel(const QString &name, const QString &path=QString(), int maxDegree=-1, int maxOrder=-1)
Constructor for QgsMagneticModel.
Custom exception class which is raised when an operation is not supported.
#define SIP_OUT
Definition qgis_sip.h:58
#define SIP_THROW(name,...)
Definition qgis_sip.h:211