18 void MElementBB(
void *a,
double *min,
double *max);
54 return s >= 0 ? 1.0 : s <= 0 ? -1.0 : 0.0;
59 double a[2] = {va->
x(), va->
y()};
60 double b[2] = {vb->
x(), vb->
y()};
61 double c[2] = {vc->
x(), vc->
y()};
67 double a[2] = {va.
x(), va.
y()};
68 double b[2] = {vb.
x(), vb.
y()};
69 double c[2] = {vc.
x(), vc.
y()};
84 if(xmax1 < xmin2)
return false;
85 if(xmax2 < xmin1)
return false;
86 if(ymax1 < ymin2)
return false;
87 if(ymax2 < ymin1)
return false;
89 if(xmin1 > xmax2)
return false;
90 if(xmin2 > xmax1)
return false;
91 if(ymin1 > ymax2)
return false;
92 if(ymin2 > ymax1)
return false;
157 if(std::binary_search(wrapper->
_notOverlap.begin(),
171 Msg::Error(
"overlapping of elements in 3D not done yet");
176 :
public std::binary_function<MElement *, MElement *, bool> {
184 std::map<
MElement *, std::vector<MElement *> > &_elemColumns)
186 std::sort(
elem.begin(),
elem.end());
187 std::vector<MElement *> toKeep;
188 for(
auto it = _elemColumns.begin(); it != _elemColumns.end(); ++it) {
189 const std::vector<MElement *> &
c = it->second;
190 std::size_t
MAX =
c.size();
192 for(std::size_t i = 0; i <
c.size(); i++) {
193 if(!std::binary_search(
elem.begin(),
elem.end(),
c[i])) {
200 for(std::size_t i = 0; i <
MAX; i++) {
202 c[i]->getVertex(2)) < 0)
204 toKeep.push_back(
c[i]);
216 std::vector<MLine *> &lines, std::vector<MElement *> &els,
217 std::map<
MElement *, std::vector<MElement *> > &_elemColumns,
218 std::map<MElement *, MElement *> &_toFirst)
220 std::vector<MElement *> newEls;
223 for(std::size_t i = 0; i < lines.size(); i++) {
225 double _min[3], _max[3];
227 rtree.
Insert(_min, _max, e);
230 for(std::size_t i = 0; i < els.size(); i++) {
232 double _min[3], _max[3];
241 rtree.
Insert(_min, _max, e);
252 std::vector<MLine *> &bdry, std::vector<MTriangle *> &blTris,
253 std::vector<MQuadrangle *> &blQuads,
254 std::map<
MElement *, std::vector<MElement *> > &_elemColumns,
255 std::map<MElement *, MElement *> &_toFirst)
257 std::vector<MElement *> vvv;
258 vvv.insert(vvv.begin(), blTris.begin(), blTris.end());
259 vvv.insert(vvv.begin(), blQuads.begin(), blQuads.end());
261 std::sort(vvv.begin(), vvv.end(), lp);
266 for(std::size_t i = 0; i < vvv.size(); i++) {