Exemplo n.º 1
0
def createApp(win):
    # - Frame -
    Frame = TTK.LabelFrame(win, borderwidth=2, relief=CTK.FRAMESTYLE,
                           text='tkInit', font=CTK.FRAMEFONT, takefocus=1)
    #BB = CTK.infoBulle(parent=Frame, text='Init solution fields.\nCtrl+c to close applet.', temps=0, btype=1)
    Frame.bind('<Control-c>', hideApp)
    Frame.bind('<ButtonRelease-3>', displayFrameMenu)
    Frame.bind('<Enter>', lambda event : Frame.focus_set())
    Frame.columnconfigure(0, weight=1)
    WIDGETS['frame'] = Frame
    
    # - Frame menu -
    FrameMenu = TK.Menu(Frame, tearoff=0)
    FrameMenu.add_command(label='Close', accelerator='Ctrl+c', command=hideApp)
    CTK.addPinMenu(FrameMenu, 'tkInit')
    WIDGETS['frameMenu'] = FrameMenu

    # - VARS -
    # -0- Zone filter regexp -
    #V = TK.StringVar(win); V.set(''); VARS.append(V)
    
    # - Init solution -
    B = TTK.Button(Frame, text="Initialize solution from state",
                   command=initSolution)
    B.grid(row=0, column=0, columnspan=2, sticky=TK.EW)
    BB = CTK.infoBulle(parent=B, text='Initialize the solution in centers (require state).')

    # - Init wall distances -
    B = TTK.Button(Frame, text="Initialize wall distances",
                   command=initWallDistance)
    B.grid(row=1, column=0, columnspan=2, sticky=TK.EW)
    BB = CTK.infoBulle(parent=B, text='Compute wall distances.')
Exemplo n.º 2
0
def createApp(win):
    ttk = CTK.importTtk()

    # - Frame -
    Frame = TTK.LabelFrame(win, borderwidth=2, relief=CTK.FRAMESTYLE,
                           text='tkCamera', font=CTK.FRAMEFONT, takefocus=1)
    #BB = CTK.infoBulle(parent=Frame, text='Display mesh informations.\nCtrl+c to close applet.', temps=0, btype=1)
    Frame.bind('<Control-c>', hideApp)
    Frame.bind('<ButtonRelease-3>', displayFrameMenu)
    Frame.bind('<Enter>', lambda event : Frame.focus_set())
    Frame.columnconfigure(0, weight=0)
    Frame.columnconfigure(1, weight=3)
    WIDGETS['frame'] = Frame
    
    # - Frame menu -
    FrameMenu = TK.Menu(Frame, tearoff=0)
    FrameMenu.add_command(label='Close', accelerator='Ctrl+c', command=hideApp)
    CTK.addPinMenu(FrameMenu, 'tkCamera')
    WIDGETS['frameMenu'] = FrameMenu

    #- VARS -
    # -0- posCam -
    V = TK.StringVar(win); V.set('(0., 0., 0.)'); VARS.append(V)
    # -1- posEye -
    V = TK.StringVar(win); V.set('(0., 0.; 0.)'); VARS.append(V)
    # -2- dirCam -
    V = TK.StringVar(win); V.set('(0., 0., 0.)'); VARS.append(V)
    
    # - posCam -
    B = TTK.Label(Frame, text="posCam: ")
    B.grid(row=0, column=0, columnspan=1, sticky=TK.EW)
    B = TTK.Entry(Frame, textvariable=VARS[0], background='White', width=15)
    B.grid(row=0, column=1, columnspan=1, sticky=TK.EW)
    B.bind('<Return>', setInfo)
    BB = CTK.infoBulle(parent=B, text='Camera position.')

    # - posEye -
    B = TTK.Label(Frame, text="posEye: ")
    B.grid(row=1, column=0, columnspan=1, sticky=TK.EW)
    B = TTK.Entry(Frame, textvariable=VARS[1], background='White', width=15)
    B.grid(row=1, column=1, columnspan=1, sticky=TK.EW)
    B.bind('<Return>', setInfo)
    BB = CTK.infoBulle(parent=B, text='Eye position.')

    # - dirCam -
    B = TTK.Label(Frame, text="dirCam: ")
    B.grid(row=2, column=0, columnspan=1, sticky=TK.EW)
    B = TTK.Entry(Frame, textvariable=VARS[2], background='White', width=15)
    B.grid(row=2, column=1, columnspan=1, sticky=TK.EW)
    B.bind('<Return>', setInfo)
    BB = CTK.infoBulle(parent=B, text='Camera direction.')
    
    # - get -
    B = TTK.Button(Frame, text="Get", command=getInfo)
    B.grid(row=3, column=1, columnspan=1, sticky=TK.EW)
    
    # - set -
    B = TTK.Button(Frame, text="Set", command=setInfo)
    B.grid(row=3, column=0, columnspan=1, sticky=TK.EW)
Exemplo n.º 3
0
def createApp(win):
    # - Frame -
    Frame = TTK.LabelFrame(win, borderwidth=2, relief=CTK.FRAMESTYLE,
                           text='tkDraw', font=CTK.FRAMEFONT, takefocus=1)
    #BB = CTK.infoBulle(parent=Frame, text='Drawing tools.\nCtrl+c to close applet.', temps=0, btype=1)
    Frame.bind('<Control-c>', hideApp)
    Frame.bind('<ButtonRelease-3>', displayFrameMenu)
    Frame.bind('<Enter>', lambda event : Frame.focus_set())
    Frame.columnconfigure(0, weight=2)
    Frame.columnconfigure(1, weight=2)
    Frame.columnconfigure(2, weight=1)

    WIDGETS['frame'] = Frame
    
    # - Frame menu -
    FrameMenu = TK.Menu(Frame, tearoff=0)
    FrameMenu.add_command(label='Close', accelerator='Ctrl+c', command=hideApp)
    FrameMenu.add_command(label='Save', command=saveApp)
    FrameMenu.add_command(label='Reset', command=resetApp)
    CTK.addPinMenu(FrameMenu, 'tkDraw')
    WIDGETS['frameMenu'] = FrameMenu

    # - VARS -
    # -0- Figure type -
    V = TK.StringVar(win); V.set('Line'); VARS.append(V)
    if 'tkDrawType' in CTK.PREFS: V.set(CTK.PREFS['tkDrawType'])
    # -1- Npts -
    V = TK.StringVar(win); V.set('10'); VARS.append(V)
    if 'tkDrawNpts' in CTK.PREFS: V.set(CTK.PREFS['tkDrawNpts'])
    # -2- underlaying surface
    V = TK.StringVar(win); V.set(''); VARS.append(V)

    # - Surface -
    B = TTK.Button(Frame, text="Surf", command=setSurface,
                   image=iconics.PHOTO[8], compound=TK.RIGHT, padx=0, pady=0)
    B.grid(row=0, column=2, sticky=TK.EW)
    BB = CTK.infoBulle(parent=B, text='Set underlaying model surfaces (you draw onto).')
    B = TTK.Entry(Frame, textvariable=VARS[2], background='White')
    B.grid(row=0, column=0, columnspan=2, sticky=TK.EW)
    BB = CTK.infoBulle(parent=B, text='Underlaying model surfaces.')
    
    # - Figure type -
    B = TTK.OptionMenu(Frame, VARS[0], 'Line', 'Circle', 'Circular arc', 
                       'Rectangle', 'Polyline', 'Cubic', 'Free hand')
    BB = CTK.infoBulle(parent=B, text='Type of drawing.')
    B.grid(row=1, column=0, sticky=TK.EW)

    # - Npts -
    B = TTK.Entry(Frame, textvariable=VARS[1], background='White', width=7)
    B.grid(row=1, column=1, sticky=TK.EW)
    BB = CTK.infoBulle(parent=B, text='Number of points.')
    
    # - Draw -
    B = TTK.Button(Frame, text="Draw", command=draw)
    B.grid(row=1, column=2, columnspan=1, sticky=TK.EW)
    BB = CTK.infoBulle(parent=B, text='Click to start to draw. Click again to end.')
    WIDGETS['draw'] = B
Exemplo n.º 4
0
def createApp(win):
    # - Frame -
    Frame = TTK.LabelFrame(win,
                           borderwidth=2,
                           relief=CTK.FRAMESTYLE,
                           text='tkBoolean',
                           font=CTK.FRAMEFONT,
                           takefocus=1)
    #BB = CTK.infoBulle(parent=Frame, text='Boolean operations\on surfaces.\nCtrl+c to close applet.', temps=0, btype=1)
    Frame.bind('<Control-c>', hideApp)
    Frame.bind('<ButtonRelease-3>', displayFrameMenu)
    Frame.bind('<Enter>', lambda event: Frame.focus_set())
    Frame.columnconfigure(0, weight=1)
    Frame.columnconfigure(1, weight=2)
    WIDGETS['frame'] = Frame

    # - Frame menu -
    FrameMenu = TK.Menu(Frame, tearoff=0)
    FrameMenu.add_command(label='Close', accelerator='Ctrl+c', command=hideApp)
    CTK.addPinMenu(FrameMenu, 'tkBoolean')
    WIDGETS['frameMenu'] = FrameMenu

    # - VARS -
    # -0- tolerance -
    V = TK.StringVar(win)
    V.set('0.')
    VARS.append(V)

    # - Tolerance -
    B = TTK.Label(Frame, text='Tolerance')
    B.grid(row=0, column=0, sticky=TK.EW)
    B = TTK.Entry(Frame, textvariable=VARS[0], background='White', width=5)
    B.grid(row=0, column=1, sticky=TK.EW)
    BB = CTK.infoBulle(
        parent=B,
        text=
        'Tolerance used in boolean operations.\n0. means automatic setting.')

    # - Union -
    B = TTK.Button(Frame, text="Union", command=union)
    B.grid(row=1, column=0, sticky=TK.EW)
    BB = CTK.infoBulle(parent=B, text='Union of two surfaces.')

    # - Difference -
    B = TTK.Button(Frame, text="Difference", command=difference)
    B.grid(row=1, column=1, sticky=TK.EW)
    BB = CTK.infoBulle(parent=B, text='Difference of two surfaces.')

    # - Intersection -
    B = TTK.Button(Frame, text="Intersection", command=intersection)
    B.grid(row=2, column=0, sticky=TK.EW)
    BB = CTK.infoBulle(parent=B, text='Intersect two surfaces.')

    # - Rev. Difference -
    B = TTK.Button(Frame, text="Rev. Diff", command=difference2)
    B.grid(row=2, column=1, sticky=TK.EW)
    BB = CTK.infoBulle(parent=B, text='Reversed difference of two surfaces.')
Exemplo n.º 5
0
def createApp(win):
    # - Frame -
    Frame = TTK.LabelFrame(win,
                           borderwidth=2,
                           relief=CTK.FRAMESTYLE,
                           text='tkCells',
                           font=CTK.FRAMEFONT,
                           takefocus=1)
    #BB = CTK.infoBulle(parent=Frame, text='Per cell operation\non meshes.\nCtrl+c to close applet.', temps=0, btype=1)
    Frame.bind('<Control-c>', hideApp)
    Frame.bind('<ButtonRelease-3>', displayFrameMenu)
    Frame.bind('<Enter>', lambda event: Frame.focus_set())
    Frame.columnconfigure(0, weight=1)
    Frame.columnconfigure(1, weight=4)
    Frame.columnconfigure(2, weight=0)
    WIDGETS['frame'] = Frame

    # - Frame menu -
    FrameMenu = TK.Menu(Frame, tearoff=0)
    FrameMenu.add_command(label='Close', accelerator='Ctrl+c', command=hideApp)
    CTK.addPinMenu(FrameMenu, 'tkCells')
    WIDGETS['frameMenu'] = FrameMenu

    # - VARS -
    # -0- selection formula -
    V = TK.StringVar(win)
    V.set('')
    VARS.append(V)
    # -1- strict -
    V = TK.StringVar(win)
    V.set('0')
    VARS.append(V)

    # - Cells suppress/refine -
    B = TTK.Button(Frame, text="Suppress cell mode", command=suppressCells)
    B.grid(row=0, column=0, columnspan=3, sticky=TK.EW)
    BB = CTK.infoBulle(parent=B, text='Suppress selected cell.')
    WIDGETS['suppress'] = B
    B = TTK.Button(Frame, text="Refine cell mode", command=refineCells)
    B.grid(row=1, column=0, columnspan=3, sticky=TK.EW)
    BB = CTK.infoBulle(parent=B, text='Refine selected cell (TRI mesh only).')
    WIDGETS['refine'] = B

    # - Select cells -
    B = TTK.Button(Frame, text="SelectCells", command=selectCells)
    B.grid(row=2, column=0, sticky=TK.EW)
    BB = CTK.infoBulle(parent=B, text='Select cells that matches formula.')
    B = TTK.Entry(Frame, textvariable=VARS[0], background='White')
    B.bind('<Return>', selectCells)
    BB = CTK.infoBulle(parent=B, text='Selection formula.')
    B.grid(row=2, column=1, sticky=TK.EW)
    B = TTK.Checkbutton(Frame, text='', variable=VARS[1])
    BB = CTK.infoBulle(parent=B, text='Strict/not strict selection.')
    B.grid(row=2, column=2, sticky=TK.EW)
def createApp(win):
    # - Frame -
    Frame = TTK.LabelFrame(win,
                           borderwidth=2,
                           relief=CTK.FRAMESTYLE,
                           text='tkProjection',
                           font=CTK.FRAMEFONT,
                           takefocus=1)
    #BB = CTK.infoBulle(parent=Frame, text='Project meshes on surface meshes.\nCtrl+c to close applet.', temps=0, btype=1)
    Frame.bind('<Control-c>', hideApp)
    Frame.bind('<ButtonRelease-3>', displayFrameMenu)
    Frame.bind('<Enter>', lambda event: Frame.focus_set())
    Frame.columnconfigure(0, weight=2)
    Frame.columnconfigure(1, weight=1)
    WIDGETS['frame'] = Frame

    # - Frame menu -
    FrameMenu = TK.Menu(Frame, tearoff=0)
    FrameMenu.add_command(label='Close', accelerator='Ctrl+c', command=hideApp)
    CTK.addPinMenu(FrameMenu, 'tkProjection')
    WIDGETS['frameMenu'] = FrameMenu

    # - VARS -
    # -0- Projection surface -
    V = TK.StringVar(win)
    V.set('')
    VARS.append(V)

    # - Surface -
    B = TTK.Button(Frame,
                   text="Proj. surf",
                   command=setSurface,
                   image=iconics.PHOTO[8],
                   padx=0,
                   pady=0,
                   compound=TK.RIGHT)
    B.grid(row=0, column=1, sticky=TK.EW)
    BB = CTK.infoBulle(parent=B, text='Set projection surfaces.')
    B = TTK.Entry(Frame, textvariable=VARS[0], background='White')
    B.grid(row=0, column=0, sticky=TK.EW)
    BB = CTK.infoBulle(parent=B, text='Projection surfaces.')

    # - Orthogonal projection -
    B = TTK.Button(Frame, text="Ortho project", command=orthoProject)
    B.grid(row=1, column=0, sticky=TK.EW)
    BB = CTK.infoBulle(parent=B,
                       text='Project selection orthogonally on a surface.')

    # - Dir projection -
    B = TTK.Button(Frame, text="Dir project", command=dirProject)
    B.grid(row=1, column=1, sticky=TK.EW)
    BB = CTK.infoBulle(
        parent=B,
        text='Project selection following eye direction on a surface.')
Exemplo n.º 7
0
def createApp(win):
    # - Frame -
    Frame = TTK.LabelFrame(win,
                           borderwidth=2,
                           relief=CTK.FRAMESTYLE,
                           text='tkGhostCells',
                           font=CTK.FRAMEFONT,
                           takefocus=1)
    #BB = CTK.infoBulle(parent=Frame, text='My personal applet.\nCtrl+c to close applet.', temps=0, btype=1)
    Frame.bind('<Control-c>', hideApp)
    Frame.bind('<ButtonRelease-3>', displayFrameMenu)
    Frame.bind('<Enter>', lambda event: Frame.focus_set())
    Frame.columnconfigure(0, weight=1)
    Frame.columnconfigure(1, weight=1)
    WIDGETS['frame'] = Frame

    # - Frame menu -
    FrameMenu = TK.Menu(Frame, tearoff=0)
    FrameMenu.add_command(label='Close', accelerator='Ctrl+c', command=hideApp)
    CTK.addPinMenu(FrameMenu, 'tkGhostCells')
    WIDGETS['frameMenu'] = FrameMenu

    # - VARS -
    # -0- number of layers of ghost cells -
    V = TK.StringVar(win)
    V.set('2')
    VARS.append(V)
    # -1- methode pour les coins -
    V = TK.StringVar(win)
    V.set('None')
    VARS.append(V)

    # - Number of ghost cell layers -
    B = TTK.Entry(Frame, textvariable=VARS[0], background='White', width=5)
    B.grid(row=0, column=0, sticky=TK.EW)
    BB = CTK.infoBulle(parent=B, text='Number of ghost cell layers.')

    # - methode pour les coins -
    B = TTK.OptionMenu(Frame, VARS[1], 'None')
    B.grid(row=0, column=1, columnspan=1, sticky=TK.EW)

    # - add ghost cells -
    B = TTK.Button(Frame, text="Add", command=addGhostCells)
    B.grid(row=1, column=0, sticky=TK.EW)
    BB = CTK.infoBulle(parent=B, text='Add layers of ghost cells.')

    # - rm ghost cells -
    B = TTK.Button(Frame, text="Rm", command=rmGhostCells)
    B.grid(row=1, column=1, sticky=TK.EW)
    BB = CTK.infoBulle(parent=B, text='Rm layers of ghost cells.')
Exemplo n.º 8
0
def createApp(win):
    # - Frame -
    Frame = TTK.LabelFrame(win, borderwidth=2, relief=CTK.FRAMESTYLE,
                           text='tkReorder', font=CTK.FRAMEFONT, takefocus=1)
    #BB = CTK.infoBulle(parent=Frame, text='Reorder blocks.\nCtrl+c to close applet.', temps=0, btype=1)
    Frame.bind('<Control-c>', hideApp)
    Frame.bind('<ButtonRelease-3>', displayFrameMenu)
    Frame.bind('<Enter>', lambda event : Frame.focus_set())
    Frame.columnconfigure(0, weight=1)
    Frame.columnconfigure(1, weight=1)
    WIDGETS['frame'] = Frame
    
    # - Frame menu -
    FrameMenu = TK.Menu(Frame, tearoff=0)
    FrameMenu.add_command(label='Close', accelerator='Ctrl+c', command=hideApp)
    CTK.addPinMenu(FrameMenu, 'tkReorder')
    WIDGETS['frameMenu'] = FrameMenu

    # -0- Transformation de i -
    V = TK.StringVar(win); V.set('I -> I'); VARS.append(V)
    # -1- Transformation de j -
    V = TK.StringVar(win); V.set('J -> J'); VARS.append(V)
    # -2- Transformation de k -
    V = TK.StringVar(win); V.set('K -> K'); VARS.append(V)

    # - Index switch for structured grids 
    B = TTK.OptionMenu(Frame, VARS[0], 'I -> I', 'I -> -I', 'I -> J', 'I -> -J', 'I -> K', 'I -> -K')
    B.grid(row=0, column=0, sticky=TK.EW)
    BB = CTK.infoBulle(parent=B, text='Transformation of i index.')
    B = TTK.OptionMenu(Frame, VARS[1], 'J -> I', 'J -> -I', 'J -> J', 'J -> -J', 'J -> K', 'J -> -K')
    B.grid(row=0, column=1, sticky=TK.EW)
    BB = CTK.infoBulle(parent=B, text='Transformation of j index.')
    B = TTK.OptionMenu(Frame, VARS[2], 'K -> I', 'K -> -I', 'K -> J', 'K -> -J', 'K -> K', 'K -> -K')
    B.grid(row=0, column=2, sticky=TK.EW)
    BB = CTK.infoBulle(parent=B, text='Transformation of k index.')

    # - Bouton reorder -
    B = TTK.Button(Frame, text="Reorder", command=reorder)
    B.grid(row=1, column=0, sticky=TK.EW)
    BB = CTK.infoBulle(parent=B, text='Reorder the numerotation of block.')

    # - Bouton reorderAll -
    B = TTK.Button(Frame, text="ReorderAll", command=reorderAll)
    BB = CTK.infoBulle(parent=B, text='Reorder all blocks even with overlaps.')
    B.grid(row=1, column=1, columnspan=1, sticky=TK.EW)

    # - Bouton makeDirect -
    B = TTK.Button(Frame, text="makeDirect", command=makeDirect)
    BB = CTK.infoBulle(parent=B, text='Make structured blocks direct.')
    B.grid(row=1, column=2, columnspan=1, sticky=TK.EW)
Exemplo n.º 9
0
def createApp(win):
    # - Frame -
    Frame = TTK.LabelFrame(win,
                           borderwidth=2,
                           relief=CTK.FRAMESTYLE,
                           text='tkPoint',
                           font=CTK.FRAMEFONT,
                           takefocus=1)
    #BB = CTK.infoBulle(parent=Frame, text='Generate points.\nCtrl+c to close applet.', temps=0, btype=1)
    Frame.bind('<Control-c>', hideApp)
    Frame.bind('<ButtonRelease-3>', displayFrameMenu)
    Frame.bind('<Enter>', lambda event: Frame.focus_set())
    Frame.columnconfigure(0, weight=4)
    Frame.columnconfigure(1, weight=4)
    Frame.columnconfigure(2, weight=0)
    WIDGETS['frame'] = Frame

    # - Frame menu -
    FrameMenu = TK.Menu(Frame, tearoff=0)
    FrameMenu.add_command(label='Close', accelerator='Ctrl+c', command=hideApp)
    CTK.addPinMenu(FrameMenu, 'tkPoint')
    WIDGETS['frameMenu'] = FrameMenu

    # - VARS -
    # -0- point coordinates -
    V = TK.StringVar(win)
    V.set('0;0;0')
    VARS.append(V)

    # - Buttons -
    B = TTK.Entry(Frame, textvariable=VARS[0], background='White', width=15)
    B.bind('<Return>', createPoint)
    B.grid(row=0, column=0, columnspan=2, sticky=TK.EW)
    BB = CTK.infoBulle(parent=B, text='Point coordinates (x;y;z).')
    B = TTK.Button(Frame,
                   image=iconics.PHOTO[8],
                   command=getPointCoordinates,
                   padx=0)
    B.grid(row=0, column=2, sticky=TK.EW)
    BB = CTK.infoBulle(parent=B, text='Get point coordinates from mouse.')

    B = TTK.Button(Frame, text="Create", command=createPoint)
    B.grid(row=1, column=0, sticky=TK.EW)
    BB = CTK.infoBulle(parent=B, text='Create a point.')

    B = TTK.Button(Frame, text="Modify", command=modifyPoint)
    B.grid(row=1, column=1, columnspan=2, sticky=TK.EW)
    BB = CTK.infoBulle(parent=B, text='Modify point coordinate.')
Exemplo n.º 10
0
def createApp(win):
    # - Frame -
    Frame = TTK.LabelFrame(win,
                           borderwidth=2,
                           relief=CTK.FRAMESTYLE,
                           text='tkRuler',
                           font=CTK.FRAMEFONT,
                           takefocus=1)
    #BB = CTK.infoBulle(parent=Frame, text='Take measures by clicking.\nCtrl+c to close applet.', temps=0, btype=1)
    Frame.bind('<Control-c>', hideApp)
    Frame.bind('<ButtonRelease-3>', displayFrameMenu)
    Frame.bind('<Enter>', lambda event: Frame.focus_set())
    Frame.columnconfigure(0, weight=1)
    WIDGETS['frame'] = Frame

    # - Frame menu -
    FrameMenu = TK.Menu(Frame, tearoff=0)
    FrameMenu.add_command(label='Close', accelerator='Ctrl+c', command=hideApp)
    CTK.addPinMenu(FrameMenu, 'tkRuler')
    WIDGETS['frameMenu'] = FrameMenu

    # - VARS -
    # -0- Zone filter regexp -
    #V = TK.StringVar(win); V.set(''); VARS.append(V)

    # - Buttons -
    B = TTK.Button(Frame, text="Measure mode", command=measure)
    B.grid(row=0, column=0, sticky=TK.EW)
    BB = CTK.infoBulle(parent=B,
                       text='Click on two points to obtain the distance.')
    WIDGETS['button'] = B
Exemplo n.º 11
0
def createApp(win):
    # - Frame -
    Frame = TTK.LabelFrame(win,
                           borderwidth=2,
                           relief=CTK.FRAMESTYLE,
                           text='tkNGon',
                           font=CTK.FRAMEFONT,
                           takefocus=1)
    #BB = CTK.infoBulle(parent=Frame, text='Manage Polyhedral (NGON) meshes.\nCtrl+c to close applet.', temps=0, btype=1)
    Frame.bind('<Control-c>', hideApp)
    Frame.bind('<ButtonRelease-3>', displayFrameMenu)
    Frame.bind('<Enter>', lambda event: Frame.focus_set())
    Frame.columnconfigure(0, weight=1)
    Frame.columnconfigure(1, weight=1)
    WIDGETS['frame'] = Frame

    # - Frame menu -
    FrameMenu = TK.Menu(Frame, tearoff=0)
    FrameMenu.add_command(label='Close', accelerator='Ctrl+c', command=hideApp)
    CTK.addPinMenu(FrameMenu, 'tkNGon')
    WIDGETS['frameMenu'] = FrameMenu

    # - VARS -

    # - Convert2NGon -
    B = TTK.Button(Frame, text="Convert2NGon", command=convert2NGon)
    B.grid(row=0, column=0, sticky=TK.EW)
    BB = CTK.infoBulle(parent=B, text='Convert selection to NGon.')

    # - Break Elements -
    B = TTK.Button(Frame, text="BreakElts", command=breakElts)
    B.grid(row=0, column=1, sticky=TK.EW)
    BB = CTK.infoBulle(parent=B, text='Convert a NGon zone to basic elements.')

    # - Dual -
    B = TTK.Button(Frame, text="Dual", command=dual)
    B.grid(row=1, column=0, columnspan=1, sticky=TK.EW)
    BB = CTK.infoBulle(parent=B, text='Compute the dual mesh of a NGon.')

    # - Conformize -
    B = TTK.Button(Frame, text="Conformize", command=conformize)
    B.grid(row=1, column=1, columnspan=1, sticky=TK.EW)
    BB = CTK.infoBulle(
        parent=B,
        text='Conformize a NGon (split faces to match hanging nodes).')
Exemplo n.º 12
0
def createApp(win):
    # - Frame -
    Frame = TTK.LabelFrame(win, borderwidth=2, relief=CTK.FRAMESTYLE,
                           text='tkFilterSurfs', font=CTK.FRAMEFONT, takefocus=1)
    #BB = CTK.infoBulle(parent=Frame, text='Filter or offset a surface.\nCtrl+c to close applet.', temps=0, btype=1)
    Frame.bind('<Control-c>', hideApp)
    Frame.bind('<ButtonRelease-3>', displayFrameMenu)
    Frame.bind('<Enter>', lambda event : Frame.focus_set())
    Frame.columnconfigure(0, weight=1)
    Frame.columnconfigure(1, weight=2)
    Frame.columnconfigure(2, weight=2)
    Frame.columnconfigure(3, weight=0)
    WIDGETS['frame'] = Frame
    
    # - Frame menu -
    FrameMenu = TK.Menu(Frame, tearoff=0)
    FrameMenu.add_command(label='Close', accelerator='Ctrl+c', command=hideApp)
    FrameMenu.add_command(label='Save', command=saveApp)
    FrameMenu.add_command(label='Reset', command=resetApp)
    CTK.addPinMenu(FrameMenu, 'tkFilterSurfs')
    WIDGETS['frameMenu'] = FrameMenu

    # - VARS -
    # -0- Point density -
    V = TK.StringVar(win); V.set('1.'); VARS.append(V)
    if 'tkFilterSurfsDensity' in CTK.PREFS: 
        V.set(CTK.PREFS['tkFilterSurfsDensity'])
    # -1- Offset -
    V = TK.StringVar(win); V.set('0.'); VARS.append(V)
    if 'tkFilterSurfsOffset' in CTK.PREFS: 
        V.set(CTK.PREFS['tkFilterSurfsOffset'])
    # -2- Algorithm cart/octree
    V = TK.StringVar(win); V.set('0'); VARS.append(V)
    if 'tkFilterSurfsType' in CTK.PREFS: 
        V.set(CTK.PREFS['tkFilterSurfsType'])

    # - Point density -
    B = TTK.Label(Frame, text="density/offset")
    B.grid(row=0, column=0, sticky=TK.EW)
    B = TTK.Entry(Frame, textvariable=VARS[0], background='White', width=8)
    B.grid(row=0, column=1, sticky=TK.EW)
    BB = CTK.infoBulle(parent=B, text='Point density (npts/length unit).')

    # - Offset -
    B = TTK.Entry(Frame, textvariable=VARS[1], background='White', width=8)
    B.grid(row=0, column=2, sticky=TK.EW)
    BB = CTK.infoBulle(parent=B, text='Distance of surface offset.')

    # - Algorithm -
    B = TTK.Checkbutton(Frame, text='', variable=VARS[2])
    B.grid(row=0, column=3, sticky=TK.EW)
    BB = CTK.infoBulle(parent=B, text='Toggle octree algorithm.')
    
    # - Remap -
    B = TTK.Button(Frame, text="Filter/offset", command=remap)
    BB = CTK.infoBulle(parent=B, text='Remap/offset a surface with a given spacing.')
    B.grid(row=2, column=0, columnspan=4, sticky=TK.EW)
Exemplo n.º 13
0
def createApp(win):
    # - Frame -
    Frame = TTK.LabelFrame(win, borderwidth=2, relief=CTK.FRAMESTYLE,
                           text='tkPovRay', font=CTK.FRAMEFONT, takefocus=1)
    #BB = CTK.infoBulle(parent=Frame, text='Export to povRay ray tracer.\nCtrl+c to close applet.', temps=0, btype=1)
    Frame.bind('<Control-c>', hideApp)
    Frame.bind('<ButtonRelease-3>', displayFrameMenu)
    Frame.bind('<Enter>', lambda event : Frame.focus_set())
    Frame.columnconfigure(0, weight=1)
    Frame.columnconfigure(1, weight=1)
    WIDGETS['frame'] = Frame
    
    # - Frame menu -
    FrameMenu = TK.Menu(Frame, tearoff=0)
    FrameMenu.add_command(label='Close', accelerator='Ctrl+c', command=hideApp)
    FrameMenu.add_command(label='Save', command=saveApp)
    FrameMenu.add_command(label='Reset', command=resetApp)
    CTK.addPinMenu(FrameMenu, 'tkPovRay')
    WIDGETS['frameMenu'] = FrameMenu

    # - VARS -
    # -0- background -
    V = TK.StringVar(win); V.set('Black'); VARS.append(V)
    if 'tkPovRayBackground' in CTK.PREFS: 
        V.set(CTK.PREFS['tkPovRayBackground'])
    # -1- Image size
    V = TK.StringVar(win); V.set('800x600'); VARS.append(V)
    if 'tkPovRaySize' in CTK.PREFS: 
        V.set(CTK.PREFS['tkPovRaySize'])
    # -2- Dir name (file.pov et file.png)
    V = TK.StringVar(win); V.set('PovRay'); VARS.append(V)    
    if 'tkPovRayOutput' in CTK.PREFS: 
        V.set(CTK.PREFS['tkPovRayOutput'])

    # - File -
    B = TTK.Entry(Frame, textvariable=VARS[2], background='White')
    B.grid(row=0, column=0, columnspan=2, sticky=TK.EW)
    BB = CTK.infoBulle(parent=B, text='Directory name for output (.pov and .png).')

    # - Background selection -
    B = TTK.OptionMenu(Frame, VARS[0], 'Black', 'White', 'Blue sky', 
                       'Cloudy sky', 'Starfield' )
    B.grid(row=1, column=0, sticky=TK.EW)
    BB = CTK.infoBulle(parent=B, text='Output background.')

    # - Image size -
    B = TTK.OptionMenu(Frame, VARS[1], '320x200', '800x600',
                       '1024x768', '1600x1200')
    B.grid(row=1, column=1, sticky=TK.EW)
    BB = CTK.infoBulle(parent=B, text='Image resolution.')

    # - Render scene -
    B = TTK.Button(Frame, text="Render scene", command=render)
    B.grid(row=2, column=0, columnspan=2, sticky=TK.EW)
    BB = CTK.infoBulle(parent=B, text='Render pov scene.')
Exemplo n.º 14
0
def createApp(win):
    # - Frame -
    Frame = TTK.LabelFrame(win, borderwidth=2, relief=CTK.FRAMESTYLE,
                           text='tkMeshQual', font=CTK.FRAMEFONT, takefocus=1)
    #BB = CTK.infoBulle(parent=Frame, text='Analyse mesh quality.\nCtrl+c to close applet.', temps=0, btype=1)
    Frame.bind('<Control-c>', hideApp)
    Frame.bind('<ButtonRelease-3>', displayFrameMenu)
    Frame.bind('<Enter>', lambda event : Frame.focus_set())
    Frame.columnconfigure(0, weight=1)
    Frame.columnconfigure(1, weight=1)
    WIDGETS['frame'] = Frame
    
    # - Frame menu -
    FrameMenu = TK.Menu(Frame, tearoff=0)
    FrameMenu.add_command(label='Close', accelerator='Ctrl+c', command=hideApp)
    CTK.addPinMenu(FrameMenu, 'tkMeshQual')
    WIDGETS['frameMenu'] = FrameMenu

    # - VARS -
    # -0- Qual to compute -
    V = TK.StringVar(win); V.set('Volume map'); VARS.append(V)
    # -0- Filter for view -
    V = TK.StringVar(win); V.set('Mesh'); VARS.append(V)
    
    # - Compute -
    B = TTK.Button(Frame, text="Compute", command=computeQual)
    B.grid(row=0, column=0, sticky=TK.EW)
    BB = CTK.infoBulle(parent=B, text='Compute this field. Tree is modified.')
    B = TTK.OptionMenu(Frame, VARS[0], 'Volume map', 'Orthogonality map', 'Regularity map')
    B.grid(row=0, column=1, sticky=TK.EW)

    # - View -
    B = TTK.Button(Frame, text="View", command=viewQual)
    B.grid(row=1, column=0, sticky=TK.EW)
    BB = CTK.infoBulle(parent=B, text='View this filter.')
    B = TTK.OptionMenu(Frame, VARS[1], 'Mesh', 'Neg. volume cells')
    B.grid(row=1, column=1, sticky=TK.EW)
Exemplo n.º 15
0
def createApp(win):
    # - Frame -
    Frame = TTK.LabelFrame(win,
                           borderwidth=2,
                           relief=CTK.FRAMESTYLE,
                           text='tkTetraMesher',
                           font=CTK.FRAMEFONT,
                           takefocus=1)
    Frame.bind('<Control-c>', hideApp)
    Frame.bind('<ButtonRelease-3>', displayFrameMenu)
    Frame.bind('<Enter>', lambda event: Frame.focus_set())
    Frame.columnconfigure(0, weight=1)
    Frame.columnconfigure(1, weight=1)
    #Frame.columnconfigure(1, weight=1)
    WIDGETS['frame'] = Frame

    # - Frame menu -
    FrameMenu = TK.Menu(Frame, tearoff=0)
    FrameMenu.add_command(label='Close', accelerator='Ctrl+c', command=hideApp)
    FrameMenu.add_command(label='Save', command=saveApp)
    FrameMenu.add_command(label='Reset', command=resetApp)
    CTK.addPinMenu(FrameMenu, 'tkTetraMesher')
    WIDGETS['frameMenu'] = FrameMenu

    # - VARS -
    # -0- Mesher type -
    V = TK.StringVar(win)
    V.set('tetgen')
    VARS.append(V)
    if 'tkTetraMesherType' in CTK.PREFS: V.set(CTK.PREFS['tkTetraMesherType'])

    # - mesher menu -
    B = TTK.OptionMenu(Frame, VARS[0], 'netgen', 'tetgen')
    B.grid(row=0, column=1, columnspan=1, sticky=TK.EW)

    # - Run -
    B = TTK.Button(Frame, text="tetraMesher", command=tetraMesher)
    B.grid(row=0, column=0, sticky=TK.EW)
    BB = CTK.infoBulle(parent=B, text='Mesh with TETRAs or TRIs.')
Exemplo n.º 16
0
def createApp(win):
    # - Frame -
    Frame = TTK.LabelFrame(win,
                           borderwidth=2,
                           relief=CTK.FRAMESTYLE,
                           text='tkBackground',
                           font=CTK.FRAMEFONT,
                           takefocus=1)
    #BB = CTK.infoBulle(parent=Frame, text='Create a background.\nCtrl+c to close applet.', temps=0, btype=1)
    Frame.bind('<Control-c>', hideApp)
    Frame.bind('<ButtonRelease-3>', displayFrameMenu)
    Frame.bind('<Enter>', lambda event: Frame.focus_set())
    Frame.columnconfigure(0, weight=1)
    Frame.columnconfigure(1, weight=2)
    Frame.columnconfigure(2, weight=1)
    WIDGETS['frame'] = Frame

    # - Frame menu -
    FrameMenu = TK.Menu(Frame, tearoff=0)
    FrameMenu.add_command(label='Close', accelerator='Ctrl+c', command=hideApp)
    FrameMenu.add_command(label='Save', command=saveApp)
    FrameMenu.add_command(label='Reset', command=resetApp)
    CTK.addPinMenu(FrameMenu, 'tkBackground')
    WIDGETS['frameMenu'] = FrameMenu

    # - VARS -
    # -0- Type de background -
    V = TK.StringVar(win)
    V.set('None')
    VARS.append(V)
    if 'tkBackgroundType' in CTK.PREFS:
        V.set(CTK.PREFS['tkBackgroundType'])
    # -1- Border
    V = TK.StringVar(win)
    V.set('2')
    VARS.append(V)
    if 'tkBackgroundBorder' in CTK.PREFS:
        V.set(CTK.PREFS['tkBackgroundBorder'])

    # - Type de background -
    B = TTK.OptionMenu(Frame,
                       VARS[0],
                       'None',
                       'Half-Box',
                       'Box',
                       'Z-Half-Box',
                       'Z-Box',
                       'Z-Ellipse',
                       'Z-Plane',
                       'Z-Square-Ground',
                       command=setBackground)
    B.grid(row=0, column=0, columnspan=1, sticky=TK.EW)
    BB = CTK.infoBulle(parent=B, text='Type of background.')

    B = TTK.Entry(Frame, textvariable=VARS[1], background='White', width=5)
    B.grid(row=0, column=1, sticky=TK.EW)
    BB = CTK.infoBulle(
        parent=B, text='Borders N or (Ni;Nj;Nk) or (Ni-;Nj-;Nk-;Ni+;Nj+;Nk+).')
    B.bind('<Return>', setBackground)

    B = TTK.Button(Frame, text="Set", command=setBackground)
    B.grid(row=0, column=2, sticky=TK.EW)
    BB = CTK.infoBulle(parent=B, text='Set or reset the background.')
Exemplo n.º 17
0
def createApp(win):
    # - Frame -
    Frame = TTK.LabelFrame(win, borderwidth=2, relief=CTK.FRAMESTYLE,
                           text='tkSurfaceWalk', font=CTK.FRAMEFONT, takefocus=1)
    #BB = CTK.infoBulle(parent=Frame, text='Generate meshes by orthogonal\nwalk on surfaces.\nCtrl+c to close applet.', temps=0, btype=1)
    Frame.bind('<Control-c>', hideApp)
    Frame.bind('<ButtonRelease-3>', displayFrameMenu)
    Frame.bind('<Enter>', lambda event : Frame.focus_set())
    Frame.columnconfigure(0, weight=1)
    Frame.columnconfigure(1, weight=1)
    Frame.columnconfigure(2, weight=1)
    WIDGETS['frame'] = Frame

    # - Frame menu -
    FrameMenu = TK.Menu(Frame, tearoff=0)
    FrameMenu.add_command(label='Close', accelerator='Ctrl+c', command=hideApp)
    FrameMenu.add_command(label='Save', command=saveApp)
    FrameMenu.add_command(label='Reset', command=resetApp)
    CTK.addPinMenu(FrameMenu, 'tkSurfaceWalk')
    WIDGETS['frameMenu'] = FrameMenu

    # - VARS -
    # -0- Constraint contour -
    V = TK.StringVar(win); V.set(''); VARS.append(V)
    # -1- Projection surface - 
    V = TK.StringVar(win); V.set(''); VARS.append(V)
    # -2- Hauteur de chaque maille -
    V = TK.StringVar(win); V.set('1.e-1'); VARS.append(V)
    if 'tkSurfaceWalkHeight' in CTK.PREFS: 
        V.set(CTK.PREFS['tkSurfaceWalkHeight'])
    # -3- Nombre de layers a ajouter
    V = TK.StringVar(win); V.set('1'); VARS.append(V)
    if 'tkSurfaceWalkNLayers' in CTK.PREFS: 
        V.set(CTK.PREFS['tkSurfaceWalkNLayers'])
    # -4- Nombre d'iterations de lissage
    V = TK.StringVar(win); V.set('0'); VARS.append(V)
    if 'tkSurfaceWalkSmooth' in CTK.PREFS: 
        V.set(CTK.PREFS['tkSurfaceWalkSmooth'])

    # - Surface -
    B = TTK.Button(Frame, text="Proj. surf", command=setSurface,
                   image=iconics.PHOTO[8], padx=0, pady=0, compound=TK.RIGHT)
    B.grid(row=0, column=2, sticky=TK.EW)
    BB = CTK.infoBulle(parent=B, text='Set projection surfaces.')
    B = TTK.Entry(Frame, textvariable=VARS[1], background='White')
    B.grid(row=0, column=0, columnspan=2, sticky=TK.EW)
    BB = CTK.infoBulle(parent=B, text='Projection surfaces.')

    # - Contours - 
    B = TTK.Button(Frame, text="Constraints", command=setConstraintContour,
                   image=iconics.PHOTO[8], padx=0, pady=0, compound=TK.RIGHT)
    B.grid(row=1, column=2, sticky=TK.EW)
    BB = CTK.infoBulle(parent=B, text='Set constraint contours.')
    B = TTK.Entry(Frame, textvariable=VARS[0], background='White')
    B.grid(row=1, column=0, columnspan=2, sticky=TK.EW)
    BB = CTK.infoBulle(parent=B, text='Constraint contours.')

    # - Walk
    B = TTK.Entry(Frame, textvariable=VARS[2], background='White', width=5)
    B.grid(row=2, column=0, sticky=TK.EW)
    BB = CTK.infoBulle(parent=B, text='Height of each layer.')

    B = TTK.Entry(Frame, textvariable=VARS[3], background='White', width=5)
    B.grid(row=2, column=1, sticky=TK.EW)
    BB = CTK.infoBulle(parent=B, text='Number of layers.')

    B = TTK.Entry(Frame, textvariable=VARS[4], background='White', width=5)
    B.grid(row=2, column=2, sticky=TK.EW)
    BB = CTK.infoBulle(parent=B, text='Number of smoothing iterations.')
    
    B = TTK.Button(Frame, text="Walk in", command=walkIn)
    B.grid(row=3, column=0, columnspan=2, sticky=TK.EW)
    BB = CTK.infoBulle(parent=B, text='Walk in.')
    
    B = TTK.Button(Frame, text="Walk out", command=walkOut)
    B.grid(row=3, column=2, columnspan=1, sticky=TK.EW)
    BB = CTK.infoBulle(parent=B, text='Walk out.')
Exemplo n.º 18
0
def createApp(win):
    # - Frame -
    Frame = TTK.LabelFrame(win,
                           borderwidth=2,
                           relief=CTK.FRAMESTYLE,
                           text='tkCanvas',
                           font=CTK.FRAMEFONT,
                           takefocus=1)
    #BB = CTK.infoBulle(parent=Frame, text='Manage a canvas\nfor drawing..\nCtrl+c to close applet.', temps=0, btype=1)
    Frame.bind('<Control-c>', hideApp)
    Frame.bind('<ButtonRelease-3>', displayFrameMenu)
    Frame.bind('<Enter>', lambda event: Frame.focus_set())
    Frame.columnconfigure(0, weight=1)
    Frame.columnconfigure(1, weight=1)
    Frame.columnconfigure(2, weight=4)
    WIDGETS['frame'] = Frame

    # - Frame menu -
    FrameMenu = TK.Menu(Frame, tearoff=0)
    FrameMenu.add_command(label='Close', accelerator='Ctrl+c', command=hideApp)
    FrameMenu.add_command(label='Save', command=saveApp)
    FrameMenu.add_command(label='Reset', command=resetApp)
    CTK.addPinMenu(FrameMenu, 'tkCanvas')
    WIDGETS['frameMenu'] = FrameMenu

    # - VARS -
    # -0- Canvas dir
    V = TK.StringVar(win)
    V.set('None')
    VARS.append(V)
    # -1- Canvas pos
    V = TK.StringVar(win)
    V.set('0.')
    VARS.append(V)
    # -2- Canvas dir step
    V = TK.StringVar(win)
    V.set('0.1')
    VARS.append(V)
    if 'tkCanvasDirStep' in CTK.PREFS:
        V.set(CTK.PREFS['tkCanvasDirStep'])
    # -3- Canvas enlarge step
    V = TK.StringVar(win)
    V.set('1.')
    VARS.append(V)
    if 'tkCanvasEnlargeStep' in CTK.PREFS:
        V.set(CTK.PREFS['tkCanvasEnlargeStep'])

    # - Direction -
    B = TTK.OptionMenu(Frame,
                       VARS[0],
                       'None',
                       'View',
                       'XY',
                       'XZ',
                       'YZ',
                       command=initCanvas)
    B.grid(row=0, column=0, columnspan=1, sticky=TK.EW)
    BB = CTK.infoBulle(parent=B, text='Create a canvas.')

    # - Refresh -
    B = TTK.Button(Frame,
                   text="",
                   command=initCanvas,
                   image=iconics.PHOTO[8],
                   padx=0,
                   pady=2)
    B.grid(row=0, column=1, sticky=TK.EW)
    BB = CTK.infoBulle(
        parent=B,
        text=
        'Refresh canvas.\nUpdate it to make it pass through selection point.')

    # - Position -
    B = TTK.Entry(Frame, textvariable=VARS[1], background='White', width=7)
    B.bind('<Return>', setCanvasPos)
    B.grid(row=0, column=2, sticky=TK.EW)
    BB = CTK.infoBulle(parent=B, text='Canvas position.')

    # - Move canvas -
    B = TTK.Button(Frame, text="+", command=moveUp)
    B.grid(row=1, column=0, sticky=TK.EW)
    BB = CTK.infoBulle(parent=B, text='Move canvas right.')
    B = TTK.Button(Frame, text="-", command=moveDown)
    B.grid(row=1, column=1, sticky=TK.EW)
    BB = CTK.infoBulle(parent=B, text='Move canvas left.')
    B = TTK.Entry(Frame, textvariable=VARS[2], background='White', width=7)
    B.grid(row=1, column=2, sticky=TK.EW)
    BB = CTK.infoBulle(parent=B, text='Canvas move step.')

    # - Enlarge / reduce -
    B = TTK.Button(Frame, text="Enlarge", command=enlarge)
    B.grid(row=2, column=0, sticky=TK.EW)
    BB = CTK.infoBulle(parent=B, text='Enlarge canvas.')
    B = TTK.Button(Frame, text="Reduce", command=reduce)
    B.grid(row=2, column=1, sticky=TK.EW)
    BB = CTK.infoBulle(parent=B, text='Reduce canvas.')
    B = TTK.Entry(Frame, textvariable=VARS[3], background='White', width=7)
    B.grid(row=2, column=2, sticky=TK.EW)
    BB = CTK.infoBulle(parent=B, text='Canvas enlarge step.')
Exemplo n.º 19
0
def createApp(win):
    ttk = CTK.importTtk()

    # - Frame -
    Frame = TTK.LabelFrame(win, borderwidth=2, relief=CTK.FRAMESTYLE,
                           text='tkIsoSurf', font=CTK.FRAMEFONT, takefocus=1)
    #BB = CTK.infoBulle(parent=Frame, text='Compute iso-surfaces.\nCtrl+c to close applet.', temps=0, btype=1)
    Frame.bind('<Control-c>', hideApp)
    Frame.bind('<ButtonRelease-3>', displayFrameMenu)
    Frame.bind('<Enter>', lambda event : Frame.focus_set())
    Frame.columnconfigure(0, weight=1)
    Frame.columnconfigure(1, weight=1)
    Frame.columnconfigure(2, weight=0)
    WIDGETS['frame'] = Frame
    
    # - Frame menu -
    FrameMenu = TK.Menu(Frame, tearoff=0)
    FrameMenu.add_command(label='Close', accelerator='Ctrl+c', command=hideApp)
    FrameMenu.add_command(label='Save', command=saveApp)
    FrameMenu.add_command(label='Reset', command=resetApp)
    CTK.addPinMenu(FrameMenu, 'tkIsoSurf')
    WIDGETS['frameMenu'] = FrameMenu

    # - VARS -
    # -0- Field name -
    V = TK.StringVar(win); V.set('CoordinateX'); VARS.append(V)
    # -1- value -
    V = TK.StringVar(win); V.set('1.'); VARS.append(V)
    if 'tkIsoSurfValue' in CTK.PREFS: 
        V.set(CTK.PREFS['tkIsoSurfValue'])

    # - field name -
    F = TTK.Frame(Frame, borderwidth=0)
    F.columnconfigure(0, weight=1)

    if ttk is None:
        B = TK.OptionMenu(F, VARS[0], '')
        B.grid(sticky=TK.EW)
        F.bind('<Enter>', updateVarNameList)
        F.grid(row=0, column=0, sticky=TK.EW)
        BB = CTK.infoBulle(parent=B, text='Extracted field.')
        WIDGETS['field'] = B
    else:
        B = ttk.Combobox(F, textvariable=VARS[0], 
                         values=[], state='readonly', width=10)
        B.grid(sticky=TK.EW)
        F.bind('<Enter>', updateVarNameList2)
        F.grid(row=0, column=0, sticky=TK.EW)
        BB = CTK.infoBulle(parent=B, text='Extracted field.')
        WIDGETS['field'] = B

    # - Value -
    B = TTK.Entry(Frame, textvariable=VARS[1], background='White', width=7)
    BB = CTK.infoBulle(parent=B, text='Extracted field value.')
    B.bind('<Return>', extractIsoSurf)
    B.grid(row=0, column=1, sticky=TK.EW)
    
    # - Get value from mouse -
    B = TTK.Button(Frame, image=iconics.PHOTO[8],
                   command=getValueFromMouse, padx=0)
    B.grid(row=0, column=2, sticky=TK.EW)
    BB = CTK.infoBulle(parent=B, text='Get value from mouse.')

    # - Extract -
    B = TTK.Button(Frame, text="Extract isosurf", command=extractIsoSurf)
    B.grid(row=1, column=0, columnspan=3, sticky=TK.EW)
    BB = CTK.infoBulle(parent=B, text='Extract isosurf to SURFACES.')
def createApp(win):
    # - Frame -
    Frame = TTK.LabelFrame(win,
                           borderwidth=2,
                           relief=CTK.FRAMESTYLE,
                           text='tkCassiopeeSolver',
                           font=CTK.FRAMEFONT,
                           takefocus=1)
    #BB = CTK.infoBulle(parent=Frame, text='Export to Cassiopee \nCartesian solver.\nCtrl+c to close applet.', temps=0, btype=1)
    Frame.bind('<Control-c>', hideApp)
    Frame.bind('<ButtonRelease-3>', displayFrameMenu)
    Frame.bind('<Enter>', lambda event: Frame.focus_set())
    Frame.columnconfigure(0, weight=0)
    Frame.columnconfigure(1, weight=1)
    WIDGETS['frame'] = Frame

    # - Frame menu -
    FrameMenu = TK.Menu(Frame, tearoff=0)
    FrameMenu.add_command(label='Close', accelerator='Ctrl+c', command=hideApp)
    CTK.addPinMenu(FrameMenu, 'tkCassiopeeSolver')
    WIDGETS['frameMenu'] = FrameMenu

    # - VARS -
    # -0- Integ -
    V = TK.StringVar(win)
    V.set('steady')
    VARS.append(V)
    # -1- Scheme -
    V = TK.StringVar(win)
    V.set('jameson')
    VARS.append(V)
    # -2- Inititer
    V = TK.StringVar(win)
    V.set('1')
    VARS.append(V)
    # -3- Niter
    V = TK.StringVar(win)
    V.set('10')
    VARS.append(V)
    # -4- Chimera option
    V = TK.StringVar(win)
    V.set('Solver performs hole cutting')
    VARS.append(V)
    # -5- double wall tolerance -
    V = TK.StringVar(win)
    V.set('10.')
    VARS.append(V)
    # -6- delta XRay -
    V = TK.StringVar(win)
    V.set('1.e-10')
    VARS.append(V)
    # -7- tolerance XRay -
    V = TK.StringVar(win)
    V.set('1.e-8')
    VARS.append(V)
    # -8- Cartesian option -
    V = TK.StringVar(win)
    V.set('No Cartesian generation')
    VARS.append(V)
    # -9- Dfar -
    V = TK.StringVar(win)
    V.set('10.')
    VARS.append(V)

    # - Integ -
    B = TTK.Label(Frame, text="Integ")
    B.grid(row=0, column=0, sticky=TK.EW)
    BB = CTK.infoBulle(parent=B, text='Kind of integration.')
    B = TTK.OptionMenu(Frame, VARS[0], 'steady', 'unsteady', 'gear')
    B.grid(row=0, column=1, sticky=TK.EW)

    # - Scheme -
    B = TTK.Label(Frame, text="Scheme")
    B.grid(row=1, column=0, sticky=TK.EW)
    BB = CTK.infoBulle(parent=B, text='Numerical scheme used.')
    B = TTK.OptionMenu(Frame, VARS[1], 'jameson', 'jameson_ho', 'jameson_ho5',
                       'roe', 'ausmppmiles', 'ausmpup')
    B.grid(row=1, column=1, sticky=TK.EW)

    # - Inititer -
    B = TTK.Label(Frame, text="Inititer")
    B.grid(row=2, column=0, sticky=TK.EW)
    BB = CTK.infoBulle(parent=B, text='First iteration of this computation.')
    B = TTK.Entry(Frame, textvariable=VARS[2])
    B.grid(row=2, column=1, sticky=TK.EW)

    # - Niter -
    B = TTK.Label(Frame, text="Niter")
    B.grid(row=3, column=0, sticky=TK.EW)
    BB = CTK.infoBulle(parent=B,
                       text='Number of iterations of this computation.')
    B = TTK.Entry(Frame, textvariable=VARS[3])
    B.grid(row=3, column=1, sticky=TK.EW)

    # - Chimera settings -
    B = TTK.OptionMenu(Frame, VARS[4], 'Solver performs hole cutting',
                       'Use OversetHole nodes')
    B.grid(row=4, column=0, columnspan=2, sticky=TK.EW)

    #- XRay settings  -
    B = TTK.Label(Frame, text="XRay delta")
    B.grid(row=5, column=0, sticky=TK.EW)
    B = TTK.Entry(Frame, textvariable=VARS[6])
    B.grid(row=5, column=1, sticky=TK.EW)

    # - Cartesian option -
    B = TTK.OptionMenu(Frame, VARS[8], 'Cartesian mesh generation',
                       'No Cartesian generation')
    B.grid(row=6, column=0, columnspan=2, sticky=TK.EW)

    #- Dfar settings  -
    B = TTK.Label(Frame, text="Dfar")
    B.grid(row=7, column=0, sticky=TK.EW)
    B = TTK.Entry(Frame, textvariable=VARS[9])
    B.grid(row=7, column=1, sticky=TK.EW)

    # - Run -
    B = TTK.Button(Frame, text="Run", command=run)
    B.grid(row=8, column=0, sticky=TK.EW)

    # - Write setup file -
    B = TTK.Button(Frame, text="Write setup", command=writeSetupFile)
    B.grid(row=8, column=1, sticky=TK.EW)
Exemplo n.º 21
0
def createApp(win):
    # - Frame -
    Frame = TTK.LabelFrame(win,
                           borderwidth=2,
                           relief=CTK.FRAMESTYLE,
                           text='tkExtrusion',
                           font=CTK.FRAMEFONT,
                           takefocus=1)
    #BB = CTK.infoBulle(parent=Frame, text='Extrude a mesh.\nCtrl+c to close applet.', temps=0, btype=1)
    Frame.bind('<Control-c>', hideApp)
    Frame.bind('<ButtonRelease-3>', displayFrameMenu)
    Frame.bind('<Enter>', lambda event: Frame.focus_set())
    Frame.columnconfigure(0, weight=1)
    Frame.columnconfigure(1, weight=1)
    Frame.columnconfigure(2, weight=1)
    WIDGETS['frame'] = Frame

    # - Frame menu -
    FrameMenu = TK.Menu(Frame, tearoff=0)
    FrameMenu.add_command(label='Close', accelerator='Ctrl+c', command=hideApp)
    FrameMenu.add_command(label='Save', command=saveApp)
    FrameMenu.add_command(label='Reset', command=resetApp)
    CTK.addPinMenu(FrameMenu, 'tkExtrusion')
    WIDGETS['frameMenu'] = FrameMenu

    # - VARS -
    # -0- Hauteur de chaque maille -
    V = TK.StringVar(win)
    V.set('1.e-1')
    VARS.append(V)
    if 'tkExtrusionHeight' in CTK.PREFS:
        V.set(CTK.PREFS['tkExtrusionHeight'])
    # -1- Nombre de layers a ajouter
    V = TK.StringVar(win)
    V.set('1')
    VARS.append(V)
    if 'tkExtrusionNLayers' in CTK.PREFS:
        V.set(CTK.PREFS['tkExtrusionNLayers'])
    # -2- Nombre d'iterations de lissage
    V = TK.StringVar(win)
    V.set('50')
    VARS.append(V)
    if 'tkExtrusionSmooth' in CTK.PREFS:
        V.set(CTK.PREFS['tkExtrusionSmooth'])
    # -3- Driving curve
    V = TK.StringVar(win)
    V.set('')
    VARS.append(V)
    # -4- Axis for revolve
    V = TK.StringVar(win)
    V.set('')
    VARS.append(V)
    # -5- Angle for revolve
    V = TK.StringVar(win)
    V.set('360.')
    VARS.append(V)
    if 'tkExtrusionRevAngle' in CTK.PREFS:
        V.set(CTK.PREFS['tkExtrusionRevAngle'])
    # -6- Npts for revolve
    V = TK.StringVar(win)
    V.set('30')
    VARS.append(V)
    if 'tkExtrusionNpts' in CTK.PREFS:
        V.set(CTK.PREFS['tkExtrusionNpts'])

    # - AddNormalLayers -
    B = TTK.Entry(Frame, textvariable=VARS[0], background='White', width=5)
    B.grid(row=0, column=0, sticky=TK.EW)
    BB = CTK.infoBulle(parent=B, text='Height of each layer.')

    B = TTK.Entry(Frame, textvariable=VARS[1], background='White', width=5)
    B.grid(row=0, column=1, sticky=TK.EW)
    BB = CTK.infoBulle(parent=B, text='Number of layers.')

    B = TTK.Entry(Frame, textvariable=VARS[2], background='White', width=5)
    B.grid(row=0, column=2, columnspan=1, sticky=TK.EW)
    BB = CTK.infoBulle(parent=B, text='Number of smoothing iterations.')

    B = TTK.Button(Frame, text="Add layers", command=addLayers)
    B.grid(row=1, column=0, columnspan=2, sticky=TK.EW)
    BB = CTK.infoBulle(parent=B, text='Add normal layers to surface.')

    B = TTK.Button(Frame, text="Add k planes", command=addkplanes)
    B.grid(row=1, column=2, columnspan=1, sticky=TK.EW)
    BB = CTK.infoBulle(parent=B, text='Add k planes.')

    # - Extrusion suivant une courbe -
    B = TTK.Button(Frame,
                   text="Curve(s)",
                   command=setCurve,
                   image=iconics.PHOTO[8],
                   padx=0,
                   pady=0,
                   compound=TK.RIGHT)
    B.grid(row=2, column=2, columnspan=1, sticky=TK.EW)
    BB = CTK.infoBulle(parent=B, text='Set driving curve(s) for extrusion.')
    B = TTK.Entry(Frame, textvariable=VARS[3], background='White')
    B.grid(row=2, column=0, columnspan=2, sticky=TK.EW)
    BB = CTK.infoBulle(parent=B, text='Driving curve(s) for extrusion.')

    B = TTK.Button(Frame, text="LineDrive", command=lineDrive)
    B.grid(row=3, column=0, columnspan=2, sticky=TK.EW)
    BB = CTK.infoBulle(parent=B, text='Extrude following linearly curve(s).')

    B = TTK.Button(Frame, text="OrthoDrive", command=orthoDrive)
    B.grid(row=3, column=2, columnspan=1, sticky=TK.EW)
    BB = CTK.infoBulle(parent=B,
                       text='Extrude following orthogonally curve(s).')

    # - Revolve -
    B = TTK.Button(Frame,
                   text="Axis",
                   command=setAxis,
                   image=iconics.PHOTO[8],
                   padx=0,
                   pady=0,
                   compound=TK.RIGHT)
    B.grid(row=4, column=2, columnspan=1, sticky=TK.EW)
    BB = CTK.infoBulle(parent=B, text='Set axis for revolve.')
    B = TTK.Entry(Frame, textvariable=VARS[4], background='White')
    B.grid(row=4, column=0, columnspan=2, sticky=TK.EW)
    BB = CTK.infoBulle(
        parent=B, text='Axis for revolve or\nAxis + rmod curve for revolve.')

    B = TTK.Entry(Frame, textvariable=VARS[5], background='White', width=5)
    B.grid(row=5, column=0, columnspan=1, sticky=TK.EW)
    BB = CTK.infoBulle(parent=B, text='Angle for revolve.')
    B = TTK.Entry(Frame, textvariable=VARS[6], background='White', width=5)
    B.grid(row=5, column=1, columnspan=1, sticky=TK.EW)
    BB = CTK.infoBulle(parent=B, text='Number of points in revolve.')

    B = TTK.Button(Frame, text="Revolve", command=revolve)
    B.grid(row=5, column=2, columnspan=1, sticky=TK.EW)
    BB = CTK.infoBulle(parent=B, text='Revolve following axis.')
Exemplo n.º 22
0
def createApp(win):
    # - Frame -
    Frame = TTK.LabelFrame(win,
                           borderwidth=2,
                           relief=CTK.FRAMESTYLE,
                           text='tkDemo',
                           font=CTK.FRAMEFONT,
                           takefocus=1)
    #BB = CTK.infoBulle(parent=Frame, text='Demo mode.\nCtrl+c to close applet.', temps=0, btype=1)
    Frame.bind('<Control-c>', hideApp)
    Frame.bind('<ButtonRelease-3>', displayFrameMenu)
    Frame.bind('<Enter>', lambda event: Frame.focus_set())
    Frame.columnconfigure(0, weight=2)
    Frame.columnconfigure(1, weight=1)
    WIDGETS['frame'] = Frame

    # - Frame menu -
    FrameMenu = TK.Menu(Frame, tearoff=0)
    FrameMenu.add_command(label='Close', accelerator='Ctrl+c', command=hideApp)
    CTK.addPinMenu(FrameMenu, 'tkDemo')
    WIDGETS['frameMenu'] = FrameMenu

    # -0- Orbiter path -
    V = TK.StringVar(win)
    V.set('')
    VARS.append(V)

    # - Slider -
    B = TTK.Scale(Frame,
                  from_=0,
                  to=100,
                  orient=TK.HORIZONTAL,
                  showvalue=0,
                  borderwidth=1,
                  value=50)
    WIDGETS['speed'] = B
    B.grid(row=0, columnspan=2, sticky=TK.EW)
    BB = CTK.infoBulle(parent=B, text='Speed.')

    # - Rotate -
    B = TTK.Button(Frame, text="Rotate", command=rotate)
    B.grid(row=1, column=0, sticky=TK.EW)
    BB = CTK.infoBulle(parent=B, text='Rotate your model automatically.')
    WIDGETS['rotate'] = B

    # - Fly -
    B = TTK.Button(Frame, text="Fly", command=fly)
    B.grid(row=1, column=1, sticky=TK.EW)
    BB = CTK.infoBulle(parent=B, text='Fly around your model.')
    WIDGETS['fly'] = B

    # - Orbite -
    B = TTK.Button(Frame,
                   text="Path",
                   command=setPath,
                   image=iconics.PHOTO[8],
                   compound=TK.RIGHT,
                   padx=0,
                   pady=0)
    B.grid(row=2, column=1, sticky=TK.EW)
    BB = CTK.infoBulle(parent=B, text='Set orbiter path.')
    B = TTK.Entry(Frame, textvariable=VARS[0], background='White')
    B.grid(row=2, column=0, sticky=TK.EW)
    BB = CTK.infoBulle(parent=B, text='Orbiter path (curve).')

    B = TTK.Button(Frame, text="Orbite", command=orbite)
    B.grid(row=3, column=0, columnspan=2, sticky=TK.EW)
    BB = CTK.infoBulle(parent=B, text='Orbite following a path.')
    WIDGETS['orbite'] = B
Exemplo n.º 23
0
def createApp(win):
    ttk = CTK.importTtk()

    # - Frame -
    Frame = TTK.LabelFrame(win,
                           borderwidth=2,
                           relief=CTK.FRAMESTYLE,
                           text='tkRenderSet',
                           font=CTK.FRAMEFONT,
                           takefocus=1)
    #BB = CTK.infoBulle(parent=Frame, text='Customize block rendering\n(render mode).\nCtrl+c to close applet.', temps=0, btype=1)
    Frame.bind('<Control-c>', hideApp)
    Frame.bind('<ButtonRelease-3>', displayFrameMenu)
    Frame.bind('<Enter>', lambda event: Frame.focus_set())
    Frame.columnconfigure(0, weight=1)
    Frame.columnconfigure(1, weight=1)
    WIDGETS['frame'] = Frame

    # - Frame menu -
    FrameMenu = TK.Menu(Frame, tearoff=0)
    FrameMenu.add_command(label='Close', accelerator='Ctrl+c', command=hideApp)
    CTK.addPinMenu(FrameMenu, 'tkRenderSet')
    WIDGETS['frameMenu'] = FrameMenu

    # - VARS -
    # -0- Material -
    V = TK.StringVar(win)
    V.set('Solid')
    VARS.append(V)
    # -1- Color -
    V = TK.StringVar(win)
    V.set('White')
    VARS.append(V)
    # -2- Blending
    V = TK.StringVar(win)
    V.set('1.')
    VARS.append(V)
    # -3- Mesh overlay
    V = TK.StringVar(win)
    V.set('0')
    VARS.append(V)
    # -4- Shader parameter1 info bulle
    V = TK.StringVar(win)
    V.set('Shader parameter 1.')
    VARS.append(V)
    # -5- Shader parameter2 info bulle
    V = TK.StringVar(win)
    V.set('Shader parameter 2.')
    VARS.append(V)
    # -6- Blending info bulle
    V = TK.StringVar(win)
    V.set('Blending.')
    VARS.append(V)

    # - set Blending -
    B = TTK.Scale(Frame,
                  from_=0,
                  to=100,
                  orient=TK.HORIZONTAL,
                  command=setBlending,
                  showvalue=0,
                  borderwidth=1,
                  value=100)
    WIDGETS['blending'] = B
    B.grid(row=0, column=0, sticky=TK.EW)
    BB = CTK.infoBulle(parent=B, textVariable=VARS[6])

    # - set mesh overlay -
    B = TTK.Checkbutton(Frame,
                        text='Mesh',
                        variable=VARS[3],
                        command=setMeshOverlay)
    BB = CTK.infoBulle(parent=B, text='Add underlaying mesh.')
    B.grid(row=0, column=1, sticky=TK.EW)

    # - set shader parameter 1 & 2-
    B = TTK.Scale(Frame,
                  from_=0,
                  to=100,
                  orient=TK.HORIZONTAL,
                  command=setShaderParameter,
                  showvalue=0,
                  borderwidth=1,
                  value=50)
    WIDGETS['param1'] = B
    B.grid(row=1, column=0, sticky=TK.EW)
    BB = CTK.infoBulle(parent=B, textVariable=VARS[4])

    # - set shader parameter 2 -
    B = TTK.Scale(Frame,
                  from_=0,
                  to=100,
                  orient=TK.HORIZONTAL,
                  command=setShaderParameter,
                  showvalue=0,
                  borderwidth=1,
                  value=50)
    WIDGETS['param2'] = B
    B.grid(row=1, column=1, sticky=TK.EW)
    BB = CTK.infoBulle(parent=B, textVariable=VARS[5])

    # - set Material -
    B = TTK.Button(Frame, text="Set Material", command=setMaterial)
    B.grid(row=2, column=0, sticky=TK.EW)
    BB = CTK.infoBulle(parent=B, text='Set the material render property.')
    B = TTK.OptionMenu(Frame, VARS[0], *MATERIALS)
    B.grid(row=2, column=1, sticky=TK.EW)

    # - set Color -
    B = TTK.Button(Frame, text="Set Color", command=setColor)
    B.grid(row=3, column=0, sticky=TK.EW)
    BB = CTK.infoBulle(parent=B, text='Set the color render property.')

    F = TTK.Frame(Frame, borderwidth=0)
    F.columnconfigure(0, weight=1)

    if ttk is None:
        B = TK.OptionMenu(F, VARS[1], '')
        B.grid(sticky=TK.EW)
        F.bind('<Enter>', updateVarNameList)
        F.grid(row=3, column=1, sticky=TK.EW)
        WIDGETS['colors'] = B
    else:
        B = ttk.Combobox(F,
                         textvariable=VARS[1],
                         values=[],
                         state='readonly',
                         height=11)
        B.bind('<<ComboboxSelected>>', setColorVar2)
        B.grid(sticky=TK.EW)
        F.bind('<Enter>', updateVarNameList2)
        F.grid(row=3, column=1, sticky=TK.EW)
        WIDGETS['colors'] = B

    # - set all properties -
    F = TTK.Frame(Frame, borderwidth=0)
    F.columnconfigure(0, weight=1)
    F.columnconfigure(1, weight=0)

    B = TTK.Button(F, text="Set all properties", command=setAll)
    B.grid(row=0, column=0, columnspan=1, sticky=TK.EW)
    BB = CTK.infoBulle(parent=B, text='Set all render properties.')
    B = TTK.Button(F, command=getData, image=iconics.PHOTO[8], padx=0, pady=0)
    BB = CTK.infoBulle(parent=B, text='Get data from selected zone.')
    B.grid(row=0, column=1, sticky=TK.EW)
    F.grid(row=4, column=0, columnspan=2, sticky=TK.EW)
Exemplo n.º 24
0
def createApp(win):
    # - Frame -
    Frame = TTK.LabelFrame(win,
                           borderwidth=2,
                           relief=CTK.FRAMESTYLE,
                           text='tkDist2Walls',
                           font=CTK.FRAMEFONT,
                           takefocus=1)
    #BB = CTK.infoBulle(parent=Frame, text='Compute wall distance.\nCtrl+c to close applet.', temps=0, btype=1)
    Frame.bind('<Control-c>', hideApp)
    Frame.bind('<ButtonRelease-3>', displayFrameMenu)
    Frame.bind('<Enter>', lambda event: Frame.focus_set())
    Frame.columnconfigure(0, weight=1)
    Frame.columnconfigure(1, weight=4)
    WIDGETS['frame'] = Frame

    # - Frame menu -
    FrameMenu = TK.Menu(Frame, tearoff=0)
    FrameMenu.add_command(label='Close', accelerator='Ctrl+c', command=hideApp)
    FrameMenu.add_command(label='Save', command=saveApp)
    FrameMenu.add_command(label='Reset', command=resetApp)
    CTK.addPinMenu(FrameMenu, 'tkDist2Walls')
    WIDGETS['frameMenu'] = FrameMenu

    # - VARS -
    # -0- Type de distance -
    V = TK.StringVar(win)
    V.set('ortho')
    VARS.append(V)
    if 'tkDist2WallsType' in CTK.PREFS:
        V.set(CTK.PREFS['tkDist2WallsType'])
    # -1- Surfaces -
    V = TK.StringVar(win)
    V.set('')
    VARS.append(V)
    # -2- Signed ou absolute -
    V = TK.StringVar(win)
    V.set('absolute')
    VARS.append(V)
    if 'tkDist2WallsSigned' in CTK.PREFS:
        V.set(CTK.PREFS['tkDist2WallsSigned'])
    # -3- Vars location -
    V = TK.StringVar(win)
    V.set('nodes')
    VARS.append(V)
    if 'tkVariablesLoc' in CTK.PREFS:
        V.set(CTK.PREFS['tkVariablesLoc'])

    # - Surfaces -
    B = TTK.Button(Frame, text="Surfaces", command=setSurfaces)
    B.grid(row=0, column=0, columnspan=1, sticky=TK.EW)
    BB = CTK.infoBulle(
        parent=B,
        text=
        'Set surfaces for distances computation.\nIf not set, BCWalls are used.'
    )
    B = TTK.Entry(Frame, textvariable=VARS[1], background='White')
    B.grid(row=0, column=1, columnspan=1, sticky=TK.EW)

    # - Algorithm -
    B = TTK.OptionMenu(Frame, VARS[0], 'ortho', 'mininterf')
    B.grid(row=1, column=1, sticky=TK.EW)
    B = TTK.OptionMenu(Frame, VARS[2], 'absolute', 'signed')
    B.grid(row=1, column=0, sticky=TK.EW)

    # - Compute -
    B = TTK.Button(Frame, text="Compute", command=compute)
    B.grid(row=2, column=0, sticky=TK.EW)
    B = TTK.OptionMenu(Frame, VARS[3], 'nodes', 'centers')
    B.grid(row=2, column=1, sticky=TK.EW)

    C = CTK.infoBulle(parent=B,
                      text='Compute the wall distance.\nTree is modified.')
Exemplo n.º 25
0
def createApp(win):
    ttk = CTK.importTtk()

    # - Frame -
    Frame = TTK.LabelFrame(win,
                           borderwidth=2,
                           relief=CTK.FRAMESTYLE,
                           text='tkBasicSurfs',
                           font=CTK.FRAMEFONT,
                           takefocus=1)
    #BB = CTK.infoBulle(parent=Frame, text='Create basic surfaces.\nCtrl+c to close applet.', btype=1)
    Frame.bind('<Control-c>', hideApp)
    Frame.bind('<ButtonRelease-3>', displayFrameMenu)
    Frame.bind('<Enter>', lambda event: Frame.focus_set())
    Frame.columnconfigure(0, weight=1)
    Frame.columnconfigure(0, weight=1)
    WIDGETS['frame'] = Frame

    # - Frame menu -
    FrameMenu = TK.Menu(Frame, tearoff=0)
    FrameMenu.add_command(label='Close', accelerator='Ctrl+c', command=hideApp)
    FrameMenu.add_command(label='Save', command=saveApp)
    FrameMenu.add_command(label='Reset', command=resetApp)
    CTK.addPinMenu(FrameMenu, 'tkBasicSurfs')
    WIDGETS['frameMenu'] = FrameMenu

    # - VARS -
    # -0- NPts -
    V = TK.StringVar(win)
    V.set('10')
    VARS.append(V)
    if 'tkBasicSurfsNpts' in CTK.PREFS:
        V.set(CTK.PREFS['tkBasicSurfsNpts'])
    # -1- Type d'elements
    V = TK.StringVar(win)
    V.set('TRI')
    VARS.append(V)
    if 'tkBasicSurfsElts' in CTK.PREFS:
        V.set(CTK.PREFS['tkBasicSurfsElts'])
    # -2- Type de surface
    V = TK.StringVar(win)
    V.set('Sphere')
    VARS.append(V)
    if 'tkBasicSurfsType' in CTK.PREFS:
        V.set(CTK.PREFS['tkBasicSurfsType'])

    # - Npts -
    B = TTK.Entry(Frame, textvariable=VARS[0], background='White')
    B.grid(row=0, column=0, sticky=TK.EW)
    BB = CTK.infoBulle(parent=B, text='Number of generated points.')
    B.bind('<Return>', generate)

    # - Type d'elements: TRI ou STRUCT -
    B = TTK.OptionMenu(Frame, VARS[1], 'TRI', 'QUAD', 'STRUCT')
    B.grid(row=0, column=1, sticky=TK.EW)
    BB = CTK.infoBulle(parent=B, text='Surface element type.')

    # - Type de surface -
    SURFTYPES = [
        'Sphere', 'Cube', 'Tetra', 'Pyramid', 'Cylinder', 'Plane', 'Cone'
    ]
    SURFTYPES += base.keys()
    if ttk is None:
        B = TK.OptionMenu(Frame, VARS[2], *SURFTYPES)
    else:
        B = ttk.Combobox(Frame,
                         textvariable=VARS[2],
                         values=SURFTYPES,
                         state='readonly',
                         width=10)
    B.grid(row=1, column=0, sticky=TK.EW)
    BB = CTK.infoBulle(parent=B, text='Type of generated surface.')
    B = TTK.Button(Frame, text="Generate", command=generate)
    B.grid(row=1, column=1, sticky=TK.EW)
    BB = CTK.infoBulle(parent=B, text='Generate surface.')
Exemplo n.º 26
0
def createApp(win):
    # - Frame -
    Frame = TTK.LabelFrame(win,
                           borderwidth=2,
                           relief=CTK.FRAMESTYLE,
                           text='tkCellN',
                           font=CTK.FRAMEFONT,
                           takefocus=1)
    #BB = CTK.infoBulle(parent=Frame, text='Chimera cellN analysis.\nCtrl+c to close applet.', temps=0, btype=1)
    Frame.bind('<Control-c>', hideApp)
    Frame.bind('<ButtonRelease-3>', displayFrameMenu)
    Frame.bind('<Enter>', lambda event: Frame.focus_set())
    Frame.columnconfigure(0, weight=1)
    Frame.columnconfigure(1, weight=1)
    WIDGETS['frame'] = Frame

    # - Frame menu -
    FrameMenu = TK.Menu(Frame, tearoff=0)
    FrameMenu.add_command(label='Close', accelerator='Ctrl+c', command=hideApp)
    FrameMenu.add_command(label='Save', command=saveApp)
    FrameMenu.add_command(label='Reset', command=resetApp)
    CTK.addPinMenu(FrameMenu, 'tkCellN')
    WIDGETS['frameMenu'] = FrameMenu

    # - VARS -
    # -0- cellN filter -
    norow = 0
    V = TK.StringVar(win)
    V.set('cellN=0')
    VARS.append(V)
    if 'tkCellNFilter' in CTK.PREFS: V.set(CTK.PREFS['tkCellNFilter'])

    # Filter
    B = TTK.OptionMenu(Frame, VARS[0], 'Mesh', 'cellN=0', 'cellN=-99999',
                       'cellN=2', 'cellN<0', '0<cellN<1', 'cellN=1', 'cf>1',
                       'Orphan points', 'Extrapolated points',
                       'Interpolated points')
    B.grid(row=norow, column=0, columnspan=2, sticky=TK.EW)

    # - View cellN -
    norow += 1
    B = TTK.Button(Frame, text="View", command=view)
    B.grid(row=norow, column=0, sticky=TK.EW)
    BB = CTK.infoBulle(
        parent=B,
        text='View the location of specified cellN.\nTree is NOT modified.')

    # - Extract cellN -
    B = TTK.Button(Frame, text="Extract", command=extract)
    B.grid(row=norow, column=1, sticky=TK.EW)
    BB = CTK.infoBulle(
        parent=B,
        text='Extract the location of specified cellN.\nTree is modified.')

    # - chimeraInfo
    # -1- chimeraInfo type
    norow += 1
    V = TK.StringVar(win)
    V.set('interpolated')
    VARS.append(V)
    if 'tkChimeraInfoType' in CTK.PREFS: V.set(CTK.PREFS['tkChimeraInfoType'])

    # Filter
    B = TTK.Button(Frame, text="Chimera info", command=chimeraInfo)
    B.grid(row=norow, column=0, sticky=TK.EW)
    B = TTK.OptionMenu(Frame, VARS[1], 'interpolated', 'extrapolated',
                       'orphan', 'cellRatio', 'donorAspect')
    B.grid(row=norow, column=1, sticky=TK.EW)
Exemplo n.º 27
0
def createApp(win):
    # - Frame -
    Frame = TTK.LabelFrame(win,
                           borderwidth=2,
                           relief=CTK.FRAMESTYLE,
                           text='tkEffects',
                           font=CTK.FRAMEFONT,
                           takefocus=1)
    #BB = CTK.infoBulle(parent=Frame, text='Set anaglyph mode.\nCtrl+c to close applet.', temps=0, btype=1)
    Frame.bind('<Control-c>', hideApp)
    Frame.bind('<ButtonRelease-3>', displayFrameMenu)
    Frame.bind('<Enter>', lambda event: Frame.focus_set())
    Frame.columnconfigure(0, weight=1)
    Frame.columnconfigure(1, weight=1)
    WIDGETS['frame'] = Frame

    # - Frame menu -
    FrameMenu = TK.Menu(Frame, tearoff=0)
    FrameMenu.add_command(label='Close', accelerator='Ctrl+c', command=hideApp)
    FrameMenu.add_command(label='Save', command=saveApp)
    FrameMenu.add_command(label='Reset', command=resetApp)
    CTK.addPinMenu(FrameMenu, 'tkEffects')
    WIDGETS['frameMenu'] = FrameMenu

    # - VARS -
    # -0- cam view angle -
    V = TK.StringVar(win)
    V.set('50.')
    VARS.append(V)
    if 'tkEffectsAngle' in CTK.PREFS: V.set(CTK.PREFS['tkEffectsAngle'])
    # -1- Shadow
    V = TK.StringVar(win)
    V.set('0')
    VARS.append(V)
    if 'tkEffectsShadow' in CTK.PREFS:
        V.set(CTK.PREFS['tkEffectsShadow'])
    # -2- DOF
    V = TK.StringVar(win)
    V.set('0')
    VARS.append(V)
    if 'tkEffectsDOF' in CTK.PREFS: V.set(CTK.PREFS['tkEffectsDOF'])
    # -3- Light offset X info bulle
    V = TK.StringVar(win)
    V.set('Light offset in x.')
    VARS.append(V)
    # -4- Light offset Y info bulle
    V = TK.StringVar(win)
    V.set('Light offset in y.')
    VARS.append(V)
    # -5- Depth of field info bulle
    V = TK.StringVar(win)
    V.set('Depth of field power.')
    VARS.append(V)
    # -6- Gamma correction info bulle
    V = TK.StringVar(win)
    V.set('Gamma correction.')
    VARS.append(V)

    # - Camera angle -
    B = TTK.Button(Frame, text="Set Cam angle", command=setViewAngle)
    B.grid(row=0, column=0, columnspan=1, sticky=TK.EW)
    BB = CTK.infoBulle(parent=B, text='Set the camera view angle.')
    B = TTK.Entry(Frame, textvariable=VARS[0], background='White', width=5)
    B.grid(row=0, column=1, sticky=TK.EW)
    B.bind('<Return>', setViewAngle)
    BB = CTK.infoBulle(parent=B, text='Cam view angle (deg).')

    # - Light offset X -
    B = TTK.Scale(Frame,
                  from_=0,
                  to=100,
                  orient=TK.HORIZONTAL,
                  showvalue=0,
                  borderwidth=1,
                  command=setLightOffsetX,
                  value=55)
    WIDGETS['lightOffsetX'] = B
    B.grid(row=1, column=0, columnspan=1, sticky=TK.EW)
    BB = CTK.infoBulle(parent=B, textVariable=VARS[3])

    # - Light offset Y -
    B = TTK.Scale(Frame,
                  from_=0,
                  to=100,
                  orient=TK.HORIZONTAL,
                  showvalue=0,
                  borderwidth=1,
                  command=setLightOffsetY,
                  value=25)
    WIDGETS['lightOffsetY'] = B
    B.grid(row=1, column=1, columnspan=1, sticky=TK.EW)
    BB = CTK.infoBulle(parent=B, textVariable=VARS[4])

    # - DOF power -
    B = TTK.Scale(Frame,
                  from_=0,
                  to=100,
                  orient=TK.HORIZONTAL,
                  showvalue=0,
                  borderwidth=1,
                  command=setDofPower,
                  value=0)
    WIDGETS['dofPower'] = B
    B.grid(row=2, column=0, columnspan=1, sticky=TK.EW)
    BB = CTK.infoBulle(parent=B, textVariable=VARS[5])

    # - Gamma correction -
    B = TTK.Scale(Frame,
                  from_=0,
                  to=100,
                  orient=TK.HORIZONTAL,
                  showvalue=0,
                  borderwidth=1,
                  command=setGammaCorrection,
                  value=50)
    WIDGETS['gammaCorrection'] = B
    B.grid(row=2, column=1, columnspan=1, sticky=TK.EW)
    BB = CTK.infoBulle(parent=B, textVariable=VARS[6])

    # - Shadow + DOF -
    B = TTK.Checkbutton(Frame,
                        text='Shadow',
                        variable=VARS[1],
                        command=setShadow)
    BB = CTK.infoBulle(parent=B, text='Toggle shadows.')
    B.grid(row=3, column=0, sticky=TK.EW)
    B = TTK.Checkbutton(Frame,
                        text='DOF/Gamma',
                        variable=VARS[2],
                        command=setDOF)
    BB = CTK.infoBulle(parent=B,
                       text='Toggle depth of field blur/gamma correction.')
    B.grid(row=3, column=1, sticky=TK.EW)
Exemplo n.º 28
0
def createApp(win):
    # - Frame -
    Frame = TTK.LabelFrame(win,
                           borderwidth=2,
                           relief=CTK.FRAMESTYLE,
                           text='tkRigidMotion',
                           font=CTK.FRAMEFONT,
                           takefocus=1)
    #BB = CTK.infoBulle(parent=Frame, text='Define block rigid motions.\nCtrl+c to close applet.', temps=0, btype=1)
    Frame.bind('<Control-c>', hideApp)
    Frame.bind('<ButtonRelease-3>', displayFrameMenu)
    Frame.bind('<Enter>', lambda event: Frame.focus_set())
    Frame.columnconfigure(0, weight=0)
    Frame.columnconfigure(1, weight=1)
    Frame.columnconfigure(2, weight=0)
    WIDGETS['frame'] = Frame

    # - Frame menu -
    FrameMenu = TK.Menu(Frame, tearoff=0)
    FrameMenu.add_command(label='Close', accelerator='Ctrl+c', command=hideApp)
    CTK.addPinMenu(FrameMenu, 'tkRigidMotion')
    WIDGETS['frameMenu'] = FrameMenu

    # - VARS -
    # -0- motion name -
    V = TK.StringVar(win)
    V.set('New')
    VARS.append(V)
    #---------------------
    # -- Motion strings --
    #---------------------
    # -1- tx -
    V = TK.StringVar(win)
    V.set('0')
    VARS.append(V)
    # -2- ty -
    V = TK.StringVar(win)
    V.set('0')
    VARS.append(V)
    # -3- tz -
    V = TK.StringVar(win)
    V.set('0')
    VARS.append(V)
    # -4- cx -
    V = TK.StringVar(win)
    V.set('0')
    VARS.append(V)
    # -5- cy -
    V = TK.StringVar(win)
    V.set('0')
    VARS.append(V)
    # -6- cz -
    V = TK.StringVar(win)
    V.set('0')
    VARS.append(V)
    # -7- ex -
    V = TK.StringVar(win)
    V.set('0')
    VARS.append(V)
    # -8- ey -
    V = TK.StringVar(win)
    V.set('0')
    VARS.append(V)
    # -9- ez -
    V = TK.StringVar(win)
    V.set('0')
    VARS.append(V)
    # -10- angle -
    V = TK.StringVar(win)
    V.set('0')
    VARS.append(V)
    # -11- motion type
    V = TK.StringVar(win)
    V.set('1:MotionStrings')
    VARS.append(V)
    #-----------------------------
    # -- Cassiopee Motion rotor --
    #-----------------------------
    # -12- psi0 -
    V = TK.DoubleVar(win)
    V.set(0.)
    VARS.append(V)
    # -13- psi0_b -
    V = TK.DoubleVar(win)
    V.set(0.)
    VARS.append(V)
    # -14- alp_pnt -
    V = TK.StringVar(win)
    V.set('0.; 0.; 0.')
    VARS.append(V)
    # -15- alp_vct -
    V = TK.StringVar(win)
    V.set('0.; 1.; 0.')
    VARS.append(V)
    # -16- alp0 -
    V = TK.DoubleVar(win)
    V.set(0.)
    VARS.append(V)
    # -17- transl_speed -
    V = TK.StringVar(win)
    V.set('0.; 0.; 0.')
    VARS.append(V)
    # -18- rot_pnt -
    V = TK.StringVar(win)
    V.set('0.; 0.; 0.')
    VARS.append(V)
    # -19- rot_vct -
    V = TK.StringVar(win)
    V.set('0.; 0.; 1.')
    VARS.append(V)
    # -20- rot_omg -
    V = TK.DoubleVar(win)
    V.set(0.)
    VARS.append(V)
    # -21- del_pnt -
    V = TK.StringVar(win)
    V.set('0.; 0.; 0.')
    VARS.append(V)
    # -22- del_vct -
    V = TK.StringVar(win)
    V.set('0.; 0.; 1.')
    VARS.append(V)
    # -23- del0 -
    V = TK.DoubleVar(win)
    V.set(0.)
    VARS.append(V)
    # -24- delc -
    V = TK.StringVar(win)
    V.set('0.; 0.; 0.')
    VARS.append(V)
    # -25- dels -
    V = TK.StringVar(win)
    V.set('0.; 0.; 0.')
    VARS.append(V)
    # -26- bet_pnt -
    V = TK.StringVar(win)
    V.set('0.; 0.; 0.')
    VARS.append(V)
    # -27- bet_vct -
    V = TK.StringVar(win)
    V.set('0.; 0.; 1.')
    VARS.append(V)
    # -28- bet0 -
    V = TK.DoubleVar(win)
    V.set(0.)
    VARS.append(V)
    # -29- betc -
    V = TK.StringVar(win)
    V.set('0.; 0.; 0.')
    VARS.append(V)
    # -30- bets -
    V = TK.StringVar(win)
    V.set('0.; 0.; 0.')
    VARS.append(V)
    # -31- tet_pnt -
    V = TK.StringVar(win)
    V.set('0.; 0.; 0.')
    VARS.append(V)
    # -32- tet_vct -
    V = TK.StringVar(win)
    V.set('1.; 0.; 0.')
    VARS.append(V)
    # -33- tet0 -
    V = TK.DoubleVar(win)
    V.set(0.)
    VARS.append(V)
    # -34- tetc -
    V = TK.StringVar(win)
    V.set('0.')
    VARS.append(V)
    # -35- tets -
    V = TK.StringVar(win)
    V.set('0.')
    VARS.append(V)
    # -36- span_vct -
    V = TK.StringVar(win)
    V.set('1.; 0.; 0.')
    VARS.append(V)
    # -37- pre_lag_pnt -
    V = TK.StringVar(win)
    V.set('0.; 0.; 0.')
    VARS.append(V)
    # -38- pre_lag_vct -
    V = TK.StringVar(win)
    V.set('1.; 0.; 0.')
    VARS.append(V)
    # -39- pre_lag_ang -
    V = TK.DoubleVar(win)
    V.set(0.)
    VARS.append(V)
    # -40- pre_con_pnt -
    V = TK.StringVar(win)
    V.set('0.; 0.; 0.')
    VARS.append(V)
    # -41- pre_con_vct -
    V = TK.StringVar(win)
    V.set('1.; 0.; 0.')
    VARS.append(V)
    # -42- pre_con_ang -
    V = TK.DoubleVar(win)
    V.set(0.)
    VARS.append(V)
    #----------------------
    # -- Constant motion --
    #----------------------
    # -43- transl_speed -
    V = TK.StringVar(win)
    V.set('0.; 0.; 0.')
    VARS.append(V)
    # -44- axis_pnt -
    V = TK.StringVar(win)
    V.set('0.; 0.; 0.')
    VARS.append(V)
    # -45- axis_vct -
    V = TK.StringVar(win)
    V.set('0.; 0.; 1.')
    VARS.append(V)
    # -46- omega -
    V = TK.DoubleVar(win)
    V.set(0.)
    VARS.append(V)

    # - Settings -
    B = TTK.OptionMenu(Frame,
                       VARS[11],
                       '1:MotionStrings',
                       '2:KMotionRotor',
                       '3:ConstantMotion',
                       command=changeMotionType)
    B.grid(row=0, column=0, columnspan=3, sticky=TK.EW)

    B = TTK.Label(Frame, text="Name:")
    BB = CTK.infoBulle(parent=B, text='Name of motion.')
    B.grid(row=1, column=0, sticky=TK.EW)
    B = TTK.Entry(Frame, textvariable=VARS[0], background='White')
    B.grid(row=1, column=1, columnspan=2, sticky=TK.EW)

    # - Set/Get -
    B = TTK.Button(Frame, text="Get", command=getVars)
    B.grid(row=3, column=0, sticky=TK.EW)
    BB = CTK.infoBulle(parent=B, text='Get motion from zone (if exists).')
    B = TTK.Button(Frame, text="Set", command=setVars)
    B.grid(row=3, column=1, sticky=TK.EW)
    BB = CTK.infoBulle(parent=B, text='Set motion in zone.')
    B = TTK.Button(Frame, text="Reset", command=resetVars)
    B.grid(row=3, column=2, sticky=TK.EW)
    BB = CTK.infoBulle(parent=B, text='Reset all to default.')

    # Frame pour chaque type de motion
    Frame1 = TTK.Frame(Frame, borderwidth=0)
    Frame1.columnconfigure(0, weight=0)
    Frame1.columnconfigure(1, weight=1)
    WIDGETS['frame1'] = Frame1
    Frame2 = TTK.Frame(Frame, borderwidth=0)
    Frame2.columnconfigure(0, weight=0)
    Frame2.columnconfigure(1, weight=1)
    WIDGETS['frame2'] = Frame2
    Frame3 = TTK.Frame(Frame, borderwidth=0)
    Frame3.columnconfigure(0, weight=0)
    Frame3.columnconfigure(1, weight=1)
    WIDGETS['frame3'] = Frame3

    # - Motion Type1: motion strings -
    B = TTK.Label(Frame1, text="tx:")
    BB = CTK.infoBulle(parent=B,
                       text='Translation of origin.\nCan depend on {t}.')
    B.grid(row=0, column=0, sticky=TK.EW)
    B = TTK.Entry(Frame1, textvariable=VARS[1], background='White')
    BB = CTK.infoBulle(parent=B,
                       text='Translation of origin.\nCan depend on {t}.')
    B.grid(row=0, column=1, sticky=TK.EW)
    B.bind('<Return>', setVars1)

    B = TTK.Label(Frame1, text="ty:")
    BB = CTK.infoBulle(parent=B,
                       text='Translation of origin.\nCan depend on {t}.')
    B.grid(row=1, column=0, sticky=TK.EW)
    B = TTK.Entry(Frame1, textvariable=VARS[2], background='White')
    BB = CTK.infoBulle(parent=B,
                       text='Translation of origin.\nCan depend on {t}.')
    B.grid(row=1, column=1, sticky=TK.EW)
    B.bind('<Return>', setVars1)

    B = TTK.Label(Frame1, text="tz:")
    BB = CTK.infoBulle(parent=B,
                       text='Translation of origin.\nCan depend on {t}.')
    B.grid(row=2, column=0, sticky=TK.EW)
    B = TTK.Entry(Frame1, textvariable=VARS[3], background='White')
    BB = CTK.infoBulle(parent=B,
                       text='Translation of origin.\nCan depend on {t}.')
    B.grid(row=2, column=1, sticky=TK.EW)
    B.bind('<Return>', setVars1)

    B = TTK.Button(Frame1, text="Set", command=setTransOrigin)
    B.grid(row=1, column=2, sticky=TK.EW)
    BB = CTK.infoBulle(parent=B, text='Set trans origin from mouse.')

    B = TTK.Label(Frame1, text="cx:")
    BB = CTK.infoBulle(parent=B,
                       text='Center of rotation.\nCan depend on {t}.')
    B.grid(row=4, column=0, sticky=TK.EW)
    B = TTK.Entry(Frame1, textvariable=VARS[4], background='White')
    BB = CTK.infoBulle(parent=B,
                       text='Center of rotation.\nCan depend on {t}.')
    B.grid(row=4, column=1, sticky=TK.EW)
    B.bind('<Return>', setVars1)

    B = TTK.Label(Frame1, text="cy:")
    BB = CTK.infoBulle(parent=B,
                       text='Center of rotation.\nCan depend on {t}.')
    B.grid(row=5, column=0, sticky=TK.EW)
    B = TTK.Entry(Frame1, textvariable=VARS[5], background='White')
    BB = CTK.infoBulle(parent=B,
                       text='Center of rotation.\nCan depend on {t}.')
    B.grid(row=5, column=1, sticky=TK.EW)
    B.bind('<Return>', setVars1)

    B = TTK.Label(Frame1, text="cz:")
    BB = CTK.infoBulle(parent=B,
                       text='Center of rotation.\nCan depend on {t}.')
    B.grid(row=6, column=0, sticky=TK.EW)
    B = TTK.Entry(Frame1, textvariable=VARS[6], background='White')
    B.grid(row=6, column=1, sticky=TK.EW)
    B.bind('<Return>', setVars1)

    B = TTK.Button(Frame1, text="Set", command=setCenterRotation)
    B.grid(row=5, column=2, sticky=TK.EW)
    BB = CTK.infoBulle(parent=B, text='Set rotation center from mouse.')

    B = TTK.Label(Frame1, text="ex:")
    BB = CTK.infoBulle(parent=B,
                       text='Second rot axis point.\nCan depend on {t}.')
    B.grid(row=7, column=0, sticky=TK.EW)
    B = TTK.Entry(Frame1, textvariable=VARS[7], background='White')
    BB = CTK.infoBulle(parent=B,
                       text='Second rot axis point.\nCan depend on {t}.')
    B.grid(row=7, column=1, sticky=TK.EW)
    B.bind('<Return>', setVars1)

    B = TTK.Label(Frame1, text="ey:")
    BB = CTK.infoBulle(parent=B,
                       text='Second rot axis point.\nCan depend on {t}.')
    B.grid(row=8, column=0, sticky=TK.EW)
    B = TTK.Entry(Frame1, textvariable=VARS[8], background='White')
    BB = CTK.infoBulle(parent=B,
                       text='Second rot axis point.\nCan depend on {t}.')
    B.grid(row=8, column=1, sticky=TK.EW)
    B.bind('<Return>', setVars1)

    B = TTK.Label(Frame1, text="ez:")
    BB = CTK.infoBulle(parent=B,
                       text='Second rot axis point.\nCan depend on {t}.')
    B.grid(row=9, column=0, sticky=TK.EW)
    B = TTK.Entry(Frame1, textvariable=VARS[9], background='White')
    BB = CTK.infoBulle(parent=B,
                       text='Second rot axis point.\nCan depend on {t}.')
    B.grid(row=9, column=1, sticky=TK.EW)
    B.bind('<Return>', setVars1)

    B = TTK.Button(Frame1, text="Set", command=set2Axis)
    B.grid(row=8, column=2, sticky=TK.EW)
    BB = CTK.infoBulle(parent=B, text='Set rot axis from mouse.')

    B = TTK.Label(Frame1, text="angle:")
    BB = CTK.infoBulle(parent=B,
                       text='Rotation angle.\Can depend on {t}. In degrees.')
    B.grid(row=10, column=0, sticky=TK.EW)
    B = TTK.Entry(Frame1, textvariable=VARS[10], background='White')
    BB = CTK.infoBulle(parent=B,
                       text='Rotation angle.\Can depend on {t}. In degrees.')
    B.grid(row=10, column=1, sticky=TK.EW)
    B.bind('<Return>', setVars1)

    # - Motion Type2: KMotionRotor -
    B = TTK.Label(Frame2, text="transl_speed:")
    BB = CTK.infoBulle(parent=B, text='Translation speed and span_vect.')
    B.grid(row=0, column=0, sticky=TK.EW)
    B = TTK.Entry(Frame2, textvariable=VARS[17], background='White', width=10)
    BB = CTK.infoBulle(parent=B, text='transl_speed.')
    B.grid(row=0, column=1, sticky=TK.EW)
    B.bind('<Return>', setVars2)

    B = TTK.Entry(Frame2, textvariable=VARS[36], background='White', width=10)
    BB = CTK.infoBulle(parent=B, text='span vector.')
    B.grid(row=0, column=2, sticky=TK.EW)
    B.bind('<Return>', setVars2)

    B = TTK.Label(Frame2, text="psi0:")
    BB = CTK.infoBulle(parent=B, text='Azymuth at t=0.')
    B.grid(row=1, column=0, sticky=TK.EW)
    B = TTK.Entry(Frame2, textvariable=VARS[12], background='White', width=10)
    BB = CTK.infoBulle(parent=B, text='psi0. In degrees.')
    B.grid(row=1, column=1, sticky=TK.EW)
    B.bind('<Return>', setVars2)
    B = TTK.Entry(Frame2, textvariable=VARS[13], background='White', width=10)
    BB = CTK.infoBulle(parent=B, text='psi0_b. In degrees.')
    B.grid(row=1, column=2, sticky=TK.EW)
    B.bind('<Return>', setVars2)

    B = TTK.Label(Frame2, text="alp:")
    BB = CTK.infoBulle(parent=B, text='Shaft angle.')
    B.grid(row=2, column=0, sticky=TK.EW)
    B = TTK.Entry(Frame2, textvariable=VARS[14], background='White', width=10)
    BB = CTK.infoBulle(parent=B, text='alp_pnt.')
    B.grid(row=2, column=1, sticky=TK.EW)
    B.bind('<Return>', setVars2)
    B = TTK.Entry(Frame2, textvariable=VARS[15], background='White', width=10)
    BB = CTK.infoBulle(parent=B, text='alp_vct.')
    B.grid(row=2, column=2, sticky=TK.EW)
    B.bind('<Return>', setVars2)
    B = TTK.Entry(Frame2, textvariable=VARS[16], background='White', width=4)
    BB = CTK.infoBulle(parent=B, text='alp0. In degrees.')
    B.grid(row=2, column=3, sticky=TK.EW)
    B.bind('<Return>', setVars2)

    B = TTK.Label(Frame2, text="rot:")
    BB = CTK.infoBulle(parent=B, text='Rotation.')
    B.grid(row=3, column=0, sticky=TK.EW)
    B = TTK.Entry(Frame2, textvariable=VARS[18], background='White', width=10)
    BB = CTK.infoBulle(parent=B, text='rot_pnt.')
    B.grid(row=3, column=1, sticky=TK.EW)
    B.bind('<Return>', setVars2)
    B = TTK.Entry(Frame2, textvariable=VARS[19], background='White', width=10)
    BB = CTK.infoBulle(parent=B, text='rot_vct.')
    B.grid(row=3, column=2, sticky=TK.EW)
    B.bind('<Return>', setVars2)
    B = TTK.Entry(Frame2, textvariable=VARS[20], background='White', width=4)
    BB = CTK.infoBulle(parent=B, text='rot_omg. In rad/time unit.')
    B.grid(row=3, column=3, sticky=TK.EW)
    B.bind('<Return>', setVars2)

    B = TTK.Label(Frame2, text="del:")
    BB = CTK.infoBulle(parent=B, text='..')
    B.grid(row=4, column=0, sticky=TK.EW)
    B = TTK.Entry(Frame2, textvariable=VARS[21], background='White', width=10)
    BB = CTK.infoBulle(parent=B, text='del_pnt.')
    B.grid(row=4, column=1, sticky=TK.EW)
    B.bind('<Return>', setVars2)
    B = TTK.Entry(Frame2, textvariable=VARS[22], background='White', width=10)
    BB = CTK.infoBulle(parent=B, text='del_vct.')
    B.grid(row=4, column=2, sticky=TK.EW)
    B.bind('<Return>', setVars2)
    B = TTK.Entry(Frame2, textvariable=VARS[23], background='White', width=4)
    B.grid(row=4, column=3, sticky=TK.EW)
    BB = CTK.infoBulle(parent=B, text='del0. In degrees.')
    B.bind('<Return>', setVars2)
    B = TTK.Label(Frame2, text="delc,s:")
    BB = CTK.infoBulle(parent=B, text='del modes.')
    B.grid(row=5, column=0, sticky=TK.EW)
    B = TTK.Entry(Frame2, textvariable=VARS[24], background='White', width=10)
    BB = CTK.infoBulle(parent=B, text='delc.')
    B.grid(row=5, column=1, sticky=TK.EW)
    B.bind('<Return>', setVars2)
    B = TTK.Entry(Frame2, textvariable=VARS[25], background='White', width=10)
    BB = CTK.infoBulle(parent=B, text='dels.')
    B.grid(row=5, column=2, sticky=TK.EW)
    B.bind('<Return>', setVars2)

    B = TTK.Label(Frame2, text="bet:")
    BB = CTK.infoBulle(parent=B, text='..')
    B.grid(row=6, column=0, sticky=TK.EW)
    B = TTK.Entry(Frame2, textvariable=VARS[26], background='White', width=10)
    BB = CTK.infoBulle(parent=B, text='bet_pnt.')
    B.grid(row=6, column=1, sticky=TK.EW)
    B.bind('<Return>', setVars2)
    B = TTK.Entry(Frame2, textvariable=VARS[27], background='White', width=10)
    BB = CTK.infoBulle(parent=B, text='bet_vct.')
    B.grid(row=6, column=2, sticky=TK.EW)
    B.bind('<Return>', setVars2)
    B = TTK.Entry(Frame2, textvariable=VARS[28], background='White', width=4)
    B.grid(row=6, column=3, sticky=TK.EW)
    BB = CTK.infoBulle(parent=B, text='bet0. In degrees.')
    B.bind('<Return>', setVars2)
    B = TTK.Label(Frame2, text="betc,s:")
    BB = CTK.infoBulle(parent=B, text='bet modes.')
    B.grid(row=7, column=0, sticky=TK.EW)
    B = TTK.Entry(Frame2, textvariable=VARS[29], background='White', width=10)
    BB = CTK.infoBulle(parent=B, text='betc.')
    B.grid(row=7, column=1, sticky=TK.EW)
    B.bind('<Return>', setVars2)
    B = TTK.Entry(Frame2, textvariable=VARS[30], background='White', width=10)
    BB = CTK.infoBulle(parent=B, text='bets.')
    B.grid(row=7, column=2, sticky=TK.EW)
    B.bind('<Return>', setVars2)

    B = TTK.Label(Frame2, text="tet:")
    BB = CTK.infoBulle(parent=B, text='..')
    B.grid(row=8, column=0, sticky=TK.EW)
    B = TTK.Entry(Frame2, textvariable=VARS[31], background='White', width=10)
    BB = CTK.infoBulle(parent=B, text='tet_pnt.')
    B.grid(row=8, column=1, sticky=TK.EW)
    B.bind('<Return>', setVars2)
    B = TTK.Entry(Frame2, textvariable=VARS[32], background='White', width=10)
    BB = CTK.infoBulle(parent=B, text='tet_vct.')
    B.grid(row=8, column=2, sticky=TK.EW)
    B.bind('<Return>', setVars2)
    B = TTK.Entry(Frame2, textvariable=VARS[33], background='White', width=4)
    B.grid(row=8, column=3, sticky=TK.EW)
    BB = CTK.infoBulle(parent=B, text='tet0. In degrees.')
    B.bind('<Return>', setVars2)
    B = TTK.Label(Frame2, text="tetc,s:")
    BB = CTK.infoBulle(parent=B, text='tet modes.')
    B.grid(row=9, column=0, sticky=TK.EW)
    B = TTK.Entry(Frame2, textvariable=VARS[34], background='White', width=10)
    BB = CTK.infoBulle(parent=B, text='tetc.')
    B.grid(row=9, column=1, sticky=TK.EW)
    B.bind('<Return>', setVars2)
    B = TTK.Entry(Frame2, textvariable=VARS[35], background='White', width=10)
    BB = CTK.infoBulle(parent=B, text='tets.')
    B.grid(row=9, column=2, sticky=TK.EW)
    B.bind('<Return>', setVars2)

    B = TTK.Label(Frame2, text="pre_lag:")
    BB = CTK.infoBulle(parent=B, text='..')
    B.grid(row=10, column=0, sticky=TK.EW)
    B = TTK.Entry(Frame2, textvariable=VARS[37], background='White', width=10)
    BB = CTK.infoBulle(parent=B, text='pre_lag_pnt.')
    B.grid(row=10, column=1, sticky=TK.EW)
    B.bind('<Return>', setVars2)
    B = TTK.Entry(Frame2, textvariable=VARS[38], background='White', width=10)
    BB = CTK.infoBulle(parent=B, text='pre_lag_vct.')
    B.grid(row=10, column=2, sticky=TK.EW)
    B.bind('<Return>', setVars2)
    B = TTK.Entry(Frame2, textvariable=VARS[39], background='White', width=4)
    B.grid(row=10, column=3, sticky=TK.EW)
    BB = CTK.infoBulle(parent=B, text='pre_lag_ang. In degrees.')
    B.bind('<Return>', setVars2)

    B = TTK.Label(Frame2, text="pre_con:")
    BB = CTK.infoBulle(parent=B, text='..')
    B.grid(row=11, column=0, sticky=TK.EW)
    B = TK.Entry(Frame2, textvariable=VARS[40], background='White', width=10)
    BB = CTK.infoBulle(parent=B, text='pre_con_pnt.')
    B.grid(row=11, column=1, sticky=TK.EW)
    B.bind('<Return>', setVars2)
    B = TK.Entry(Frame2, textvariable=VARS[41], background='White', width=10)
    BB = CTK.infoBulle(parent=B, text='pre_con_vct.')
    B.grid(row=11, column=2, sticky=TK.EW)
    B.bind('<Return>', setVars2)
    B = TK.Entry(Frame2, textvariable=VARS[42], background='White', width=4)
    B.grid(row=11, column=3, sticky=TK.EW)
    BB = CTK.infoBulle(parent=B, text='pre_con_ang. In degrees.')
    B.bind('<Return>', setVars2)

    # - Motion Type3: ConstantMotion -
    B = TTK.Label(Frame3, text="transl_speed:")
    BB = CTK.infoBulle(parent=B, text='Translation speed.')
    B.grid(row=0, column=0, sticky=TK.EW)
    B = TTK.Entry(Frame3, textvariable=VARS[43], background='White')
    BB = CTK.infoBulle(parent=B, text='Translation speed.')
    B.grid(row=0, column=1, sticky=TK.EW)
    B.bind('<Return>', setVars3)
    B = TTK.Label(Frame3, text="axis_pnt:")
    BB = CTK.infoBulle(parent=B, text='Rotation center.')
    B.grid(row=1, column=0, sticky=TK.EW)
    B = TTK.Entry(Frame3, textvariable=VARS[44], background='White')
    BB = CTK.infoBulle(parent=B, text='Rotation center.')
    B.grid(row=1, column=1, sticky=TK.EW)
    B.bind('<Return>', setVars3)
    B = TTK.Label(Frame3, text="axis_vct:")
    BB = CTK.infoBulle(parent=B, text='Rotation axis.')
    B.grid(row=2, column=0, sticky=TK.EW)
    B = TTK.Entry(Frame3, textvariable=VARS[45], background='White')
    BB = CTK.infoBulle(parent=B, text='Rotation axis.')
    B.grid(row=2, column=1, sticky=TK.EW)
    B.bind('<Return>', setVars3)
    B = TTK.Label(Frame3, text="omega:")
    BB = CTK.infoBulle(parent=B, text='Rotation speed. In rad/time unit.')
    B.grid(row=3, column=0, sticky=TK.EW)
    B = TTK.Entry(Frame3, textvariable=VARS[46], background='White')
    BB = CTK.infoBulle(parent=B, text='Rotation speed. In rad/time unit.')
    B.grid(row=3, column=1, sticky=TK.EW)
    B.bind('<Return>', setVars3)

    changeMotionType()
Exemplo n.º 29
0
def createApp(win):
    # - Frame -
    Frame = TTK.LabelFrame(win,
                           borderwidth=2,
                           relief=CTK.FRAMESTYLE,
                           text='tkChimera',
                           font=CTK.FRAMEFONT,
                           takefocus=1)
    #BB = CTK.infoBulle(parent=Frame, text='Chimera connectivity.\nCtrl+c to close applet.', temps=0, btype=1)
    Frame.bind('<Control-c>', hideApp)
    Frame.bind('<ButtonRelease-3>', displayFrameMenu)
    Frame.bind('<Enter>', lambda event: Frame.focus_set())
    Frame.columnconfigure(0, weight=0)
    Frame.columnconfigure(1, weight=1)
    Frame.columnconfigure(2, weight=1)
    Frame.columnconfigure(3, weight=1)
    Frame.columnconfigure(4, weight=1)
    WIDGETS['frame'] = Frame

    # - Frame menu -
    FrameMenu = TK.Menu(Frame, tearoff=0)
    FrameMenu.add_command(label='Close', accelerator='Ctrl+c', command=hideApp)
    CTK.addPinMenu(FrameMenu, 'tkChimera')
    WIDGETS['frameMenu'] = FrameMenu

    # - VARS -
    # -0- double wall: active ? -
    V = TK.StringVar(win)
    V.set('inactive')
    VARS.append(V)
    # -1- delta XRay -
    V = TK.StringVar(win)
    V.set('1.e-10')
    VARS.append(V)
    # -2- tolerance XRay -
    V = TK.StringVar(win)
    V.set('1.e-8')
    VARS.append(V)
    # -3- Base name 1
    V = TK.StringVar(win)
    V.set('')
    VARS.append(V)
    # -4- Relation
    V = TK.StringVar(win)
    V.set('+')
    VARS.append(V)
    # -5- Base name 2
    V = TK.StringVar(win)
    V.set('')
    VARS.append(V)
    # -6- Blanking surface
    V = TK.StringVar(win)
    V.set('')
    VARS.append(V)
    # -7- depth
    V = TK.StringVar(win)
    V.set('2')
    VARS.append(V)
    # -8- Blanking type
    V = TK.StringVar(win)
    V.set('cell_intersect')
    VARS.append(V)
    # -9- Priorite
    V = TK.StringVar(win)
    V.set('0')
    VARS.append(V)

    r = 0  # row
    # - Number of layers (depth) -
    B = TTK.Label(Frame, text="Depth")
    B.grid(row=r, column=0, sticky=TK.EW)
    BB = CTK.infoBulle(parent=B, text='Number of interpolated layers.')
    B = TTK.Entry(Frame, textvariable=VARS[7], background='White', width=2)
    B.grid(row=r, column=1, sticky=TK.EW)
    BB = CTK.infoBulle(parent=B, text='Number of interpolated layers.')

    # - Blanking type -
    B = TTK.OptionMenu(Frame, VARS[8], 'cell_intersect', 'cell_intersect_opt',
                       'center_in', 'node_in')
    B.grid(row=r, column=2, columnspan=2, sticky=TK.EW)
    BB = CTK.infoBulle(parent=B, text='Blanking type.')
    r += 1

    # - initCellN -
    B = TTK.Button(Frame, text="Init cellN", command=initCellN)
    B.grid(row=r, column=0, columnspan=4, sticky=TK.EW)
    BB = CTK.infoBulle(parent=B,
                       text='Init the cellN to 1. in the tree or selection.')
    r += 1

    # - applyBCOverlap -
    B = TTK.Button(Frame, text="ApplyBCOverlaps", command=applyOverlap)
    B.grid(row=r, column=0, columnspan=2, sticky=TK.EW)
    BB = CTK.infoBulle(
        parent=B,
        text='Modify the cellN (=2) near BCOverlaps and doubly defined BCs.')

    # - setHoleInterpolatedPoints -
    B = TTK.Button(Frame,
                   text="SetHoleInterpPoints",
                   command=setHoleInterpolatedPoints)
    B.grid(row=r, column=2, columnspan=2, sticky=TK.EW)
    BB = CTK.infoBulle(parent=B, text='Modify the cellN (=2) near holes.')
    r += 1

    # - XRay delta  -
    B = TTK.Label(Frame, text="XRay delta")
    B.grid(row=r, column=0, sticky=TK.EW)
    BB = CTK.infoBulle(parent=B,
                       text='The created holes will expand of this value.')
    B = TTK.Entry(Frame, textvariable=VARS[1], background='White', width=5)
    B.grid(row=r, column=1, sticky=TK.EW)

    # - Xray tol -
    B = TTK.Label(Frame, text="Tol")
    B.grid(row=r, column=2, sticky=TK.EW)
    BB = CTK.infoBulle(
        parent=B,
        text=
        'Two surface points separated of this value\nwill be considered as identical.'
    )
    B = TTK.Entry(Frame, textvariable=VARS[2], background='White', width=5)
    B.grid(row=r, column=3, sticky=TK.EW)
    r += 1

    # - Surface -
    B = TTK.Button(Frame,
                   text="Surf",
                   command=setSurface,
                   image=iconics.PHOTO[8],
                   padx=0,
                   pady=0,
                   compound=TK.RIGHT)
    B.grid(row=r, column=3, sticky=TK.EW)
    BB = CTK.infoBulle(
        parent=B,
        text='Set blanking surfaces.\nThey must define ONE closed body.')
    B = TTK.Entry(Frame, textvariable=VARS[6], background='White')
    BB = CTK.infoBulle(parent=B, text='Blanking surfaces.')
    B.grid(row=r, column=0, columnspan=3, sticky=TK.EW)
    r += 1

    # - blanking -
    B = TTK.Button(Frame, text="Blank cells", command=blank)
    B.grid(row=r, column=0, columnspan=4, sticky=TK.EW)
    BB = CTK.infoBulle(parent=B, text='Blank cells with with surface.')
    r += 1

    # - set priority -
    B = TTK.Button(Frame, text="Set Priority", command=setPriority)
    B.grid(row=r, column=0, columnspan=3, sticky=TK.EW)
    BB = CTK.infoBulle(parent=B, text='Set a priority to a base.')
    B = TTK.OptionMenu(Frame, VARS[9], '0', '1', '2', '3')
    B.grid(row=r, column=3, sticky=TK.EW)
    r += 1

    # - double wall active ? for optimizeOverlap
    B = TTK.Label(Frame, text="DoubleWall")
    B.grid(row=r, column=0, sticky=TK.EW)
    B = TTK.OptionMenu(Frame, VARS[0], 'inactive', 'active')
    B.grid(row=r, column=3, sticky=TK.EW)

    # - optimizeOverlap -
    B = TTK.Button(Frame, text="Optimize overlap", command=optimize)
    B.grid(row=r, column=0, columnspan=4, sticky=TK.EW)
    BB = CTK.infoBulle(parent=B, text='Optimize the overlapping')
    r += 1

    # - createOversetHoles -
    B = TTK.Button(Frame,
                   text="Create OversetHoles nodes",
                   command=createOversetHoles)
    B.grid(row=r, column=0, columnspan=4, sticky=TK.EW)
    BB = CTK.infoBulle(parent=B,
                       text='Create the nodes OversetHoles in pyTree.')
    r += 1
Exemplo n.º 30
0
def createApp(win):

    ttk = CTK.importTtk()

    # - Frame -
    Frame = TTK.LabelFrame(win, borderwidth=2, relief=CTK.FRAMESTYLE,
                           text='tkFamily', font=CTK.FRAMEFONT, takefocus=1)
    #BB = CTK.infoBulle(parent=Frame, text='Create famlies of\nblocks or BCs.\nCtrl+c to close applet.', temps=0, btype=1)
    Frame.bind('<Control-c>', hideApp)
    Frame.bind('<ButtonRelease-3>', displayFrameMenu)
    Frame.bind('<Enter>', lambda event : Frame.focus_set())
    Frame.columnconfigure(0, weight=1)
    Frame.columnconfigure(1, weight=4)
    WIDGETS['frame'] = Frame

    # - Frame menu -
    FrameMenu = TK.Menu(Frame, tearoff=0)
    FrameMenu.add_command(label='Close', accelerator='Ctrl+c', command=hideApp)
    CTK.addPinMenu(FrameMenu, 'tkFamily')
    WIDGETS['frameMenu'] = FrameMenu
    
    # - VARS -
    # -0- Nom de la FamilyZone (new) -
    V = TK.StringVar(win); V.set(''); VARS.append(V)
    # -1- Nom de la FamilyBC (new) -
    V = TK.StringVar(win); V.set(''); VARS.append(V)
    # -2- Nom de la famille zone pour le tag
    V = TK.StringVar(win); V.set(''); VARS.append(V)
    
    # - Create zone family name -
    B = TTK.Button(Frame, text="NewZoneFamily", command=createZoneFamily)
    B.grid(row=0, column=0, sticky=TK.EW)
    BB = CTK.infoBulle(parent=B, text='Create a new zone family tag.')
    B = TTK.Entry(Frame, textvariable=VARS[0], background='White', width=15)
    BB = CTK.infoBulle(parent=B, text='Zone family name.')
    B.grid(row=0, column=1, sticky=TK.EW)
    B.bind('<Return>', createZoneFamily)

    # - Tag with zone family -
    B = TTK.Button(Frame, text="Tag zone", command=tagWithZoneFamily)
    B.grid(row=1, column=0, sticky=TK.EW)
    BB = CTK.infoBulle(parent=B, text='Tag a zone with a zone family.')
    F = TTK.Frame(Frame, borderwidth=0)
    F.columnconfigure(0, weight=1)

    if ttk is None:
        B = TK.OptionMenu(F, VARS[2], '')
        B.grid(sticky=TK.EW)
        BB = CTK.infoBulle(parent=B, text='Family zone name.')
        F.bind('<Enter>', updateFamilyZoneNameList)
        F.grid(row=1, column=1, sticky=TK.EW)
        WIDGETS['zones'] = B
    else:
        B = ttk.Combobox(F, textvariable=VARS[2], 
                         values=[], state='readonly')
        B.grid(sticky=TK.EW)
        F.bind('<Enter>', updateFamilyZoneNameList2)
        F.grid(row=1, column=1, sticky=TK.EW)
        BB = CTK.infoBulle(parent=B, text='Family zone name.')
        WIDGETS['zones'] = B

    # - Create BC family -
    B = TTK.Button(Frame, text="NewBCFamily", command=createBCFamily)
    B.grid(row=2, column=0, sticky=TK.EW)
    BB = CTK.infoBulle(parent=B, text='Create a new BC family tag.')
    B = TTK.Entry(Frame, textvariable=VARS[1], background='White', width=15)
    BB = CTK.infoBulle(parent=B, text='BC family name.')
    B.grid(row=2, column=1, sticky=TK.EW)
    B.bind('<Return>', createBCFamily)