-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathOrient.cpp
67 lines (54 loc) · 1.21 KB
/
Orient.cpp
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
#include <iostream>
#include "Orient.hh"
#include "3D.h"
#include "Util.hh"
std::string
Orient::orient(std::vector<std::string> paramList){
if(paramList.size()<=9){
if(paramList.size() <9){
return "too few parameters";
}
float a = 0;
float b = 0;
float c = 0;
float d = 0;
float e = 0;
float f = 0;
float g = 0;
float h = 0;
float i = 0;
try{
a = std::stod(paramList[0]);
b = std::stod(paramList[1]);
c = std::stod(paramList[2]);
d = std::stod(paramList[3]);
e = std::stod(paramList[4]);
f = std::stod(paramList[5]);
g = std::stod(paramList[6]);
h = std::stod(paramList[7]);
i = std::stod(paramList[8]);
}
catch(...){
return "illegal params";
}
matrix_unit * orient_mat = new matrix_unit({
{ {a , b , c , 0. },
{d , e , f , 0. },
{g , h , i , 0. },
{0., 0., 0., 1.0} },
});
matrix_unit tmpsln;
Mult_mat(stack[top], orient_mat, &tmpsln);
Copy_mat(&tmpsln, stack[top]);
/*
Util::debug_head("Orient.cpp");
std::cout<<"stack["<<top<<"]:"<<std::endl;
Util::print_mat(stack[top]);
Util::debug_tail();
*/
return "Orient Done";
}
else{
return "too many parameters";
}
}