|
@@ -5234,138 +5234,6 @@
|
|
|
|
|
|
},
|
|
|
|
|
|
- searchConnectionParent: function ( id ) {
|
|
|
-
|
|
|
- if ( this.__cache_search_connection_parent === undefined ) {
|
|
|
-
|
|
|
- this.__cache_search_connection_parent = [];
|
|
|
-
|
|
|
- }
|
|
|
-
|
|
|
- if ( this.__cache_search_connection_parent[ id ] !== undefined ) {
|
|
|
-
|
|
|
- return this.__cache_search_connection_parent[ id ];
|
|
|
-
|
|
|
- } else {
|
|
|
-
|
|
|
- this.__cache_search_connection_parent[ id ] = [];
|
|
|
-
|
|
|
- }
|
|
|
-
|
|
|
- var conns = this.Connections.properties.connections;
|
|
|
-
|
|
|
- var results = [];
|
|
|
- for ( var i = 0; i < conns.length; ++ i ) {
|
|
|
-
|
|
|
- if ( conns[ i ][ 0 ] == id ) {
|
|
|
-
|
|
|
- // 0 means scene root
|
|
|
- var res = conns[ i ][ 1 ] === 0 ? - 1 : conns[ i ][ 1 ];
|
|
|
- results.push( res );
|
|
|
-
|
|
|
- }
|
|
|
-
|
|
|
- }
|
|
|
-
|
|
|
- if ( results.length > 0 ) {
|
|
|
-
|
|
|
- append( this.__cache_search_connection_parent[ id ], results );
|
|
|
- return results;
|
|
|
-
|
|
|
- } else {
|
|
|
-
|
|
|
- this.__cache_search_connection_parent[ id ] = [ - 1 ];
|
|
|
- return [ - 1 ];
|
|
|
-
|
|
|
- }
|
|
|
-
|
|
|
- },
|
|
|
-
|
|
|
- searchConnectionChildren: function ( id ) {
|
|
|
-
|
|
|
- if ( this.__cache_search_connection_children === undefined ) {
|
|
|
-
|
|
|
- this.__cache_search_connection_children = [];
|
|
|
-
|
|
|
- }
|
|
|
-
|
|
|
- if ( this.__cache_search_connection_children[ id ] !== undefined ) {
|
|
|
-
|
|
|
- return this.__cache_search_connection_children[ id ];
|
|
|
-
|
|
|
- } else {
|
|
|
-
|
|
|
- this.__cache_search_connection_children[ id ] = [];
|
|
|
-
|
|
|
- }
|
|
|
-
|
|
|
- var conns = this.Connections.properties.connections;
|
|
|
-
|
|
|
- var res = [];
|
|
|
- for ( var i = 0; i < conns.length; ++ i ) {
|
|
|
-
|
|
|
- if ( conns[ i ][ 1 ] == id ) {
|
|
|
-
|
|
|
- // 0 means scene root
|
|
|
- res.push( conns[ i ][ 0 ] === 0 ? - 1 : conns[ i ][ 0 ] );
|
|
|
- // there may more than one kid, then search to the end
|
|
|
-
|
|
|
- }
|
|
|
-
|
|
|
- }
|
|
|
-
|
|
|
- if ( res.length > 0 ) {
|
|
|
-
|
|
|
- append( this.__cache_search_connection_children[ id ], res );
|
|
|
- return res;
|
|
|
-
|
|
|
- } else {
|
|
|
-
|
|
|
- this.__cache_search_connection_children[ id ] = [];
|
|
|
- return [];
|
|
|
-
|
|
|
- }
|
|
|
-
|
|
|
- },
|
|
|
-
|
|
|
- searchConnectionType: function ( id, to ) {
|
|
|
-
|
|
|
- var key = id + ',' + to; // TODO: to hash
|
|
|
- if ( this.__cache_search_connection_type === undefined ) {
|
|
|
-
|
|
|
- this.__cache_search_connection_type = {};
|
|
|
-
|
|
|
- }
|
|
|
-
|
|
|
- if ( this.__cache_search_connection_type[ key ] !== undefined ) {
|
|
|
-
|
|
|
- return this.__cache_search_connection_type[ key ];
|
|
|
-
|
|
|
- } else {
|
|
|
-
|
|
|
- this.__cache_search_connection_type[ key ] = '';
|
|
|
-
|
|
|
- }
|
|
|
-
|
|
|
- var conns = this.Connections.properties.connections;
|
|
|
-
|
|
|
- for ( var i = 0; i < conns.length; ++ i ) {
|
|
|
-
|
|
|
- if ( conns[ i ][ 0 ] == id && conns[ i ][ 1 ] == to ) {
|
|
|
-
|
|
|
- // 0 means scene root
|
|
|
- this.__cache_search_connection_type[ key ] = conns[ i ][ 2 ];
|
|
|
- return conns[ i ][ 2 ];
|
|
|
-
|
|
|
- }
|
|
|
-
|
|
|
- }
|
|
|
-
|
|
|
- this.__cache_search_connection_type[ id ] = null;
|
|
|
- return null;
|
|
|
-
|
|
|
- }
|
|
|
-
|
|
|
} );
|
|
|
|
|
|
|