Exemplo n.º 1
0
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)
Exemplo n.º 2
0
def processXMLElement(xmlElement, xmlProcessor):
    "Process the xml element."
    delta = evaluate.getVector3ByPrefix('delta', Vector3(), xmlElement)
    if abs(delta) <= 0.0:
        'Warning, delta was zero in translate so nothing will be done for:'
        print(xmlElement)
        return
    target = evaluate.getXMLElementByKey('target', xmlElement)
    if target == None:
        print('Warning, translate could not get target for:')
        print(xmlElement)
        return
    targetMatrix4X4 = matrix4x4.Matrix4X4().getFromXMLElement(target)
    targetMatrix4X4.matrixTetragrid[0][3] += delta.x
    targetMatrix4X4.matrixTetragrid[1][3] += delta.y
    targetMatrix4X4.matrixTetragrid[2][3] += delta.z
    matrix4x4.setAttributeDictionaryMatrixToMatrix(targetMatrix4X4, target)
Exemplo n.º 3
0
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)
Exemplo n.º 4
0
 def __init__(self):
     "Add empty lists."
     Dictionary.__init__(self)
     self.matrix4X4 = matrix4x4.Matrix4X4()
     self.transformedVertices = None
     self.vertices = []
Exemplo n.º 5
0
 def __init__(self):
     "Add empty lists."
     Dictionary.__init__(self)
     self.matrix4X4 = matrix4x4.Matrix4X4()