-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathobject3D.h
More file actions
59 lines (52 loc) · 1.61 KB
/
Copy pathobject3D.h
File metadata and controls
59 lines (52 loc) · 1.61 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
#ifndef _object3D_Aloschil_h_
#define _object3D_Aloschil_h_
#include <vector>
#include "matrix.h"
namespace Aloschil
{
class Face
{
std::vector<Matrix> points;
Matrix normal;
public:
Face(){}
//////////////////////////////////////////////////////////////////////////////
/// @brief This function sets points of the face
///
/// Points are set in order of traversal and normal is also calculated
/// normal is calculated by first three points.
/// Default traversal is counter-clockwise
///
/// @returns – nothing
///
//////////////////////////////////////////////////////////////////////////////
void setPoints(std::vector<Matrix> pointsToSet);
//////////////////////////////////////////////////////////////////////////////
/// @brief This function returns face with the same points set but inverted normal
///
/// Note: traversal of face's points is also inverted. <A HREF="#faceInversionImage">See image</A>
/// <A NAME="faceInversion">
/// <IMG src=images/faceInversion.jpg ALIGN=left>
/// </A>
///
/// @returns – Return codes and their meanings.
///
//////////////////////////////////////////////////////////////////////////////
Face getInvertedFace();
std::vector<Matrix> &getPoints(){return points;}
Matrix & getNormal(){return normal;}
Matrix & operator [](int i){return points[i];}
friend Face operator *(const Matrix &m,const Face &face);
void print();
void updateNormal();
};
class Object3D
{
std::vector<Face> faces;
public:
Object3D(){}
std::vector<Face> & getFaces(){return faces;}
~Object3D(){}
};
}
#endif /*_object3D_Aloschil_h_*/