Skip to content

Commit 2a54a42

Browse files
committed
update the README.md
1 parent 88244f1 commit 2a54a42

1 file changed

Lines changed: 96 additions & 0 deletions

File tree

README.md

Lines changed: 96 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,3 +20,99 @@ uv run pytest --cov=src --cov-report=term-missing
2020
```
2121

2222
For coverage reports.
23+
24+
## Classes
25+
26+
### [`abstract_vao.py`](src/ncca/ngl/abstract_vao.py)
27+
* [`VertexData`](src/ncca/ngl/abstract_vao.py): A simple data structure to hold vertex data for a VAO. It stores the data as a numpy array, the size of the data, and the drawing mode.
28+
* [`AbstractVAO`](src/ncca/ngl/abstract_vao.py): An abstract base class for Vertex Array Objects (VAOs). It defines the interface for different VAO implementations, including methods for binding, drawing, setting data, and managing the VAO's lifecycle.
29+
30+
### [`base_mesh.py`](src/ncca/ngl/base_mesh.py)
31+
* [`Face`](src/ncca/ngl/base_mesh.py): A simple data structure for a mesh face, holding indices for vertices, UVs, and normals.
32+
* [`BaseMesh`](src/ncca/ngl/base_mesh.py): A base class for mesh geometry. It provides storage for vertices, normals, UVs, and faces, and includes methods for creating a VAO from the mesh data, calculating dimensions, and drawing the mesh.
33+
34+
### [`bbox.py`](src/ncca/ngl/bbox.py)
35+
* [`BBox`](src/ncca/ngl/bbox.py): Represents a 3D bounding box. It stores the center, dimensions, and extents of the box, and provides methods to calculate these values and retrieve the box's vertices and normals.
36+
37+
### [`bezier_curve.py`](src/ncca/ngl/bezier_curve.py)
38+
* [`BezierCurve`](src/ncca/ngl/bezier_curve.py): A class for creating and evaluating Bézier curves. It stores control points and knots, and can calculate points on the curve using the Cox-de Boor algorithm.
39+
40+
### [`first_person_camera.py`](src/ncca/ngl/first_person_camera.py)
41+
* [`FirstPersonCamera`](src/ncca/ngl/first_person_camera.py): Implements a first-person camera with movement, rotation, and projection matrix calculation. It handles mouse and keyboard input for camera control.
42+
43+
### [`image.py`](src/ncca/ngl/image.py)
44+
* [`Image`](src/ncca/ngl/image.py): A class for loading, saving, and manipulating images. It uses the Pillow library to handle different image formats and stores image data as a NumPy array.
45+
46+
### [`log.py`](src/ncca/ngl/log.py)
47+
* [`ColoredFormatter`](src/ncca/ngl/log.py): A custom logging formatter that adds color to log messages based on their severity level.
48+
* [`setup_logger`](src/ncca/ngl/log.py): A function to set up a logger with both file and console handlers.
49+
50+
### [`mat2.py`](src/ncca/ngl/mat2.py)
51+
* [`Mat2`](src/ncca/ngl/mat2.py): A 2x2 matrix class with support for identity, multiplication (matrix-matrix and matrix-vector), and conversion to a NumPy array.
52+
53+
### [`mat3.py`](src/ncca/ngl/mat3.py)
54+
* [`Mat3`](src/ncca/ngl/mat3.py): A 3x3 matrix class for 3D transformations. It includes methods for identity, zero, scale, rotation, transpose, inverse, and matrix multiplication.
55+
56+
### [`mat4.py`](src/ncca/ngl/mat4.py)
57+
* [`Mat4`](src/ncca/ngl/mat4.py): A 4x4 matrix class for 3D transformations. It supports creation of identity, zero, scale, translation, and rotation matrices, as well as matrix multiplication and inversion.
58+
59+
### [`multi_buffer_vao.py`](src/ncca/ngl/multi_buffer_vao.py)
60+
* [`MultiBufferVAO`](src/ncca/ngl/multi_buffer_vao.py): A VAO implementation that can manage multiple vertex buffers. This is useful for separating different types of vertex attributes (e.g., positions, colors, normals) into different buffers.
61+
62+
### [`obj.py`](src/ncca/ngl/obj.py)
63+
* [`Obj`](src/ncca/ngl/obj.py): A class for loading and saving Wavefront OBJ files. It extends `BaseMesh` and handles parsing of vertices, normals, UVs, and faces from an OBJ file, including support for negative indices.
64+
65+
### [`plane.py`](src/ncca/ngl/plane.py)
66+
* [`Plane`](src/ncca/ngl/plane.py): Represents a mathematical plane in 3D space. It can be defined by three points or a normal and a point, and can calculate the distance from a point to the plane.
67+
68+
### [`prim_data.py`](src/ncca/ngl/prim_data.py)
69+
* [`Prims`](src/ncca/ngl/prim_data.py): An enum of available primitive types.
70+
* [`PrimData`](src/ncca/ngl/prim_data.py): A class that provides static methods to generate vertex data for various geometric primitives like spheres, cubes, and tori.
71+
72+
### [`primitives.py`](src/ncca/ngl/primitives.py)
73+
* [`Primitives`](src/ncca/ngl/primitives.py): A static class for creating and drawing pre-defined geometric primitives. It uses `PrimData` to generate the vertex data and `VAOFactory` to create VAOs for rendering.
74+
75+
### [`pyside_event_handling_mixin.py`](src/ncca/ngl/pyside_event_handling_mixin.py)
76+
* [`PySideEventHandlingMixin`](src/ncca/ngl/pyside_event_handling_mixin.py): A mixin class for PySide6 applications that provides common event handling for mouse-based camera control (rotation, translation, zoom) and keyboard shortcuts.
77+
78+
### [`quaternion.py`](src/ncca/ngl/quaternion.py)
79+
* [`Quaternion`](src/ncca/ngl/quaternion.py): A class for representing rotations using quaternions. It includes methods for converting from a rotation matrix, multiplication, normalization, and applying the rotation to a vector.
80+
81+
### [`random.py`](src/ncca/ngl/random.py)
82+
* [`Random`](src/ncca/ngl/random.py): A static class for generating random numbers and vectors. It provides methods to get random floats, integers, and vectors of different dimensions.
83+
84+
### [`shader.py`](src/ncca/ngl/shader.py)
85+
* [`Shader`](src/ncca/ngl/shader.py): Represents a single OpenGL shader object (e.g., vertex, fragment). It handles loading source from a file, compiling the shader, and checking for errors.
86+
87+
### [`shader_lib.py`](src/ncca/ngl/shader_lib.py)
88+
* [`ShaderLib`](src/ncca/ngl/shader_lib.py): A singleton class that manages a library of shader programs. It provides a global point of access for loading, compiling, linking, and using shaders, as well as for setting uniform variables.
89+
90+
### [`shader_program.py`](src/ncca/ngl/shader_program.py)
91+
* [`ShaderProgram`](src/ncca/ngl/shader_program.py): A wrapper for an OpenGL shader program. It manages attaching shaders, linking the program, and provides an interface for setting uniform variables.
92+
93+
### [`simple_index_vao.py`](src/ncca/ngl/simple_index_vao.py)
94+
* [`SimpleIndexVAO`](src/ncca/ngl/simple_index_vao.py): A VAO implementation that uses an index buffer for indexed drawing. This is more efficient for meshes where vertices are shared between multiple faces.
95+
96+
### [`simple_vao.py`](src/ncca/ngl/simple_vao.py)
97+
* [`SimpleVAO`](src/ncca/ngl/simple_vao.py): A basic VAO implementation that uses a single buffer for non-indexed drawing.
98+
99+
### [`text.py`](src/ncca/ngl/text.py)
100+
* [`Text`](src/ncca/ngl/text.py): A class for rendering text in OpenGL. It uses `freetype-py` to create a texture atlas of font glyphs and renders text using a geometry shader to create quads for each character.
101+
102+
### [`texture.py`](src/ncca/ngl/texture.py)
103+
* [`Texture`](src/ncca/ngl/texture.py): A class for loading image files and creating OpenGL textures from them.
104+
105+
### [`transform.py`](src/ncca/ngl/transform.py)
106+
* [`Transform`](src/ncca/ngl/transform.py): A class to represent a 3D transformation with position, rotation, and scale components. It can generate a transformation matrix based on a specified rotation order.
107+
108+
### [`util.py`](src/ncca/ngl/util.py)
109+
* [`util.py`](src/ncca/ngl/util.py): This module contains various utility functions for 3D math, including `lookAt`, `perspective`, `ortho`, and `frustum` matrix generation, as well as `clamp` and `lerp` functions.
110+
111+
### [`vao_factory.py`](src/ncca/ngl/vao_factory.py)
112+
* [`VAOFactory`](src/ncca/ngl/vao_factory.py): A factory class for creating different types of VAOs. It allows for registering custom VAO creators and creating VAO instances by name.
113+
114+
### [`vec2.py`](src/ncca/ngl/vec2.py), [`vec3.py`](src/ncca/ngl/vec3.py), [`vec4.py`](src/ncca/ngl/vec4.py)
115+
* [`Vec2`](src/ncca/ngl/vec2.py), [`Vec3`](src/ncca/ngl/vec3.py), [`Vec4`](src/ncca/ngl/vec4.py): Classes for 2D, 3D, and 4D vectors, respectively. They provide standard vector operations such as addition, subtraction, dot product, cross product, normalization, and length calculation.
116+
117+
### [`vec2_array.py`](src/ncca/ngl/vec2_array.py), [`vec3_array.py`](src/ncca/ngl/vec3_array.py), [`vec4_array.py`](src/ncca/ngl/vec4_array.py)
118+
* [`Vec2Array`](src/ncca/ngl/vec2_array.py), [`Vec3Array`](src/ncca/ngl/vec3_array.py), [`Vec4Array`](src/ncca/ngl/vec4_array.py): Container classes that act like `std::vector` for `Vec2`, `Vec3`, and `Vec4` objects, respectively. They provide methods for appending, extending, and converting the data to flat lists or NumPy arrays.

0 commit comments

Comments
 (0)