Skip to content

Commit

Permalink
documentation changes
Browse files Browse the repository at this point in the history
  • Loading branch information
PycraftDeveloper committed Nov 19, 2024
1 parent a612802 commit 1a1ebac
Show file tree
Hide file tree
Showing 4 changed files with 734 additions and 9 deletions.
34 changes: 32 additions & 2 deletions python_src/advmath.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ class Math:
"""
def __init__(self):
"""
Constructor for the Math class.
🟩 **R** - Constructor for the Math class.
"""
_initialize(self)

Expand All @@ -32,21 +32,30 @@ def __init__(self):
"pmma.python_src.pyx_alternatives.utility.math_utils")

def __del__(self, do_garbage_collection=False):
"""
🟩 **R** -
"""
if self._shut_down is False:
del self
if do_garbage_collection:
_gc__collect()

def quit(self, do_garbage_collection=True):
"""
🟩 **R** -
"""
self.__del__(do_garbage_collection=do_garbage_collection)
self._shut_down = True

def smooth_step(self, value):
"""
🟩 **R/C** -
"""
return _MathIntermediary.math_module.raw_smooth_step(value)

def pythag(self, points):
"""
**R** - Calculates the pythagorean distance between two points.
🟩 **R/C** -Calculates the pythagorean distance between two points.
Parameters:
points (list) - A list containing two tuples, each representing a point in 3D space.
Expand All @@ -59,22 +68,43 @@ def pythag(self, points):
return _MathIntermediary.math_module.raw_pythag(points)

def ranger(self, value, old, new):
"""
🟩 **R/C** -
"""
return _MathIntermediary.math_module.raw_ranger(value, old, new)

def nparray_ranger(self, value, old, new):
"""
🟩 **R/C** -
"""
return _MathIntermediary.math_module.raw_nparray_ranger(value, old, new)

def gl_look_at(self, eye, target, up):
"""
🟩 **R/C** -
"""
return _MathIntermediary.math_module.raw_gl_look_at(eye, target, up)

def compute_position(self, pos, target, up):
"""
🟩 **R/C** -
"""
return _MathIntermediary.math_module.raw_compute_position(pos, target, up)

def perspective_fov(self, fov, aspect_ratio, near_plane, far_plane):
"""
🟩 **R/C** -
"""
return _MathIntermediary.math_module.raw_perspective_fov(fov, aspect_ratio, near_plane, far_plane)

def look_at(self, camera_position, camera_target, up_vector):
"""
🟩 **R/C** -
"""
return _MathIntermediary.math_module.raw_look_at(camera_position, camera_target, up_vector)

def multiply(self, a, b):
"""
🟩 **R/C** -
"""
return _MathIntermediary.math_module.raw_multiply(a, b)
21 changes: 21 additions & 0 deletions python_src/advthreading.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,32 +2,53 @@
import threading as _threading

class Thread(_threading.Thread):
"""
🟩 **R** -
"""
def __init__(self, *args, **keywords):
"""
🟩 **R** -
"""
_threading.Thread.__init__(self, *args, **keywords)

self._killed = False

def start(self):
"""
🟩 **R** -
"""
self.__run_backup = self.run
self.run = self.__run
_threading.Thread.start(self)

def __run(self):
"""
🟩 **R** -
"""
_sys.settrace(self.globaltrace)
self.__run_backup()
self.run = self.__run_backup

def globaltrace(self, frame, event, arg):
"""
🟩 **R** -
"""
if event == 'call':
return self.localtrace
else:
return None

def localtrace(self, frame, event, arg):
"""
🟩 **R** -
"""
if self._killed:
if event == 'line':
raise SystemExit()
return self.localtrace

def kill(self):
"""
🟩 **R** -
"""
self._killed = True
21 changes: 21 additions & 0 deletions python_src/advtkinter.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,20 +6,35 @@
from pmma.python_src.utility.initialization_utils import initialize as _initialize

class Tkinter:
"""
🟩 **R** -
"""
def __init__(self):
"""
🟩 **R** -
"""
_initialize(self)

def __del__(self, do_garbage_collection=False):
"""
🟩 **R** -
"""
if self._shut_down is False:
del self
if do_garbage_collection:
_gc__collect()

def quit(self, do_garbage_collection=True):
"""
🟩 **R** -
"""
self.__del__(do_garbage_collection=do_garbage_collection)
self._shut_down = True

def style(self, widget):
"""
🟩 **R** -
"""
style = _ttk.Style()
style.configure(
widget,
Expand All @@ -35,6 +50,9 @@ def style(self, widget):
("active", "white")])

def get_display_size(self):
"""
🟩 **R** -
"""
try:
root = _tk.Tk()

Expand All @@ -49,6 +67,9 @@ def get_display_size(self):
return (0, 0)

def set_size(self, x, y, root=None):
"""
🟩 **R** -
"""
if root is None:
root = _Registry.root

Expand Down
Loading

0 comments on commit 1a1ebac

Please sign in to comment.