Wed, 08 Jun 2022 23:14:55 +0300
Add model icons back into the list view
154 | 1 | #pragma once |
206
654661eab7f3
More refactor, merged main.h, basics.h and utility.h into one header file basics.h and removed plenty of unused code
Teemu Piippo <teemu@hecknology.net>
parents:
200
diff
changeset
|
2 | #include "basics.h" |
200 | 3 | #include "model.h" |
154 | 4 | |
5 | namespace ldraw | |
6 | { | |
7 | /// Determines how quadrilaterals are split into triangles | |
8 | enum class Diagonal | |
9 | { | |
10 | Diagonal_13, | |
11 | Diagonal_24 | |
12 | }; | |
13 | ||
200 | 14 | std::pair<Triangle, Triangle> splitTriangles( |
15 | const Quadrilateral& q, | |
16 | ldraw::Diagonal diagonal); | |
154 | 17 | |
200 | 18 | /* |
154 | 19 | void makeUnofficial(ModelEditor &editor); |
200 | 20 | */ |
186 | 21 | |
22 | template<typename Fn> | |
23 | void circle(int segments, int divisions, Fn&& fn) | |
24 | { | |
196 | 25 | float factor = 2.0f * pi<> / divisions; |
186 | 26 | for (int i = 0; i < segments; i += 1) |
27 | { | |
28 | fn( | |
29 | glm::vec2{std::sin((i - 1) * factor), std::cos((i - 1) * factor)}, | |
30 | glm::vec2{std::sin(i * factor), std::cos(i * factor)}, | |
31 | glm::vec2{std::sin((i + 1) * factor), std::cos((i - 1) * factor)} | |
32 | ); | |
33 | } | |
34 | } | |
154 | 35 | } |
200 | 36 | |
37 | ModelElement inverted(const ModelElement &element); |