Revision: 44696
          http://brlcad.svn.sourceforge.net/brlcad/?rev=44696&view=rev
Author:   erikgreenwald
Date:     2011-05-26 11:39:38 +0000 (Thu, 26 May 2011)

Log Message:
-----------
Stub Niven's "ringworld" structure as a proc-db. It'd be an awesome stress test.

Modified Paths:
--------------
    brlcad/trunk/src/proc-db/CMakeLists.txt
    brlcad/trunk/src/proc-db/Makefile.am

Added Paths:
-----------
    brlcad/trunk/src/proc-db/ringworld.c

Modified: brlcad/trunk/src/proc-db/CMakeLists.txt
===================================================================
--- brlcad/trunk/src/proc-db/CMakeLists.txt     2011-05-25 19:53:59 UTC (rev 
44695)
+++ brlcad/trunk/src/proc-db/CMakeLists.txt     2011-05-26 11:39:38 UTC (rev 
44696)
@@ -31,6 +31,7 @@
 BRLCAD_ADDEXEC(pix2g pix2g.c libwdb)
 BRLCAD_ADDEXEC(pyramid pyramid.c libwdb)
 BRLCAD_ADDEXEC(rawbot rawbot.c libwdb)
+BRLCAD_ADDEXEC(ringworld ringworld.c libwdb)
 BRLCAD_ADDEXEC(room "room.c common.c" libwdb)
 BRLCAD_ADDEXEC(sketch sketch.c libwdb)
 BRLCAD_ADDEXEC(sphflake sphflake.c libwdb)

Modified: brlcad/trunk/src/proc-db/Makefile.am
===================================================================
--- brlcad/trunk/src/proc-db/Makefile.am        2011-05-25 19:53:59 UTC (rev 
44695)
+++ brlcad/trunk/src/proc-db/Makefile.am        2011-05-26 11:39:38 UTC (rev 
44696)
@@ -29,6 +29,7 @@
        pix2g \
        pyramid \
        rawbot \
+       ringworld \
        room \
        sketch \
        sphflake \
@@ -94,6 +95,7 @@
 pix2g_SOURCES = pix2g.c
 pyramid_SOURCES = pyramid.c
 rawbot_SOURCES = rawbot.c
+ringworld_SOURCES = ringworld.c
 room_SOURCES = room.c common.c
 sketch_SOURCES = sketch.c
 sphflake_SOURCES = sphflake.c
@@ -143,6 +145,7 @@
        $(pix2g_OBJECTS) \
        $(pyramid_OBJECTS) \
        $(rawbot_OBJECTS) \
+       $(ringworld_OBJECTS) \
        $(room_OBJECTS) \
        $(sketch_OBJECTS) \
        $(sphflake_OBJECTS) \

Added: brlcad/trunk/src/proc-db/ringworld.c
===================================================================
--- brlcad/trunk/src/proc-db/ringworld.c                                (rev 0)
+++ brlcad/trunk/src/proc-db/ringworld.c        2011-05-26 11:39:38 UTC (rev 
44696)
@@ -0,0 +1,88 @@
+/*                    R I N G W O R L D . C
+ * BRL-CAD
+ *
+ * Copyright (c) 2011-2011 United States Government as represented by
+ * the U.S. Army Research Laboratory.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public License
+ * version 2.1 as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this file; see the file named COPYING for more
+ * information.
+ */
+
+/** @file ringworld.c
+ *
+ * Generate a 'ringworld', as imagined by Larry Niven.
+ *
+ */
+
+#include "common.h"
+
+#include <stdlib.h>
+#include <stdio.h>
+#include <math.h>
+#include <string.h>
+#ifdef HAVE_UNISTD_H
+#  include <unistd.h>
+#endif
+
+#include "vmath.h"
+#include "raytrace.h"
+#include "rtgeom.h"
+#include "wdb.h"
+
+int
+main(int argc, char *argv[])
+{
+    static const char usage[] = "Usage:\n%s [-h] [-o outfile] \n\n  -h      
\tShow help\n  -o file \tFile to write out (default: ringworld.g)\n\n";
+
+    char outfile[MAXPATHLEN] = "ringworld.g";
+    int optc = 0;
+
+    while ((optc = bu_getopt(argc, argv, "Hho:n:")) != -1) {
+       switch (optc) {
+           case 'o':
+               snprintf(outfile, MAXPATHLEN, "%s", bu_optarg);;
+               break;
+           case 'h' :
+           case 'H' :
+           case '?' :
+               printf(usage, *argv);
+               return optc == '?' ? EXIT_FAILURE : EXIT_SUCCESS;
+       }
+    }
+
+    if (count <= 0) {
+       bu_exit(EXIT_FAILURE, "ERROR: count must be greater than zero");
+    }
+
+    if (bu_file_exists(outfile)) {
+       bu_exit(EXIT_FAILURE, "ERROR: %s already exists.  Remove file and try 
again.", outfile);
+    }
+
+    bu_log("Writing ringworld out to [%s]\n", outfile);
+
+    /* do things and stuff. */
+
+    bu_log("BRL-CAD geometry database file [%s] created.\nDone.\n", outfile);
+
+    return EXIT_SUCCESS;
+}
+
+/*
+ * Local Variables:
+ * mode: C
+ * tab-width: 8
+ * indent-tabs-mode: t
+ * c-file-style: "stroustrup"
+ * End:
+ * ex: shiftwidth=4 tabstop=8
+ */


Property changes on: brlcad/trunk/src/proc-db/ringworld.c
___________________________________________________________________
Added: svn:mime-type
   + text/plain
Added: svn:eol-style
   + native


This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.

------------------------------------------------------------------------------
vRanger cuts backup time in half-while increasing security.
With the market-leading solution for virtual backup and recovery, 
you get blazing-fast, flexible, and affordable data protection.
Download your free trial now. 
http://p.sf.net/sfu/quest-d2dcopy1
_______________________________________________
BRL-CAD Source Commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/brlcad-commits

Reply via email to