X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=lib%2Ffpa%2FBase%2FAlgorithm.hxx;h=26729aaa37e77fdad63c16d4d207fa7bf66e9ba7;hb=89393f2267e42e921571c0184320d6c6382f34ab;hp=3a8b2d04aca27f44155f6112afc7575be1308bef;hpb=721b19efb3da24f38076b689517b6ed1ddbd03d2;p=FrontAlgorithms.git diff --git a/lib/fpa/Base/Algorithm.hxx b/lib/fpa/Base/Algorithm.hxx index 3a8b2d0..26729aa 100644 --- a/lib/fpa/Base/Algorithm.hxx +++ b/lib/fpa/Base/Algorithm.hxx @@ -139,12 +139,13 @@ GenerateData( ) this->InvokeEvent( TEvent( node.Vertex, node.FrontId, false ) ); if( !( this->_IsMarked( node.Vertex ) ) ) { - // Mark it - if( this->_Mark( node.Vertex, node.FrontId ) ) - { - // Update output value - this->_UpdateOutputValue( node ); + // Update output value and mark vertex + this->_UpdateOutputValue( node ); + this->_Mark( node.Vertex, node.FrontId ); + // The actual node was effectively marked? + if( node.FrontId > 0 ) + { // Add neighborhood TNeighborhood neighbors = this->_GetNeighbors( node.Vertex ); typename TNeighborhood::const_iterator nIt = neighbors.begin( ); @@ -167,12 +168,9 @@ GenerateData( ) nnode.Vertex = *nIt; nnode.Parent = node.Vertex; nnode.FrontId = node.FrontId; - if( this->_ComputeOutputValue( nnode ) ) - { - this->_QueuePush( nnode ); - this->InvokeEvent( TEvent( nnode.Vertex, nnode.FrontId, true ) ); - - } // fi + this->_ComputeOutputValue( nnode ); + this->_QueuePush( nnode ); + this->InvokeEvent( TEvent( nnode.Vertex, nnode.FrontId, true ) ); } // fi ++nIt;