summaryrefslogtreecommitdiff
path: root/meme/meme.c
diff options
context:
space:
mode:
authorWerner Almesberger <werner@almesberger.net>2015-03-13 06:53:53 (GMT)
committerWerner Almesberger <werner@almesberger.net>2015-03-13 06:53:53 (GMT)
commit55e2604f9cf7145d3aa4456658260ace68bc260c (patch)
treed69e89401dd64a247425821a53a975385bb8f81d /meme/meme.c
parent6a7b99db7751a7b7bceb2e79d7b11f68a2ad226a (diff)
downloadmisc-55e2604f9cf7145d3aa4456658260ace68bc260c.zip
misc-55e2604f9cf7145d3aa4456658260ace68bc260c.tar.gz
misc-55e2604f9cf7145d3aa4456658260ace68bc260c.tar.bz2
meme/: add overlays (option -o, key O); clean up log file implementation
Diffstat (limited to 'meme/meme.c')
-rw-r--r--meme/meme.c15
1 files changed, 12 insertions, 3 deletions
diff --git a/meme/meme.c b/meme/meme.c
index fcafdb9..411b7ca 100644
--- a/meme/meme.c
+++ b/meme/meme.c
@@ -18,6 +18,7 @@
#include "time.h"
#include "mesh.h"
#include "stl.h"
+#include "overlay.h"
extern void gui(const char *logfile);
@@ -44,7 +45,8 @@ static unsigned count_edges(void)
static void usage(const char *name)
{
- fprintf(stderr, "usage: %s [file.stl]\n", name);
+ fprintf(stderr, "usage: %s [-l logfile] [-o overlap.gp] [file.stl]\n",
+ name);
exit(1);
}
@@ -52,14 +54,18 @@ static void usage(const char *name)
int main(int argc, char **argv)
{
int c;
- const char *logfile = 0;
+ const char *logfile = NULL;
+ const char *overlay = NULL;
struct time t_load;
- while ((c = getopt(argc, argv, "l:")) != EOF)
+ while ((c = getopt(argc, argv, "l:o:")) != EOF)
switch (c) {
case 'l':
logfile = optarg;
break;
+ case 'o':
+ overlay = optarg;
+ break;
default:
usage(*argv);
}
@@ -82,6 +88,9 @@ int main(int argc, char **argv)
fprintf(stderr, "STL loaded in %.3f s\n", time_ms(&t_load)/1000.0);
fprintf(stderr, "%u edges\n", count_edges());
+ if (overlay)
+ overlay_load(overlay);
+
gui(logfile);
return 0;