Revision: 71752 http://sourceforge.net/p/brlcad/code/71752 Author: starseeker Date: 2018-09-19 19:48:29 +0000 (Wed, 19 Sep 2018) Log Message: ----------- looks like the public API and how db_tree need to use this are a bit different
Modified Paths: -------------- brlcad/trunk/src/librt/db_fullpath.c brlcad/trunk/src/librt/db_tree.c brlcad/trunk/src/librt/librt_private.h Modified: brlcad/trunk/src/librt/db_fullpath.c =================================================================== --- brlcad/trunk/src/librt/db_fullpath.c 2018-09-19 17:11:00 UTC (rev 71751) +++ brlcad/trunk/src/librt/db_fullpath.c 2018-09-19 19:48:29 UTC (rev 71752) @@ -591,7 +591,7 @@ return 0; } -HIDDEN int +int cyclic_path(const struct db_full_path *fp, const char *test_name, long int depth) { if (!test_name || !fp || depth < 0) Modified: brlcad/trunk/src/librt/db_tree.c =================================================================== --- brlcad/trunk/src/librt/db_tree.c 2018-09-19 17:11:00 UTC (rev 71751) +++ brlcad/trunk/src/librt/db_tree.c 2018-09-19 19:48:29 UTC (rev 71752) @@ -899,7 +899,7 @@ } /* protect against cyclic geometry */ - if (db_full_path_cyclic(pathp, tp->tr_l.tl_name, 0)) { + if (cyclic_path(pathp, tp->tr_l.tl_name, pathp->fp_len - 2)) { int depth = pathp->fp_len; bu_log("Detected cyclic reference of %s\nPath stack is:\n", tp->tr_l.tl_name); Modified: brlcad/trunk/src/librt/librt_private.h =================================================================== --- brlcad/trunk/src/librt/librt_private.h 2018-09-19 17:11:00 UTC (rev 71751) +++ brlcad/trunk/src/librt/librt_private.h 2018-09-19 19:48:29 UTC (rev 71752) @@ -111,7 +111,19 @@ */ extern void rt_plot_cell(const union cutter *cutp, struct rt_shootray_status *ssp, struct bu_list *waiting_segs_hd, struct rt_i *rtip); +/* db_fullpath.c */ +/** + * Function to test whether a path has a cyclic entry in it. + * + * @param fp [i] Full path to test + * @param name [i] String to use when checking path. + * @param depth [i] Starting depth for path node name comparisons. + * @return 1 if the path is cyclic, 0 if it is not. + */ +extern int cyclic_path(const struct db_full_path *fp, const char *test_name, long int depth); + + /* db_diff.c */ /** This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. _______________________________________________ BRL-CAD Source Commits mailing list brlcad-commits@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/brlcad-commits