void dissolveCommonEdges_ ( ) { int visitedEdges = m_topo_graph . createUserIndexForHalfEdges ( ) ; AttributeStreamOfInt32 edgesToDelete = new AttributeStreamOfInt32 ( 0 ) ; // Now extract paths that for ( int cluster = m_topo_graph . getFirstCluster ( ) ; cluster != - 1 ; cluster = m_topo_graph . getNextCluster ( cluster ) ) { int firstHalfEdge = m_topo_graph . getClusterHalfEdge ( cluster ) ; int half_edge = firstHalfEdge ; if ( firstHalfEdge == - 1 ) continue ; do { int visited = m_topo_graph . getHalfEdgeUserIndex ( half_edge , visitedEdges ) ; if ( visited != 1 ) { int halfEdgeTwin = m_topo_graph . getHalfEdgeTwin ( half_edge ) ; m_topo_graph . setHalfEdgeUserIndex ( halfEdgeTwin , visitedEdges , 1 ) ; m_topo_graph . setHalfEdgeUserIndex ( half_edge , visitedEdges , 1 ) ; int parentage = m_topo_graph . getHalfEdgeFaceParentage ( half_edge ) ; if ( isGoodParentage ( parentage ) ) { int twinParentage = m_topo_graph . getHalfEdgeFaceParentage ( halfEdgeTwin ) ; if ( isGoodParentage ( twinParentage ) ) { // This half_edge pair is a border between two faces // that share the parentage or it is a dangling edge edgesToDelete . add ( half_edge ) ; // remember for // subsequent delete } } } half_edge = m_topo_graph . getHalfEdgeNext ( m_topo_graph . getHalfEdgeTwin ( half_edge ) ) ; } while ( half_edge != firstHalfEdge ) ; } m_topo_graph . deleteUserIndexForHalfEdges ( visitedEdges ) ; m_topo_graph . deleteEdgesBreakFaces_ ( edgesToDelete ) ; }
dissolved faces . Only face parentage will be uasable .