My Project
face.cpp
Go to the documentation of this file.
1 #include "stdafx.h"
2 #include "../stdafx.h"
3 #include "face.h"
4 
6 {
7  for (int i = 0; i < 3; i++)
8  {
9  this->Vertices.push_back(0);
10  }
11  this->viterator = this->Vertices.begin();
12 
13  for (int i = 0; i < 3; i++)
14  {
15  this->Normals.push_back(0);
16  }
17  this->niterator = this->Normals.begin();
18 }
19 
20 Face::Face(int A, int nA, int B, int nB, int C, int nC)
21 {
22  this->Vertices.push_back(A);
23  this->Vertices.push_back(B);
24  this->Vertices.push_back(C);
25  this->Normals.push_back(nA);
26  this->Normals.push_back(nB);
27  this->Normals.push_back(nC);
28 
29  this->viterator = this->Vertices.begin();
30  this->niterator = this->Normals.begin();
31 }
32 
33 Face::Face(const Face& other)
34 {
35  this->Vertices = other.Vertices;
36  this->viterator = this->Vertices.begin();
37  this->Normals = other.Normals;
38  this->niterator = this->Normals.begin();
39 }
40 
41 Face::Face(Face&& other)
42 {
43  this->Vertices = other.Vertices;
44  this->viterator = this->Vertices.begin();
45  this->Normals = other.Normals;
46  this->niterator = this->Normals.begin();
47 }
48 
50 {
51 }
52 
53 Face& Face::operator=(const Face& face)
54 {
55  this->Vertices = face.Vertices;
56  this->viterator = this->Vertices.begin();
57  this->Normals = face.Normals;
58  this->niterator = this->Normals.begin();
59  return *this;
60 }
61 
62 int Face::A()
63 {
64  return this->Vertices[0];
65 }
66 
67 int Face::B()
68 {
69  return this->Vertices[1];
70 }
71 
72 int Face::C()
73 {
74  return this->Vertices[2];
75 }
76 
77 int Face::nA()
78 {
79  return this->Normals[0];
80 }
81 
82 int Face::nB()
83 {
84  return this->Normals[1];
85 }
86 
87 int Face::nC()
88 {
89  return this->Normals[2];
90 }
91 
93 {
94  return *(this->viterator);
95 }
96 
98 {
99  this->viterator++;
100  if (this->viterator == this->Vertices.end())
101  {
102  this->viterator = this->Vertices.begin();
103  }
104  return *(this->viterator);
105 }
106 
108 {
109  return *(this->niterator);
110 }
111 
113 {
114  this->niterator++;
115  if (this->niterator == this->Normals.end())
116  {
117  this->niterator = this->Normals.begin();
118  }
119  return *(this->niterator);
120 }
int C()
Definition: face.cpp:72
Face & operator=(const Face &face)
Definition: face.cpp:53
Define face consisting 3 links to vetices.
Definition: face.h:25
Face()
Definition: face.cpp:5
int getNextVertex()
Definition: face.cpp:97
int getVertex()
Definition: face.cpp:92
vector< int > Normals
Definition: face.h:126
int nB()
Definition: face.cpp:82
int A()
Definition: face.cpp:62
Define face consisting 3 links to vetices.
int B()
Definition: face.cpp:67
int nA()
Definition: face.cpp:77
~Face()
Definition: face.cpp:49
int getNormal()
Definition: face.cpp:107
int getNextNormal()
Definition: face.cpp:112
vector< int > Vertices
Definition: face.h:125
int nC()
Definition: face.cpp:87