key = new HashKey(key); String nodeId = key.getLastNodeId(); NodeRetained prevNode = node; Vector<NodeRetained> parents = ((SharedGroupRetained)node).parents;
/** * Returns a hash number based on the data values in this * object. Two different SceneGraphPath objects with identical data * values (ie, returns true for trans.equals(SceneGraphPath) ) will * return the same hash number. Two Paths with different data members * may return the same hash value, although this is not likely. * @return the integer hash value */ @Override public int hashCode() { HashKey key = new HashKey(250); // NOTE: Needed to add interior != null because this method is called // by object.toString() when interior is null. if(interior != null && item != null) { for(int i=0; i<interior.length; i++) { key.append(LinkRetained.plus).append( item.toString() ); } } return( key.hashCode() + transform.hashCode() ); }
HashKey append(String str) { int len = 0; if (str == null) return this; len = str.length(); ensureCapacity(count + len); str.getChars(0, len, value, count); count += len; return this; }
HashKey[] getNewKeys(String localeNodeId, HashKey oldKeys[]) { HashKey newKeys[]; if (!inSharedGroup) { newKeys = new HashKey[1]; newKeys[0] = new HashKey(localeNodeId); newKeys[0].append(plus + nodeId); } else { // Need to append this link node id to all keys passed in. newKeys = new HashKey[oldKeys.length]; for (int i=oldKeys.length-1; i>=0; i--) { newKeys[i] = new HashKey(oldKeys[i].toString() + plus + nodeId); } } return newKeys; }
void getHashKey(HashKey key) { if (interior != null) { key.reset(); key.append(root.nodeId); for(int i=0; i<interior.length; i++) { Node node = interior[i]; if (!node.isLive()) { throw new RuntimeException(J3dI18N.getString("SceneGraphPath3")); } NodeRetained nodeR = (NodeRetained) node.retained; if (nodeR.nodeType == NodeRetained.LINK) { key.append("+").append(nodeR.nodeId); } } } }
int equals(HashKey localToVworldKeys[], int start, int end) { int mid; mid = start +((end - start)/ 2); if(localToVworldKeys[mid] != null) { int test = equals(localToVworldKeys[mid]); if((test < 0) && (start != mid)) return equals(localToVworldKeys, start, mid); else if((test > 0) && (start != mid)) return equals(localToVworldKeys, mid, end); else if(test == 0) return mid; else return -1; } // A null haskey encountered. return -2; }
void removeScope(int index) { Object[] scopeInfo = new Object[3]; ArrayList removeScopeList = new ArrayList(); GroupRetained group = scopes.elementAt(index); tempKey.reset(); group.removeAllNodesForScopedFog(mirrorFog, removeScopeList, tempKey); initRemoveScope(index); scopeInfo[0] = null; scopeInfo[1] = removeScopeList; scopeInfo[2] = (scopes.size() > 0 ? Boolean.TRUE: Boolean.FALSE); sendMessage(SCOPE_CHANGED, scopeInfo); }
nodeR = this; transformLevels[i] = -1; key = new HashKey(localToVworldKeys[i]); else if (nodeR instanceof SharedGroupRetained) { String nodeId = key.getLastNodeId(); Vector<NodeRetained> parents = ((SharedGroupRetained)nodeR).parents; int sz = parents.size(); if (tg.inSharedGroup) { j = key.equals(tg.localToVworldKeys, 0, tg.localToVworldKeys.length);
HashKey(String str) { this(str.length() + 16); append(str); }
HashKey(HashKey hashkey) { this.set(hashkey); }
String nodeId = key.getLastNodeId();
HashKey currentKey = new HashKey(); } else { // LinkRetained ln = (LinkRetained)obj; currentKey.set(localToVworldKeys[index]); currentKey.append(LinkRetained.plus).append(ln.nodeId); if ((ln.sharedGroup != null) && (ln.sharedGroup.localToVworldKeys != null)) { j = currentKey.equals(ln.sharedGroup.localToVworldKeys,0, ln.sharedGroup.localToVworldKeys.length); if(j < 0) { currentKey.reset(); currentKey.append(locale.nodeId); currentKey.append(LinkRetained.plus).append(ln.nodeId); if ((ln.sharedGroup != null) && (ln.sharedGroup.localToVworldKeys != null)) { j = currentKey.equals(ln.sharedGroup.localToVworldKeys,0, ln.sharedGroup.localToVworldKeys.length); if(j < 0) {
/** * Get the localToVworld transform for a node */ void getLocalToVworld(Transform3D t, HashKey key) { HashKey newKey = new HashKey(key); computeLocalToVworld(this, this, newKey, t); }
void removeScope(int index) { Object[] scopeInfo = new Object[3]; ArrayList removeScopeList = new ArrayList(); GroupRetained group = scopes.elementAt(index); tempKey.reset(); group.removeAllNodesForScopedAltApp(mirrorAltApp, removeScopeList, tempKey); initRemoveScope(index); scopeInfo[0] = null; scopeInfo[1] = removeScopeList; scopeInfo[2] = (scopes.size() > 0 ? Boolean.TRUE: Boolean.FALSE); sendMessage(SCOPE_CHANGED, scopeInfo); }
@Override int[] processViewSpecificInfo(int mode, HashKey k, View v, ArrayList vsgList, int[] keyList, ArrayList leafList) { int nchildren = children.size(); if (source.isLive()) { for (int i = 0; i < nchildren; i++) { NodeRetained child = children.get(i); if (child instanceof LeafRetained) { if (child instanceof LinkRetained) { int lastCount = k.count; LinkRetained ln = (LinkRetained) child; if (k.count == 0) { k.append(locale.nodeId); } keyList = ((GroupRetained)(ln.sharedGroup)). processViewSpecificInfo(mode, k.append("+").append(ln.nodeId), v, vsgList, keyList, leafList); k.count = lastCount; } else { ((LeafRetained)child).getMirrorObjects(leafList, k); } } else { keyList = child.processViewSpecificInfo(mode, k, v, vsgList, keyList, leafList); } } } return keyList; }