def processXMLElement(xmlElement, xmlProcessor): "Process the xml element." target = evaluate.getXMLElementByKey('target', xmlElement) if target == None: print('Warning, array could not get target for:') print(xmlElement) return vertices = getVerticesByKey('vertices', xmlElement) if len(vertices) == 0: print('Warning, array could not get vertices for:') print(xmlElement) return arrayDictionary = xmlElement.attributeDictionary.copy() targetMatrix4X4Copy = matrix4x4.Matrix4X4().getFromXMLElement(target) matrix4x4.setAttributeDictionaryToMatrix(target.attributeDictionary, targetMatrix4X4Copy) xmlElement.className = 'group' for vector3Index in xrange(len(vertices)): vector3 = vertices[vector3Index] vector3Matrix4X4 = matrix4x4.Matrix4X4( targetMatrix4X4Copy.matrixTetragrid) lastChild = target.getCopy(xmlElement.getIDSuffix(vector3Index), xmlElement) euclidean.overwriteDictionary(xmlElement.attributeDictionary, ['id'], ['visible'], lastChild.attributeDictionary) vertexElement = vertex.getUnboundVertexElement(vector3) matrix4x4.setXMLElementDictionaryToOtherElementDictionary( vertexElement, vector3Matrix4X4, lastChild) xmlProcessor.processXMLElement(xmlElement)
def processXMLElement( xmlElement, xmlProcessor ): "Process the xml element." target = evaluate.getXMLElementByKey( 'target', xmlElement ) if target == None: print( 'Warning, translate could not get target.' ) return translateDictionary = xmlElement.attributeDictionary.copy() targetMatrix4X4Copy = matrix4x4.Matrix4X4().getFromXMLElement( target ) xmlElement.attributeDictionary = target.attributeDictionary.copy() matrix4x4.setAttributeDictionaryToMatrix( target.attributeDictionary, targetMatrix4X4Copy ) euclidean.overwriteDictionary( translateDictionary, [], [ 'visible' ], xmlElement.attributeDictionary ) xmlElement.className = target.className matrix4x4.setXMLElementDictionaryToOtherElementDictionary( xmlElement, targetMatrix4X4Copy, xmlElement ) target.copyXMLChildren( xmlElement.getIDSuffix(), xmlElement ) xmlProcessor.processXMLElement( xmlElement )
def processXMLElement(xmlElement, xmlProcessor): "Process the xml element." target = evaluate.getXMLElementByKey('target', xmlElement) if target == None: print('Warning, translate could not get target.') return translateDictionary = xmlElement.attributeDictionary.copy() targetMatrix4X4Copy = matrix4x4.Matrix4X4().getFromXMLElement(target) xmlElement.attributeDictionary = target.attributeDictionary.copy() matrix4x4.setAttributeDictionaryToMatrix(target.attributeDictionary, targetMatrix4X4Copy) euclidean.overwriteDictionary(translateDictionary, [], ['visible'], xmlElement.attributeDictionary) xmlElement.className = target.className matrix4x4.setXMLElementDictionaryToOtherElementDictionary( xmlElement, targetMatrix4X4Copy, xmlElement) target.copyXMLChildren(xmlElement.getIDSuffix(), xmlElement) xmlProcessor.processXMLElement(xmlElement)
def processXMLElement( xmlElement, xmlProcessor ): "Process the xml element." target = evaluate.getXMLElementByKey( 'target', xmlElement ) if target == None: print( 'Warning, array could not get target for:' ) print( xmlElement ) return vertices = getVerticesByKey( 'vertices', xmlElement ) if len( vertices ) == 0: print( 'Warning, array could not get vertices for:' ) print( xmlElement ) return arrayDictionary = xmlElement.attributeDictionary.copy() targetMatrix4X4Copy = matrix4x4.Matrix4X4().getFromXMLElement( target ) matrix4x4.setAttributeDictionaryToMatrix( target.attributeDictionary, targetMatrix4X4Copy ) xmlElement.className = 'group' for vector3Index in xrange( len( vertices ) ): vector3 = vertices[ vector3Index ] vector3Matrix4X4 = matrix4x4.Matrix4X4( targetMatrix4X4Copy.matrixTetragrid ) lastChild = target.getCopy( xmlElement.getIDSuffix( vector3Index ), xmlElement ) euclidean.overwriteDictionary( xmlElement.attributeDictionary, [ 'id' ], [ 'visible' ], lastChild.attributeDictionary ) vertexElement = vertex.getUnboundVertexElement( vector3 ) matrix4x4.setXMLElementDictionaryToOtherElementDictionary( vertexElement, vector3Matrix4X4, lastChild ) xmlProcessor.processXMLElement( xmlElement )