Revision: 56274
http://sourceforge.net/p/brlcad/code/56274
Author: brlcad
Date: 2013-07-28 05:58:08 +0000 (Sun, 28 Jul 2013)
Log Message:
-----------
address an ancient FIXME about supporting the plotting of both lines and
points. total fast-hack method via global but matches the existing code well.
Modified Paths:
--------------
brlcad/trunk/src/burst/burst.c
brlcad/trunk/src/burst/extern.h
brlcad/trunk/src/burst/glob.c
brlcad/trunk/src/burst/grid.c
brlcad/trunk/src/burst/plot.c
brlcad/trunk/src/burst/prnt.c
Modified: brlcad/trunk/src/burst/burst.c
===================================================================
--- brlcad/trunk/src/burst/burst.c 2013-07-27 22:01:06 UTC (rev 56273)
+++ brlcad/trunk/src/burst/burst.c 2013-07-28 05:58:08 UTC (rev 56274)
@@ -121,11 +121,17 @@
{
int c;
/* Parse options. */
- while ((c = bu_getopt(argc, argv, "bh?")) != -1) {
+ while ((c = bu_getopt(argc, argv, "bpPh?")) != -1) {
switch (c) {
case 'b' :
tty = 0;
break;
+ case 'p' :
+ plotline = 0;
+ break;
+ case 'P' :
+ plotline = 1;
+ break;
default:
return 0;
}
Modified: brlcad/trunk/src/burst/extern.h
===================================================================
--- brlcad/trunk/src/burst/extern.h 2013-07-27 22:01:06 UTC (rev 56273)
+++ brlcad/trunk/src/burst/extern.h 2013-07-28 05:58:08 UTC (rev 56274)
@@ -73,7 +73,8 @@
extern void plotGrid();
extern void plotInit();
extern void plotPartition();
-extern void plotRay();
+extern void plotRayLine();
+extern void plotRayPoint();
extern void prntAspectInit();
extern void prntBurstHdr();
extern void prntCellIdent();
@@ -140,6 +141,7 @@
extern unsigned char pixtarg[3];
extern Trie *cmdtrie;
+extern int plotline;
extern int batchmode;
extern int cantwarhead;
extern int deflectcone;
Modified: brlcad/trunk/src/burst/glob.c
===================================================================
--- brlcad/trunk/src/burst/glob.c 2013-07-27 22:01:06 UTC (rev 56273)
+++ brlcad/trunk/src/burst/glob.c 2013-07-28 05:58:08 UTC (rev 56274)
@@ -59,6 +59,7 @@
unsigned char pixtarg[3] = { 255, 255, 255 }; /* shot hit target */
Trie *cmdtrie = NULL;
+int plotline = 0; /* boolean for plot lines (otherwise plots points) */
int batchmode = 0; /* are we processing batch input now */
int cantwarhead = 0; /* pitch or yaw will be applied to warhead */
int deflectcone = DFL_DEFLECT; /* cone axis deflects towards normal */
Modified: brlcad/trunk/src/burst/grid.c
===================================================================
--- brlcad/trunk/src/burst/grid.c 2013-07-27 22:01:06 UTC (rev 56273)
+++ brlcad/trunk/src/burst/grid.c 2013-07-28 05:58:08 UTC (rev 56274)
@@ -1611,7 +1611,12 @@
int ncrit;
spallVec(a_burst.a_ray.r_dir, a_spall.a_ray.r_dir,
phi, gammaval);
- plotRay(&a_spall.a_ray);
+
+ if (plotline)
+ plotRayPoint(&a_spall.a_ray);
+ else
+ plotRayLine(&a_spall.a_ray);
+
bu_semaphore_acquire(RT_SEM_WORKER);
a_spall.a_user = a_burst.a_user++;
bu_semaphore_release(RT_SEM_WORKER);
Modified: brlcad/trunk/src/burst/plot.c
===================================================================
--- brlcad/trunk/src/burst/plot.c 2013-07-27 22:01:06 UTC (rev 56273)
+++ brlcad/trunk/src/burst/plot.c 2013-07-28 05:58:08 UTC (rev 56274)
@@ -66,19 +66,16 @@
void
-plotRay(struct xray *rayp)
+plotRayLine(struct xray *rayp)
{
int endpoint[3];
if (plotfp == NULL)
return;
VJOIN1(endpoint, rayp->r_pt, cellsz, rayp->r_dir);
+
bu_semaphore_acquire(BU_SEM_SYSCALL);
pl_color(plotfp, R_BURST, G_BURST, B_BURST);
- /* FIXME: would be nice to have some mechanism for toggling
- * between lines and points (for large collections of rays)
- */
-#if 0
/* draw line */
pl_3line(plotfp,
(int) rayp->r_pt[X],
@@ -88,10 +85,25 @@
endpoint[Y],
endpoint[Z]
);
-#else
+
+ bu_semaphore_release(BU_SEM_SYSCALL);
+ return;
+}
+
+
+void
+plotRayPoint(struct xray *rayp)
+{
+ int endpoint[3];
+ if (plotfp == NULL)
+ return;
+ VJOIN1(endpoint, rayp->r_pt, cellsz, rayp->r_dir);
+
+ bu_semaphore_acquire(BU_SEM_SYSCALL);
+ pl_color(plotfp, R_BURST, G_BURST, B_BURST);
+
/* draw point */
pl_3point(plotfp, (int) endpoint[X], (int) endpoint[Y], (int) endpoint[Z]);
-#endif
bu_semaphore_release(BU_SEM_SYSCALL);
return;
Modified: brlcad/trunk/src/burst/prnt.c
===================================================================
--- brlcad/trunk/src/burst/prnt.c 2013-07-27 22:01:06 UTC (rev 56273)
+++ brlcad/trunk/src/burst/prnt.c 2013-07-28 05:58:08 UTC (rev 56274)
@@ -891,8 +891,9 @@
static char *usage[] =
{
- "Usage: burst [-b]",
+ "Usage: burst [-b] [-p|-P]",
"\tThe -b option suppresses the screen display (for batch jobs).",
+ "\tThe -p/-P options specifies whether to plot points or lines.",
NULL
};
void
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