Revision: 56302
http://sourceforge.net/p/brlcad/code/56302
Author: brlcad
Date: 2013-07-29 02:34:04 +0000 (Mon, 29 Jul 2013)
Log Message:
-----------
extract the ray bundle test harness into its own proper test program
Modified Paths:
--------------
brlcad/trunk/src/librt/mkbundle.c
brlcad/trunk/src/librt/tests/CMakeLists.txt
Added Paths:
-----------
brlcad/trunk/src/librt/tests/test_bundle.c
Modified: brlcad/trunk/src/librt/mkbundle.c
===================================================================
--- brlcad/trunk/src/librt/mkbundle.c 2013-07-29 00:22:31 UTC (rev 56301)
+++ brlcad/trunk/src/librt/mkbundle.c 2013-07-29 02:34:04 UTC (rev 56302)
@@ -157,46 +157,6 @@
/*
- * Test driver.
- */
-
-#if 0
-main()
-{
- FILE *fp = fopen("bundle.plot3", "wb");
- int rays_per_ring=5;
- int nring=3;
- fastf_t bundle_radius=1000.0;
- int i;
- vect_t avec, bvec;
- struct xray *rp;
- vect_t dir;
-
-
- VSET(dir, 0, 0, -1);
- /* create orthogonal rays for basis of bundle */
- bn_vec_ortho(avec, dir);
- VCROSS(bvec, dir, avec);
- VUNITIZE(bvec);
-
- rp = (struct xray *)bu_calloc(sizeof(struct xray),
- (rays_per_ring * nring) + 1,
- "ray bundle");
- VSET(rp[0].r_pt, 0, 0, 2000);
- VMOVE(rp[0].r_dir, dir);
- rt_raybundle_maker(rp, bundle_radius, avec, bvec, rays_per_ring, nring);
-
-
- for (i=0; i <= rays_per_ring * nring; i++) {
- point_t tip;
- VJOIN1(tip, rp[i].r_pt, 3500, rp[i].r_dir);
- pdv_3line(fp, rp[i].r_pt, tip);
- }
- fclose(fp);
-}
-#endif
-
-/*
* Local Variables:
* mode: C
* tab-width: 8
Modified: brlcad/trunk/src/librt/tests/CMakeLists.txt
===================================================================
--- brlcad/trunk/src/librt/tests/CMakeLists.txt 2013-07-29 00:22:31 UTC (rev
56301)
+++ brlcad/trunk/src/librt/tests/CMakeLists.txt 2013-07-29 02:34:04 UTC (rev
56302)
@@ -1,3 +1,7 @@
+BRLCAD_ADDEXEC(test_bundle test_bundle.c "librt" NO_INSTALL LOCAL)
+add_test(test_bundle test_bundle)
+set_property(DIRECTORY APPEND PROPERTY ADDITIONAL_MAKE_CLEAN_FILES
bundle.plot3)
+
BRLCAD_ADDEXEC(test_dvec test_dvec.cpp "librt" NOSTRICT NO_INSTALL LOCAL)
add_test(test_dvec test_dvec)
Added: brlcad/trunk/src/librt/tests/test_bundle.c
===================================================================
--- brlcad/trunk/src/librt/tests/test_bundle.c (rev 0)
+++ brlcad/trunk/src/librt/tests/test_bundle.c 2013-07-29 02:34:04 UTC (rev
56302)
@@ -0,0 +1,81 @@
+/* T E S T _ B U N D L E . C
+ * BRL-CAD
+ *
+ * Copyright (c) 2013 United States Government as represented by
+ * the U.S. Army Research Laboratory.
+ *
+ * This library 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 library 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.
+ */
+
+#include "common.h"
+
+#include "bu.h"
+#include "bn.h"
+#include "vmath.h"
+#include "plot3.h"
+#include "raytrace.h"
+
+
+int
+main(int ac, char *av[])
+{
+ FILE *fp;
+ int rays_per_ring=50;
+ int nring=30;
+ fastf_t bundle_radius=1000.0;
+ int i;
+ vect_t avec, bvec;
+ struct xray *rp;
+ vect_t dir;
+
+ if (ac > 1)
+ bu_exit(1, "Usage: %s\n", av[0]);
+
+ fp = fopen("bundle.plot3", "wb");
+
+ VSET(dir, 0, 0, -1);
+
+ /* create orthogonal rays for basis of bundle */
+ bn_vec_ortho(avec, dir);
+ VCROSS(bvec, dir, avec);
+ VUNITIZE(bvec);
+
+ rp = (struct xray *)bu_calloc(sizeof(struct xray),
+ (rays_per_ring * nring) + 1,
+ "ray bundle");
+ VSET(rp[0].r_pt, 0, 0, 2000);
+ VMOVE(rp[0].r_dir, dir);
+ rt_raybundle_maker(rp, bundle_radius, avec, bvec, rays_per_ring, nring);
+
+
+ for (i=0; i <= rays_per_ring * nring; i++) {
+ point_t tip;
+ VJOIN1(tip, rp[i].r_pt, 3500, rp[i].r_dir);
+ pdv_3line(fp, rp[i].r_pt, tip);
+ }
+ fclose(fp);
+ bu_free(rp, "ray bundle");
+
+ return 0;
+}
+
+/*
+ * Local Variables:
+ * tab-width: 8
+ * mode: C
+ * indent-tabs-mode: t
+ * c-file-style: "stroustrup"
+ * End:
+ * ex: shiftwidth=4 tabstop=8
+ */
Property changes on: brlcad/trunk/src/librt/tests/test_bundle.c
___________________________________________________________________
Added: svn:mime-type
## -0,0 +1 ##
+text/plain
\ No newline at end of property
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
This was sent by the SourceForge.net collaborative development platform, the
world's largest Open Source development site.
------------------------------------------------------------------------------
See everything from the browser to the database with AppDynamics
Get end-to-end visibility with application monitoring from AppDynamics
Isolate bottlenecks and diagnose root cause in seconds.
Start your free trial of AppDynamics Pro today!
http://pubads.g.doubleclick.net/gampad/clk?id=48808831&iu=/4140/ostg.clktrk
_______________________________________________
BRL-CAD Source Commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/brlcad-commits