-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathFace.cpp
More file actions
70 lines (54 loc) · 1.49 KB
/
Face.cpp
File metadata and controls
70 lines (54 loc) · 1.49 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
60
61
62
63
64
65
66
67
68
69
70
// Tyrus Malmstrom
// 11/1/2016
// Face.cpp class
// directives:
#include "Face.h"
// namespace:
using namespace std;
using Eigen::Matrix3d;
using Eigen::MatrixXd;
using Eigen::Vector3d;
// Macros:
#define DEBUG false
void Face::map(const MatrixXd& mat, const Matrix3d& fm, const Vector3d& sn){
mvil.resize(3,3);
material.resize(3,3);
/*
cout << "this is A \n" << A << endl;
cout << "this is B \n" << B << endl;
cout << "this is C \n" << C << endl;
cout << "the A row in mat \n" << mat.row(A).transpose() << endl;
cout << "the B row in mat \n" << mat.row(B).transpose() << endl;
cout << "the C row in mat \n" << mat.row(C).transpose() << endl;
*/
mvil.col(0) = mat.row(A).transpose();
mvil.col(1) = mat.row(B).transpose();
mvil.col(2) = mat.row(C).transpose();
// cout << mvil << endl;
// mapping face material:
material = fm;
// mapping surface normal:
surface_normal = sn;
}
void Face::pprint(ostream& out) const{
out << "FACE: " << endl;
// print off vertex list:
out << "mapped vertex list: " << endl;
out << mvil << endl;
out << "With this associated material: \n" << material << endl;
out << "With surface normal: \n" << surface_normal << endl;
out << "With ptof of = \n" << ptof << endl;
}
ostream& operator<< (ostream& out, const Face& f){
f.pprint( out );
return out;
}
const Vector3d Face::getA() const{
return mvil.col(0);
}
const Vector3d Face::getB() const{
return mvil.col(1);
}
const Vector3d Face::getC() const{
return mvil.col(2);
}