Commit fa5b300b authored by Kirill Terekhov's avatar Kirill Terekhov
Browse files

SwapEnds function and unfinished ecl format implementation

parent d5434456
......@@ -528,6 +528,8 @@ namespace INMOST
static bool TestSplitEdge (Edge e, const ElementArray<Node> & nodes, MarkerType del_protect);
//implemented in geometry.cpp
Storage::real Length () const;
///Swap positions of first node and last node
void SwapEnds ();
};
__INLINE const Edge & InvalidEdge() {static Edge ret(NULL,InvalidHandle()); return ret;}
......
This diff is collapsed.
......@@ -56,6 +56,22 @@ namespace INMOST
FixNormalOrientation(); //maybe should change orientation?
}
}
void Edge::SwapEnds()
{
Mesh * m = GetMeshLink();
MarkerType hm = m->HideMarker();
adj_type & hc = m->HighConn(GetHandle());
if( m->Count(hc.data(),static_cast<enumerator>(hc.size()),hm) == 2 )
{
enumerator k1 = ENUMUNDEF, k2;
k1 = m->getNext(hc.data(),static_cast<enumerator>(hc.size()),k1,hm);
k2 = m->getNext(hc.data(),static_cast<enumerator>(hc.size()),k1,hm);
HandleType temp = hc[k1];
hc[k1] = hc[k2];
hc[k2] = temp;
}
}
void Element::Disconnect(bool del_upper) const
{
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment