-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathGlyphComponent.cpp
More file actions
57 lines (44 loc) · 1.51 KB
/
GlyphComponent.cpp
File metadata and controls
57 lines (44 loc) · 1.51 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
#include "GlyphComponent.h"
#include <algorithm>
#include <iostream>
#include <utility>
#include <vector>
GlyphComponent::GlyphComponent(uint16_t numOfVertices_,
std::unordered_set<uint16_t> endPtsOfContours_,
std::unordered_set<uint16_t> ptsOnCurve_,
BoundingRect boundingRect_,
std::vector<glm::vec2> coordinates_)
: numOfVertices(numOfVertices_),
endPtsOfContours(std::move(endPtsOfContours_)),
boundingRect(boundingRect_),
coordinates(std::move(coordinates_)),
ptsOnCurve(std::move(ptsOnCurve_)) {
}
uint16_t GlyphComponent::getNumOfVertices() const {
return numOfVertices;
}
const std::unordered_set<uint16_t>&
GlyphComponent::getEndPtsOfContours() const {
return endPtsOfContours;
}
const std::unordered_set<uint16_t>& GlyphComponent::getPtsOnCurve() const {
return ptsOnCurve;
}
const std::vector<glm::vec2>& GlyphComponent::getCoordinates() const {
return coordinates;
}
BoundingRect GlyphComponent::getBoundingRect() const {
return boundingRect;
}
void GlyphComponent::printDebugInfo() const {
std::wcout << "numOfVertices: " << numOfVertices << std::endl;
std::wcout << "endPtsOfContours: [";
for (auto c : endPtsOfContours) {
std::wcout << c << ",";
}
std::wcout << "]" << std::endl;
for (int i = 0; i < numOfVertices; ++i) {
std::wcout << "points " << i << ": ";
std::wcout << coordinates[i][0] << ", " << coordinates[i][1] << std::endl;
}
}