6#include "GeoDataBuilding.h"
7#include "GeoDataBuilding_p.h"
8#include "GeoDataTypes.h"
12GeoDataBuilding::GeoDataBuilding()
13 : GeoDataGeometry(new GeoDataBuildingPrivate),
14 d(new GeoDataBuildingPrivate)
18GeoDataBuilding::GeoDataBuilding(
const GeoDataGeometry &other)
19 : GeoDataGeometry(other),
20 d(new GeoDataBuildingPrivate)
24GeoDataBuilding::GeoDataBuilding(
const GeoDataBuilding &other)
25 : GeoDataGeometry(other),
26 d(new GeoDataBuildingPrivate(*other.d))
30GeoDataBuilding::~GeoDataBuilding()
37 GeoDataGeometry::operator=(other);
42const char *GeoDataBuilding::nodeType()
const
44 return GeoDataTypes::GeoDataBuildingType;
47EnumGeometryId GeoDataBuilding::geometryId()
const
49 return GeoDataBuildingId;
52GeoDataGeometry *GeoDataBuilding::copy()
const
54 return new GeoDataBuilding(*
this);
57double GeoDataBuilding::height()
const
62void GeoDataBuilding::setHeight(
double height)
67int GeoDataBuilding::minLevel()
const
72void GeoDataBuilding::setMinLevel(
int minLevel)
74 d->m_minLevel = minLevel;
77int GeoDataBuilding::maxLevel()
const
82void GeoDataBuilding::setMaxLevel(
int maxLevel)
84 d->m_maxLevel = maxLevel;
89 return d->m_nonExistentLevels;
92void GeoDataBuilding::setNonExistentLevels(
const QVector<int> &nonExistentLevels)
94 d->m_nonExistentLevels = nonExistentLevels;
99 return &d->m_multiGeometry;
105 Q_ASSERT(d->m_multiGeometry.size() == 1);
114void GeoDataBuilding::setName(
const QString& name)
126 d->m_entries = entries;
129double GeoDataBuilding::parseBuildingHeight(
const QString& buildingHeight)
135 double extractedHeight = buildingHeight.
toDouble(&converted);
137 return extractedHeight;
146 .
remove(QStringLiteral(
"meter")).
remove(QStringLiteral(
"metres"))
149 double extractedHeight = heightValue.
toDouble(&extracted);
151 height = extractedHeight;
154 double extractedHeight = 0.0;
156 double heightInches = 0.0;
159 double feet = feetInches[0].trimmed().toDouble(&okFeet);
161 heightInches = feet * FT2IN;
163 if (!feetInches[1].isEmpty()) {
167 heightInches += inches;
170 extractedHeight = heightInches;
175 extractedHeight = feet * FT2IN;
178 if (extractedHeight > 0.0) {
179 height = extractedHeight * IN2M;
Contains important information about a building and its floors (levels)
A class that defines a 3D bounding box for geographic data.
A class that can contain other GeoDataGeometry objects.
Binds a QML item to a specific geodetic location in screen coordinates.
bool contains(QChar ch, Qt::CaseSensitivity cs) const const
bool endsWith(QChar c, Qt::CaseSensitivity cs) const const
QString & remove(QChar ch, Qt::CaseSensitivity cs)
QStringList split(QChar sep, Qt::SplitBehavior behavior, Qt::CaseSensitivity cs) const const
double toDouble(bool *ok) const const
QString trimmed() const const