25 #ifdef MODULE_COREFINEMENT
27 #include "g-map-vertex.hh"
31 #include "corefinement-api.hh"
32 #include "geometry.hh"
34 using namespace GMap3d;
42 assert(normal != NULL);
50 if (!
FMap->isIFreeOrbit(*d1, 3, ORBIT_CC))
52 setMessage(
"Mesh 1 invalid: all the darts must be 3-free");
62 if (!
FMap->isIFreeOrbit(*d2, 3, ORBIT_CC))
64 setMessage(
"Mesh 2 invalid: all the darts must be 3-free");
68 CVertex n1 =
FMap->cellDimensionNormalVector(*d1, 3);
69 CVertex n2 =
FMap->cellDimensionNormalVector(*d2, 3);
71 TCoordinate angle = CGeometry::getAngle(n1,n2);
76 if (fabs(angle) > 0.5)
82 CVertex bary1 =
FMap->barycenter(*d1, ORBIT_CC);
83 CVertex bary2 =
FMap->barycenter(*d2, ORBIT_CC);
85 if (!(bary1 - CGeometry::orthoProjectVertexOnPlane(bary1, bary2,n2)).isNull())
99 * normal /= normal->norm();
117 CCorefinementAPI(
FMap).corefine2dMeshesSweeping(d1,d2, normal);
121 setMessage(
"Co-refinement by sweeping line done");
133 CCorefinementAPI corefinator(
FMap);
141 corefinator.corefine2dMeshesPropagation(d1, d2, normal);
145 setMessage(
"Co-refinement 2D by propagation done");
156 CCorefinementAPI coref(
FMap);
175 coref.booleanOperations2d(d1, d2, normal,
194 CCorefinementAPI corefinator(
FMap);
211 corefinator.corefine3dMeshes(d1, d2);
227 CCorefinementAPI corefinator(
FMap);
253 CCorefinementAPI coref(
FMap);
268 coref.booleanOperations3d(d1, d2,
287 CCorefinementAPI corefinator(
FMap);
304 corefinator.corefine3dMeshes(d1, d2);
320 CCorefinementAPI corefinator(
FMap);
335 #endif // COREFINEMENT