Revision: 71598 http://sourceforge.net/p/brlcad/code/71598 Author: starseeker Date: 2018-08-28 18:08:30 +0000 (Tue, 28 Aug 2018) Log Message: ----------- add ability to toggle point gen messages
Modified Paths: -------------- brlcad/trunk/include/analyze.h brlcad/trunk/src/libanalyze/obj_to_pnts.cxx brlcad/trunk/src/libged/facetize.c brlcad/trunk/src/libged/pnts.cpp Modified: brlcad/trunk/include/analyze.h =================================================================== --- brlcad/trunk/include/analyze.h 2018-08-28 18:03:20 UTC (rev 71597) +++ brlcad/trunk/include/analyze.h 2018-08-28 18:08:30 UTC (rev 71598) @@ -362,7 +362,7 @@ #define ANALYZE_OBJ_TO_PNTS_RAND 0x4 /**< @brief sample using Marsaglia sampling on the bounding sphere with pseudo random numbers */ #define ANALYZE_OBJ_TO_PNTS_SOBOL 0x8 /**< @brief sample using Marsaglia sampling on the bounding sphere with Sobol' low-discrepancy-sequence generation */ ANALYZE_EXPORT int analyze_obj_to_pnts(struct rt_pnts_internal *rpnts, double *avg_thickness, struct db_i *dbip, - const char *obj, struct bn_tol *tol, int flags, int max_pnts, int max_time); + const char *obj, struct bn_tol *tol, int flags, int max_pnts, int max_time, int verbosity); ANALYZE_EXPORT extern int analyze_polygonize(int **faces, int *num_faces, point_t **vertices, int *num_vertices, fastf_t size, point_t p_s, const char *obj, struct db_i *dbip, int max_time, int verbosity); Modified: brlcad/trunk/src/libanalyze/obj_to_pnts.cxx =================================================================== --- brlcad/trunk/src/libanalyze/obj_to_pnts.cxx 2018-08-28 18:03:20 UTC (rev 71597) +++ brlcad/trunk/src/libanalyze/obj_to_pnts.cxx 2018-08-28 18:08:30 UTC (rev 71598) @@ -237,7 +237,7 @@ /* 0 = success, -1 error */ int analyze_obj_to_pnts(struct rt_pnts_internal *rpnts, fastf_t *avg_thickness, struct db_i *dbip, - const char *obj, struct bn_tol *tol, int flags, int max_pnts, int max_time) + const char *obj, struct bn_tol *tol, int flags, int max_pnts, int max_time, int verbosity) { int pntcnt = 0; int ret, i, j; @@ -292,8 +292,11 @@ rt_prep_parallel(rtip, ncpus); currtime = bu_gettime(); - bu_log("Object to Point Set prep time: %.1f\n", (currtime - oldtime)/1.0e6); + if (verbosity > 1) { + bu_log("Object to Point Set prep time: %.1f\n", (currtime - oldtime)/1.0e6); + } + /* Regardless of whether or not we're shooting the grid, it is our * guide for how many rays to fire */ if (do_grid) { @@ -317,7 +320,9 @@ for (i = 0; i < ncpus+1; i++) { state[i].rays = NULL; } - bu_log("analyze time: %.1f\n", (currtime - oldtime)/1.0e6); + if (verbosity > 1) { + bu_log("analyze time: %.1f\n", (currtime - oldtime)/1.0e6); + } } if (flags & ANALYZE_OBJ_TO_PNTS_RAND || flags & ANALYZE_OBJ_TO_PNTS_SOBOL) { Modified: brlcad/trunk/src/libged/facetize.c =================================================================== --- brlcad/trunk/src/libged/facetize.c 2018-08-28 18:03:20 UTC (rev 71597) +++ brlcad/trunk/src/libged/facetize.c 2018-08-28 18:08:30 UTC (rev 71598) @@ -906,7 +906,7 @@ bu_vls_free(&pnt_msg); } - if (analyze_obj_to_pnts(pnts, NULL, gedp->ged_wdbp->dbip, objname, &btol, flags, opts->max_pnts, opts->max_time)) { + if (analyze_obj_to_pnts(pnts, NULL, gedp->ged_wdbp->dbip, objname, &btol, flags, opts->max_pnts, opts->max_time, opts->verbosity)) { if (!opts->quiet) { bu_log("SPSR: point generation failed: %s\n", objname); } @@ -1086,7 +1086,7 @@ } /* Shoot - we need both the avg thickness of the hit partitions and seed points */ - if (analyze_obj_to_pnts(pnts, &avg_thickness, gedp->ged_wdbp->dbip, objname, &btol, flags, max_pnts, opts->max_time) || pnts->count <= 0) { + if (analyze_obj_to_pnts(pnts, &avg_thickness, gedp->ged_wdbp->dbip, objname, &btol, flags, max_pnts, opts->max_time, opts->verbosity) || pnts->count <= 0) { r->failure_mode = GED_FACETIZE_FAILURE_PNTGEN; ret = GED_ERROR; goto ged_facetize_continuation_memfree; Modified: brlcad/trunk/src/libged/pnts.cpp =================================================================== --- brlcad/trunk/src/libged/pnts.cpp 2018-08-28 18:03:20 UTC (rev 71597) +++ brlcad/trunk/src/libged/pnts.cpp 2018-08-28 18:08:30 UTC (rev 71598) @@ -360,7 +360,7 @@ pnts->scale = 0.0; pnts->type = RT_PNT_TYPE_NRM; - if (analyze_obj_to_pnts(pnts, &avg_thickness, gedp->ged_wdbp->dbip, obj_name, &btol, flags, max_pnts, max_time)) { + if (analyze_obj_to_pnts(pnts, &avg_thickness, gedp->ged_wdbp->dbip, obj_name, &btol, flags, max_pnts, max_time, 2)) { bu_vls_sprintf(gedp->ged_result_str, "Error: point generation failed\n"); return GED_ERROR; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. ------------------------------------------------------------------------------ Check out the vibrant tech community on one of the world's most engaging tech sites, Slashdot.org! http://sdm.link/slashdot _______________________________________________ BRL-CAD Source Commits mailing list brlcad-commits@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/brlcad-commits