def getMatrixTetragridC(matrixTetragrid, prefix, xmlElement):
 columnKeys = 'Pc1 Pc2 Pc3 Pc4'.replace('P', prefix).split()
 evaluatedDictionary = evaluate.getEvaluatedDictionary(columnKeys, xmlElement)
 if (len(evaluatedDictionary.keys()) < 1):
  return matrixTetragrid
 for (columnKeyIndex, columnKey) in enumerate(columnKeys):
  if (columnKey in evaluatedDictionary):
   value = evaluatedDictionary[columnKey]
   if ((value == None) or (value == 'None')):
    print 'Warning, value in getMatrixTetragridC in matrix is None for columnKey for dictionary:'
    print columnKey
    print evaluatedDictionary
   else:
    matrixTetragrid = getIdentityMatrixTetragrid(matrixTetragrid)
    for (elementIndex, element) in enumerate(value):
     matrixTetragrid[elementIndex][columnKeyIndex] = element
 euclidean.removeListFromDictionary(xmlElement.attributeDictionary, columnKeys)
 return matrixTetragrid

def getMatrixTetragridC ( matrixTetragrid , prefix , xmlElement ) : columnKeys = 'Pc1 Pc2 Pc3 Pc4' . replace ( 'P' , prefix ) . split ( ) evaluatedDictionary = evaluate . getEvaluatedDictionary ( columnKeys , xmlElement ) if ( len ( evaluatedDictionary . keys ( ) ) < 1 ) : return matrixTetragrid for ( columnKeyIndex , columnKey ) in enumerate ( columnKeys ) : if ( columnKey in evaluatedDictionary ) : value = evaluatedDictionary [ columnKey ] if ( ( value == None ) or ( value == 'None' ) ) : print 'Warning, value in getMatrixTetragridC in matrix is None for columnKey for dictionary:' print columnKey print evaluatedDictionary else : matrixTetragrid = getIdentityMatrixTetragrid ( matrixTetragrid ) for ( elementIndex , element ) in enumerate ( value ) : matrixTetragrid [ elementIndex ] [ columnKeyIndex ] = element euclidean . removeListFromDictionary ( xmlElement . attributeDictionary , columnKeys ) return matrixTetragrid
get the matrix tetragrid from the xmlelement c values .