[MOAB-dev] r5829 - MOAB/trunk/tools/mbcslam
iulian at mcs.anl.gov
iulian at mcs.anl.gov
Wed Oct 24 17:08:28 CDT 2012
Author: iulian
Date: 2012-10-24 17:08:27 -0500 (Wed, 24 Oct 2012)
New Revision: 5829
Added:
MOAB/trunk/tools/mbcslam/Intx2MeshInPlane.cpp
MOAB/trunk/tools/mbcslam/Intx2MeshInPlane.hpp
MOAB/trunk/tools/mbcslam/intx_in_plane_test.cpp
Modified:
MOAB/trunk/tools/mbcslam/Intx2Mesh.cpp
MOAB/trunk/tools/mbcslam/Intx2Mesh.hpp
MOAB/trunk/tools/mbcslam/Intx2MeshOnSphere.cpp
MOAB/trunk/tools/mbcslam/Intx2MeshOnSphere.hpp
MOAB/trunk/tools/mbcslam/IntxUtils.cpp
MOAB/trunk/tools/mbcslam/IntxUtils.hpp
MOAB/trunk/tools/mbcslam/Makefile.am
MOAB/trunk/tools/mbcslam/intx_on_sphere_test.cpp
Log:
refactor intersection in plane
Modified: MOAB/trunk/tools/mbcslam/Intx2Mesh.cpp
===================================================================
--- MOAB/trunk/tools/mbcslam/Intx2Mesh.cpp 2012-10-24 19:37:50 UTC (rev 5828)
+++ MOAB/trunk/tools/mbcslam/Intx2Mesh.cpp 2012-10-24 22:08:27 UTC (rev 5829)
@@ -6,6 +6,8 @@
#include "Intx2Mesh.hpp"
+#include <queue>
+
namespace moab {
@@ -76,18 +78,21 @@
ErrorCode Intx2Mesh::GetOrderedNeighbors(EntityHandle set, EntityHandle quad,
EntityHandle neighbors[4])
{
+ int nsides = 3;
+ if (type == MBQUAD)
+ nsides = 4;
// will get the 4 ordered neighbors;
// first quad is for nodes 0, 1, second to 1, 2, third to 2, 3,
int nnodes;
const EntityHandle * conn4;
ErrorCode rval = mb->get_connectivity(quad, conn4, nnodes);
- if (MB_SUCCESS != rval || nnodes != 4)
+ if (MB_SUCCESS != rval || nnodes != nsides)
return MB_FAILURE;
- for (int i = 0; i < 4; i++)
+ for (int i = 0; i < nsides; i++)
{
EntityHandle v[2];
v[0] = conn4[i];
- v[1] = conn4[(i + 1) % 4];
+ v[1] = conn4[(i + 1) % nsides];
// get quads adjacent to vertices
std::vector<EntityHandle> quads;
std::vector<EntityHandle> quadsInSet;
@@ -120,7 +125,214 @@
}
return MB_SUCCESS;
}
+// main interface; this will do the advancing front trick
+// some are triangles, some are quads
+ErrorCode Intx2Mesh::intersect_meshes(EntityHandle mbset1, EntityHandle mbset2,
+ EntityHandle & outputSet)
+{
+ int nsides=3;
+ if (type == MBQUAD)
+ nsides=4;
More information about the moab-dev
mailing list