Beispiel #1
0
def makeDirect():
    if CTK.t == []: return
    if CTK.__MAINTREE__ <= 0:
        CTK.TXT.insert('START', 'Fail on a temporary tree.\n')
        CTK.TXT.insert('START', 'Error: ', 'Error'); return
    nzs = CPlot.getSelectedZones()
    if nzs == []:
        CTK.TXT.insert('START', 'Selection is empty.\n')
        CTK.TXT.insert('START', 'Error: ', 'Error'); return
    
    CTK.saveTree()

    fail = False; errors = []
    for nz in nzs:
        nob = CTK.Nb[nz]+1
        noz = CTK.Nz[nz]
        z = CTK.t[2][nob][2][noz]
        try:
            a = T.makeDirect(z)
            CTK.replace(CTK.t, nob, noz, a)
        except Exception as e:
            fail = True; errors += [0,str(e)]
            
    if not fail:
        CTK.TXT.insert('START', 'Zones made direct.\n')
    else:
        Panels.displayErrors(errors, header='Error: makeDirect')
        CTK.TXT.insert('START', 'MakeDirect fails for at least one zone.\n')
        CTK.TXT.insert('START', 'Warning: ', 'Warning')
    CTK.TKTREE.updateApp()
    CPlot.render()
Beispiel #2
0
# - makeDirect (pyTree) -
import Generator.PyTree as G
import Transform.PyTree as T
import KCore.test as test

a = G.cart((0., 0., 0.), (1., 1., 1.), (10, 10, 10))
a = T.reorder(a, (1, 2, -3))  # indirect now
a = T.makeDirect(a)
test.testT(a, 1)