Cogs.Core
MeshOpCommands.h
1#pragma once
2
3#include "EditorCommand.h"
4
5#include <atomic>
6
7#include "Services/TaskManager.h"
8#include "CommandHelpers.h"
9
10namespace Cogs::Core
11{
12
14 {
16
17 void apply() override;
18 void beginModal() override;
19 bool continueModal() override;
20 void showGui() override;
21 void undo() override;
22 protected:
23 UnpackOptions opts;
24 bool modal = false;
25 bool cancel = false;
26 MeshItems items;
27 MeshReps meshes;
28 std::vector<MeshHandle> originalMeshes;
29 };
30
32 {
33 AbstractLiveUpdateCommand(EditorState * state, uint32_t primitiveMask = ~0u) : ModalEditorCommand(state), primitiveMask(primitiveMask) {}
34
35 void beginModal() override;
36 bool continueModal() override;
37 void showGui() override;
38
39 void undo() override;
40
41 virtual bool issueTask() = 0;
42
43 protected:
44 UnpackOptions opts;
45 uint32_t primitiveMask;
46 bool modal = false;
47 bool dirty = false;
48 std::atomic<bool> running = false;
49 std::atomic<bool> cancel = false;
50 MeshItems items;
51 MeshReps meshes;
52 MeshReps newMeshes;
53 std::vector<MeshHandle> originalMeshes;
54
55 TaskId task = NoTask;
56
57 };
58
60 {
62
63 float featureAngle = 0.6f;
64 float protrusionAngle = 0.6f;
65 bool flip = false;
66
67 void apply() override;
68 void showGui() override;
69 bool issueTask() override;
70 };
71
73 {
75
76 float epsilon = std::numeric_limits<float>::epsilon();
77 bool keepNormals = true;
78 bool keepTexCoords = true;
79 bool keepTangents = true;
80
81
82 bool hasNormals = true;
83 bool hasTexCoords = true;
84 bool hasTangents = true;
85
86
87 void apply() override;
88 void showGui() override;
89 bool issueTask() override;
90 };
91}
Contains the Engine, Renderer, resource managers and other systems needed to run Cogs....
void beginModal() override
Called when the command is initiated.
bool continueModal() override
Shall return true while the GUI should still be shown. False when.
void showGui() override
Display custom ImGUI.
void showGui() override
Display custom ImGUI.
void apply() override
Run the command.
Abstract base class for all editor commands showing GUI in interactive mode.
Definition: EditorCommand.h:40
bool continueModal() override
Shall return true while the GUI should still be shown. False when.
void beginModal() override
Called when the command is initiated.
void apply() override
Run the command.
void showGui() override
Display custom ImGUI.
Task id struct used to identify unique Task instances.
Definition: TaskManager.h:20
void apply() override
Run the command.
void showGui() override
Display custom ImGUI.