Commit 5e041bc3 authored by Kirill Terekhov's avatar Kirill Terekhov
Browse files

some updates

Retrieval of elements by markers;
Introduced options for loading of files;
Fixed issues saving vtk format when not all topological tests are
active;
Introduced Connect / Disconnect functions for manipulations with mesh;
DrawGrid example can now visualize array of entered cells/faces for
debug purposes;
OldDrawGrid example demonstrates fast interactive mesh slicing and
onscreen element picking.
parent b8d47cc5
...@@ -54,19 +54,19 @@ namespace INMOST ...@@ -54,19 +54,19 @@ namespace INMOST
} }
adjacent<Node> Cell::getNodes(MIDType mask) adjacent<Node> Cell::getNodes(MIDType mask, bool invert)
{ {
adjacent<Node> aret; adjacent<Node> aret;
if( !GetMeshLink()->HideMarker() ) if( !GetMeshLink()->HideMarker() )
{ {
for(adj_iterator it = high_conn.begin(); it != high_conn.end(); ++it) for(adj_iterator it = high_conn.begin(); it != high_conn.end(); ++it)
if( (*it)->GetMarker(mask) ) aret.push_back((*it)); if( invert ^ (*it)->GetMarker(mask) ) aret.push_back((*it));
} }
else else
{ {
MIDType hm = GetMeshLink()->HideMarker(); MIDType hm = GetMeshLink()->HideMarker();
for(adj_iterator it = high_conn.begin(); it != high_conn.end(); ++it) for(adj_iterator it = high_conn.begin(); it != high_conn.end(); ++it)
if( (*it)->GetMarker(mask) && !(*it)->GetMarker(hm) ) aret.push_back((*it)); if( (invert ^ (*it)->GetMarker(mask)) && !(*it)->GetMarker(hm) ) aret.push_back((*it));
} }
return aret; return aret;
} }
...@@ -169,7 +169,7 @@ namespace INMOST ...@@ -169,7 +169,7 @@ namespace INMOST
} }
adjacent<Edge> Cell::getEdges(MIDType mask) adjacent<Edge> Cell::getEdges(MIDType mask, bool invert)
{ {
adjacent<Edge> aret; adjacent<Edge> aret;
if( !GetMeshLink()->HideMarker() ) if( !GetMeshLink()->HideMarker() )
...@@ -179,8 +179,8 @@ namespace INMOST ...@@ -179,8 +179,8 @@ namespace INMOST
aret.reserve(low_conn.size()); aret.reserve(low_conn.size());
Element * last, * first; Element * last, * first;
Element * q = low_conn[0]; //edge 0 Element * q = low_conn[0]; //edge 0
if( q->low_conn[0]->GetMarker(mask) ) aret.push_back(q->low_conn[0]); //node 0 if( invert ^ q->low_conn[0]->GetMarker(mask) ) aret.push_back(q->low_conn[0]); //node 0
if( q->low_conn[1]->GetMarker(mask) ) aret.push_back(q->low_conn[1]); //node 1 if( invert ^ q->low_conn[1]->GetMarker(mask) ) aret.push_back(q->low_conn[1]); //node 1
first = q->low_conn[0]; first = q->low_conn[0];
last = q->low_conn[1]; last = q->low_conn[1];
Element * r = low_conn[1]; //edge 1 Element * r = low_conn[1]; //edge 1
...@@ -200,12 +200,12 @@ namespace INMOST ...@@ -200,12 +200,12 @@ namespace INMOST
if( last == (*it)->low_conn[0] ) if( last == (*it)->low_conn[0] )
{ {
last = (*it)->low_conn[1]; last = (*it)->low_conn[1];
if( last->GetMarker(mask) ) aret.push_back(last); if( invert ^ last->GetMarker(mask) ) aret.push_back(last);
} }
else else
{ {
last = (*it)->low_conn[0]; last = (*it)->low_conn[0];
if( last->GetMarker(mask) ) aret.push_back(last); if( invert ^ last->GetMarker(mask) ) aret.push_back(last);
} }
++it; ++it;
} }
...@@ -216,7 +216,7 @@ namespace INMOST ...@@ -216,7 +216,7 @@ namespace INMOST
MIDType mrk = m->CreateMarker(); MIDType mrk = m->CreateMarker();
for(Element::adj_iterator it = low_conn.begin(); it != low_conn.end(); it++) //faces for(Element::adj_iterator it = low_conn.begin(); it != low_conn.end(); it++) //faces
for(Element::adj_iterator jt = (*it)->low_conn.begin(); jt != (*it)->low_conn.end(); jt++) //edges for(Element::adj_iterator jt = (*it)->low_conn.begin(); jt != (*it)->low_conn.end(); jt++) //edges
if( (*jt)->GetMarker(mask) && !(*jt)->GetMarker(mrk)) if( (invert ^ (*jt)->GetMarker(mask)) && !(*jt)->GetMarker(mrk))
{ {
aret.push_back(*jt); aret.push_back(*jt);
(*jt)->SetMarker(mrk); (*jt)->SetMarker(mrk);
...@@ -239,10 +239,10 @@ namespace INMOST ...@@ -239,10 +239,10 @@ namespace INMOST
i = Mesh::getNext(&low_conn[0],low_conn.size(),i,hm); i = Mesh::getNext(&low_conn[0],low_conn.size(),i,hm);
Element * q = low_conn[i]; //edge 0 Element * q = low_conn[i]; //edge 0
k = Mesh::getNext(&q->low_conn[0],q->low_conn.size(),k,hm); k = Mesh::getNext(&q->low_conn[0],q->low_conn.size(),k,hm);
if( q->low_conn[k]->GetMarker(mask) ) aret.push_back(q->low_conn[k]); //node 0 if( invert ^ q->low_conn[k]->GetMarker(mask) ) aret.push_back(q->low_conn[k]); //node 0
first = q->low_conn[k]; first = q->low_conn[k];
k = Mesh::getNext(&q->low_conn[0],q->low_conn.size(),k,hm); k = Mesh::getNext(&q->low_conn[0],q->low_conn.size(),k,hm);
if( q->low_conn[k]->GetMarker(mask) ) aret.push_back(q->low_conn[k]); //node 1 if( invert ^ q->low_conn[k]->GetMarker(mask) ) aret.push_back(q->low_conn[k]); //node 1
last = q->low_conn[k]; last = q->low_conn[k];
i = Mesh::getNext(&low_conn[0],low_conn.size(),i,hm); i = Mesh::getNext(&low_conn[0],low_conn.size(),i,hm);
Element * r = low_conn[i]; //edge 1 Element * r = low_conn[i]; //edge 1
...@@ -267,12 +267,12 @@ namespace INMOST ...@@ -267,12 +267,12 @@ namespace INMOST
if( last == (*it)->low_conn[k1] ) if( last == (*it)->low_conn[k1] )
{ {
last = (*it)->low_conn[k2]; last = (*it)->low_conn[k2];
if( last->GetMarker(mask) ) aret.push_back(last); if( invert ^ last->GetMarker(mask) ) aret.push_back(last);
} }
else else
{ {
last = (*it)->low_conn[k1]; last = (*it)->low_conn[k1];
if( last->GetMarker(mask) ) aret.push_back(last); if( invert ^ last->GetMarker(mask) ) aret.push_back(last);
} }
++it; ++it;
} }
...@@ -283,7 +283,7 @@ namespace INMOST ...@@ -283,7 +283,7 @@ namespace INMOST
MIDType mrk = m->CreateMarker(); MIDType mrk = m->CreateMarker();
for(Element::adj_iterator it = low_conn.begin(); it != low_conn.end(); it++) if( !(*it)->GetMarker(hm) ) //faces for(Element::adj_iterator it = low_conn.begin(); it != low_conn.end(); it++) if( !(*it)->GetMarker(hm) ) //faces
for(Element::adj_iterator jt = (*it)->low_conn.begin(); jt != (*it)->low_conn.end(); jt++) if( !(*jt)->GetMarker(hm) )//edges for(Element::adj_iterator jt = (*it)->low_conn.begin(); jt != (*it)->low_conn.end(); jt++) if( !(*jt)->GetMarker(hm) )//edges
if( (*jt)->GetMarker(mask) && !(*jt)->GetMarker(mrk)) if( (invert ^ (*jt)->GetMarker(mask)) && !(*jt)->GetMarker(mrk))
{ {
aret.push_back(*jt); aret.push_back(*jt);
(*jt)->SetMarker(mrk); (*jt)->SetMarker(mrk);
...@@ -311,19 +311,19 @@ namespace INMOST ...@@ -311,19 +311,19 @@ namespace INMOST
} }
adjacent<Face> Cell::getFaces(MIDType mask) adjacent<Face> Cell::getFaces(MIDType mask, bool invert)
{ {
adjacent<Face> aret; adjacent<Face> aret;
if( !GetMeshLink()->HideMarker() ) if( !GetMeshLink()->HideMarker() )
{ {
for(adj_iterator it = low_conn.begin(); it != low_conn.end(); ++it) for(adj_iterator it = low_conn.begin(); it != low_conn.end(); ++it)
if( (*it)->GetMarker(mask) ) aret.push_back((*it)); if( invert ^ (*it)->GetMarker(mask) ) aret.push_back((*it));
} }
else else
{ {
MIDType hm = GetMeshLink()->HideMarker(); MIDType hm = GetMeshLink()->HideMarker();
for(adj_iterator it = low_conn.begin(); it != low_conn.end(); ++it) for(adj_iterator it = low_conn.begin(); it != low_conn.end(); ++it)
if( (*it)->GetMarker(mask) && !(*it)->GetMarker(hm) ) aret.push_back((*it)); if( (invert ^ (*it)->GetMarker(mask)) && !(*it)->GetMarker(hm) ) aret.push_back((*it));
} }
return aret; return aret;
} }
......
...@@ -1833,6 +1833,8 @@ namespace INMOST ...@@ -1833,6 +1833,8 @@ namespace INMOST
} }
} }
public: public:
element * data() {return pbegin;}
const element * data() const {return pbegin;}
void report_addr() void report_addr()
{ {
std::cout << "stack: " << &stack << std::endl; std::cout << "stack: " << &stack << std::endl;
......
...@@ -84,19 +84,19 @@ namespace INMOST ...@@ -84,19 +84,19 @@ namespace INMOST
} }
} }
adjacent<Node> Edge::getNodes(MIDType mask) adjacent<Node> Edge::getNodes(MIDType mask, bool invert)
{ {
adjacent<Node> aret; adjacent<Node> aret;
if( !GetMeshLink()->HideMarker() ) if( !GetMeshLink()->HideMarker() )
{ {
for(adj_iterator it = low_conn.begin(); it != low_conn.end(); ++it) for(adj_iterator it = low_conn.begin(); it != low_conn.end(); ++it)
if( (*it)->GetMarker(mask) ) aret.push_back((*it)); if( invert ^ (*it)->GetMarker(mask) ) aret.push_back((*it));
} }
else else
{ {
MIDType hm = GetMeshLink()->HideMarker(); MIDType hm = GetMeshLink()->HideMarker();
for(adj_iterator it = low_conn.begin(); it != low_conn.end(); ++it) for(adj_iterator it = low_conn.begin(); it != low_conn.end(); ++it)
if( (*it)->GetMarker(mask) && !(*it)->GetMarker(hm) ) aret.push_back((*it)); if( (invert ^ (*it)->GetMarker(mask)) && !(*it)->GetMarker(hm) ) aret.push_back((*it));
} }
return aret; return aret;
} }
...@@ -116,19 +116,19 @@ namespace INMOST ...@@ -116,19 +116,19 @@ namespace INMOST
} }
adjacent<Face> Edge::getFaces(MIDType mask) adjacent<Face> Edge::getFaces(MIDType mask, bool invert)
{ {
adjacent<Face> aret; adjacent<Face> aret;
if( !GetMeshLink()->HideMarker() ) if( !GetMeshLink()->HideMarker() )
{ {
for(adj_iterator it = high_conn.begin(); it != high_conn.end(); ++it) for(adj_iterator it = high_conn.begin(); it != high_conn.end(); ++it)
if( (*it)->GetMarker(mask) ) aret.push_back((*it)); if( (invert ^ (*it)->GetMarker(mask)) ) aret.push_back((*it));
} }
else else
{ {
MIDType hm = GetMeshLink()->HideMarker(); MIDType hm = GetMeshLink()->HideMarker();
for(adj_iterator it = high_conn.begin(); it != high_conn.end(); ++it) for(adj_iterator it = high_conn.begin(); it != high_conn.end(); ++it)
if( (*it)->GetMarker(mask) && !(*it)->GetMarker(hm) ) aret.push_back((*it)); if( (invert ^ (*it)->GetMarker(mask)) && !(*it)->GetMarker(hm) ) aret.push_back((*it));
} }
return aret; return aret;
} }
...@@ -165,7 +165,7 @@ namespace INMOST ...@@ -165,7 +165,7 @@ namespace INMOST
return aret; return aret;
} }
adjacent<Cell> Edge::getCells(MIDType mask) adjacent<Cell> Edge::getCells(MIDType mask, bool invert)
{ {
adjacent<Cell> aret; adjacent<Cell> aret;
Mesh * m = GetMeshLink(); Mesh * m = GetMeshLink();
...@@ -174,7 +174,7 @@ namespace INMOST ...@@ -174,7 +174,7 @@ namespace INMOST
{ {
for(Element::adj_iterator it = high_conn.begin(); it != high_conn.end(); it++) //faces for(Element::adj_iterator it = high_conn.begin(); it != high_conn.end(); it++) //faces
for(Element::adj_iterator jt = (*it)->high_conn.begin(); jt != (*it)->high_conn.end(); jt++) //cels for(Element::adj_iterator jt = (*it)->high_conn.begin(); jt != (*it)->high_conn.end(); jt++) //cels
if( (*jt)->GetMarker(mask) && !(*jt)->GetMarker(mrk) ) if( (invert ^ (*jt)->GetMarker(mask)) && !(*jt)->GetMarker(mrk) )
{ {
aret.push_back(*jt); aret.push_back(*jt);
(*jt)->SetMarker(mrk); (*jt)->SetMarker(mrk);
...@@ -185,7 +185,7 @@ namespace INMOST ...@@ -185,7 +185,7 @@ namespace INMOST
MIDType hm = GetMeshLink()->HideMarker(); MIDType hm = GetMeshLink()->HideMarker();
for(Element::adj_iterator it = high_conn.begin(); it != high_conn.end(); it++) if( !(*it)->GetMarker(hm) ) //faces for(Element::adj_iterator it = high_conn.begin(); it != high_conn.end(); it++) if( !(*it)->GetMarker(hm) ) //faces
for(Element::adj_iterator jt = (*it)->high_conn.begin(); jt != (*it)->high_conn.end(); jt++) if( !(*jt)->GetMarker(hm) ) //cels for(Element::adj_iterator jt = (*it)->high_conn.begin(); jt != (*it)->high_conn.end(); jt++) if( !(*jt)->GetMarker(hm) ) //cels
if( (*jt)->GetMarker(mask) && !(*jt)->GetMarker(mrk) ) if( (invert ^ (*jt)->GetMarker(mask)) && !(*jt)->GetMarker(mrk) )
{ {
aret.push_back(*jt); aret.push_back(*jt);
(*jt)->SetMarker(mrk); (*jt)->SetMarker(mrk);
......
...@@ -232,7 +232,7 @@ namespace INMOST ...@@ -232,7 +232,7 @@ namespace INMOST
} }
INMOST_DATA_ENUM_TYPE Element::nbAdjElements(ElementType _etype, MIDType mask)const INMOST_DATA_ENUM_TYPE Element::nbAdjElements(ElementType _etype, MIDType mask, bool invert)const
{ {
assert( !(_etype & MESH) ); assert( !(_etype & MESH) );
assert( !(_etype & ESET) ); assert( !(_etype & ESET) );
...@@ -252,17 +252,17 @@ namespace INMOST ...@@ -252,17 +252,17 @@ namespace INMOST
{ {
if( i == myconn ) if( i == myconn )
{ {
if( GetMarker(mask) ) ret += 1; if( invert ^ GetMarker(mask) ) ret += 1;
} }
else if( i == (myconn + 1 + 4)%4 ) else if( i == (myconn + 1 + 4)%4 )
{ {
for(adj_type::const_iterator it = high_conn.begin(); it != high_conn.end(); ++it) for(adj_type::const_iterator it = high_conn.begin(); it != high_conn.end(); ++it)
if( (*it)->GetMarker(mask) ) ret++; if( invert ^ (*it)->GetMarker(mask) ) ret++;
} }
else if( i == (myconn - 1 + 4)%4 ) else if( i == (myconn - 1 + 4)%4 )
{ {
for(adj_type::const_iterator it = low_conn.begin(); it != low_conn.end(); ++it) for(adj_type::const_iterator it = low_conn.begin(); it != low_conn.end(); ++it)
if( (*it)->GetMarker(mask) ) ret++; if( invert ^ (*it)->GetMarker(mask) ) ret++;
} }
else if( i == (myconn - 2 + 4)%4 ) else if( i == (myconn - 2 + 4)%4 )
{ {
...@@ -272,7 +272,7 @@ namespace INMOST ...@@ -272,7 +272,7 @@ namespace INMOST
MIDType mrk = m->CreateMarker(); MIDType mrk = m->CreateMarker();
for(adj_type::const_iterator it = high_conn.begin(); it != high_conn.end(); it++) for(adj_type::const_iterator it = high_conn.begin(); it != high_conn.end(); it++)
for(adj_iterator jt = (*it)->high_conn.begin(); jt != (*it)->high_conn.end(); jt++) for(adj_iterator jt = (*it)->high_conn.begin(); jt != (*it)->high_conn.end(); jt++)
if( (*jt)->GetMarker(mask) && !(*jt)->GetMarker(mrk) ) if( (invert ^ (*jt)->GetMarker(mask)) && !(*jt)->GetMarker(mrk) )
{ {
result.push_back(*jt); result.push_back(*jt);
(*jt)->SetMarker(mrk); (*jt)->SetMarker(mrk);
...@@ -290,7 +290,7 @@ namespace INMOST ...@@ -290,7 +290,7 @@ namespace INMOST
MIDType mrk = m->CreateMarker(); MIDType mrk = m->CreateMarker();
for(adj_type::const_iterator it = low_conn.begin(); it != low_conn.end(); it++) for(adj_type::const_iterator it = low_conn.begin(); it != low_conn.end(); it++)
for(adj_iterator jt = (*it)->low_conn.begin(); jt != (*it)->low_conn.end(); jt++) for(adj_iterator jt = (*it)->low_conn.begin(); jt != (*it)->low_conn.end(); jt++)
if( (*jt)->GetMarker(mask) && !(*jt)->GetMarker(mrk) ) if( (invert ^ (*jt)->GetMarker(mask)) && !(*jt)->GetMarker(mrk) )
{ {
result.push_back(*jt); result.push_back(*jt);
(*jt)->SetMarker(mrk); (*jt)->SetMarker(mrk);
...@@ -311,17 +311,17 @@ namespace INMOST ...@@ -311,17 +311,17 @@ namespace INMOST
{ {
if( i == myconn ) if( i == myconn )
{ {
if( !GetMarker(hm) && GetMarker(mask) ) ret ++; if( !GetMarker(hm) && (invert ^ GetMarker(mask)) ) ret ++;
} }
else if( i == (myconn + 1 + 4)%4 ) else if( i == (myconn + 1 + 4)%4 )
{ {
for(adj_type::const_iterator it = high_conn.begin(); it != high_conn.end(); ++it) for(adj_type::const_iterator it = high_conn.begin(); it != high_conn.end(); ++it)
if( !(*it)->GetMarker(hm) && (*it)->GetMarker(mask) ) ret++; if( !(*it)->GetMarker(hm) && (invert ^ (*it)->GetMarker(mask)) ) ret++;
} }
else if( i == (myconn - 1 + 4)%4 ) else if( i == (myconn - 1 + 4)%4 )
{ {
for(adj_type::const_iterator it = low_conn.begin(); it != low_conn.end(); ++it) for(adj_type::const_iterator it = low_conn.begin(); it != low_conn.end(); ++it)
if( !(*it)->GetMarker(hm) && (*it)->GetMarker(mask) ) ret++; if( !(*it)->GetMarker(hm) && (invert ^ (*it)->GetMarker(mask)) ) ret++;
} }
else if( i == (myconn - 2 + 4)%4 ) else if( i == (myconn - 2 + 4)%4 )
{ {
...@@ -331,7 +331,7 @@ namespace INMOST ...@@ -331,7 +331,7 @@ namespace INMOST
MIDType mrk = m->CreateMarker(); MIDType mrk = m->CreateMarker();
for(adj_type::const_iterator it = high_conn.begin(); it != high_conn.end(); it++) if( !(*it)->GetMarker(hm) ) for(adj_type::const_iterator it = high_conn.begin(); it != high_conn.end(); it++) if( !(*it)->GetMarker(hm) )
for(adj_iterator jt = (*it)->high_conn.begin(); jt != (*it)->high_conn.end(); jt++) if( !(*jt)->GetMarker(hm) ) for(adj_iterator jt = (*it)->high_conn.begin(); jt != (*it)->high_conn.end(); jt++) if( !(*jt)->GetMarker(hm) )
if( (*jt)->GetMarker(mask) && !(*jt)->GetMarker(mrk) ) if( (invert ^ (*jt)->GetMarker(mask)) && !(*jt)->GetMarker(mrk) )
{ {
result.push_back(*jt); result.push_back(*jt);
(*jt)->SetMarker(mrk); (*jt)->SetMarker(mrk);
...@@ -349,7 +349,7 @@ namespace INMOST ...@@ -349,7 +349,7 @@ namespace INMOST
MIDType mrk = m->CreateMarker(); MIDType mrk = m->CreateMarker();
for(adj_type::const_iterator it = low_conn.begin(); it != low_conn.end(); it++) if( !(*it)->GetMarker(hm) ) for(adj_type::const_iterator it = low_conn.begin(); it != low_conn.end(); it++) if( !(*it)->GetMarker(hm) )
for(adj_iterator jt = (*it)->low_conn.begin(); jt != (*it)->low_conn.end(); jt++) if( !(*jt)->GetMarker(hm) ) for(adj_iterator jt = (*it)->low_conn.begin(); jt != (*it)->low_conn.end(); jt++) if( !(*jt)->GetMarker(hm) )
if( (*jt)->GetMarker(mask) && !(*jt)->GetMarker(mrk) ) if( (invert ^ (*jt)->GetMarker(mask)) && !(*jt)->GetMarker(mrk) )
{ {
result.push_back(*jt); result.push_back(*jt);
(*jt)->SetMarker(mrk); (*jt)->SetMarker(mrk);
...@@ -492,7 +492,7 @@ namespace INMOST ...@@ -492,7 +492,7 @@ namespace INMOST
return result; return result;
} }
adjacent<Element> Element::getAdjElements(ElementType _etype, MIDType mask) const adjacent<Element> Element::getAdjElements(ElementType _etype, MIDType mask, bool invert) const
{ {
assert( !(_etype & MESH) ); assert( !(_etype & MESH) );
assert( !(_etype & ESET) ); assert( !(_etype & ESET) );
...@@ -513,18 +513,18 @@ namespace INMOST ...@@ -513,18 +513,18 @@ namespace INMOST
{ {
if( i == myconn ) if( i == myconn )
{ {
if( GetMarker(mask) ) result.push_back(const_cast<Element *>(this)); if( invert ^ GetMarker(mask) ) result.push_back(const_cast<Element *>(this));
} }
else if( i == (myconn + 1 + 4)%4 ) else if( i == (myconn + 1 + 4)%4 )
{ {
for(adj_type::const_iterator it = high_conn.begin(); it != high_conn.end(); ++it) for(adj_type::const_iterator it = high_conn.begin(); it != high_conn.end(); ++it)
if( (*it)->GetMarker(mask) ) result.push_back(*it); if( invert ^ (*it)->GetMarker(mask) ) result.push_back(*it);
} }
else if( i == (myconn - 1 + 4)%4 ) else if( i == (myconn - 1 + 4)%4 )
{ {
for(adj_type::const_iterator it = low_conn.begin(); it != low_conn.end(); ++it) for(adj_type::const_iterator it = low_conn.begin(); it != low_conn.end(); ++it)
if( (*it)->GetMarker(mask) ) result.push_back(*it); if( invert ^ (*it)->GetMarker(mask) ) result.push_back(*it);
} }
else if( i == (myconn - 2 + 4)%4 ) else if( i == (myconn - 2 + 4)%4 )
{ {
...@@ -534,7 +534,7 @@ namespace INMOST ...@@ -534,7 +534,7 @@ namespace INMOST
MIDType mrk = m->CreateMarker(); MIDType mrk = m->CreateMarker();
for(adj_type::const_iterator it = high_conn.begin(); it != high_conn.end(); it++) for(adj_type::const_iterator it = high_conn.begin(); it != high_conn.end(); it++)
for(adj_type::iterator jt = (*it)->high_conn.begin(); jt != (*it)->high_conn.end(); jt++) for(adj_type::iterator jt = (*it)->high_conn.begin(); jt != (*it)->high_conn.end(); jt++)
if( (*jt)->GetMarker(mask) && !(*jt)->GetMarker(mrk) ) if( (invert ^ (*jt)->GetMarker(mask)) && !(*jt)->GetMarker(mrk) )
{ {
result.push_back(*jt); result.push_back(*jt);
(*jt)->SetMarker(mrk); (*jt)->SetMarker(mrk);
...@@ -549,7 +549,7 @@ namespace INMOST ...@@ -549,7 +549,7 @@ namespace INMOST
MIDType mrk = m->CreateMarker(); MIDType mrk = m->CreateMarker();
for(adj_type::const_iterator it = low_conn.begin(); it != low_conn.end(); it++) for(adj_type::const_iterator it = low_conn.begin(); it != low_conn.end(); it++)
for(adj_type::iterator jt = (*it)->low_conn.begin(); jt != (*it)->low_conn.end(); jt++) for(adj_type::iterator jt = (*it)->low_conn.begin(); jt != (*it)->low_conn.end(); jt++)
if( (*jt)->GetMarker(mask) && !(*jt)->GetMarker(mrk) ) if( (invert ^ (*jt)->GetMarker(mask)) && !(*jt)->GetMarker(mrk) )
{ {
result.push_back(*jt); result.push_back(*jt);
(*jt)->SetMarker(mrk); (*jt)->SetMarker(mrk);
...@@ -568,19 +568,19 @@ namespace INMOST ...@@ -568,19 +568,19 @@ namespace INMOST
{ {
if( i == myconn ) if( i == myconn )
{ {
if( !GetMarker(hm) && GetMarker(mask) ) if( !GetMarker(hm) && (invert ^ GetMarker(mask)) )
result.push_back(const_cast<Element *>(this)); result.push_back(const_cast<Element *>(this));
} }
else if( i == (myconn + 1 + 4)%4 ) else if( i == (myconn + 1 + 4)%4 )
{ {
for(adj_type::const_iterator it = high_conn.begin(); it != high_conn.end(); ++it) for(adj_type::const_iterator it = high_conn.begin(); it != high_conn.end(); ++it)
if( (*it)->GetMarker(mask) && !(*it)->GetMarker(hm) ) result.push_back(*it); if( (invert ^ (*it)->GetMarker(mask)) && !(*it)->GetMarker(hm) ) result.push_back(*it);
} }
else if( i == (myconn - 1 + 4)%4 ) else if( i == (myconn - 1 + 4)%4 )
{ {
for(adj_type::const_iterator it = low_conn.begin(); it != low_conn.end(); ++it) for(adj_type::const_iterator it = low_conn.begin(); it != low_conn.end(); ++it)
if( (*it)->GetMarker(mask) && !(*it)->GetMarker(hm) ) result.push_back(*it); if( (invert ^ (*it)->GetMarker(mask)) && !(*it)->GetMarker(hm) ) result.push_back(*it);
} }
else if( i == (myconn - 2 + 4)%4 ) else if( i == (myconn - 2 + 4)%4 )
{ {
...@@ -590,7 +590,7 @@ namespace INMOST ...@@ -590,7 +590,7 @@ namespace INMOST
MIDType mrk = m->CreateMarker(); MIDType mrk = m->CreateMarker();
for(adj_type::const_iterator it = high_conn.begin(); it != high_conn.end(); it++) if( !(*it)->GetMarker(hm) ) for(adj_type::const_iterator it = high_conn.begin(); it != high_conn.end(); it++) if( !(*it)->GetMarker(hm) )
for(adj_type::iterator jt = (*it)->high_conn.begin(); jt != (*it)->high_conn.end(); jt++) if( !(*jt)->GetMarker(hm) ) for(adj_type::iterator jt = (*it)->high_conn.begin(); jt != (*it)->high_conn.end(); jt++) if( !(*jt)->GetMarker(hm) )
if( (*jt)->GetMarker(mask) && !(*jt)->GetMarker(mrk) ) if( (invert ^ (*jt)->GetMarker(mask)) && !(*jt)->GetMarker(mrk) )
{ {
result.push_back(*jt); result.push_back(*jt);
(*jt)->SetMarker(mrk); (*jt)->SetMarker(mrk);
...@@ -605,7 +605,7 @@ namespace INMOST ...@@ -605,7 +605,7 @@ namespace INMOST
MIDType mrk = m->CreateMarker(); MIDType mrk = m->CreateMarker();
for(adj_type::const_iterator it = low_conn.begin(); it != low_conn.end(); it++) if( !(*it)->GetMarker(hm) ) for(adj_type::const_iterator it = low_conn.begin(); it != low_conn.end(); it++) if( !(*it)->GetMarker(hm) )
for(adj_type::iterator jt = (*it)->low_conn.begin(); jt != (*it)->low_conn.end(); jt++) if( !(*jt)->GetMarker(hm) ) for(adj_type::iterator jt = (*it)->low_conn.begin(); jt != (*it)->low_conn.end(); jt++) if( !(*jt)->GetMarker(hm) )
if( (*jt)->GetMarker(mask) && !(*jt)->GetMarker(mrk) )