QGIS API Documentation
4.1.0-Master (60fea48833c)
Loading...
Searching...
No Matches
src
core
proj
qgscelestialbody.h
Go to the documentation of this file.
1
/***************************************************************************
2
qgscelestialbody.h
3
------------------------
4
begin : May 2021
5
copyright : (C) 2021 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
#ifndef QGSCELESTIALBODY_H
18
#define QGSCELESTIALBODY_H
19
20
#include "qgis_core.h"
21
#include "
qgis_sip.h
"
22
23
#include <QString>
24
25
using namespace
Qt::StringLiterals;
26
34
class
CORE_EXPORT
QgsCelestialBody
35
{
36
public
:
41
bool
isValid
()
const
{
return
mValid; }
42
46
QString
name
()
const
{
return
mName; }
47
51
QString
authority
()
const
{
return
mAuthority; }
52
53
#ifdef SIP_RUN
54
// clang-format off
55
SIP_PYOBJECT __repr__();
56
% MethodCode
57
QString str;
58
if
( !sipCpp->isValid() )
59
{
60
str = u
"<QgsCelestialBody: invalid>"
_s;
61
}
62
else
63
{
64
QString id;
65
if
( !sipCpp->authority().isEmpty() )
66
id
= u
"%1 (%2)"
_s.arg( sipCpp->name(), sipCpp->authority() );
67
else
68
id
= sipCpp->name();
69
str = u
"<QgsCelestialBody: %1>"
_s.arg(
id
);
70
}
71
sipRes = PyUnicode_FromString( str.toUtf8().constData() );
72
% End
73
// clang-format on
74
#endif
75
76
// clang-format off
77
private
:
78
// clang-format on
79
80
bool
mValid
81
=
false
;
82
QString mName;
83
QString mAuthority;
84
85
friend
class
QgsCoordinateReferenceSystemRegistry
;
86
};
87
88
#endif
// QGSCELESTIALBODY_H
QgsCelestialBody
Contains information about a celestial body.
Definition
qgscelestialbody.h:35
QgsCelestialBody::isValid
bool isValid() const
Returns true if the body is a valid object, or false if it is a null/invalid object.
Definition
qgscelestialbody.h:41
QgsCelestialBody::authority
QString authority() const
Authority name, e.g.
Definition
qgscelestialbody.h:51
QgsCelestialBody::QgsCoordinateReferenceSystemRegistry
friend class QgsCoordinateReferenceSystemRegistry
Definition
qgscelestialbody.h:85
QgsCelestialBody::name
QString name() const
Name of celestial body.
Definition
qgscelestialbody.h:46
qgis_sip.h
Generated on
for QGIS API Documentation by
1.15.0