File indexing completed on 2024-05-12 03:50:09

0001 // SPDX-License-Identifier: LGPL-2.1-or-later
0002 //
0003 // SPDX-FileCopyrightText: 2017 Mohammed Nafees <nafees.technocool@gmail.com>
0004 //
0005 
0006 #ifndef MARBLE_GEODATABUILDING_H
0007 #define MARBLE_GEODATABUILDING_H
0008 
0009 #include <QVector>
0010 
0011 #include "GeoDataGeometry.h"
0012 #include "GeoDataCoordinates.h"
0013 
0014 #include "geodata_export.h"
0015 
0016 namespace Marble {
0017 class GeoDataBuildingPrivate;
0018 
0019 /*!
0020     \class GeoDataBuilding
0021     \brief Contains important information about a building and its floors (levels)
0022 
0023     GeoDataBuilding holds information such as minimum floor, maximum floor,
0024     floor data and their respective MultiGeometry and other possible metadata such
0025     as the total height of the building, type etc.
0026  */
0027 
0028 class GEODATA_EXPORT GeoDataBuilding : public GeoDataGeometry
0029 {
0030 public:
0031     explicit GeoDataBuilding();
0032     explicit GeoDataBuilding(const GeoDataGeometry &other);
0033     explicit GeoDataBuilding(const GeoDataBuilding &other);
0034 
0035     struct NamedEntry {
0036         GeoDataCoordinates point;
0037         QString label;
0038     };
0039 
0040     GeoDataBuilding& operator=(const GeoDataBuilding &other);
0041 
0042     const char *nodeType() const override;
0043 
0044     EnumGeometryId geometryId() const override;
0045 
0046     GeoDataGeometry *copy() const override;
0047 
0048     static double parseBuildingHeight(const QString& buildingHeight);
0049 
0050     /*!
0051     Destroys the GeoDataBuilding
0052 */
0053     ~GeoDataBuilding() override;
0054 
0055 
0056 /*!
0057     @return the height of the building
0058 */
0059     double height() const;
0060 
0061 
0062 /*!
0063     Sets the height of the building
0064     @param height
0065  */
0066     void setHeight(double height);
0067 
0068 
0069 /*!
0070     @return the minimum level
0071  */
0072     int minLevel() const;
0073 
0074 
0075 /*!
0076     Sets the minimum level of the building
0077     @param minLevel
0078  */
0079     void setMinLevel(int minLevel);
0080 
0081 
0082 /*!
0083     @return the maximum level of the building
0084  */
0085     int maxLevel() const;
0086 
0087 
0088 /*!
0089     Sets the maximum level of the building
0090     @param maxLevel
0091  */
0092     void setMaxLevel(int maxLevel);
0093 
0094 
0095 /*!
0096     @return the non existent levels in the building
0097  */
0098     QVector<int> nonExistentLevels() const;
0099 
0100 
0101 /*!
0102     Sets the non existent levels of the building
0103     @param nonExistentLevels
0104  */
0105     void setNonExistentLevels(const QVector<int>& nonExistentLevels);
0106 
0107 
0108 /*!
0109     @return the multigeometry associated with the building
0110  */
0111     GeoDataMultiGeometry* multiGeometry() const;
0112 
0113 
0114 /*!
0115     @return the latlonaltbox for the contained multigeometry
0116  */
0117     const GeoDataLatLonAltBox& latLonAltBox() const override;
0118 
0119 
0120 /*!
0121     @return the name of the building
0122  */
0123     QString name() const;
0124 
0125 
0126 /*!
0127     Sets the name of the building
0128     @param name
0129  */
0130     void setName(const QString& name);
0131 
0132     QVector<NamedEntry> entries() const;
0133 
0134     void setEntries(const QVector<NamedEntry>& entries);
0135 
0136 private:
0137     GeoDataBuildingPrivate* const d;
0138 };
0139 
0140 }
0141 
0142 #endif