Skip to content

Commit

Permalink
merging RELEASE branch to STABLE branch, r70324 through r70331
Browse files Browse the repository at this point in the history
svn:revision:70332
svn:branch:STABLE
svn:account:starseeker
  • Loading branch information
starseeker committed Sep 22, 2017
2 parents 0131d28 + 9b5b605 commit 1f5d680
Show file tree
Hide file tree
Showing 8 changed files with 108 additions and 11 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
/bin
/lib
/build
8 changes: 8 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
2017-09-22 18:35 starseeker

* [r70328] include/rt/functab.h, src/librt/cut.c,
src/librt/primitives/arb8/arb8.c, src/librt/primitives/table.cpp:
Removal of arb8 classification is causing some change - commit a
minimal re-insertion to RELEASE branch to document what may be
needed here...

2017-09-21 15:17 starseeker

* [r70321] src/other/libutahrle/CMakeLists.txt:
Expand Down
2 changes: 1 addition & 1 deletion NEWS
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ descriptive text that emphasizes or further describes significant
changes made. See document footer for additional details.

----------------------------------------------------------------------
--- 2017-09-21 Release 7.26.4 ---
--- 2017-09-22 Release 7.26.4 ---
----------------------------------------------------------------------

This is a patch release, primary focused on updates to the build
Expand Down
3 changes: 3 additions & 0 deletions include/rt/functab.h
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,9 @@ struct rt_functab {
struct soltab *stp);
#define RTFUNCTAB_FUNC_CURVE_CAST(_func) ((void (*)(struct curvature *, struct hit *, struct soltab *))_func)

int (*ft_classify)(const struct soltab * /*stp*/, const vect_t /*min*/, const vect_t /*max*/, const struct bn_tol * /*tol*/);
#define RTFUNCTAB_FUNC_CLASS_CAST(_func) ((int (*)(const struct soltab *, const vect_t, const vect_t, const struct bn_tol *))_func)

void (*ft_free)(struct soltab * /*stp*/);
#define RTFUNCTAB_FUNC_FREE_CAST(_func) ((void (*)(struct soltab *))_func)

Expand Down
2 changes: 1 addition & 1 deletion misc/debian/changelog
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ brlcad (7.26.4-0) unstable; urgency=low

* update brlcad version

-- Cliff Yapp <[email protected]> Thu, 21 Sep 2017 12:30:18 -0400
-- Cliff Yapp <[email protected]> Thu, 22 Sep 2017 17:21:44 -0400


brlcad (7.26.2-0) unstable; urgency=low
Expand Down
34 changes: 25 additions & 9 deletions src/librt/cut.c
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
#include "bn/plot3.h"


HIDDEN int rt_ck_overlap(const vect_t min, const vect_t max, const struct soltab *stp);
HIDDEN int rt_ck_overlap(const vect_t min, const vect_t max, const struct soltab *stp, const struct rt_i *rtip);
HIDDEN int rt_ct_box(struct rt_i *rtip, union cutter *cutp, int axis, double where, int force);
HIDDEN void rt_ct_optim(struct rt_i *rtip, union cutter *cutp, size_t depth);
HIDDEN void rt_ct_free(struct rt_i *rtip, union cutter *cutp);
Expand Down Expand Up @@ -103,7 +103,8 @@ rt_cut_one_axis(struct bu_ptbl *boxes, struct rt_i *rtip, int axis, int min, int
/* Search all solids for those in this slice */
RT_VISIT_ALL_SOLTABS_START(stp, rtip) {
RT_CHECK_SOLTAB(stp);
if (!rt_ck_overlap(box->bn.bn_min, box->bn.bn_max, stp))
if (!rt_ck_overlap(box->bn.bn_min, box->bn.bn_max,
stp, rtip))
continue;
box->bn.bn_list[box->bn.bn_len++] = stp;
} RT_VISIT_ALL_SOLTABS_END
Expand Down Expand Up @@ -553,7 +554,7 @@ rt_nugrid_cut(register struct nugridnode *nugnp, register struct boxnode *fromp,
for (i = 0, stpp = fromp->bn_list;
i < fromp->bn_len;
i++, stpp++) {
if (!rt_ck_overlap(xmin, xmax, *stpp))
if (!rt_ck_overlap(xmin, xmax, *stpp, rtip))
continue;
nu_xbox.bn_list[nu_xbox.bn_len++] = *stpp;
}
Expand All @@ -569,7 +570,9 @@ rt_nugrid_cut(register struct nugridnode *nugnp, register struct boxnode *fromp,
nu_ybox.bn_len = 0;
/* Search X slice for membs of this Y slice */
for (i=0; i<nu_xbox.bn_len; i++) {
if (!rt_ck_overlap(ymin, ymax, nu_xbox.bn_list[i]))
if (!rt_ck_overlap(ymin, ymax,
nu_xbox.bn_list[i],
rtip))
continue;
nu_ybox.bn_list[nu_ybox.bn_len++] =
nu_xbox.bn_list[i];
Expand All @@ -595,7 +598,9 @@ rt_nugrid_cut(register struct nugridnode *nugnp, register struct boxnode *fromp,
nu_zbox.bn_len = 0;
/* Search Y slice for members of this Z slice*/
for (i=0; i<nu_ybox.bn_len; i++) {
if (!rt_ck_overlap(zmin, zmax, nu_ybox.bn_list[i]))
if (!rt_ck_overlap(zmin, zmax,
nu_ybox.bn_list[i],
rtip))
continue;
nu_zbox.bn_list[nu_zbox.bn_len++] =
nu_ybox.bn_list[i];
Expand Down Expand Up @@ -1138,7 +1143,8 @@ rt_ct_populate_box(union cutter *outp, const union cutter *inp, struct rt_i *rti
"bn_list");
for (i = inp->bn.bn_len-1; i >= 0; i--) {
struct soltab *stp = inp->bn.bn_list[i];
if (!rt_ck_overlap(outp->bn.bn_min, outp->bn.bn_max, stp))
if (!rt_ck_overlap(outp->bn.bn_min, outp->bn.bn_max,
stp, rtip))
continue;
outp->bn.bn_list[outp->bn.bn_len++] = stp;
}
Expand Down Expand Up @@ -1298,12 +1304,15 @@ rt_ct_box(struct rt_i *rtip, register union cutter *cutp, register int axis, dou
* See if any part of the solid is contained within the bounding box
* (RPP).
*
* If the solid RPP at least partly overlaps the bounding RPP, invoke
* the per-solid "classifier" method to perform a more rigorous check.
*
* Returns -
* !0 if object potentially overlaps box.
* !0 if object overlaps box.
* 0 if no overlap.
*/
HIDDEN int
rt_ck_overlap(register const fastf_t *min, register const fastf_t *max, register const struct soltab *stp)
rt_ck_overlap(register const fastf_t *min, register const fastf_t *max, register const struct soltab *stp, register const struct rt_i *rtip)
{
RT_CHECK_SOLTAB(stp);

Expand All @@ -1322,7 +1331,14 @@ rt_ck_overlap(register const fastf_t *min, register const fastf_t *max, register
/* If the object fits in a box (i.e., it's not infinite), and that
* box doesn't overlap with the bounding RPP, we know it's a miss.
*/
if ((stp->st_aradius < INFINITY) && V3RPP_DISJOINT(stp->st_min, stp->st_max, min, max))
if (stp->st_aradius < INFINITY) {
if (V3RPP_DISJOINT(stp->st_min, stp->st_max, min, max))
return 0;
}

/* RPP overlaps, invoke per-solid method for detailed check */
if (OBJ[stp->st_id].ft_classify &&
OBJ[stp->st_id].ft_classify(stp, min, max, &rtip->rti_tol) == BN_CLASSIFY_OUTSIDE)
return 0;

/* don't know, check it */
Expand Down
19 changes: 19 additions & 0 deletions src/librt/primitives/arb8/arb8.c
Original file line number Diff line number Diff line change
Expand Up @@ -1190,6 +1190,25 @@ rt_arb_plot(struct bu_list *vhead, struct rt_db_internal *ip, const struct rt_te
return 0;
}

int
rt_arb_class(const struct soltab *stp, const fastf_t *min, const fastf_t *max, const struct bn_tol *tol)
{
register struct arb_specific *arbp = (struct arb_specific *)stp->st_specific;
register int i;

if (arbp == (struct arb_specific *)0) {
bu_log("arb(%s): no faces\n", stp->st_name);
return BN_CLASSIFY_UNIMPLEMENTED;
}

for (i = 0; i < arbp->arb_nmfaces; i++) {
if (bn_hlf_class(arbp->arb_face[i].peqn, min, max, tol) == BN_CLASSIFY_OUTSIDE)
return BN_CLASSIFY_OUTSIDE;
}

/* FIXME: We need to test for BN_CLASSIFY_INSIDE vs. BN_CLASSIFY_OVERLAPPING! */
return BN_CLASSIFY_UNIMPLEMENTED; /* let the caller assume the worst */
}

/**
* Import an ARB8 from the database format to the internal format.
Expand Down
Loading

0 comments on commit 1f5d680

Please sign in to comment.