[MOAB-dev] r6015 - MOAB/trunk/tools/mbcslam
iulian at mcs.anl.gov
iulian at mcs.anl.gov
Mon Feb 25 16:31:50 CST 2013
Author: iulian
Date: 2013-02-25 16:31:50 -0600 (Mon, 25 Feb 2013)
New Revision: 6015
Modified:
MOAB/trunk/tools/mbcslam/Intx2Mesh.cpp
Log:
the arrival mesh could be disjoint, so the advancing front strategy
might stop
after processing each arrival element, remove it from the initial range;
stop when the initial range is empty
search for a new starting seed within the remaining elements;
Modified: MOAB/trunk/tools/mbcslam/Intx2Mesh.cpp
===================================================================
--- MOAB/trunk/tools/mbcslam/Intx2Mesh.cpp 2013-02-20 05:37:27 UTC (rev 6014)
+++ MOAB/trunk/tools/mbcslam/Intx2Mesh.cpp 2013-02-25 22:31:50 UTC (rev 6015)
@@ -162,187 +162,192 @@
Range rs2;
mb->get_entities_by_type(mbs1, type, rs1);
mb->get_entities_by_type(mbs2, type, rs2);
- for (Range::iterator it = rs1.begin(); it != rs1.end(); it++)
+ while (!rs2.empty())
{
- startBlue = *it;
- int found = 0;
- for (Range::iterator it2 = rs2.begin(); it2 != rs2.end() && !found; it2++)
+ for (Range::iterator it = rs1.begin(); it != rs1.end(); it++)
{
- startRed = *it2;
- double area = 0;
- // if area is > 0 , we have intersections
- double P[48]; // max 8 intx points + 8 more in the polygon
- // the red quad is convex, always, while the blue can be concave
- int nP = 0;
- int nb[4], nr[4]; // sides 3 or 4? also, check boxes first
- computeIntersectionBetweenRedAndBlue(startRed, startBlue, P, nP, area, nb, nr, true);
- if (area > 0)
+ startBlue = *it;
+ int found = 0;
+ for (Range::iterator it2 = rs2.begin(); it2 != rs2.end() && !found; it2++)
{
- found = 1;
- break; // found 2 elements that intersect; these will be the seeds
+ startRed = *it2;
+ double area = 0;
+ // if area is > 0 , we have intersections
+ double P[48]; // max 8 intx points + 8 more in the polygon
+ // the red quad is convex, always, while the blue can be concave
+ int nP = 0;
+ int nb[4], nr[4]; // sides 3 or 4? also, check boxes first
+ computeIntersectionBetweenRedAndBlue(startRed, startBlue, P, nP, area, nb, nr, true);
+ if (area > 0)
+ {
+ found = 1;
+ break; // found 2 elements that intersect; these will be the seeds
+ }
}
+ if (found)
+ break;
}
- if (found)
- break;
- }
More information about the moab-dev
mailing list