external/bbop.js
function rec_up(nid){

	//print('rec_up on: ' + nid);

    	var results = new Array();
    	var new_parent_edges = anchor.get_parent_edges(nid, pid);

	// Capture edge list for later adding.
	for( var e = 0; e < new_parent_edges.length; e++ ){
	    seen_edge_list.push(new_parent_edges[e]);
	}

	// Pull extant nodes from edges. NOTE: This is a retread
	// of what happens in get_parent_nodes to avoid another
	// call to get_parent_edges (as all this is now
	// implemented).
	var new_parents = new Array();
	for( var n = 0; n < new_parent_edges.length; n++ ){
	    // Make sure that any found edges are in our
	    // world.
	    var obj_id = new_parent_edges[n].object_id();
	    var temp_node = anchor.get_node(obj_id);
	    if( temp_node ){
		new_parents.push( temp_node );
	    }
	}

	// Make sure we're in there too.
	var tmp_node = anchor.get_node(nid);
	if( tmp_node ){
	    new_parents.push( tmp_node );
	}

	// Recur on unseen things and mark the current as seen.
    	if( new_parents.length != 0 ){
    	    for( var i = 0; i < new_parents.length; i++ ){
    		// Only do things we haven't ever seen before.
    		var new_anc = new_parents[i];
    		var new_anc_id = new_anc.id();
    		if( ! seen_node_hash[ new_anc_id ] ){
    		    seen_node_hash[ new_anc_id ] = new_anc;
    		    rec_up(new_anc_id);	
    		}
    	    }
    	}
    	return results;
    }
function rec_up(nid){

	//print('rec_up on: ' + nid);

    	var results = new Array();
    	var new_parent_edges = anchor.get_parent_edges(nid, pid);

	// Capture edge list for later adding.
	for( var e = 0; e < new_parent_edges.length; e++ ){
	    seen_edge_list.push(new_parent_edges[e]);
	}

	// Pull extant nodes from edges. NOTE: This is a retread
	// of what happens in get_parent_nodes to avoid another
	// call to get_parent_edges (as all this is now
	// implemented).
	var new_parents = new Array();
	for( var n = 0; n < new_parent_edges.length; n++ ){
	    // Make sure that any found edges are in our
	    // world.
	    var obj_id = new_parent_edges[n].object_id();
	    var temp_node = anchor.get_node(obj_id);
	    if( temp_node ){
		new_parents.push( temp_node );
	    }
	}

	// Make sure we're in there too.
	var tmp_node = anchor.get_node(nid);
	if( tmp_node ){
	    new_parents.push( tmp_node );
	}

	// Recur on unseen things and mark the current as seen.
    	if( new_parents.length != 0 ){
    	    for( var i = 0; i < new_parents.length; i++ ){
    		// Only do things we haven't ever seen before.
    		var new_anc = new_parents[i];
    		var new_anc_id = new_anc.id();
    		if( ! seen_node_hash[ new_anc_id ] ){
    		    seen_node_hash[ new_anc_id ] = new_anc;
    		    rec_up(new_anc_id);	
    		}
    	    }
    	}
    	return results;
    }
function rec_up ( nid ) { //print('rec_up on: ' + nid); var results = new Array ( ) ; var new_parent_edges = anchor . get_parent_edges ( nid , pid ) ; // Capture edge list for later adding. for ( var e = 0 ; e < new_parent_edges . length ; e ++ ) { seen_edge_list . push ( new_parent_edges [ e ] ) ; } // Pull extant nodes from edges. NOTE: This is a retread // of what happens in get_parent_nodes to avoid another // call to get_parent_edges (as all this is now // implemented). var new_parents = new Array ( ) ; for ( var n = 0 ; n < new_parent_edges . length ; n ++ ) { // Make sure that any found edges are in our // world. var obj_id = new_parent_edges [ n ] . object_id ( ) ; var temp_node = anchor . get_node ( obj_id ) ; if ( temp_node ) { new_parents . push ( temp_node ) ; } } // Make sure we're in there too. var tmp_node = anchor . get_node ( nid ) ; if ( tmp_node ) { new_parents . push ( tmp_node ) ; } // Recur on unseen things and mark the current as seen. if ( new_parents . length != 0 ) { for ( var i = 0 ; i < new_parents . length ; i ++ ) { // Only do things we haven't ever seen before. var new_anc = new_parents [ i ] ; var new_anc_id = new_anc . id ( ) ; if ( ! seen_node_hash [ new_anc_id ] ) { seen_node_hash [ new_anc_id ] = new_anc ; rec_up ( new_anc_id ) ; } } } return results ; }
Define recursive ascent.
Define recursive ascent .