QGIS API Documentation
4.3.0-Master (a080b0d5f12)
Toggle main menu visibility
Loading...
Searching...
No Matches
src
core
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
29
namespace
GeographicLib
30
{
31
class
MagneticModel;
32
}
33
#endif
34
#endif
35
50
class
CORE_EXPORT
QgsMagneticModel
51
{
52
public
:
58
static
QString
defaultFilePath
()
SIP_THROW
(
QgsNotSupportedException
);
59
65
static
QString
defaultModelName
()
SIP_THROW
(
QgsNotSupportedException
);
66
85
QgsMagneticModel
(
const
QString &
name
,
const
QString &path = QString(),
int
maxDegree = -1,
int
maxOrder = -1 );
86
~QgsMagneticModel
();
87
88
QgsMagneticModel
(
const
QgsMagneticModel
&other ) =
delete
;
89
QgsMagneticModel
&
operator=
(
const
QgsMagneticModel
&other ) =
delete
;
90
98
bool
isValid
() const
SIP_THROW
(
QgsNotSupportedException
);
99
105
QString
description
() const
SIP_THROW
(
QgsNotSupportedException
);
106
112
QDateTime
dateTime
() const
SIP_THROW
(
QgsNotSupportedException
);
113
119
QString
file
() const
SIP_THROW
(
QgsNotSupportedException
);
120
126
QString
directory
() const
SIP_THROW
(
QgsNotSupportedException
);
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
273
) const
SIP_THROW
(
QgsNotSupportedException
);
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
333
)
SIP_THROW
(
QgsNotSupportedException
);
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
QgsMagneticModel
Represents a model of the Earth's magnetic field.
Definition
qgsmagneticmodel.h:51
QgsMagneticModel::defaultFilePath
static QString defaultFilePath()
Returns the default path used by GeographicLib to search for magnetic models.
Definition
qgsmagneticmodel.cpp:30
QgsMagneticModel::error
QString error() const
Returns a string for the last error encountered by the model.
Definition
qgsmagneticmodel.h:138
QgsMagneticModel::~QgsMagneticModel
~QgsMagneticModel()
QgsMagneticModel::description
QString description() const
Returns the description of the magnetic model, if available.
Definition
qgsmagneticmodel.cpp:82
QgsMagneticModel::file
QString file() const
Returns the full file name for the magnetic model.
Definition
qgsmagneticmodel.cpp:111
QgsMagneticModel::isValid
bool isValid() const
Returns true if the model is valid and can be used.
Definition
qgsmagneticmodel.cpp:73
QgsMagneticModel::name
QString name() const
Returns the name of the magnetic model.
Definition
qgsmagneticmodel.cpp:129
QgsMagneticModel::directory
QString directory() const
Returns the full directory name containing the magnetic model file.
Definition
qgsmagneticmodel.cpp:120
QgsMagneticModel::operator=
QgsMagneticModel & operator=(const QgsMagneticModel &other)=delete
QgsMagneticModel::QgsMagneticModel
QgsMagneticModel(const QgsMagneticModel &other)=delete
QgsMagneticModel::dateTime
QDateTime dateTime() const
Returns the date of the magnetic model, if available.
Definition
qgsmagneticmodel.cpp:95
QgsMagneticModel::defaultModelName
static QString defaultModelName()
Returns the name of the default magnetic model used by GeographicLib.
Definition
qgsmagneticmodel.cpp:39
QgsMagneticModel::QgsMagneticModel
QgsMagneticModel(const QString &name, const QString &path=QString(), int maxDegree=-1, int maxOrder=-1)
Constructor for QgsMagneticModel.
Definition
qgsmagneticmodel.cpp:48
QgsNotSupportedException
Custom exception class which is raised when an operation is not supported.
Definition
qgsexception.h:111
qgis.h
qgis_sip.h
SIP_OUT
#define SIP_OUT
Definition
qgis_sip.h:57
SIP_THROW
#define SIP_THROW(name,...)
Definition
qgis_sip.h:215
Generated on
for QGIS API Documentation by
1.17.0