Initial commit
This commit is contained in:
commit
b7d90b9afe
16245 files changed
+3396666
No files matched your search
+36
@@ -0,0 +1,36 @@
|
||||
/**
|
||||
* @RDE_HEADER@
|
||||
*
|
||||
* $Id$
|
||||
* $HeadURL$
|
||||
* $Author$
|
||||
* Created by Philipp Last, SLSY, 2017-09-22
|
||||
*/
|
||||
|
||||
#include "bdv_helper.h"
|
||||
|
||||
namespace BuildingViewer
|
||||
{
|
||||
QString gStrFeatureIdPrefix = QStringLiteral("House_");
|
||||
|
||||
/*
|
||||
* Converts a given building id (as used within the database) to the featureId
|
||||
* format which is internally used by the BuildingViewer
|
||||
*/
|
||||
QString databaseId2FeatureId(int32_t buildingDatabaseId)
|
||||
{
|
||||
if (buildingDatabaseId <= 0)
|
||||
return QString();
|
||||
return gStrFeatureIdPrefix + QString::number(buildingDatabaseId);
|
||||
}
|
||||
|
||||
|
||||
int32_t featureId2DatabaseId(const QString &strFeatureId)
|
||||
{
|
||||
if (!strFeatureId.startsWith(gStrFeatureIdPrefix))
|
||||
return -1;
|
||||
bool isOk = false;
|
||||
int32_t buildingDatabaseId = strFeatureId.midRef(gStrFeatureIdPrefix.size()).toInt(&isOk);
|
||||
return isOk ? buildingDatabaseId : -1;
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user