Skip to content

Commit

Permalink
New command line options --help, --version
Browse files Browse the repository at this point in the history
Also update version to 0.1 in preparation for first release.
  • Loading branch information
c42f committed Apr 11, 2013
1 parent 3b49c92 commit 365e69c
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 3 deletions.
1 change: 1 addition & 0 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ Various things which would be nice to do, in no particular order
* Threaded rendering for better responsiveness
* Autotune simplification quality based on total points
* Approximate ambient occlusion (?)
* Fix GLSL deprecation warnings for builtin variables

* GUI

Expand Down
1 change: 1 addition & 0 deletions config.h.in.cmake
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
#define DISPLAZ_VERSION_STRING "0.1"
#define DISPLAZ_SHADER_BASE_PATH "@DISPLAZ_SHADER_BASE_PATH@"
20 changes: 18 additions & 2 deletions main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
#include <QtOpenGL/QGLFormat>

#include "argparse.h"
#include "config.h"


QStringList g_initialFileNames;
Expand All @@ -51,13 +52,17 @@ int main(int argc, char *argv[])
QApplication app(argc, argv);

ArgParse::ArgParse ap;
bool printVersion = false;
bool printHelp = false;
int maxPointCount = 200000000;

ap.options(
"displaz - view a LAS point cloud\n"
"Usage: displaz [opts] file1.las [file2.las ...]",
"Usage: displaz [opts] [file1.las ...]",
"%*", storeFileName, "",
"-maxpoints %d", &maxPointCount, "Maximum number of points to load at a time",
"--maxpoints %d", &maxPointCount, "Maximum number of points to load at a time",
"--version", &printVersion, "Print version number",
"--help", &printHelp, "Print command line usage help",
NULL
);

Expand All @@ -68,6 +73,17 @@ int main(int argc, char *argv[])
return EXIT_FAILURE;
}

if (printVersion)
{
std::cout << "version " DISPLAZ_VERSION_STRING "\n";
return EXIT_SUCCESS;
}
if (printHelp)
{
ap.usage();
return EXIT_SUCCESS;
}

// Turn on multisampled antialiasing - this makes rendered point clouds
// look much nicer.
QGLFormat f = QGLFormat::defaultFormat();
Expand Down
5 changes: 4 additions & 1 deletion mainwindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -316,7 +316,10 @@ void PointViewerMainWindow::helpDialog()

void PointViewerMainWindow::aboutDialog()
{
QString message = tr("Displaz - a qt-based las viewer\nversion 0.0.1");
QString message = tr(
"<p><b>Displaz</b> - a LiDAR viewer for geographic data</p>"
"<p>version " DISPLAZ_VERSION_STRING "</p>"
);
QMessageBox::information(this, tr("About displaz"), message);
}

Expand Down

0 comments on commit 365e69c

Please sign in to comment.