def processXMLElement(xmlElement): 'Process the xml element.' target = evaluate.getXMLElementByKey('target', xmlElement) if target == None: print('Warning, copy could not get target.') return del xmlElement.attributeDictionary['target'] copyMatrix = matrix.getFromObjectOrXMLElement(xmlElement) targetMatrix = matrix.getFromObjectOrXMLElement(target) targetDictionaryCopy = target.attributeDictionary.copy() euclidean.removeElementsFromDictionary(targetDictionaryCopy, ['id', 'name']) targetDictionaryCopy.update(xmlElement.attributeDictionary) xmlElement.attributeDictionary = targetDictionaryCopy euclidean.removeTrueFromDictionary(xmlElement.attributeDictionary, 'visible') xmlElement.className = target.className target.copyXMLChildren(xmlElement.getIDSuffix(), xmlElement) xmlElement.getXMLProcessor().processXMLElement(xmlElement) if copyMatrix != None and targetMatrix != None: xmlElement.object.matrix4X4 = copyMatrix.getSelfTimesOther(targetMatrix.tetragrid)
def processXMLElement(xmlElement): 'Process the xml element.' target = evaluate.getXMLElementByKey('target', xmlElement) if target == None: print('Warning, copy could not get target.') return del xmlElement.attributeDictionary['target'] copyMatrix = matrix.getFromObjectOrXMLElement(xmlElement) targetMatrix = matrix.getFromObjectOrXMLElement(target) targetDictionaryCopy = target.attributeDictionary.copy() euclidean.removeElementsFromDictionary(targetDictionaryCopy, ['id', 'name']) targetDictionaryCopy.update(xmlElement.attributeDictionary) xmlElement.attributeDictionary = targetDictionaryCopy euclidean.removeTrueFromDictionary(xmlElement.attributeDictionary, 'visible') xmlElement.className = target.className target.copyXMLChildren(xmlElement.getIDSuffix(), xmlElement) xmlElement.getXMLProcessor().processXMLElement(xmlElement) if copyMatrix != None and targetMatrix != None: xmlElement.object.matrix4X4 = copyMatrix.getSelfTimesOther( targetMatrix.tetragrid)
def processXMLElement(xmlElement): "Process the xml element." target = evaluate.getXMLElementByKey('target', xmlElement) if target == None: print('Warning, array could not get target for:') print(xmlElement) return vertexes = getVertexesByKey('vertexes', xmlElement) if len(vertexes) == 0: print('Warning, array could not get vertexes for:') print(xmlElement) return arrayDictionary = xmlElement.attributeDictionary.copy() targetMatrixCopy = matrix.getFromObjectOrXMLElement(target) matrix.setAttributeDictionaryToMatrix(target.attributeDictionary, targetMatrixCopy) xmlElement.className = 'group' for vector3Index in xrange(len(vertexes)): vector3 = vertexes[vector3Index] vector3Matrix = matrix.Matrix(targetMatrixCopy.tetragrid) lastChild = target.getCopy(xmlElement.getIDSuffix(vector3Index), xmlElement) euclidean.overwriteDictionary(xmlElement.attributeDictionary, ['id'], ['visible'], lastChild.attributeDictionary) vertexElement = vertex.getUnboundVertexElement(vector3) matrix.setXMLElementDictionaryToOtherElementDictionary(vertexElement, vector3Matrix, 'matrix.', lastChild) xmlElement.getXMLProcessor().processXMLElement(xmlElement)