QGIS API Documentation 4.1.0-Master (60fea48833c)
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:
59
66
85 QgsMagneticModel( const QString &name, const QString &path = QString(), int maxDegree = -1, int maxOrder = -1 );
87
88 QgsMagneticModel( const QgsMagneticModel &other ) = delete;
89 QgsMagneticModel &operator=( const QgsMagneticModel &other ) = delete;
90
99
106
112 QDateTime dateTime() const SIP_THROW( QgsNotSupportedException );
113
119 QString file() const SIP_THROW( QgsNotSupportedException );
120
127
133 QString name() const SIP_THROW( QgsNotSupportedException );
134
138 QString error() const { return mError; }
139
146 double minimumHeight() const SIP_THROW( QgsNotSupportedException );
147
154 double maximumHeight() const SIP_THROW( QgsNotSupportedException );
155
162 double minimumYear() const SIP_THROW( QgsNotSupportedException );
163
170 double maximumYear() const SIP_THROW( QgsNotSupportedException );
171
178 int degree() const SIP_THROW( QgsNotSupportedException );
179
186 int order() const SIP_THROW( QgsNotSupportedException );
187
206 bool declination( double years, double latitude, double longitude, double height, double &declination SIP_OUT ) const SIP_THROW( QgsNotSupportedException );
207
226 bool inclination( double years, double latitude, double longitude, double height, double &inclination SIP_OUT ) const SIP_THROW( QgsNotSupportedException );
227
247 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 );
248
271 bool getComponentsWithTimeDerivatives(
272 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
274
292 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 );
293
318 static bool fieldComponentsWithTimeDerivatives(
319 double Bx,
320 double By,
321 double Bz,
322 double Bxt,
323 double Byt,
324 double Bzt,
325 double &H SIP_OUT,
326 double &F SIP_OUT,
327 double &D SIP_OUT,
328 double &I SIP_OUT,
329 double &Ht SIP_OUT,
330 double &Ft SIP_OUT,
331 double &Dt SIP_OUT,
332 double &It SIP_OUT
334
335 private:
336#ifdef SIP_RUN
337 QgsMagneticModel( const QgsMagneticModel &other );
338#endif
339
340 QString mName;
341 QString mPath;
342
343#ifdef WITH_GEOGRAPHICLIB
344 std::unique_ptr< GeographicLib::MagneticModel > mModel;
345#endif
346 QString mError;
347};
348
349#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:57
#define SIP_THROW(name,...)
Definition qgis_sip.h:210