PhysicsWindow module¶
-
class
PhysicsWindow.
AddObjectWindow
(window, event)[source]¶ Bases:
PhysicsWindow.PhysicsWindow
Opens a new window with entry fields for adding a new PhysicsObject to the canvas.
- Parameters
window (
Ui.MainWindow
) – The root windowevent (Tk.MouseEvent ?) – A Mousevent
Executed when user clicks Add button.
Creates PhysicsObject, calls PhysicsCanvas.add_physics_object
Deltes and closes the window
-
class
PhysicsWindow.
PhysicsObjectWindow
(window, physics_object, x=200, y=200)[source]¶ Bases:
PhysicsWindow.PhysicsWindow
A window which tracks the status of a
Physics.ForceObject
, showing its current x, y, velocity, etc.Also provides buttons for deleting the object and adding an “orbiter”
- Parameters
window (
Ui.MainWindow
) – The main UI windowphysics_object (
Physics.ForceObject
) – The ForceObject to trackx (number) – The screen x the window should appear
y (number) – The screen y the window should appear
Called when user presses the delete button on the window.
Deletes the ForceObject and the PhysicsObjectWindow
Calls clear_forces on the
Physics.ForceObject
Adds a new ForceObject to the physics canvas. The new ForceObject is 1/100th the mass of the object this ForceWindow is already referencing. It starts 100 meters N of this ForceWindow’s ForceObject and has a western velocity. A
Physics.GravitationalForceGenerator
is also created to generate gravity between the two objects
-
class
PhysicsWindow.
PhysicsWindow
(window)[source]¶ Bases:
object
Generated by Physics Canvas interactions, when some interaction should cause a new window to open which relates to something on the PhysicsCanvas.
- Parameters
window (
Ui.MainWindow
) – The main UI window