ncca-ngl 0.3.2__tar.gz → 0.3.4__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (82) hide show
  1. {ncca_ngl-0.3.2 → ncca_ngl-0.3.4}/PKG-INFO +1 -1
  2. {ncca_ngl-0.3.2 → ncca_ngl-0.3.4}/pyproject.toml +1 -1
  3. {ncca_ngl-0.3.2 → ncca_ngl-0.3.4}/src/ncca/ngl/widgets/lookatwidget.py +33 -2
  4. {ncca_ngl-0.3.2 → ncca_ngl-0.3.4}/src/ncca/ngl/widgets/transformwidget.py +22 -0
  5. {ncca_ngl-0.3.2 → ncca_ngl-0.3.4}/LICENSE.txt +0 -0
  6. {ncca_ngl-0.3.2 → ncca_ngl-0.3.4}/src/ncca/ngl/.ruff_cache/.gitignore +0 -0
  7. {ncca_ngl-0.3.2 → ncca_ngl-0.3.4}/src/ncca/ngl/.ruff_cache/0.13.0/10564494386971134025 +0 -0
  8. {ncca_ngl-0.3.2 → ncca_ngl-0.3.4}/src/ncca/ngl/.ruff_cache/0.13.0/7783445477288392980 +0 -0
  9. {ncca_ngl-0.3.2 → ncca_ngl-0.3.4}/src/ncca/ngl/.ruff_cache/CACHEDIR.TAG +0 -0
  10. {ncca_ngl-0.3.2 → ncca_ngl-0.3.4}/src/ncca/ngl/PrimData/NGLDebug.log +0 -0
  11. {ncca_ngl-0.3.2 → ncca_ngl-0.3.4}/src/ncca/ngl/PrimData/Primitives.npz +0 -0
  12. {ncca_ngl-0.3.2 → ncca_ngl-0.3.4}/src/ncca/ngl/PrimData/buddah.npy +0 -0
  13. {ncca_ngl-0.3.2 → ncca_ngl-0.3.4}/src/ncca/ngl/PrimData/bunny.npy +0 -0
  14. {ncca_ngl-0.3.2 → ncca_ngl-0.3.4}/src/ncca/ngl/PrimData/cube.npy +0 -0
  15. {ncca_ngl-0.3.2 → ncca_ngl-0.3.4}/src/ncca/ngl/PrimData/dodecahedron.npy +0 -0
  16. {ncca_ngl-0.3.2 → ncca_ngl-0.3.4}/src/ncca/ngl/PrimData/dragon.npy +0 -0
  17. {ncca_ngl-0.3.2 → ncca_ngl-0.3.4}/src/ncca/ngl/PrimData/football.npy +0 -0
  18. {ncca_ngl-0.3.2 → ncca_ngl-0.3.4}/src/ncca/ngl/PrimData/icosahedron.npy +0 -0
  19. {ncca_ngl-0.3.2 → ncca_ngl-0.3.4}/src/ncca/ngl/PrimData/octahedron.npy +0 -0
  20. {ncca_ngl-0.3.2 → ncca_ngl-0.3.4}/src/ncca/ngl/PrimData/pack_arrays.py +0 -0
  21. {ncca_ngl-0.3.2 → ncca_ngl-0.3.4}/src/ncca/ngl/PrimData/teapot.npy +0 -0
  22. {ncca_ngl-0.3.2 → ncca_ngl-0.3.4}/src/ncca/ngl/PrimData/tetrahedron.npy +0 -0
  23. {ncca_ngl-0.3.2 → ncca_ngl-0.3.4}/src/ncca/ngl/PrimData/troll.npy +0 -0
  24. {ncca_ngl-0.3.2 → ncca_ngl-0.3.4}/src/ncca/ngl/__init__.py +0 -0
  25. {ncca_ngl-0.3.2 → ncca_ngl-0.3.4}/src/ncca/ngl/abstract_vao.py +0 -0
  26. {ncca_ngl-0.3.2 → ncca_ngl-0.3.4}/src/ncca/ngl/base_mesh.py +0 -0
  27. {ncca_ngl-0.3.2 → ncca_ngl-0.3.4}/src/ncca/ngl/base_mesh.pyi +0 -0
  28. {ncca_ngl-0.3.2 → ncca_ngl-0.3.4}/src/ncca/ngl/bbox.py +0 -0
  29. {ncca_ngl-0.3.2 → ncca_ngl-0.3.4}/src/ncca/ngl/bezier_curve.py +0 -0
  30. {ncca_ngl-0.3.2 → ncca_ngl-0.3.4}/src/ncca/ngl/first_person_camera.py +0 -0
  31. {ncca_ngl-0.3.2 → ncca_ngl-0.3.4}/src/ncca/ngl/image.py +0 -0
  32. {ncca_ngl-0.3.2 → ncca_ngl-0.3.4}/src/ncca/ngl/log.py +0 -0
  33. {ncca_ngl-0.3.2 → ncca_ngl-0.3.4}/src/ncca/ngl/mat2.py +0 -0
  34. {ncca_ngl-0.3.2 → ncca_ngl-0.3.4}/src/ncca/ngl/mat3.py +0 -0
  35. {ncca_ngl-0.3.2 → ncca_ngl-0.3.4}/src/ncca/ngl/mat4.py +0 -0
  36. {ncca_ngl-0.3.2 → ncca_ngl-0.3.4}/src/ncca/ngl/multi_buffer_vao.py +0 -0
  37. {ncca_ngl-0.3.2 → ncca_ngl-0.3.4}/src/ncca/ngl/obj.py +0 -0
  38. {ncca_ngl-0.3.2 → ncca_ngl-0.3.4}/src/ncca/ngl/plane.py +0 -0
  39. {ncca_ngl-0.3.2 → ncca_ngl-0.3.4}/src/ncca/ngl/prim_data.py +0 -0
  40. {ncca_ngl-0.3.2 → ncca_ngl-0.3.4}/src/ncca/ngl/primitives.py +0 -0
  41. {ncca_ngl-0.3.2 → ncca_ngl-0.3.4}/src/ncca/ngl/pyside_event_handling_mixin.py +0 -0
  42. {ncca_ngl-0.3.2 → ncca_ngl-0.3.4}/src/ncca/ngl/quaternion.py +0 -0
  43. {ncca_ngl-0.3.2 → ncca_ngl-0.3.4}/src/ncca/ngl/random.py +0 -0
  44. {ncca_ngl-0.3.2 → ncca_ngl-0.3.4}/src/ncca/ngl/shader.py +0 -0
  45. {ncca_ngl-0.3.2 → ncca_ngl-0.3.4}/src/ncca/ngl/shader_lib.py +0 -0
  46. {ncca_ngl-0.3.2 → ncca_ngl-0.3.4}/src/ncca/ngl/shader_program.py +0 -0
  47. {ncca_ngl-0.3.2 → ncca_ngl-0.3.4}/src/ncca/ngl/shaders/checker_fragment.glsl +0 -0
  48. {ncca_ngl-0.3.2 → ncca_ngl-0.3.4}/src/ncca/ngl/shaders/checker_vertex.glsl +0 -0
  49. {ncca_ngl-0.3.2 → ncca_ngl-0.3.4}/src/ncca/ngl/shaders/colour_fragment.glsl +0 -0
  50. {ncca_ngl-0.3.2 → ncca_ngl-0.3.4}/src/ncca/ngl/shaders/colour_vertex.glsl +0 -0
  51. {ncca_ngl-0.3.2 → ncca_ngl-0.3.4}/src/ncca/ngl/shaders/diffuse_fragment.glsl +0 -0
  52. {ncca_ngl-0.3.2 → ncca_ngl-0.3.4}/src/ncca/ngl/shaders/diffuse_vertex.glsl +0 -0
  53. {ncca_ngl-0.3.2 → ncca_ngl-0.3.4}/src/ncca/ngl/shaders/text_fragment.glsl +0 -0
  54. {ncca_ngl-0.3.2 → ncca_ngl-0.3.4}/src/ncca/ngl/shaders/text_geometry.glsl +0 -0
  55. {ncca_ngl-0.3.2 → ncca_ngl-0.3.4}/src/ncca/ngl/shaders/text_vertex.glsl +0 -0
  56. {ncca_ngl-0.3.2 → ncca_ngl-0.3.4}/src/ncca/ngl/simple_index_vao.py +0 -0
  57. {ncca_ngl-0.3.2 → ncca_ngl-0.3.4}/src/ncca/ngl/simple_vao.py +0 -0
  58. {ncca_ngl-0.3.2 → ncca_ngl-0.3.4}/src/ncca/ngl/text.py +0 -0
  59. {ncca_ngl-0.3.2 → ncca_ngl-0.3.4}/src/ncca/ngl/texture.py +0 -0
  60. {ncca_ngl-0.3.2 → ncca_ngl-0.3.4}/src/ncca/ngl/transform.py +0 -0
  61. {ncca_ngl-0.3.2 → ncca_ngl-0.3.4}/src/ncca/ngl/util.py +0 -0
  62. {ncca_ngl-0.3.2 → ncca_ngl-0.3.4}/src/ncca/ngl/vao_factory.py +0 -0
  63. {ncca_ngl-0.3.2 → ncca_ngl-0.3.4}/src/ncca/ngl/vec2.py +0 -0
  64. {ncca_ngl-0.3.2 → ncca_ngl-0.3.4}/src/ncca/ngl/vec2_array.py +0 -0
  65. {ncca_ngl-0.3.2 → ncca_ngl-0.3.4}/src/ncca/ngl/vec3.py +0 -0
  66. {ncca_ngl-0.3.2 → ncca_ngl-0.3.4}/src/ncca/ngl/vec3_array.py +0 -0
  67. {ncca_ngl-0.3.2 → ncca_ngl-0.3.4}/src/ncca/ngl/vec4.py +0 -0
  68. {ncca_ngl-0.3.2 → ncca_ngl-0.3.4}/src/ncca/ngl/vec4_array.py +0 -0
  69. {ncca_ngl-0.3.2 → ncca_ngl-0.3.4}/src/ncca/ngl/widgets/NGLDebug.log +0 -0
  70. {ncca_ngl-0.3.2 → ncca_ngl-0.3.4}/src/ncca/ngl/widgets/__init__.py +0 -0
  71. {ncca_ngl-0.3.2 → ncca_ngl-0.3.4}/src/ncca/ngl/widgets/__main__.py +0 -0
  72. {ncca_ngl-0.3.2 → ncca_ngl-0.3.4}/src/ncca/ngl/widgets/glsl/phong.frag +0 -0
  73. {ncca_ngl-0.3.2 → ncca_ngl-0.3.4}/src/ncca/ngl/widgets/glsl/phong.vert +0 -0
  74. {ncca_ngl-0.3.2 → ncca_ngl-0.3.4}/src/ncca/ngl/widgets/glsl/picking.frag +0 -0
  75. {ncca_ngl-0.3.2 → ncca_ngl-0.3.4}/src/ncca/ngl/widgets/glsl/picking.vert +0 -0
  76. {ncca_ngl-0.3.2 → ncca_ngl-0.3.4}/src/ncca/ngl/widgets/mat4widget.py +0 -0
  77. {ncca_ngl-0.3.2 → ncca_ngl-0.3.4}/src/ncca/ngl/widgets/rgbacolourwidget.py +0 -0
  78. {ncca_ngl-0.3.2 → ncca_ngl-0.3.4}/src/ncca/ngl/widgets/rgbcolourwidget.py +0 -0
  79. {ncca_ngl-0.3.2 → ncca_ngl-0.3.4}/src/ncca/ngl/widgets/transformation_widget.py +0 -0
  80. {ncca_ngl-0.3.2 → ncca_ngl-0.3.4}/src/ncca/ngl/widgets/vec2widget.py +0 -0
  81. {ncca_ngl-0.3.2 → ncca_ngl-0.3.4}/src/ncca/ngl/widgets/vec3widget.py +0 -0
  82. {ncca_ngl-0.3.2 → ncca_ngl-0.3.4}/src/ncca/ngl/widgets/vec4widget.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: ncca-ngl
3
- Version: 0.3.2
3
+ Version: 0.3.4
4
4
  Summary: A Python version of the NGL graphics library.
5
5
  Author: Jon Macey
6
6
  Author-email: Jon Macey <jmacey@bournemouth.ac.uk>
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "ncca-ngl"
3
- version = "0.3.2"
3
+ version = "0.3.4"
4
4
  description = "A Python version of the NGL graphics library."
5
5
  authors = [{ name = "Jon Macey", email = "jmacey@bournemouth.ac.uk" }]
6
6
  requires-python = ">=3.13"
@@ -10,6 +10,7 @@ class LookAtWidget(QFrame):
10
10
  """A widget for displaying and editing a Transform object, with foldable sections."""
11
11
 
12
12
  valueChanged = Signal(Mat4)
13
+ world_up = [Vec3(0, 1, 0), Vec3(1, 0, 0), Vec3(0, 0, 1)]
13
14
 
14
15
  def __init__(self, parent: QWidget | None = None, name: str = "", eye=Vec3(2, 2, 2), look=Vec3(0, 0, 0)) -> None:
15
16
  """
@@ -53,6 +54,31 @@ class LookAtWidget(QFrame):
53
54
  main_layout.addWidget(self._toggle_button)
54
55
  main_layout.addWidget(self._content_widget)
55
56
 
57
+ def set_eye(self, eye):
58
+ self._eye.set_value(eye)
59
+
60
+ def set_look(self, look):
61
+ self._look.set_value(look)
62
+
63
+ def set_up(self, up):
64
+ self._up.setCurrentIndex(up)
65
+
66
+ def set_name(self, name):
67
+ self._name = name
68
+ self._toggle_button.setText(name)
69
+
70
+ def get_name(self):
71
+ return self._name.text()
72
+
73
+ def get_eye(self):
74
+ return self._eye.value
75
+
76
+ def get_look(self):
77
+ return self._look.value
78
+
79
+ def get_up(self):
80
+ return self.world_up[self._up.currentIndex()]
81
+
56
82
  def toggle_collapsed(self, checked: bool) -> None:
57
83
  """Toggles the visibility of the content widget."""
58
84
  if checked:
@@ -66,8 +92,8 @@ class LookAtWidget(QFrame):
66
92
  """Updates the view matrix based on the widget values."""
67
93
  eye = self._eye.value
68
94
  look = self._look.value
69
- world_up = [Vec3(0, 1, 0), Vec3(1, 0, 0), Vec3(0, 0, 1)]
70
- up = world_up[self._up.currentIndex()]
95
+
96
+ up = self.world_up[self._up.currentIndex()]
71
97
 
72
98
  self._view = look_at(eye, look, up)
73
99
  self.valueChanged.emit(self._view)
@@ -75,3 +101,8 @@ class LookAtWidget(QFrame):
75
101
  def view(self) -> Mat4:
76
102
  """Returns the current view matrix."""
77
103
  return self._view
104
+
105
+ name = Property(str, get_name, set_name)
106
+ eye = Property(Vec3, get_eye, set_eye)
107
+ look = Property(Vec3, get_look, set_look)
108
+ up = Property(Vec3, get_up, set_up)
@@ -40,8 +40,12 @@ class TransformWidget(QFrame):
40
40
  content_layout.setContentsMargins(0, 0, 0, 0)
41
41
 
42
42
  self._position = Vec3Widget(self, "Position", Vec3(0.0, 0.0, 0.0))
43
+ self._position.set_range(-20, 20)
43
44
  self._rotation = Vec3Widget(self, "Rotation", Vec3(0.0, 0.0, 0.0))
45
+ self._rotation.set_range(-360, 360)
44
46
  self._scale = Vec3Widget(self, "Scale", Vec3(1.0, 1.0, 1.0))
47
+ self._scale.set_range(-20, 20)
48
+
45
49
  self._rot_order = QComboBox(self)
46
50
  for v in self._rotation_order:
47
51
  self._rot_order.addItem(v)
@@ -79,3 +83,21 @@ class TransformWidget(QFrame):
79
83
  tx.set_scale(scale.x, scale.y, scale.z)
80
84
  print(tx.get_matrix())
81
85
  self.valueChanged.emit(tx.get_matrix())
86
+
87
+ def name(self) -> str:
88
+ """
89
+ Returns:
90
+ The name of the widget.
91
+ """
92
+ return self._name
93
+
94
+ def set_name(self, name: str) -> None:
95
+ """Sets the name of the widget.
96
+
97
+ Args:
98
+ name: The new name of the widget.
99
+ """
100
+ self._name = name
101
+ self._toggle_button.setText(name)
102
+
103
+ name = Property(str, name, set_name)
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes