MCPcopy Create free account
hub / github.com/LuxCoreRender/LuxCore / DrawObjectGUI

Method DrawObjectGUI

samples/luxcoreui/samplerwindow.cpp:56–132  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

54}
55
56bool SamplerWindow::DrawObjectGUI(Properties &props, bool &modifiedProps) {
57 //--------------------------------------------------------------------------
58 // sampler.type
59 //--------------------------------------------------------------------------
60
61 const string currentSamplerType = props.Get(Property("sampler.type")(typeTable.GetDefaultTag())).Get<string>();
62 int typeIndex = typeTable.GetVal(currentSamplerType);
63 if (ImGui::Combo("Sampler type", &typeIndex, typeTable.GetTagList())) {
64 props.Clear();
65
66 props << Property("sampler.type")(typeTable.GetTag(typeIndex));
67
68 return true;
69 }
70 ImGui::SameLine();
71 ImGui::TextDisabled("(?)");
72 if (ImGui::IsItemHovered())
73 ImGui::SetTooltip("sampler.type");
74
75 //--------------------------------------------------------------------------
76 // RANDOM
77 //--------------------------------------------------------------------------
78
79 if (typeIndex == typeTable.GetVal("RANDOM")) {
80 float fval = props.Get("sampler.random.adaptive.strength").Get<float>();
81 if (ImGui::SliderFloat("Adaptive strength", &fval, 0.f, .95f)) {
82 props.Set(Property("sampler.random.adaptive.strength")(fval));
83 modifiedProps = true;
84 }
85 LuxCoreApp::HelpMarker("sampler.random.adaptive.strength");
86 }
87
88 //--------------------------------------------------------------------------
89 // SOBOL
90 //--------------------------------------------------------------------------
91
92 if (typeIndex == typeTable.GetVal("SOBOL")) {
93 float fval = props.Get("sampler.sobol.adaptive.strength").Get<float>();
94 if (ImGui::SliderFloat("Adaptive strength", &fval, 0.f, .95f)) {
95 props.Set(Property("sampler.sobol.adaptive.strength")(fval));
96 modifiedProps = true;
97 }
98 LuxCoreApp::HelpMarker("sampler.sobol.adaptive.strength");
99 }
100
101 //--------------------------------------------------------------------------
102 // METROPOLIS
103 //--------------------------------------------------------------------------
104
105 if (typeIndex == typeTable.GetVal("METROPOLIS")) {
106 int ival;
107 float fval;
108
109 fval = props.Get("sampler.metropolis.largesteprate").Get<float>();
110 if (ImGui::SliderFloat("Large step rate", &fval, 0.f, 1.f)) {
111 props.Set(Property("sampler.metropolis.largesteprate")(fval));
112 modifiedProps = true;
113 }

Callers

nothing calls this directly

Calls 9

Get<string>Method · 0.80
GetMethod · 0.80
GetDefaultTagMethod · 0.80
GetValMethod · 0.80
GetTagListMethod · 0.80
Get<float>Method · 0.80
SetMethod · 0.80
ClearMethod · 0.45
GetTagMethod · 0.45

Tested by

no test coverage detected