QGIS API Documentation 3.99.0-Master (2fe06baccd8)
Loading...
Searching...
No Matches
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
32class CORE_EXPORT QgsCelestialBody
33{
34 public:
35
40 bool isValid() const { return mValid; }
41
45 QString name() const { return mName; }
46
50 QString authority() const { return mAuthority; }
51
52#ifdef SIP_RUN
53 SIP_PYOBJECT __repr__();
54 % MethodCode
55 QString str;
56 if ( !sipCpp->isValid() )
57 {
58 str = QStringLiteral( "<QgsCelestialBody: invalid>" );
59 }
60 else
61 {
62 QString id;
63 if ( !sipCpp->authority().isEmpty() )
64 id = QStringLiteral( "%1 (%2)" ).arg( sipCpp->name(), sipCpp->authority() );
65 else
66 id = sipCpp->name();
67 str = QStringLiteral( "<QgsCelestialBody: %1>" ).arg( id );
68 }
69 sipRes = PyUnicode_FromString( str.toUtf8().constData() );
70 % End
71#endif
72
73 private:
74
75 bool mValid = false;
76 QString mName;
77 QString mAuthority;
78
80};
81
82#endif // QGSCELESTIALBODY_H
Contains information about a celestial body.
bool isValid() const
Returns true if the body is a valid object, or false if it is a null/invalid object.
QString authority() const
Authority name, e.g.
friend class QgsCoordinateReferenceSystemRegistry
QString name() const
Name of celestial body.