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)
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.')
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.')
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.')
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.')
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.')
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
def createApp(win): # - Frame - Frame = TTK.LabelFrame(win, borderwidth=2, relief=CTK.FRAMESTYLE, text='tkPaint', font=CTK.FRAMEFONT, takefocus=1) #BB = CTK.infoBulle(parent=Frame, text='Paint 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=2) Frame.columnconfigure(1, weight=0) 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) CTK.addPinMenu(FrameMenu, 'tkPaint') WIDGETS['frameMenu'] = FrameMenu # - VARS - # -0- value - V = TK.StringVar(win) V.set('1.') VARS.append(V) # -1- width - V = TK.StringVar(win) V.set('1.') VARS.append(V) # -2- Brush V = TK.StringVar(win) V.set('Sphere') VARS.append(V) # - Value - B = TTK.Entry(Frame, textvariable=VARS[0], background='White', width=5) B.grid(row=0, column=0, columnspan=1, sticky=TK.EW) BB = CTK.infoBulle(parent=B, text='Value.') WIDGETS['value'] = B B = TTK.Button(Frame, command=getValue, image=iconics.PHOTO[8], padx=0, pady=0) B.grid(row=0, column=1, columnspan=1, sticky=TK.EW) BB = CTK.infoBulle(parent=B, text='Get value from mouse pointer.') # - Width - #B = TTK.Entry(Frame, textvariable=VARS[1], background='White', width=5) #B.grid(row=0, column=1, columnspan=1, sticky=TK.EW) #BB = CTK.infoBulle(parent=B, text='Width.') #WIDGETS['width'] = B # - Brush - #B = TTK.OptionMenu(Frame, VARS[2], 'Sphere') #BB = CTK.infoBulle(parent=B, text='Brush shape.') #B.grid(row=1, column=0, sticky=TK.EW) # - Paint mode - B = TTK.Button(Frame, text="Paint mode", command=paint) BB = CTK.infoBulle( parent=B, text='Enter paint mode.\nValue of field (scalar mode) is modified.') B.grid(row=0, column=2, columnspan=1, sticky=TK.EW) WIDGETS['paint'] = B
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='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.')
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.')
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)
def createApp(win): # - Frame - Frame = TTK.LabelFrame(win, borderwidth=2, relief=CTK.FRAMESTYLE, text='tkSmooth', font=CTK.FRAMEFONT, takefocus=1) #BB = CTK.infoBulle(parent=Frame, text='Smooth 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=0) Frame.columnconfigure(2, weight=0) Frame.columnconfigure(3, weight=0) Frame.columnconfigure(4, 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, 'tkSmooth') WIDGETS['frameMenu'] = FrameMenu # - VARS - # -0- Smoother niter - V = TK.StringVar(win); V.set('10'); VARS.append(V) if 'tkSmoothIter' in CTK.PREFS: V.set(CTK.PREFS['tkSmoothIter']) # -1- Constraint V = TK.StringVar(win); V.set(''); VARS.append(V) # -2- Constraint strength V = TK.StringVar(win); V.set('0.1'); VARS.append(V) if 'tkSmoothConsStrength' in CTK.PREFS: V.set(CTK.PREFS['tkSmoothConsStrength']) # -3- Constraint external faces V = TK.IntVar(win); V.set(1); VARS.append(V) # -4- smooth eps V = TK.StringVar(win); V.set('0.5'); VARS.append(V) if 'tkSmoothEps' in CTK.PREFS: V.set(CTK.PREFS['tkSmoothEps']) # -5- Constraint sharp edges V = TK.IntVar(win); V.set(0); VARS.append(V) # -6- Sharp edges detection angle V = TK.StringVar(win); V.set('30.'); VARS.append(V) if 'tkSmoothSharpAngle' in CTK.PREFS: V.set(CTK.PREFS['tkSmoothSharpAngle']) # -7- Project on surface V = TK.IntVar(win); V.set(0); VARS.append(V) # -8- Type de smoothing V = TK.StringVar(win); V.set('Volume'); VARS.append(V) if 'tkSmoothType' in CTK.PREFS: V.set(CTK.PREFS['tkSmoothType']) # - Smoother power - #B = TTK.Label(Frame, text="Eps") #B.grid(row=0, column=0, sticky=TK.EW) B = TTK.OptionMenu(Frame, VARS[8], 'Volume', 'Scale', 'Taubin') BB = CTK.infoBulle(parent=B, text='Smoothing algorithm.') B.grid(row=0, column=0, columnspan=2, sticky=TK.EW) B = TTK.Entry(Frame, textvariable=VARS[4], background='White', width=4) B.grid(row=0, column=2, sticky=TK.EW) BB = CTK.infoBulle(parent=B, text='Smoother power.') B = TTK.Label(Frame, text="Iter") B.grid(row=0, column=3, sticky=TK.EW) B = TTK.Entry(Frame, textvariable=VARS[0], background='White', width=4) B.grid(row=0, column=4, sticky=TK.EW) BB = CTK.infoBulle(parent=B, text='Number of smoother iterations.') # - Constraint strength - B = TTK.Entry(Frame, textvariable=VARS[2], background='White', width=4) B.grid(row=1, column=0, sticky=TK.EW) BB = CTK.infoBulle(parent=B, text='Strength of constraints.') # - Keep external faces - B = TTK.Checkbutton(Frame, text='EF', variable=VARS[3]) B.grid(row=1, column=1, columnspan=1, sticky=TK.EW) BB = CTK.infoBulle(parent=B, text='Keep external faces.') # - Keep sharp edges faces - B = TTK.Checkbutton(Frame, text='SE', variable=VARS[5]) B.grid(row=1, column=2, columnspan=1, sticky=TK.EW) BB = CTK.infoBulle(parent=B, text='Keep sharp edges.') # - Project on surface B = TTK.Checkbutton(Frame, text='PJ', variable=VARS[7]) B.grid(row=1, column=3, columnspan=1, sticky=TK.EW) BB = CTK.infoBulle(parent=B, text='Project on surface.') # - Sharp edges detection B = TTK.Entry(Frame, textvariable=VARS[6], background='White', width=4) B.grid(row=1, column=4, sticky=TK.EW) BB = CTK.infoBulle(parent=B, text='Sharp edges detection angle.') # - Smoother constraint - B = TTK.Button(Frame, command=setConstraint, image=iconics.PHOTO[8], padx=0, pady=0) BB = CTK.infoBulle(parent=B, text='Set constraint curves for smoother (points dont move).') B.grid(row=2, column=4, columnspan=1, sticky=TK.EW) B = TTK.Entry(Frame, textvariable=VARS[1], background='White', width=8) B.grid(row=2, column=0, columnspan=4, sticky=TK.EW) BB = CTK.infoBulle(parent=B, text='Constraint curves for smoother (points dont move).') # - Smooth - B = TTK.Button(Frame, text="Smooth", command=smooth) BB = CTK.infoBulle(parent=B, text='Smooth mesh.') B.grid(row=3, column=0, columnspan=5, sticky=TK.EW)
def createApp(win): # - Frame - Frame = TTK.LabelFrame(win, borderwidth=2, relief=CTK.FRAMESTYLE, text='tkTransform', font=CTK.FRAMEFONT, takefocus=1) #BB = CTK.infoBulle(parent=Frame, text='General block transformations.\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) CTK.addPinMenu(FrameMenu, 'tkTransform') WIDGETS['frameMenu'] = FrameMenu # - VARS - # -0- Translation vector - V = TK.StringVar(win) V.set('0;0;0') VARS.append(V) # -1- Scale factors - V = TK.StringVar(win) V.set('1;1;1') VARS.append(V) # -2- Rotate axis V = TK.StringVar(win) V.set('around X') VARS.append(V) # -3- Rotation angle V = TK.StringVar(win) V.set('0.') VARS.append(V) # -4- Symetry axis V = TK.StringVar(win) V.set('around XY-') VARS.append(V) # -5- Scale axis V = TK.StringVar(win) V.set('along XYZ') VARS.append(V) # -6- Translation axis V = TK.StringVar(win) V.set('along XYZ') VARS.append(V) # -7- cart2Cyl or cyl2Cart V = TK.StringVar(win) V.set('cart2Cyl') VARS.append(V) # -8- Origin and axis for cart2Cyl or cyl2Cart V = TK.StringVar(win) V.set('(0.,0.,0.); (1.,0.,0.)') VARS.append(V) # - Translate - B = TTK.Button(Frame, text="Translate", command=translate) B.grid(row=0, column=0, sticky=TK.EW) BB = CTK.infoBulle(parent=B, text='Translate zone(s) of pyTree.') B = TTK.OptionMenu(Frame, VARS[6], 'along XYZ', 'along view') B.grid(row=0, column=1, sticky=TK.EW) B = TTK.Entry(Frame, textvariable=VARS[0], background='White', width=5) B.grid(row=0, column=2, columnspan=1, sticky=TK.EW) BB = CTK.infoBulle(parent=B, text='Translation vector.') # - Translate from here to here - B = TTK.Button(Frame, text="Translate by clicking", command=translateClick) B.grid(row=1, column=0, columnspan=3, sticky=TK.EW) BB = CTK.infoBulle(parent=B, text='Translate zone(s) of pyTree \nby clicking.') WIDGETS['translate'] = B # - Scale - B = TTK.Button(Frame, text="Scale", command=scale) B.grid(row=2, column=0, sticky=TK.EW) BB = CTK.infoBulle(parent=B, text='Scale zone(s) of pyTree.') B = TTK.OptionMenu(Frame, VARS[5], 'along XYZ', 'along view') B.grid(row=2, column=1, sticky=TK.EW) B = TTK.Entry(Frame, textvariable=VARS[1], background='White', width=5) B.grid(row=2, column=2, sticky=TK.EW) BB = CTK.infoBulle( parent=B, text= 'Scale factors (+ optionally center for scaling): uniform f value or fx;fy;fz (+ optionally cx;cy;cz)\nFor automatic adimensioning, use 0.' ) # - Rotate - B = TTK.Button(Frame, text="Rotate", command=rotate) B.grid(row=3, column=0, sticky=TK.EW) BB = CTK.infoBulle(parent=B, text='Rotate zone(s) of pyTree.') B = TTK.OptionMenu(Frame, VARS[2], 'around X', 'around Y', 'around Z', 'around view') B.grid(row=3, column=1, sticky=TK.EW) B = TTK.Entry(Frame, textvariable=VARS[3], background='White', width=5) B.grid(row=3, column=2, sticky=TK.EW) BB = CTK.infoBulle( parent=B, text= 'angle (degrees) or \nangle; Xc;Yc;Zc (angle+rotation center)\nIf center is not specified, rotate around barycenter of zones.' ) # - Symetrize - B = TTK.Button(Frame, text="Mirror", command=symetrize) B.grid(row=4, column=0, sticky=TK.EW) BB = CTK.infoBulle(parent=B, text='Symetrize zone(s) of pyTree.') B = TTK.OptionMenu(Frame, VARS[4], 'around XY-', 'around XY+', 'around YZ-', 'around YZ+', 'around XZ-', 'around XZ+', 'around view') B.grid(row=4, column=1, columnspan=2, sticky=TK.EW) # - cart2Cyl and cyl2Cart - B = TTK.Button(Frame, text="Apply", command=changeFrame) B.grid(row=5, column=0, sticky=TK.EW) BB = CTK.infoBulle( parent=B, text= 'Convert grid coordinates from cartesian->cylindrical or cylindrical->cartesian frame.\nTree is modified.' ) B = TTK.OptionMenu(Frame, VARS[7], 'cart2Cyl', 'cyl2Cart') B.grid(row=5, column=1, sticky=TK.EW) B = TTK.Entry(Frame, textvariable=VARS[8], background='White') B.grid(row=5, column=2, sticky=TK.EW) BB = CTK.infoBulle(parent=B, text='Origin: x0;y0;z0\nAxis: tx;ty;tz.')
def createApp(win): # - Frame - Frame = TTK.LabelFrame(win, borderwidth=2, relief=CTK.FRAMESTYLE, text='tkBlock', font=CTK.FRAMEFONT, takefocus=1) #BB = CTK.infoBulle(parent=Frame, text='General block operations.\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, 'tkBlock') WIDGETS['frameMenu'] = FrameMenu # - VARS - # -0- oneovern - V = TK.StringVar(win) V.set('2;2;2') VARS.append(V) if 'tkBlockOneovern' in CTK.PREFS: V.set(CTK.PREFS['tkBlockOneovern']) # -1- eps pour close V = TK.StringVar(win) V.set('1.e-6') VARS.append(V) if 'tkBlockClose' in CTK.PREFS: V.set(CTK.PREFS['tkBlockClose']) # - Rm block from model - B = TTK.Button(Frame, text="Rm block", command=rmBlock) B.grid(row=0, column=0, sticky=TK.EW) BB = CTK.infoBulle(parent=B, text='Remove selection from tree.') # - Copy block - B = TTK.Button(Frame, text="Copy block", command=cpBlock) B.grid(row=0, column=1, sticky=TK.EW) BB = CTK.infoBulle(parent=B, text='Duplicate block in tree.') # - Convert a block to tetra - B = TTK.Button(Frame, text="convert2Tetra", command=convert2Tetra) B.grid(row=1, column=0, sticky=TK.EW) BB = CTK.infoBulle(parent=B, text='Convert selection to tetra.\nTree is modified.') # - Convert a block to Hexa - B = TTK.Button(Frame, text="convert2Hexa", command=convert2Hexa) B.grid(row=1, column=1, sticky=TK.EW) BB = CTK.infoBulle(parent=B, text='Convert selection to hexa.\nTree is modified.') # - Convert a block to node - B = TTK.Button(Frame, text="convert2Node", command=convert2Node) B.grid(row=2, column=0, sticky=TK.EW) BB = CTK.infoBulle(parent=B, text='Convert selection to nodes.\nTree is modified.') # - Get exteriorFaces - B = TTK.Button(Frame, text="Exterior faces", command=exteriorFaces) B.grid(row=2, column=1, sticky=TK.EW) BB = CTK.infoBulle( parent=B, text='Get the exterior faces of selection.\nAdded to tree.') # - Close - B = TTK.Button(Frame, text="Close", command=close) B.grid(row=3, column=0, sticky=TK.EW) BB = CTK.infoBulle(parent=B, text='Close mesh.') B = TTK.Entry(Frame, textvariable=VARS[1], background='White') BB = CTK.infoBulle(parent=B, text='Close accuracy.') B.grid(row=3, column=1, sticky=TK.EW) # - oneovern - B = TTK.Button(Frame, text="Oneovern", command=oneovern) B.grid(row=4, column=0, sticky=TK.EW) BB = CTK.infoBulle( parent=B, text='Extract one point over n points.\nTree is modified.') B = TTK.Entry(Frame, textvariable=VARS[0], background='White') BB = CTK.infoBulle(parent=B, text='Steps in each direction.') B.grid(row=4, column=1, sticky=TK.EW)
def createApp(win): ttk = CTK.importTtk() # - Frame - Frame = TTK.LabelFrame(win, borderwidth=2, relief=CTK.FRAMESTYLE, text='tkBC', font=CTK.FRAMEFONT, takefocus=1) #BB = CTK.infoBulle(parent=Frame, text='Manage boundary conditions.\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(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, 'tkBC') WIDGETS['frameMenu'] = FrameMenu # - VARS - # - 0 - Type de BC - V = TK.StringVar(win) V.set('Mesh') VARS.append(V) # - 1 - Type de cas (2D/3D) - V = TK.StringVar(win) V.set('3D') VARS.append(V) # - 2 - tol pour ConnectMatch - V = TK.StringVar(win) V.set('1.e-6') VARS.append(V) if 'tkBCMatchTol' in CTK.PREFS: V.set(CTK.PREFS['tkBCMatchTol']) # - 3 - ratio pour ConnectNearMatch - V = TK.StringVar(win) V.set('2') VARS.append(V) # - 4 - Type de BC pour fillEmptyBCWith - V = TK.StringVar(win) V.set('BCWall') VARS.append(V) # - 5 - Type de BC pour rmBCOfType - V = TK.StringVar(win) V.set('-All BC-') VARS.append(V) # - 6 - Type de BC pour setBCWith - V = TK.StringVar(win) V.set('BCWall') VARS.append(V) # - 7 - Edges des zones du calcul V = TK.StringVar(win) V.set('0') VARS.append(V) if 'tkBCEdges' in CTK.PREFS: V.set(CTK.PREFS['tkBCEdges']) # -8- SplitFactor info bulle V = TK.StringVar(win) V.set( 'Split more or less undefined BCs. \nUsefull only for unstructured grids.' ) VARS.append(V) # -9- Periodicity? in connectMatch V = TK.StringVar(win) V.set('Not periodic') VARS.append(V) # -10- Periodicity field (0;0;0...) V = TK.StringVar(win) V.set('0;0;0;0;0;0') VARS.append(V) if 'tkBCMatchPer' in CTK.PREFS: V.set(CTK.PREFS['tkBCMatchPer']) # - View mesh - B = TTK.Button(Frame, text="View Mesh", command=viewMesh) B.grid(row=0, column=0, sticky=TK.EW) BB = CTK.infoBulle(parent=B, text='View mesh.\nTree is NOT modified.') # - Edges - B = TTK.Checkbutton(Frame, text='Edges', variable=VARS[7]) BB = CTK.infoBulle(parent=B, text='Show edges of zones of the tree.') B.grid(row=0, column=1, sticky=TK.EW) # - View type de BC - B = TTK.Button(Frame, text="View BC", command=view) B.grid(row=1, column=0, sticky=TK.EW) BB = CTK.infoBulle(parent=B, text='View specified BC.\nTree is NOT modified.') # - Type of BC - ListBox Frame - LBFrame = TTK.Frame(Frame) LBFrame.grid(row=1, column=1, rowspan=4, sticky=TK.EW) LBFrame.rowconfigure(0, weight=1) LBFrame.columnconfigure(0, weight=1) LBFrame.columnconfigure(1, weight=0) SB = TTK.Scrollbar(LBFrame) LB = TTK.Listbox(LBFrame, selectmode=TK.EXTENDED, height=6) LB.bind('<Double-1>', view) LB.bind('<Enter>', updateBCNameList) # LB.bind('<ButtonRelease-1>', view) for i, value in enumerate(['-All BC-'] + getAllDefinedBC(CTK.t)): LB.insert(i, value) SB.config(command=LB.yview) LB.config(yscrollcommand=SB.set) LB.grid(row=0, column=0, sticky=TK.NSEW) SB.grid(row=0, column=1, sticky=TK.NSEW) LBFrame.bind('<Enter>', updateFamilyBCNameList1_2) WIDGETS['BCLB'] = LB # - View undefined BCs - B = TTK.Button(Frame, text="View undefined BC", command=displayUndefinedBoundaries) B.grid(row=2, column=0, columnspan=1, sticky=TK.EW) WIDGETS['undefinedBC'] = B BB = CTK.infoBulle( parent=B, text='View undefined BC in ALL tree.\nUse this to setBC or fillEmptyBC.' ) # - Slider for splitFactor - B = TTK.Scale(Frame, from_=0, to=100, orient=TK.HORIZONTAL, command=setSplitFactor, showvalue=0, borderwidth=1, value=0) WIDGETS['splitFactor'] = B B.grid(row=3, columnspan=1, sticky=TK.EW) BB = CTK.infoBulle(parent=B, textVariable=VARS[8]) # - rmBCOfType - B = TTK.Button(Frame, text="rm BC", command=rmBCOfType) B.grid(row=4, column=0, sticky=TK.EW) BB = CTK.infoBulle(parent=B, text='Remove the BCs of given type from tree.') # - setBCWith - B = TTK.Button(Frame, text="setBCWith", command=setBCWith) B.grid(row=5, column=0, sticky=TK.EW) BB = CTK.infoBulle( parent=B, text='Set the BC with specified type.\nAdded to pyTree.') F = TTK.Frame(Frame, borderwidth=0) F.columnconfigure(0, weight=1) if ttk is None: B = TK.OptionMenu(F, VARS[6], *(Internal.KNOWNBCS)) B.grid(sticky=TK.EW) F.bind('<Enter>', updateFamilyBCNameList3) F.grid(row=6, column=1, sticky=TK.EW) WIDGETS['BCs2'] = B else: B = ttk.Combobox(F, textvariable=VARS[6], values=Internal.KNOWNBCS, state='readonly', width=10) B.grid(sticky=TK.EW) F.bind('<Enter>', updateFamilyBCNameList3_2) F.grid(row=5, column=1, sticky=TK.EW) WIDGETS['BCs2'] = B # - FillEmptyBCWith - B = TTK.Button(Frame, text="FillEmptyBCWith", command=fillEmptyBCWith) B.grid(row=6, column=0, sticky=TK.EW) BB = CTK.infoBulle( parent=B, text='Fill empty BCs with given type.\nAdded to pyTree.') F = TTK.Frame(Frame, borderwidth=0) F.columnconfigure(0, weight=1) if ttk is None: B = TK.OptionMenu(F, VARS[4], *(Internal.KNOWNBCS)) B.grid(sticky=TK.EW) F.bind('<Enter>', updateFamilyBCNameList4) F.grid(row=6, column=1, sticky=TK.EW) WIDGETS['BCs4'] = B else: B = ttk.Combobox(F, textvariable=VARS[4], values=Internal.KNOWNBCS, state='readonly', width=10) B.grid(sticky=TK.EW) F.bind('<Enter>', updateFamilyBCNameList4_2) F.grid(row=6, column=1, sticky=TK.EW) WIDGETS['BCs4'] = B # - setDegeneratedBC - B = TTK.Button(Frame, text="SetDegeneratedBC", command=setDegeneratedBC) B.grid(row=7, column=0, columnspan=2, sticky=TK.EW) BB = CTK.infoBulle(parent=B, text='Find the degenerated BCs\nAdded to pyTree.') # - ConnectMatch - B = TTK.Button(Frame, text="ConnectMatch", command=connectMatch) B.grid(row=8, column=0, sticky=TK.EW) BB = CTK.infoBulle(parent=B, text='Find the matching BCs\nAdded to pyTree.') B = TTK.Entry(Frame, textvariable=VARS[2], background='White') B.grid(row=8, column=1, sticky=TK.EW) BB = CTK.infoBulle(parent=B, text='Tolerance for matching.') # - Periodicity management - B = TTK.OptionMenu(Frame, VARS[9], 'Not periodic', 'Translation', 'Rotation (Degree)') B.grid(row=9, column=0, sticky=TK.EW) B = TTK.Entry(Frame, textvariable=VARS[10], background='White') B.grid(row=9, column=1, sticky=TK.EW) BB = CTK.infoBulle( parent=B, text= 'Periodic translation: tx;ty;tz\nPeriodic rotation: cx;cy;cz;ax;ay;az\nangles in degrees.' ) # - ConnectNearMatch - B = TTK.Button(Frame, text="ConnectNearMatch", command=connectNearMatch) B.grid(row=10, column=0, sticky=TK.EW) BB = CTK.infoBulle(parent=B, text='Find the matching BCs\nAdded to pyTree.') B = TTK.Entry(Frame, textvariable=VARS[3], background='White') B.grid(row=10, column=1, sticky=TK.EW) BB = CTK.infoBulle(parent=B, text='Nearmatch ratio (2 or 2;1;2).')
def createApp(win): # - Frame - Frame = TTK.LabelFrame(win, borderwidth=2, relief=CTK.FRAMESTYLE, text='tkElsaSolver', font=CTK.FRAMEFONT, takefocus=1) #BB = CTK.infoBulle(parent=Frame, text='Export to Onera\nelsA fluid 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=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, 'tkElsaSolver') WIDGETS['frameMenu'] = FrameMenu # - VARS - # -0- file name for export - V = TK.StringVar(win) V.set('elsA.cgns') VARS.append(V) if 'tkElsaSolverFile' in CTK.PREFS: V.set(CTK.PREFS['tkElsaSolverFile']) # -1- Method for createElsaHybrid V = TK.IntVar(win) V.set(0) VARS.append(V) # - Export - B = TTK.Button(Frame, text="Export to", command=export) B.grid(row=0, column=0, sticky=TK.EW) BB = CTK.infoBulle( parent=B, text='Export tree to a CGNS file suitable for elsA.CGNS.') B = TTK.Entry(Frame, textvariable=VARS[0], background='White') B.grid(row=0, column=1, sticky=TK.EW) B.bind('<Return>', export) # - Adapt in memory tree - B = TTK.Button(Frame, text="Adapt current tree", command=adapt) B.grid(row=1, column=0, columnspan=2, sticky=TK.EW) BB = CTK.infoBulle( parent=B, text='Adapt in memory tree to make it suitable for elsA.CGNS.') # - Create elsA Hybrid node - B = TTK.Button(Frame, text="Create elsA Hybrid Node", command=elsAHybridNode) B.grid(row=2, column=0, sticky=TK.EW) BB = CTK.infoBulle(parent=B, text='Create elsAHybrid node for unstructured mesh') B = TK.Entry(Frame, textvariable=VARS[1], background='White') B.grid(row=2, column=1, sticky=TK.EW) BB = CTK.infoBulle(parent=B, text='Method: 0 (elsA < 3.8.01), 1 (elsA >= 3.8.1)')
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)
def createApp(win): # - Frame - Frame = TTK.LabelFrame(win, borderwidth=2, relief=CTK.FRAMESTYLE, text='tkTFI', font=CTK.FRAMEFONT, takefocus=1) #BB = CTK.infoBulle(parent=Frame, text='Transfinite interpolation mesh generation.\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) CTK.addPinMenu(FrameMenu, 'tkTFI') WIDGETS['frameMenu'] = FrameMenu # - VARS - # -0- underlaying surface V = TK.StringVar(win) V.set('') VARS.append(V) # -1- weight V = TK.StringVar(win) V.set('10.') VARS.append(V) # - Model surface - B = TTK.Button(Frame, text="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='Underlaying model surfaces.') B = TTK.Entry(Frame, textvariable=VARS[0], background='White') BB = CTK.infoBulle(parent=B, text='Underlaying model surfaces.') B.grid(row=0, column=0, columnspan=2, sticky=TK.EW) # - O - TFI - B = TTK.Button(Frame, text="O", command=OTFI) B.grid(row=1, column=0, columnspan=1, sticky=TK.EW) BB = CTK.infoBulle( parent=B, text='Perform a O-TFI from a close contour (npts must be odd).') # - HO - TFI B = TTK.Button(Frame, text="Half-O", command=HOTFI) B.grid(row=1, column=1, columnspan=1, sticky=TK.EW) BB = CTK.infoBulle( parent=B, text= 'Perform a Half O-TFI from 2 contours (longer contour is taken to be the round part).' ) # - TRI - TFI - B = TTK.Button(Frame, text="TRI", command=TRITFI) B.grid(row=1, column=2, columnspan=1, sticky=TK.EW) BB = CTK.infoBulle(parent=B, text='Perform a TRI-TFI from 3 contours.') #B = TK.Entry(Frame, textvariable=VARS[1], background='White', width=5) #B.grid(row=1, column=2, sticky=TK.EW) #BB = CTK.infoBulle(parent=B, text='Weight of curve.') # - MONO2 - TFI - B = TTK.Button(Frame, text="MONO2", command=MONO2TFI) B.grid(row=2, column=0, columnspan=1, sticky=TK.EW) BB = CTK.infoBulle( parent=B, text='Perform a TFI from two contours (longer contour is split).') # - TFI des cotes - B = TTK.Button(Frame, text="TFI", command=TFI) B.grid(row=2, column=1, columnspan=2, sticky=TK.EW) BB = CTK.infoBulle(parent=B, text='Perform TFI from 4 edges (2D) or 6 faces (3D).')
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.')
def createApp(win): # - Frame - Frame = TTK.LabelFrame(win, borderwidth=2, relief=CTK.FRAMESTYLE, text='tkOctree', font=CTK.FRAMEFONT, takefocus=1) #BB = CTK.infoBulle(parent=Frame, text='Create octrees.\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, 'tkOctree') WIDGETS['frameMenu'] = FrameMenu # - VARS - # -0- Snears - V = TK.StringVar(win) V.set('0.1') VARS.append(V) if 'tkOctreeSnear' in CTK.PREFS: V.set(CTK.PREFS['tkOctreeSnear']) # -1- Dfar - V = TK.StringVar(win) V.set('10.') VARS.append(V) if 'tkOctreeDfar' in CTK.PREFS: V.set(CTK.PREFS['tkOctreeDfar']) # -2- Balanced/unbalanced - V = TK.StringVar(win) V.set('Balanced') VARS.append(V) if 'tkOctreeBalance' in CTK.PREFS: V.set(CTK.PREFS['tkOctreeBalance']) # -3- Vmins V = TK.StringVar(win) V.set('10') VARS.append(V) if 'tkOctreeVmin' in CTK.PREFS: V.set(CTK.PREFS['tkOctreeVmin']) # -4- Level to expand V = TK.StringVar(win) V.set('0') VARS.append(V) if 'tkOctreeExpand' in CTK.PREFS: V.set(CTK.PREFS['tkOctreeExpand']) # -5- Type of body fitting V = TK.StringVar(win) V.set('Snap') VARS.append(V) # -6- Body surfaces for body fitting V = TK.StringVar(win) V.set('') VARS.append(V) # -7- Vmin (number of points for each structured block - V = TK.StringVar(win) V.set('10') VARS.append(V) # -8- Type of extension between structured blocks - V = TK.StringVar(win) V.set('Overlap2') VARS.append(V) # - Dfar - rown = 0 B = TTK.Entry(Frame, textvariable=VARS[1], background='White', width=3) B.grid(row=rown, column=0, sticky=TK.EW) BB = CTK.infoBulle(parent=B, text='Distance to far boundaries.') # - Snears - B = TTK.Entry(Frame, textvariable=VARS[0], background='White', width=3) B.grid(row=rown, column=1, columnspan=1, sticky=TK.EW) BB = CTK.infoBulle(parent=B, text='Local size near bodies (global or list).') # - Balanced/unbalanced - B = TTK.OptionMenu(Frame, VARS[2], 'Balanced', 'Unbalanced') B.grid(row=rown, column=2, sticky=TK.EW) BB = CTK.infoBulle(parent=B, text='Make a balanced octree or not.') # - Create hexa octree - rown += 1 B = TTK.Button(Frame, text="Create hexa octree", command=hexaOctree) B.grid(row=rown, column=0, columnspan=3, sticky=TK.EW) BB = CTK.infoBulle(parent=B, text='Create an hexa octree around surfaces.') # - Adapt hexa octree - rown += 1 B = TTK.Button(Frame, text="Surfaces", command=setSurface, image=iconics.PHOTO[8], padx=0, pady=0, compound=TK.RIGHT) B.grid(row=rown, column=2, columnspan=1, sticky=TK.EW) BB = CTK.infoBulle(parent=B, text='Define refinement surfaces.') B = TTK.Entry(Frame, textvariable=VARS[6], background='White') B.grid(row=rown, column=0, columnspan=2, sticky=TK.EW) rown += 1 B = TTK.Button(Frame, text="Adapt octree inside surfaces", command=adaptInsideOctree) B.grid(row=rown, column=0, columnspan=3, sticky=TK.EW) BB = CTK.infoBulle(parent=B, text='Adapt octree inside surfaces.') # - Expand layer - rown += 1 B = TTK.Button(Frame, text="Expand layer", command=expandLayer) B.grid(row=rown, column=0, columnspan=2, sticky=TK.EW) BB = CTK.infoBulle(parent=B, text='Expand one level.') B = TTK.Entry(Frame, textvariable=VARS[4], background='White', width=5) B.grid(row=rown, column=2, columnspan=1, sticky=TK.EW) BB = CTK.infoBulle(parent=B, text='Level to expand.') # - octree2Struct - rown += 1 B = TTK.Button(Frame, text="Octree2Struct", command=octree2Struct) B.grid(row=rown, column=0, columnspan=1, sticky=TK.EW) B = TK.Entry(Frame, textvariable=VARS[7], background='White', width=5) B.grid(row=rown, column=1, columnspan=1, sticky=TK.EW) BB = CTK.infoBulle(parent=B, text='Number of points in each structured blocs.') B = TTK.OptionMenu(Frame, VARS[8], 'Match', 'Overlap1', 'Overlap2', 'AMR0', 'AMR1', 'AMR2') B.grid(row=rown, column=2, sticky=TK.EW) BB = CTK.infoBulle(parent=B, text='Type of structured blocks.') # - Body surfaces - rown += 1 B = TTK.Button(Frame, text="Bodies", command=setSurface, image=iconics.PHOTO[8], padx=0, pady=0, compound=TK.RIGHT) B.grid(row=rown, column=2, columnspan=1, sticky=TK.EW) BB = CTK.infoBulle(parent=B, text='Define bodies.') B = TTK.Entry(Frame, textvariable=VARS[6], background='White') B.grid(row=rown, column=0, columnspan=2, sticky=TK.EW) # - Adapt to body rown += 1 B = TTK.Button(Frame, text="Body fit", command=bodyFit) B.grid(row=rown, column=0, columnspan=2, sticky=TK.EW) BB = CTK.infoBulle(parent=B, text='Fit the octree to bodies.') B = TTK.OptionMenu(Frame, VARS[5], 'Snap') B.grid(row=rown, column=2, sticky=TK.EW) BB = CTK.infoBulle(parent=B, text='Type of body fitting.')
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.')
def createApp(win): ttk = CTK.importTtk() # - Frame - Frame = TTK.LabelFrame(win, borderwidth=2, relief=CTK.FRAMESTYLE, text='tkMeshInfo', 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=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, 'tkMeshInfo') WIDGETS['frameMenu'] = FrameMenu #- VARS - # -0- Npts - V = TK.StringVar(win); V.set(''); VARS.append(V) # -1- Var min - V = TK.StringVar(win); V.set(''); VARS.append(V) # -2- Var max - V = TK.StringVar(win); V.set(''); VARS.append(V) # -3- Selected block name V = TK.StringVar(win); V.set(''); VARS.append(V) # -4- Selected block type V = TK.StringVar(win); V.set(''); VARS.append(V) # -5- Selected variable V = TK.StringVar(win); V.set('CoordinateX'); VARS.append(V) # -6- NCells - V = TK.StringVar(win); V.set(''); VARS.append(V) # -7- NFaces - V = TK.StringVar(win); V.set(''); VARS.append(V) # - selected block name - B = TTK.Entry(Frame, textvariable=VARS[3], background='White', width=15) B.grid(row=0, column=0, columnspan=1, sticky=TK.EW) BB = CTK.infoBulle(parent=B, text='Currently selected zone name.') # - selected block type - B = TTK.Entry(Frame, textvariable=VARS[4], background='White') B.grid(row=0, column=1, columnspan=1, sticky=TK.EW) BB = CTK.infoBulle(parent=B, text='Currently selected zone type.') # - Npts - B = TTK.Label(Frame, text="Npts") B.grid(row=1, column=0, sticky=TK.EW) BB = CTK.infoBulle(parent=B, text='Number of points in selection.') B = TTK.Entry(Frame, textvariable=VARS[0], background='White', width=10) B.grid(row=1, column=1, sticky=TK.EW) BB = CTK.infoBulle(parent=B, text='Number of points in selection.') # - Ncells - B = TTK.Label(Frame, text="NCells") B.grid(row=2, column=0, sticky=TK.EW) BB = CTK.infoBulle(parent=B, text='Number of cells in selection.') B = TTK.Entry(Frame, textvariable=VARS[6], background='White', width=10) B.grid(row=2, column=1, sticky=TK.EW) BB = CTK.infoBulle(parent=B, text='Number of cells in selection.') # - NFaces - B = TTK.Label(Frame, text="NFaces") B.grid(row=3, column=0, sticky=TK.EW) BB = CTK.infoBulle(parent=B, text='Number of faces in selection.') B = TTK.Entry(Frame, textvariable=VARS[7], background='White', width=10) B.grid(row=3, column=1, sticky=TK.EW) BB = CTK.infoBulle(parent=B, text='Number of faces in selection.') # - Variable - B = TTK.Label(Frame, text="Variable: ") B.grid(row=4, column=0, columnspan=1, sticky=TK.EW) BB = CTK.infoBulle(parent=B, text='Selected var name.') F = TTK.Frame(Frame, borderwidth=0) F.columnconfigure(0, weight=1) if ttk is None: B = TK.OptionMenu(F, VARS[5], '') B.grid(sticky=TK.EW) F.bind('<Enter>', updateVarNameList) F.grid(row=4, column=1, columnspan=1, sticky=TK.EW) BB = CTK.infoBulle(parent=B, text='Selected var name.') WIDGETS['variable'] = B else: B = ttk.Combobox(F, textvariable=VARS[5], values=[], state='readonly') B.grid(sticky=TK.EW) F.bind('<Enter>', updateVarNameList2) F.grid(row=4, column=1, columnspan=1, sticky=TK.EW) BB = CTK.infoBulle(parent=B, text='Selected var name.') WIDGETS['variable'] = B # - Min de la variable - B = TTK.Label(Frame, text="Min:") B.grid(row=5, column=0, sticky=TK.EW) BB = CTK.infoBulle(parent=B, text='Min of variable.') B = TTK.Entry(Frame, textvariable=VARS[1], background='White', width=10) B.grid(row=5, column=1, sticky=TK.EW) BB = CTK.infoBulle(parent=B, text='Min of variable.') # - Max de la variable - B = TTK.Label(Frame, text="Max:") B.grid(row=6, column=0, sticky=TK.EW) BB = CTK.infoBulle(parent=B, text='Max of variable.') B = TTK.Entry(Frame, textvariable=VARS[2], background='White', width=10) B.grid(row=6, column=1, sticky=TK.EW) BB = CTK.infoBulle(parent=B, text='Max of variable.') # - update - B = TTK.Button(Frame, text="Update info", command=updateInfo) B.grid(row=7, column=0, columnspan=2, sticky=TK.EW)
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)
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
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.')
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()
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.')
def createApp(win): # - Frame - Frame = TTK.LabelFrame(win, borderwidth=2, relief=CTK.FRAMESTYLE, text='tkFastSolver', 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=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, 'tkFastSolver') WIDGETS['frameMenu'] = FrameMenu # - VARS - # -0- temporal_scheme - V = TK.StringVar(win) V.set('explicit') VARS.append(V) # -1- ss_iteration - V = TK.StringVar(win) V.set('20') VARS.append(V) # -2- modulo_verif - V = TK.StringVar(win) V.set('200') VARS.append(V) # -3- restart_fields - V = TK.StringVar(win) V.set('1') VARS.append(V) # -4- scheme - V = TK.StringVar(win) V.set('ausmpred') VARS.append(V) # -5- Time step - V = TK.DoubleVar(win) V.set(0.002) VARS.append(V) # -6- Snear - V = TK.DoubleVar(win) V.set(0.01) VARS.append(V) # -7- IBC type - V = TK.StringVar(win) V.set('Musker') VARS.append(V) # -8- dfar local - V = TK.DoubleVar(win) V.set(-1.) VARS.append(V) # - temporal scheme - B = TTK.Label(Frame, text="temporal_scheme") B.grid(row=0, column=0, sticky=TK.EW) BB = CTK.infoBulle(parent=B, text='Time integration.') B = TTK.OptionMenu(Frame, VARS[0], 'explicit', 'implicit', 'implicit_local') B.grid(row=0, column=1, columnspan=2, sticky=TK.EW) # - ss_iteration - #B = TTK.Label(Frame, text="ss_iteration") #B.grid(row=1, column=0, sticky=TK.EW) #BB = CTK.infoBulle(parent=B, text='Nbre de sous iterations max.') #B = TTK.Entry(Frame, textvariable=VARS[1]) #B.grid(row=1, column=1, columnspan=2, sticky=TK.EW) # - scheme - B = TTK.Label(Frame, text="scheme") B.grid(row=2, column=0, sticky=TK.EW) BB = CTK.infoBulle(parent=B, text='Numerical scheme.') B = TTK.OptionMenu(Frame, VARS[4], 'ausmpred', 'roe_min') B.grid(row=2, column=1, columnspan=2, sticky=TK.EW) # - time_step - B = TTK.Label(Frame, text="time_step") B.grid(row=3, column=0, sticky=TK.EW) BB = CTK.infoBulle(parent=B, text='Time step.') B = TTK.Entry(Frame, textvariable=VARS[5]) B.grid(row=3, column=1, columnspan=2, sticky=TK.EW) #- Snear settings - B = TTK.Label(Frame, text="snear") B.grid(row=4, column=0, sticky=TK.EW) B = TTK.Entry(Frame, textvariable=VARS[6]) B.grid(row=4, column=1, columnspan=2, sticky=TK.EW) #- dfar settings - B = TTK.Label(Frame, text="dfar") B.grid(row=5, column=0, sticky=TK.EW) B = TTK.Entry(Frame, textvariable=VARS[8]) B.grid(row=5, column=1, columnspan=2, sticky=TK.EW) # - IBC type - B = TTK.Label(Frame, text="IBC type") B.grid(row=6, column=0, sticky=TK.EW) BB = CTK.infoBulle(parent=B, text='Type of IBC.') B = TTK.OptionMenu(Frame, VARS[7], 'slip', 'noslip', 'Log', 'Musker', 'outpress', 'inj', 'TBLE') B.grid(row=6, column=1, columnspan=2, sticky=TK.EW) # - Set data - B = TTK.Button(Frame, text="Set data", command=setData) BB = CTK.infoBulle(parent=B, text='Set data into selected zone.') B.grid(row=7, column=0, columnspan=2, sticky=TK.EW) B = TTK.Button(Frame, command=getData, image=iconics.PHOTO[8], padx=0, pady=0, compound=TK.RIGHT) BB = CTK.infoBulle(parent=B, text='Get data from selected zone.') B.grid(row=7, column=2, sticky=TK.EW)