Revision: 76827
http://sourceforge.net/p/brlcad/code/76827
Author: starseeker
Date: 2020-08-18 13:16:42 +0000 (Tue, 18 Aug 2020)
Log Message:
-----------
Very simple cap on the number of times this message is printed. bu_logging
from the hit callback is generally not a great idea to begin with, since you'll
have lots of threads simultaneously hitting bu_log most of the time... even if
that's not an issue for the application it's fairly hard to interpret. Better
would be to store any information we want to report about this issue per-thread
and then summarize it at the dispatcher level...
Modified Paths:
--------------
brlcad/trunk/src/rt/viewweight.c
Modified: brlcad/trunk/src/rt/viewweight.c
===================================================================
--- brlcad/trunk/src/rt/viewweight.c 2020-08-18 12:21:16 UTC (rev 76826)
+++ brlcad/trunk/src/rt/viewweight.c 2020-08-18 13:16:42 UTC (rev 76827)
@@ -85,6 +85,7 @@
extern char *densityfile; /* name of density file */
extern int output_is_binary; /* !0 means output is binary */
+static int mass_undef = 0;
static int
hit(struct application *ap, struct partition *PartHeadp, struct seg
*UNUSED(segp))
@@ -123,9 +124,12 @@
/* if we don't have a valid material density to work with, use a
default material */
if (density_factor < 0) {
- bu_log("Material type %d used, but has no density file entry.\n",
reg->reg_gmater);
- bu_log(" (region %s)\n", reg->reg_name);
- bu_log(" Mass is undefined.\n");
+ if (!mass_undef) {
+ bu_log("Material type %d used, but has no density file
entry.\n", reg->reg_gmater);
+ bu_log(" (region %s)\n", reg->reg_name);
+ bu_log(" Mass is undefined.\n");
+ mass_undef = 1;
+ }
density_factor = analyze_densities_density(density, 0);
bu_semaphore_acquire(BU_SEM_SYSCALL);
reg->reg_gmater = 0;
This was sent by the SourceForge.net collaborative development platform, the
world's largest Open Source development site.
_______________________________________________
BRL-CAD Source Commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/brlcad-commits