ProtoTracer  1.0
Real-time 3D rendering and animation engine
Loading...
Searching...
No Matches
IndexGroup.cpp
Go to the documentation of this file.
1#include "IndexGroup.h"
2
3IndexGroup::IndexGroup() : A(0), B(0), C(0) {}
4
5IndexGroup::IndexGroup(const IndexGroup& indexGroup) : A(indexGroup.A), B(indexGroup.B), C(indexGroup.C) {}
6
7IndexGroup::IndexGroup(unsigned int X, unsigned int Y, unsigned int Z) : A(X), B(Y), C(Z) {}
8
10 return IndexGroup {
11 this->A + indexGroup.A,
12 this->B + indexGroup.B,
13 this->C + indexGroup.C
14 };
15}
16
18 return IndexGroup {
19 this->A - indexGroup.A,
20 this->B - indexGroup.B,
21 this->C - indexGroup.C
22 };
23}
24
26 return IndexGroup {
27 this->A * indexGroup.A,
28 this->B * indexGroup.B,
29 this->C * indexGroup.C
30 };
31}
32
34 return IndexGroup {
35 this->A / indexGroup.A,
36 this->B / indexGroup.B,
37 this->C / indexGroup.C
38 };
39}
40
42 return "[" + String(A) + ", " + String(B) + ", " + String(C) + "]";
43}
Defines the IndexGroup class for handling a group of three unsigned integer indices.
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