-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrvmer.cpp
124 lines (103 loc) · 4.42 KB
/
rvmer.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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
#include<iostream>
#include<iterator>
#include"rvmer.hpp"
#include"rvmmeshhelper.h"
rvmreaderlib::rvmreaderlib():RVMReader(){
}
rvmreaderlib::~rvmreaderlib(){
}
void rvmreaderlib::startDocument(){
std::cout << "startDocument\n";
};
void rvmreaderlib::endDocument(){
};
void rvmreaderlib::startHeader(const std::string& banner, const std::string& fileNote, const std::string& date, const std::string& user, const std::string& encoding){
std::cout << banner <<"\n"<< fileNote <<"\n"<< date <<"\n"<< user <<"\n"<< encoding;
};
void rvmreaderlib::endHeader(){
};
void rvmreaderlib::startModel(const std::string& projectName, const std::string& name){
std::cout << projectName <<"\n"<<name;
};
void rvmreaderlib::endModel(){
};
void rvmreaderlib::startGroup(const std::string& name, const Vector3F& translation, const int& materialId){
std::cout <<"\n"<<name <<"\nx "<<translation[0] <<"\ny "<< translation[1] <<"\nz "<< translation[2];
};
void rvmreaderlib::endGroup(){
};
void rvmreaderlib::startMetaData(){
};
void rvmreaderlib::endMetaData(){
};
void rvmreaderlib::startMetaDataPair(const std::string& name, const std::string& value){
};
void rvmreaderlib::endMetaDataPair(){
};
void rvmreaderlib::createPyramid(const std::array<float, 12>& matrix, const Primitives::Pyramid& params){
std::cout << "createPyramid";
std::copy(std::begin(matrix),
std::end(matrix),
std::ostream_iterator<float>(std::cout, "\n"));
};
void rvmreaderlib::createBox(const std::array<float, 12>& matrix, const Primitives::Box& params){
std::cout << "createBox";
std::copy(std::begin(matrix),
std::end(matrix),
std::ostream_iterator<float>(std::cout, "\n"));
};
void rvmreaderlib::createRectangularTorus(const std::array<float, 12>& matrix, const Primitives::RectangularTorus& params){
std::copy(std::begin(matrix),
std::end(matrix),
std::ostream_iterator<float>(std::cout, "\n"));
};
void rvmreaderlib::createCircularTorus(const std::array<float, 12>& matrix, const Primitives::CircularTorus& params){
std::copy(std::begin(matrix),
std::end(matrix),
std::ostream_iterator<float>(std::cout, "\n"));
};
void rvmreaderlib::createEllipticalDish(const std::array<float, 12>& matrix, const Primitives::EllipticalDish& params){
std::copy(std::begin(matrix),
std::end(matrix),
std::ostream_iterator<float>(std::cout, "\n"));
};
void rvmreaderlib::createSphericalDish(const std::array<float, 12>& matrix, const Primitives::SphericalDish& params){
std::copy(std::begin(matrix),
std::end(matrix),
std::ostream_iterator<float>(std::cout, "\n"));
};
void rvmreaderlib::createSnout(const std::array<float, 12>& matrix, const Primitives::Snout& params){
std::cout << "\ncreateSnout ";
std::copy(std::begin(matrix),
std::end(matrix),
std::ostream_iterator<float>(std::cout, " "));
Mesh c = RVMMeshHelper2::makeSnout(params, RVMMeshHelper2::infoSnoutNumSides(params, 100, 100));
std::cout << "\npoints: "<< c.positionIndex.size() <<" normals: "<< c.normalIndex.size();
};
void rvmreaderlib::createCylinder(const std::array<float, 12>& matrix, const Primitives::Cylinder& params){
std::cout << "\ncreateCyl";
std::copy(std::begin(matrix),
std::end(matrix),
std::ostream_iterator<float>(std::cout, "\n"));
};
void rvmreaderlib::createSphere(const std::array<float, 12>& matrix, const Primitives::Sphere& params){
std::copy(std::begin(matrix),
std::end(matrix),
std::ostream_iterator<float>(std::cout, "\n"));
};
void rvmreaderlib::createLine(const std::array<float, 12>& matrix, const float& startx, const float& endx){
std::cout << "\ncreateLine ";
std::copy(std::begin(matrix),
std::end(matrix),
std::ostream_iterator<float>(std::cout, " "));
std::cout << "\nstartx " << startx << "\nendy " << endx;
};
void rvmreaderlib::createFacetGroup(const std::array<float, 12>& matrix, const std::vector<std::vector<std::vector<std::pair<Vector3F, Vector3F> > > >& vertexes){
std::cout << "\ncreateFacetGroup ";
std::copy(std::begin(matrix),
std::end(matrix),
std::ostream_iterator<float>(std::cout, " "));
Mesh c;
RVMMeshHelper2::tesselateFacetGroup(vertexes, &c);
std::cout << "\npoints: "<< c.positionIndex.size() <<" normals: "<< c.normalIndex.size();
};