Cogs.Core
RRTasks.h
1#pragma once
2
3#include <atomic>
4#include <vector>
5
6#include "Commands/CommandHelpers.h"
7
8namespace Cogs::Core {
9
11 {
12 float featureAngle = 0.6f;
13 float protrusionAngle = 0.6f;
14 bool flip = false;
15 };
16
18 {
19 unsigned triangles;
20 float error;
21 glm::vec3 bboxMin;
22 glm::vec3 bboxMax;
23 Cogs::Core::MeshReps meshes;
24
25 SimplifiedMeshSet() = default;
26
27 SimplifiedMeshSet(const SimplifiedMeshSet&) = delete;
28 SimplifiedMeshSet& operator=(const SimplifiedMeshSet&) = delete;
29
31 SimplifiedMeshSet& operator=(SimplifiedMeshSet&&) = default;
32 };
33
34
36 {
37 Context* context;
39 std::vector<SimplifiedMeshSet> meshSets;
40 std::atomic<float> progress = 0.f;
41 std::atomic<bool> running = false;
42 std::atomic<bool> cancel = false;
43 };
44
46 {
47 RRTaskBase(RRTaskState* state, bool modal, float epsilon, NormalGenArgs& normalGenArgs)
48 : state(state), epsilon(epsilon), modal(modal), normalGenArgs(normalGenArgs)
49 {}
50
51 void initRR();
52 void runRR();
53
54 RRTaskState* state;
55 void * rrHandle = nullptr;
56 float epsilon;
57 float edgeLengthWeight = 1.0f;
58 bool modal;
59 bool textured = false;
60
61 NormalGenArgs normalGenArgs;
62 };
63
64
66 {
67 RRTriangleGuidedTask(RRTaskState* state, bool modal, float epsilon, float percentage, NormalGenArgs& normalGenArgs)
68 : RRTaskBase(state, modal, epsilon, normalGenArgs), percentage(percentage)
69 {}
70
71 void operator()();
72
73 float percentage;
74 };
75
77 {
78 RRMinMaxErrorGuidedTask(RRTaskState* state, bool modal, float epsilon, float error_threshold, NormalGenArgs& normalGenArgs)
79 : RRTaskBase(state, modal, epsilon, normalGenArgs), error_threshold(error_threshold)
80 {}
81
82 void operator()();
83
84 float error_threshold;
85 };
86
88 {
89 RRMultiTaskBase(RRTaskState* state, bool modal, float epsilon, std::vector<float>& thresholds, NormalGenArgs& normalGenArgs)
90 : RRTaskBase(state, modal, epsilon, normalGenArgs), thresholds(thresholds)
91 {}
92
93 std::vector<float> thresholds;
94 };
95
96
98 {
99 RRMultiTriangleGuidedTask(RRTaskState* state, bool modal, float epsilon, std::vector<float>& thresholds, NormalGenArgs& normalGenArgs)
100 : RRMultiTaskBase(state, modal, epsilon, thresholds, normalGenArgs)
101 {}
102
103 void operator()();
104 };
105
107 {
108 RRMultiMinMaxErrorGuidedTask(RRTaskState* state, bool modal, float epsilon, std::vector<float>& thresholds, NormalGenArgs& normalGenArgs)
109 : RRMultiTaskBase(state, modal, epsilon, thresholds, normalGenArgs)
110 {}
111
112 void operator()();
113 };
114
115}
A Context instance contains all the services, systems and runtime components needed to use Cogs.
Definition: Context.h:83
Contains the Engine, Renderer, resource managers and other systems needed to run Cogs....