public static void markHillSlopeWithLinkValue( RandomIter flowIter, RandomIter attributeIter, WritableRandomIter markedIter,
            int cols, int rows, IHMProgressMonitor pm ) {
        pm.beginTask("Marking the hillslopes with the channel value...", rows);
        for( int r = 0; r < rows; r++ ) {
            for( int c = 0; c < cols; c++ ) {
                FlowNode flowNode = new FlowNode(flowIter, cols, rows, c, r);
                if (flowNode.isHeadingOutside()) {
                    // ignore single cells on borders that exit anyway
                    continue;
                }

                if (flowNode.isMarkedAsOutlet()) {
                    double attributeValue = flowNode.getDoubleValueFromMap(attributeIter);
                    flowNode.setDoubleValueInMap(markedIter, attributeValue);
                    continue;
                }
                if (flowNode.isValid() && flowNode.isSource()) {
                    /*
                     * run down to the net to find the
                     * attribute map content on the net 
                     */
                    double attributeValue = doubleNovalue;
                    FlowNode runningNode = flowNode.goDownstream();
                    int runningRow = -1;
                    int runningCol = -1;
                    while( runningNode != null && runningNode.isValid() ) {
                        runningRow = runningNode.row;
                        runningCol = runningNode.col;
                        if (runningNode.isMarkedAsOutlet()) {
                            attributeValue = runningNode.getDoubleValueFromMap(attributeIter);
                            break;
                        }
                        runningNode = runningNode.goDownstream();
                    }
                    if (!isNovalue(attributeValue)) {
                        // run down marking the hills
                        runningNode = flowNode;
                        while( runningNode != null && runningNode.isValid() ) {
                            runningNode.setDoubleValueInMap(markedIter, attributeValue);
                            if (runningNode.isMarkedAsOutlet()) {
                                break;
                            }
                            runningNode = runningNode.goDownstream();
                        }
                    } else {
                        throw new ModelsIllegalargumentException(
                                "Could not find a value of the attributes map in the channel after point: " + runningCol + "/"
                                        + runningRow + ". Are you sure that everything leads to a channel or outlet?",
                                "MODELSENGINE", pm);
                    }
                }
            }
            pm.worked(1);
        }
        pm.done();
    }
public static void markHillSlopeWithLinkValue ( RandomIter flowIter , RandomIter attributeIter , WritableRandomIter markedIter , int cols , int rows , IHMProgressMonitor pm ) { pm . beginTask ( "Marking the hillslopes with the channel value..." , rows ) ; for ( int r = 0 ; r < rows ; r ++ ) { for ( int c = 0 ; c < cols ; c ++ ) { FlowNode flowNode = new FlowNode ( flowIter , cols , rows , c , r ) ; if ( flowNode . isHeadingOutside ( ) ) { continue ; } if ( flowNode . isMarkedAsOutlet ( ) ) { double attributeValue = flowNode . getDoubleValueFromMap ( attributeIter ) ; flowNode . setDoubleValueInMap ( markedIter , attributeValue ) ; continue ; } if ( flowNode . isValid ( ) && flowNode . isSource ( ) ) { double attributeValue = doubleNovalue ; FlowNode runningNode = flowNode . goDownstream ( ) ; int runningRow = - 1 ; int runningCol = - 1 ; while ( runningNode != null && runningNode . isValid ( ) ) { runningRow = runningNode . row ; runningCol = runningNode . col ; if ( runningNode . isMarkedAsOutlet ( ) ) { attributeValue = runningNode . getDoubleValueFromMap ( attributeIter ) ; break ; } runningNode = runningNode . goDownstream ( ) ; } if ( ! isNovalue ( attributeValue ) ) { runningNode = flowNode ; while ( runningNode != null && runningNode . isValid ( ) ) { runningNode . setDoubleValueInMap ( markedIter , attributeValue ) ; if ( runningNode . isMarkedAsOutlet ( ) ) { break ; } runningNode = runningNode . goDownstream ( ) ; } } else { throw new ModelsIllegalargumentException ( "Could not find a value of the attributes map in the channel after point: " + runningCol + "/" + runningRow + ". Are you sure that everything leads to a channel or outlet?" , "MODELSENGINE" , pm ) ; } } } pm . worked ( 1 ) ; } pm . done ( ) ; }
Marks a map on the hillslope with the values on the channel of an attribute map.

@param flowIter map of flow direction with the network cells
all marked as {@link FlowNode#NETVALUE}. This is very important!
@param attributeIter map of attributes.
@param markedIter the map to be marked.
@param cols region cols.
@param rows region rows.
@param pm monitor.