mirror of
https://github.com/qgis/QGIS.git
synced 2025-02-24 00:47:57 -05:00
55 lines
1.4 KiB
C++
55 lines
1.4 KiB
C++
|
#ifndef _WIN32
|
||
|
#include <unistd.h>
|
||
|
#endif
|
||
|
|
||
|
#include <iostream>
|
||
|
|
||
|
#include "QgisUntwine.hpp"
|
||
|
|
||
|
int main()
|
||
|
{
|
||
|
untwine::QgisUntwine::StringList files;
|
||
|
untwine::QgisUntwine::Options options;
|
||
|
// std::string exe = "C:\\Users\\andre\\untwine\\build\\untwine.exe";
|
||
|
std::string exe = "/Users/acbell/untwine/build/untwine";
|
||
|
|
||
|
untwine::QgisUntwine api(exe);
|
||
|
|
||
|
// files.push_back("C:\\Users\\andre\\nyc2");
|
||
|
// files.push_back("C:\\Users\\andre\\nyc2\\18TXL075075.las.laz");
|
||
|
// files.push_back("/Users/acbell/nyc/18TXL075075.las.laz");
|
||
|
// files.push_back("/Users/acbell/nyc/18TXL075090.las.laz");
|
||
|
files.push_back("/Users/acbell/nyc2");
|
||
|
|
||
|
options.push_back({"dims", "X, Y, Z, Red, Green, Blue, Intensity"});
|
||
|
// book ok = api.start(files, ".\\out", options);
|
||
|
bool ok = api.start(files, "./out", options);
|
||
|
if (! ok)
|
||
|
{
|
||
|
std::cerr << "Couldn't start '" << exe << "!\n";
|
||
|
exit(-1);
|
||
|
}
|
||
|
|
||
|
bool stopped = false;
|
||
|
while (true)
|
||
|
{
|
||
|
#ifdef _WIN32
|
||
|
Sleep(1000);
|
||
|
#else
|
||
|
::sleep(1);
|
||
|
#endif
|
||
|
int percent = api.progressPercent();
|
||
|
std::string s = api.progressMessage();
|
||
|
std::cerr << "Percent/Msg = " << percent << " / " << s << "!\n";
|
||
|
/**
|
||
|
if (!stopped && percent >= 50)
|
||
|
{
|
||
|
stopped = true;
|
||
|
api.stop();
|
||
|
}
|
||
|
**/
|
||
|
if (!api.running())
|
||
|
break;
|
||
|
}
|
||
|
}
|