ProtoTracer  1.0
Real-time 3D rendering and animation engine
Loading...
Searching...
No Matches
IndexGroup.h
Go to the documentation of this file.
1/**
2 * @file IndexGroup.h
3 * @brief Defines the IndexGroup class for handling a group of three unsigned integer indices.
4 *
5 * The IndexGroup class provides functionality to manage and perform arithmetic operations
6 * on groups of three indices, such as addition, subtraction, multiplication, and division.
7 * It is useful for managing vertex or element indices in various computational contexts.
8 *
9 * @date 22/12/2024
10 * @version 1.0
11 * @author Coela Can't
12 */
13
14#pragma once
15
16#include <Arduino.h>
17
18/**
19 * @class IndexGroup
20 * @brief Represents a group of three unsigned integer indices.
21 */
23public:
24 unsigned int A; ///< First index in the group.
25 unsigned int B; ///< Second index in the group.
26 unsigned int C; ///< Third index in the group.
27
28 /**
29 * @brief Default constructor.
30 */
31 IndexGroup();
32
33 /**
34 * @brief Copy constructor.
35 * @param indexGroup The IndexGroup to copy from.
36 */
37 IndexGroup(const IndexGroup& indexGroup);
38
39 /**
40 * @brief Parameterized constructor.
41 * @param X Value for the first index.
42 * @param Y Value for the second index.
43 * @param Z Value for the third index.
44 */
45 IndexGroup(unsigned int X, unsigned int Y, unsigned int Z);
46
47 /**
48 * @brief Adds two IndexGroup objects component-wise.
49 * @param indexGroup The IndexGroup to add.
50 * @return A new IndexGroup with the result of the addition.
51 */
52 IndexGroup Add(IndexGroup indexGroup);
53
54 /**
55 * @brief Subtracts two IndexGroup objects component-wise.
56 * @param indexGroup The IndexGroup to subtract.
57 * @return A new IndexGroup with the result of the subtraction.
58 */
59 IndexGroup Subtract(IndexGroup indexGroup);
60
61 /**
62 * @brief Multiplies two IndexGroup objects component-wise.
63 * @param indexGroup The IndexGroup to multiply.
64 * @return A new IndexGroup with the result of the multiplication.
65 */
66 IndexGroup Multiply(IndexGroup indexGroup);
67
68 /**
69 * @brief Divides two IndexGroup objects component-wise.
70 * @param indexGroup The IndexGroup to divide.
71 * @return A new IndexGroup with the result of the division.
72 */
73 IndexGroup Divide(IndexGroup indexGroup);
74
75 /**
76 * @brief Converts the IndexGroup to a string representation.
77 * @return A string representation of the IndexGroup in the format "[A, B, C]".
78 */
79 String ToString();
80};
Represents a group of three unsigned integer indices.
Definition IndexGroup.h:22
String ToString()
Converts the IndexGroup to a string representation.
IndexGroup Divide(IndexGroup indexGroup)
Divides two IndexGroup objects component-wise.
unsigned int C
Third index in the group.
Definition IndexGroup.h:26
IndexGroup Subtract(IndexGroup indexGroup)
Subtracts two IndexGroup objects component-wise.
IndexGroup Add(IndexGroup indexGroup)
Adds two IndexGroup objects component-wise.
Definition IndexGroup.cpp:9
unsigned int A
First index in the group.
Definition IndexGroup.h:24
IndexGroup Multiply(IndexGroup indexGroup)
Multiplies two IndexGroup objects component-wise.
IndexGroup()
Default constructor.
Definition IndexGroup.cpp:3
unsigned int B
Second index in the group.
Definition IndexGroup.h:25