Window Documentation¶
MainWindow¶
-
class
MyMainWindow(parent=None)¶ This class is the main UI Window, the parent widget for the entire application
-
close_event()¶ Makes sure everything gets properly deleated upon closing
-
init_window()¶ Shows the main window
-
reset_zoom()¶ Resets the zoom level in the display widget
-
screenshot()¶ Takes a screenshot of the display widget
-
toggle_dim2D(s)¶ Toggles dimensionality for the display widget
-
toggle_dim3D(s)¶ Toggles dimentionality for the display widget
-
Settings¶
Getting Started¶
-
class
GettingStarted¶ This defines the window for the tutorial
-
add_widgets()¶ adds widgets to the window
-
change_page(up)¶ Changes the page displayed.
- Inputs
- up - the number of pages to move in the tutorial. Can be negative
-
create_widgets()¶ creates labels and buttons for the window
-
init_ui()¶ sets window title, layout, and adds the widgets to the window
-
Glossary¶
The glossary page
UI¶
This file adds the graphics to the UI
-
class
CustomLineEdit¶ Class that enables input in a textbox by subclassing QLineEdit
-
clear_box()¶ Clears input from the textbox
-
mousePressEvent(QMouseEvent)¶ Triggers clicked.emit()
-
reset_box()¶ Resets the textbox
-
reset_color()¶ Resets the text color of the textbox
-
-
class
UIWidget¶ Class that holds all of the widgets for viewing
-
add_widgets()¶ Adds widgets to window
-
boxcount_2d()¶ Calculates the dimensionality of a 2D L-System
-
boxcount_3d()¶ Calculates the dimensionality of a 3D L-System
-
gen_example(example)¶ Loads preset L-Systems
-
gen_rule_dict(prod_rules)¶ Generates a rule dictionary from an array of production rules taken from the UI.
formats production rules as {Symbol1: [[probability,replacement],…], Symbol2: [[probability,replacement]… ], …}
-
gen_sys()¶ Generates the L-System described by the production rules
-
init_UI()¶ Creates and adds all widgets in the viewport and sets the layout
Creates buttons for the UI
-
init_text_boxes()¶ Creates textboxes for the UI
-
is_2d()¶ Returns true if 2D is loaded, false if 3D is loaded.
-
less_prods()¶ Removes textboxes for production rules when less are needed, minimum 1.
-
more_prods()¶ Adds textboxes for additional production rules, maxiumum 8.
Determines which type of dimension checking is done
Generates the L-System
-
reload_presets()¶ pulls saved lsystems from file
-
reset_input_boxes()¶ Resets textboxes to initial configuration, does not clear the fractal from the widget.
-
reset_text_box_color()¶ resets the color of all textboxes
-
reset_zoom()¶ resets the zoom level in the display widget
-
screenshot(parent_pos)¶ Takes a screenshot of the display window
-
set_presets()¶ Shows preset L-Systems for the appropriate dimention
-
show_popup()¶ Adds and removes extra textboxes as needed
-
Save Rules¶
2D LsystemWidget¶
This file handles the OpenGL Window actions
-
class
LSystem2DWidget¶ This class manages the 2D PlotWidet used to display the lsystem.
Attributes: mesh (MeshObject): The mesh object that is being displayed. graph (Graph): Digraph class used to minimize vector redundancy.
-
clear()¶ Removes the mesh from the scene.
-
reset_camera()¶ Resets the camera to the initial position & zoom level.
-
reset_zoom()¶ Resets the camera to the initial position & zoom level.
-
screenshot(filename, pos)¶ Captures the view of the widget and saves it to a filename on disk.
Parameters: filename (str): Filename to save to. pos (???): Nani the fuck is this shit?
-
set_graph(graph)¶ Sets the graph object the scene uses to generate the mesh.
Parameters: graph (Graph): Digraph used to generate the mesh.
-
3D LsystemWidget¶
This file handles the OpenGL Window actions
-
class
LSystem3DWidget¶ This class manages the 3D pyqtgraph widget used to display the MeshObjects of the lsystem.
Attributes: mesh (MeshObject): The combined mesh that’s actually displayed. mesh_positions (list): A list tracking the positions of each mesh, used in calculating the position of the combined mesh. original_fov (vec3): Field of view at initialization, used for resetting the camera. original_distance (vec3): Distnace of the camera at initialization, used for resetting the camera.
-
add_mesh(mesh_list: list)¶ Adds MeshObjects to the scene.
Parameters: mesh_list (list): List of MeshObjects.
-
center_mesh()¶ Centers the mesh on the origin for a better camera experience.
-
clear()¶ Removes all mesh objects from the scene.
-
combine_meshes(mesh_list: list)¶ Combines all added MeshObjects to one singular mesh. This mimimizes OpenGL calls used underneath and makes working with the data easier.
Parameters: mesh_list (list): List of MeshObjects
Returns: MeshObject: Combination of the passed MeshObjects in mesh_list.
-
reset_camera()¶ Resets the camera to the initial position & zoom level.
-
reset_zoom()¶ Resets the zoom level of the camera.
-
screenshot(filename, pos)¶ Captures the view of the widget and saves it to a filename on disk.
Parameters: filename (str): Filename to save to. pos (???): Nani the fuck is this shit?
-