Files
qt5-legatus-legacy/Lts/Viewer/SituationMap/Tests/RdeExample_Viewshed/main.cpp
T
2026-08-13 18:33:10 +02:00

93 lines
2.2 KiB
C++
Executable File

/**
* @RDE_HEADER@
* Declaration/Definition
* $Id$
* $HeadURL$
* $Author$
*/
#include "Viewshed.h"
#include <NGLLogger/NGLLoggerBootstrap.h>
// Esri
#include <arcgis/ArcGISRuntime.h>
#include <arcgis/ProxySetup.h>
// Qt
#include <QApplication>
#include <QPushButton>
#include <QDialog>
#include <QGridLayout>
int main (int argc, char* argv[])
{
QApplication app ( argc, argv );
#ifdef Q_OS_WIN
QCoreApplication::setAttribute(Qt::AA_UseOpenGLES);
#endif
#define USEPROXY
#ifdef USEPROXY
EsriRuntimeQt::ProxySetup::setupProxy("192.168.133.178" // proxy @ mike
, 8080
, QNetworkProxy::HttpProxy);
#endif
#define DO_LIC
#ifdef DO_LIC
// ESRI-Account:
QLatin1String clientId("8UJNp7vsRWT4l9lc"); // 8UJNp7vsRWT4l9lc -> taken from ESRI-Account
EsriRuntimeQt::ArcGISRuntime::setClientId(clientId);
#define OLD_LICENSE
#ifdef OLD_LICENSE
//alter methode (langer String):
QLatin1String licenseCode("runtimestandard,101,rud077222135,none,FAYRMD1AJ42HXH46C167");
#else
// Neue Methode (kurzer String)
QLatin1String licenseCode("RUD077222135"); // RUD077222135 -> taken from mail "ESRI order 2874794"
#endif
EsriRuntimeQt::LicenseStatus status =
EsriRuntimeQt::ArcGISRuntime::License::setLicense(licenseCode);
qDebug() << LOGFUNCTION
<< " clientId='" << clientId << "'"
<< " licenseCode='" << licenseCode << "'"
<< " LicenseStatus=" << static_cast<int>(status)
<< " (LicenseStatusVALID=" << static_cast<int>(EsriRuntimeQt::LicenseStatus::Valid) << ")"
;
// Use this code to check for licensing errors
if (EsriRuntimeQt::ArcGISRuntime::initialize() == false)
{
// QMessageBox msgBox;
// msgBox.setText(EsriRuntimeQt::ArcGISRuntime::error());
// msgBox.exec();
// app.quit();
return 1;
}
#endif // DO_LIC
// Init the logger
NGL::NGLLoggerBootstrap::createNGLRootLogger("log4cxxSituationMapUnitTest.props", true);
mainwindow applicationWindow;
applicationWindow.setMinimumWidth(800);
applicationWindow.setMinimumHeight(600);
applicationWindow.show();
return app.exec();
}