int deleteEdgeInternal_ ( int half_edge ) { int chain = getHalfEdgeChain ( half_edge ) ; int halfEdgeTwin = getHalfEdgeTwin ( half_edge ) ; int chainTwin = getHalfEdgeChain ( halfEdgeTwin ) ; // This function only works for spikes. These two asserts check for that assert ( chainTwin == chain ) ; assert ( half_edge == getHalfEdgeNext ( halfEdgeTwin ) || halfEdgeTwin == getHalfEdgeNext ( half_edge ) ) ; int n = getHalfEdgeNext ( half_edge ) ; if ( n == halfEdgeTwin ) { n = getHalfEdgeNext ( n ) ; if ( n == half_edge ) n = - 1 ; } if ( getChainHalfEdge ( chain ) == half_edge ) { setChainHalfEdge_ ( chain , n ) ; } int chainIndex = getChainIndex_ ( chain ) ; double v = m_chainAreas . read ( chainIndex ) ; if ( ! NumberUtils . isNaN ( v ) ) { setChainArea_ ( chain , NumberUtils . TheNaN ) ; setChainPerimeter_ ( chain , NumberUtils . TheNaN ) ; } updateVertexToHalfEdgeConnection_ ( half_edge , true ) ; deleteEdgeImpl_ ( half_edge ) ; // does not change chain information return n ; }
Use with care .