TerraForge3D  2.3.1
3D Terrain And Landscape Generator

◆ Render()

void LayeredNoiseManager::Render ( )

Definition at line 19 of file LayeredNoiseManager.cpp.

20{
21 ImGui::Text("Global Offsets:");
22 ImGui::DragFloat3(MAKE_IMGUI_ID("Global Offsets"), offset, 0.1f);
23 ImGui::DragFloat("Global Strength##LayeredNoiseManager", &strength, 0.1f);
24 ImGui::Checkbox("Absolute Value##LayeredNoiseManager", &absv);
25 ImGui::Checkbox("Square Value##LayeredNoiseManager", &sq);
26 ImGui::NewLine();
27 ImGui::Text("Noise Layers");
28 std::vector<NoiseLayer *> nl = noiseLayers;
29
30 for (int i = 0; i < nl.size(); i++)
31 {
32 bool state = ImGui::CollapsingHeader((std::string("##noiseLayerName") + std::to_string(i)).c_str());
33
34 if (state)
35 {
36 nl[i]->Render(i);
37
38 if (toAdd.size() == 0)
39 {
40 if (ImGui::Button("Duplicate"))
41 {
42 nlohmann::json data = nl[i]->Save();
43 toAdd.push_back(new NoiseLayer());
44 toAdd.back()->Load(data);
45 }
46 }
47
48 if (noiseLayers.size() > 1 && toDelete.size() == 0)
49 {
50 ImGui::SameLine();
51
52 if (ImGui::Button("Delete"))
53 {
54 toDelete.push_back(i);
55 }
56 }
57 }
58
59 else
60 {
61 ImGui::SameLine();
62 ImGui::Text(nl[i]->name.data());
63 }
64 }
65
66 if (toAdd.size() == 0)
67 {
68 if (ImGui::Button("Add New Layer"))
69 {
70 toAdd.push_back(new NoiseLayer());
71 }
72 }
73}
a class to store JSON values
Definition: json.hpp:17860