From: Patrick H. <pa...@13...> - 2009-02-13 14:16:31
|
Thanks, that fixes things up nicely. This patch has been checked in. -Patrick On Feb 13, 2009, at 2:48 AM, Sebastian Messerschmidt wrote: > Mea culpa, > > I've accidentally merged in the wrong lines I were using for testing. > For testing I have analyzed the unit test, which is either wrong or > my understanding of what the function is doing is incorrect. > > The function description says: > " Tests if the given AABox is completely inside or on the surface of > the given > AABox container." > As I understand this, the container must contain the whole box, not > just intersect it, as tested in the unit test: > > gmtl::AABoxf box2(gmtl::Point3f(30,30,30), gmtl::Point3f(40,40,40)); > gmtl::AABoxf box3(gmtl::Point3f(35,35,35), gmtl::Point3f(37,37,37)); > // Test overlapping valid boxes > .... > CPPUNIT_ASSERT(gmtl::isInVolume(box3, box2)); <-- wrong in my eyes > > This test is wrong in my understanding, since the smaller box #3 > cannot contain a larger box, > > They are surely intersecting, but to check this, there are > specialized tests. > > > Attached you'll find the new patch. > > cheers > > > >> Kevin Meinert schrieb: >> >>> is it for completely contained. or just for intersection? i >>> forget... :( >>> >>> >> Hi Kevin, >> >> the test is for complete containment. I'll check it again. >> >>> --- >>> kevin meinert | http://www.subatomicglue.com >>> >>> >>> On Thu, Feb 12, 2009 at 4:34 PM, Patrick Hartling <pa...@13... >>> <mailto:pa...@13...>> wrote: >>> >>> On Feb 12, 2009, at 3:03 AM, Sebastian Messerschmidt wrote: >>> >>> > Hi folks, >>> > >>> > attached you'll find a patch for the isInVolume function >>> testing two >>> > axis-aligned boxes. >>> > >>> > The problem with the former algorithm had, was to rely on >>> overlap >>> > test only, which means that intersecting boxes were considered >>> > containing each other. >>> > I've rewritten the test, so it will work for all cases. >>> >>> After applying this patch, I get a failure in the test suite. >>> The test >>> case (see gmtlTest::AABoxContainTest::testIsInVolumeAABox() in >>> the >>> file Test/TestSuite/TestCases/AABoxContainTest.cpp) checks to >>> see if >>> box2 contains box3 where these boxes are defined as follows: >>> >>> gmtl::AABoxf box2(gmtl::Point3f(30,30,30), >>> gmtl::Point3f(40,40,40)); >>> gmtl::AABoxf box3(gmtl::Point3f(35,35,35), >>> gmtl::Point3f(37,37,37)); >>> >>> Perhaps my expectation of gmtl::isInVolume() is wrong, but the >>> documentation says that it should return true for the case when >>> the >>> second box (box3) is contained by the first (box2). >>> >>> -Patrick >>> >>> >>> -- >>> Patrick L. Hartling >>> Senior Software Engineer, Priority 5 >>> http://www.priority5.com/ >>> >>> >>> >>> ------------------------------------------------------------------------------ >>> Open Source Business Conference (OSBC), March 24-25, 2009, San >>> Francisco, CA >>> -OSBC tackles the biggest issue in open source: Open Sourcing the >>> Enterprise >>> -Strategies to boost innovation and cut costs with open source >>> participation >>> -Receive a $600 discount off the registration fee with the source >>> code: SFAD >>> http://p.sf.net/sfu/XcvMzF8H >>> _______________________________________________ >>> ggt-devel mailing list >>> ggt...@li... >>> <mailto:ggt...@li...> >>> https://lists.sourceforge.net/lists/listinfo/ggt-devel >>> >>> >>> ------------------------------------------------------------------------ >>> >>> ------------------------------------------------------------------------------ >>> Open Source Business Conference (OSBC), March 24-25, 2009, San >>> Francisco, CA >>> -OSBC tackles the biggest issue in open source: Open Sourcing the >>> Enterprise >>> -Strategies to boost innovation and cut costs with open source >>> participation >>> -Receive a $600 discount off the registration fee with the source >>> code: SFAD >>> http://p.sf.net/sfu/XcvMzF8H >>> ------------------------------------------------------------------------ >>> >>> _______________________________________________ >>> ggt-devel mailing list >>> ggt...@li... >>> https://lists.sourceforge.net/lists/listinfo/ggt-devel >>> >> >> >> ------------------------------------------------------------------------------ >> Open Source Business Conference (OSBC), March 24-25, 2009, San >> Francisco, CA >> -OSBC tackles the biggest issue in open source: Open Sourcing the >> Enterprise >> -Strategies to boost innovation and cut costs with open source >> participation >> -Receive a $600 discount off the registration fee with the source >> code: SFAD >> http://p.sf.net/sfu/XcvMzF8H >> _______________________________________________ >> ggt-devel mailing list >> ggt...@li... >> https://lists.sourceforge.net/lists/listinfo/ggt-devel >> >> > > Index: Containment.h > =================================================================== > RCS file: /cvsroot/ggt/GGT/modules/GMTL/gmtl/Containment.h,v > retrieving revision 1.21 > diff -u -r1.21 Containment.h > --- Containment.h 13 Jun 2007 19:42:29 -0000 1.21 > +++ Containment.h 13 Feb 2009 08:27:38 -0000 > @@ -399,17 +399,17 @@ > { > return false; > } > - > - // Test that the boxes are not overlapping on any axis > - if (container.mMax[0] < box.mMin[0] || container.mMin[0] > > box.mMax[0] || > - container.mMax[1] < box.mMin[1] || container.mMin[1] > > box.mMax[1] || > - container.mMax[2] < box.mMin[2] || container.mMin[2] > > box.mMax[2]) > + > + > +if (container.mMin[0] <= box.mMin[0] && container.mMax[0] >= > box.mMax[0] && > + container.mMin[1] <= box.mMin[1] && container.mMax[1] >= > box.mMax[1] && > + container.mMin[2] <= box.mMin[2] && container.mMax[2] >= > box.mMax[2]) > { > - return false; > + return true; > } > else > { > - return true; > + return false; > } > } > > ------------------------------------------------------------------------------ > Open Source Business Conference (OSBC), March 24-25, 2009, San > Francisco, CA > -OSBC tackles the biggest issue in open source: Open Sourcing the > Enterprise > -Strategies to boost innovation and cut costs with open source > participation > -Receive a $600 discount off the registration fee with the source > code: SFAD > http://p.sf.net/sfu/XcvMzF8H_______________________________________________ > ggt-devel mailing list > ggt...@li... > https://lists.sourceforge.net/lists/listinfo/ggt-devel -- Patrick L. Hartling Senior Software Engineer, Priority 5 http://www.priority5.com/ |