QGIS API Documentation
4.3.0-Master (52aa6503bed)
Toggle main menu visibility
Loading...
Searching...
No Matches
src
core
stac
qgsstacobject.h
Go to the documentation of this file.
1
/***************************************************************************
2
qgsstacobject.h
3
---------------------
4
begin : August 2024
5
copyright : (C) 2024 by Stefanos Natsis
6
email : uclaros at gmail dot com
7
***************************************************************************
8
* *
9
* This program is free software; you can redistribute it and/or modify *
10
* it under the terms of the GNU General Public License as published by *
11
* the Free Software Foundation; either version 2 of the License, or *
12
* (at your option) any later version. *
13
* *
14
***************************************************************************/
15
16
#ifndef QGSSTACOBJECT_H
17
#define QGSSTACOBJECT_H
18
19
#include "
qgis.h
"
20
#include "qgis_core.h"
21
#include "
qgsstaclink.h
"
22
23
#include <QObject>
24
#include <QString>
25
#include <QStringList>
26
33
class
CORE_EXPORT
QgsStacObject
34
{
35
//SIP_TYPEHEADER_INCLUDE( "qgsstacitem.h" );
36
//SIP_TYPEHEADER_INCLUDE( "qgsstaccollection.h" );
37
//SIP_TYPEHEADER_INCLUDE( "qgsstaccatalog.h" );
38
39
#ifdef SIP_RUN
40
SIP_CONVERT_TO_SUBCLASS_CODE
41
if
(
QgsStacItem
*item =
dynamic_cast<
QgsStacItem
*
>
( sipCpp ) )
42
{
43
sipType = sipType_QgsStacItem;
44
}
45
else
if
(
QgsStacCollection
*item =
dynamic_cast<
QgsStacCollection
*
>
( sipCpp ) )
46
{
47
sipType = sipType_QgsStacCollection;
48
}
49
else
if
(
QgsStacCatalog
*item =
dynamic_cast<
QgsStacCatalog
*
>
( sipCpp ) )
50
{
51
sipType = sipType_QgsStacCatalog;
52
}
53
else
54
{
55
sipType = NULL;
56
}
57
SIP_END
58
#endif
59
60
public
:
61
63
QgsStacObject
() =
delete
;
64
66
QgsStacObject
(
const
QString &
id
,
const
QString &version,
const
QVector< QgsStacLink > &
links
);
67
69
virtual
~QgsStacObject
() =
default
;
70
72
virtual
Qgis::StacObjectType
type
()
const
= 0;
73
75
virtual
QString
toHtml
()
const
= 0;
76
78
QString
stacVersion
()
const
;
79
81
void
setStacVersion
(
const
QString &
stacVersion
);
82
84
QStringList
stacExtensions
()
const
;
85
87
void
setStacExtensions
(
const
QStringList &
stacExtensions
);
88
90
QString
id
()
const
;
91
93
void
setId
(
const
QString &
id
);
94
96
QVector< QgsStacLink >
links
()
const
;
97
99
void
setLinks
(
const
QVector< QgsStacLink > &
links
);
100
102
QString
url
()
const
;
103
105
QString
rootUrl
()
const
;
106
108
QString
parentUrl
()
const
;
109
110
111
protected
:
112
Qgis::StacObjectType
mType
=
Qgis::StacObjectType::Unknown
;
113
QString
mId
;
114
QString
mStacVersion
;
115
QStringList
mStacExtensions
;
116
QVector< QgsStacLink >
mLinks
;
117
};
118
119
// we'll store STAC object pointers in QVariants in item models
120
Q_DECLARE_METATYPE
(
QgsStacObject
* )
121
122
#endif
// QGSSTACOBJECT_H
Qgis::StacObjectType
StacObjectType
Available types of stac objects.
Definition
qgis.h:7007
Qgis::StacObjectType::Unknown
@ Unknown
Type is not known.
Definition
qgis.h:7008
QgsStacCatalog
Stores data associated with a STAC Catalog.
Definition
qgsstaccatalog.h:33
QgsStacCollection
Stores data associated with a STAC Collection.
Definition
qgsstaccollection.h:33
QgsStacItem
Stores data associated with a STAC Item.
Definition
qgsstacitem.h:35
QgsStacObject
Abstract base class for storing STAC objects.
Definition
qgsstacobject.h:34
QgsStacObject::stacVersion
QString stacVersion() const
Returns the STAC version the object implements.
Definition
qgsstacobject.cpp:28
QgsStacObject::id
QString id() const
Id of the STAC object.
Definition
qgsstacobject.cpp:48
QgsStacObject::mId
QString mId
Definition
qgsstacobject.h:113
QgsStacObject::stacExtensions
QStringList stacExtensions() const
Returns the list of extensions the STAC object implements.
Definition
qgsstacobject.cpp:38
QgsStacObject::parentUrl
QString parentUrl() const
Returns the url stored in the object's "parent" link.
Definition
qgsstacobject.cpp:88
QgsStacObject::rootUrl
QString rootUrl() const
Returns the url stored in the object's "root" link.
Definition
qgsstacobject.cpp:78
QgsStacObject::toHtml
virtual QString toHtml() const =0
Returns an HTML representation of the STAC object.
QgsStacObject::setStacExtensions
void setStacExtensions(const QStringList &stacExtensions)
Sets the list of stacExtensions the object implements.
Definition
qgsstacobject.cpp:43
QgsStacObject::mLinks
QVector< QgsStacLink > mLinks
Definition
qgsstacobject.h:116
QgsStacObject::QgsStacObject
QgsStacObject()=delete
Default constructor is used for creating invalid objects.
QgsStacObject::setId
void setId(const QString &id)
Sets the id for the STAC object.
Definition
qgsstacobject.cpp:53
QgsStacObject::setStacVersion
void setStacVersion(const QString &stacVersion)
Sets the STAC version the object implements.
Definition
qgsstacobject.cpp:33
QgsStacObject::setLinks
void setLinks(const QVector< QgsStacLink > &links)
Sets the STAC links included in the object.
Definition
qgsstacobject.cpp:63
QgsStacObject::~QgsStacObject
virtual ~QgsStacObject()=default
Destructor.
QgsStacObject::mType
Qgis::StacObjectType mType
Definition
qgsstacobject.h:112
QgsStacObject::url
QString url() const
Returns the url stored in the object's "self" link.
Definition
qgsstacobject.cpp:68
QgsStacObject::mStacExtensions
QStringList mStacExtensions
Definition
qgsstacobject.h:115
QgsStacObject::mStacVersion
QString mStacVersion
Definition
qgsstacobject.h:114
QgsStacObject::type
virtual Qgis::StacObjectType type() const =0
Returns the Type of the STAC object.
QgsStacObject::links
QVector< QgsStacLink > links() const
Returns the STAC links included in the object.
Definition
qgsstacobject.cpp:58
qgis.h
SIP_CONVERT_TO_SUBCLASS_CODE
#define SIP_CONVERT_TO_SUBCLASS_CODE(code)
Definition
qgis_sip.h:203
SIP_END
#define SIP_END
Definition
qgis_sip.h:220
Q_DECLARE_METATYPE
Q_DECLARE_METATYPE(QgsDatabaseQueryLogEntry)
qgsstaclink.h
Generated on
for QGIS API Documentation by
1.17.0