This interface defines how to draw this component to property panel.
27 {
29
30 ImGui::Spacing();
31 ImGui::PushStyleVar(ImGuiStyleVar_FramePadding, ImVec2(2.0f, 6.0f));
33
34 ImGuiTreeNodeFlags treeNodeFlags =
35 ImGuiTreeNodeFlags_DefaultOpen |
36 ImGuiTreeNodeFlags_AllowItemOverlap |
37 ImGuiTreeNodeFlags_Framed |
38 ImGuiTreeNodeFlags_FramePadding ;
39
40
41 {
43
44 ImGui::PushStyleColor(ImGuiCol_Header, ImVec4(0.196f, 0.204f, 0.2f, 1.0f));
45 ImGui::PushStyleColor(ImGuiCol_HeaderHovered, ImVec4(0.164f, 0.18f, 0.184f, 1.0f));
46 ImGui::PushStyleColor(ImGuiCol_HeaderActive, ImVec4(0.164f, 0.18f, 0.184f, 1.0f));
47 ImGui::PushStyleColor(ImGuiCol_WindowBg, ImVec4(0.196f, 0.204f, 0.2f, 1.0f));
48
49 if(ImGui::TreeNodeEx("Geometries", treeNodeFlags))
50 {
51 for (uint64_t i = 0; i <
m_Mesh->GetPacks().size(); i++)
52 {
53 {
55
56 std::stringstream ss;
57 ss << "MeshPack [" << i << "]";
58 if(ImGui::TreeNodeEx(ss.str().c_str(), treeNodeFlags | ImGuiTreeNodeFlags_Bullet))
59 {
60 ImGui::PushStyleVar(ImGuiStyleVar_FramePadding, ImVec2(2.0f, 2.0f));
63
64 {
66
67 ImGui::Spacing();
68 ImGui::PushID("Geometries");
69 ImGui::Columns(2, 0, false);
70
71 ImGui::SetColumnWidth(0, columnWidth);
72 ImGui::ColorButton("##", ImVec4(1.0f, 0.0f, 0.0f, 0.0f), 0, ImVec2(imageIconSize, imageIconSize));
73 ImGui::NextColumn();
74
75 ImGui::BeginGroup();
76
78
79 {
81
82 std::stringstream ss0;
83 ss0 << "/World/MeshComponent/Mesh/" << ss.str();
86 char buffer0[256] = {};
88 ImGui::InputTextWithHint(
"##_0",
ICON_TEXT_ROW(
" ", ss0.str().c_str()), buffer0,
sizeof(buffer0));
89 ImGui::PopItemWidth();
90 }
91
92 {
94
95 std::stringstream ss1;
96 ss1 << "/World/MeshComponent/" << ss.str();
97 char buffer1[256] = {};
99 ImGui::InputTextWithHint(
"##_2",
ICON_TEXT_ROW(
" ", ss1.str().c_str()), buffer1,
sizeof(buffer1));
100 ImGui::PopItemWidth();
101 }
102
103 {
105
106 auto meshPack = *
m_Mesh->GetPacks().find_value(
static_cast<uint32_t
>(i));
107 std::string type = meshPack->GetPackType();
110 char buffer2[256] = {};
112 ImGui::InputTextWithHint(
"##_1",
ICON_TEXT_ROW(
" ", type.c_str()), buffer2,
sizeof(buffer2));
113 ImGui::PopItemWidth();
114 }
115 ImGui::EndGroup();
116
117 ImGui::Columns(1);
118 ImGui::PopID();
119 ImGui::Spacing();
120 ImGui::Separator();
121 }
122
123 ImGui::Spacing();
124
125 {
127
129 static bool isCastShadow = true;
131 ImGui::SameLine();
132 ImGui::PushItemWidth(100.0f);
133 ImGui::SeparatorText("##");
134 ImGui::PopItemWidth();
135 ImGui::SameLine(ImGui::GetContentRegionAvail().x - seperatorWidthS);
137 {
138 isCastShadow = true;
140 }
141 });
142 }
143
144 {
146
148 static bool isVisible = true;
150 ImGui::SameLine();
151 ImGui::SeparatorText("##");
152 ImGui::SameLine(ImGui::GetContentRegionAvail().x - seperatorWidthS);
154 {
155 isVisible = true;
157 }
158 });
159 }
160
161 ImGui::Spacing();
162
163 ImGui::PopStyleVar();
164 ImGui::TreePop();
165 }
166 }
167
168
169 }
170
171 ImGui::TreePop();
172 }
173
174 ImGui::PopStyleColor(4);
175 }
176
177 {
179
180 ImGui::PushStyleColor(ImGuiCol_Header, ImVec4(0.196f, 0.204f, 0.2f, 1.0f));
181 ImGui::PushStyleColor(ImGuiCol_HeaderHovered, ImVec4(0.164f, 0.18f, 0.184f, 1.0f));
182 ImGui::PushStyleColor(ImGuiCol_HeaderActive, ImVec4(0.164f, 0.18f, 0.184f, 1.0f));
183 ImGui::PushStyleColor(ImGuiCol_WindowBg, ImVec4(0.196f, 0.204f, 0.2f, 1.0f));
184
185 if(ImGui::TreeNodeEx("Materials", treeNodeFlags))
186 {
187 for (uint64_t i = 0; i <
m_Mesh->GetPacks().size(); i++)
188 {
189 {
191
192 std::stringstream ss;
193 ss << "Materials [" << i << "]";
194 if(ImGui::TreeNodeEx(ss.str().c_str(), treeNodeFlags | ImGuiTreeNodeFlags_Bullet))
195 {
196 ImGui::PushStyleVar(ImGuiStyleVar_FramePadding, ImVec2(2.0f, 2.0f));
199
200 {
202
203 ImGui::Spacing();
204 ImGui::PushID("Materials");
205 ImGui::Columns(2, 0, false);
206
207 ImGui::SetColumnWidth(0, columnWidth);
208 if(ImGui::ColorButton("##", ImVec4(0.0f, 1.0f, 0.0f, 0.0f), 0, ImVec2(imageIconSize, imageIconSize)))
209 {
211 }
212 ImGui::NextColumn();
213
214 ImGui::BeginGroup();
215
217
218 {
220
221 std::stringstream ss0;
222 ss0 << "/World/MeshComponent/Mesh/" << ss.str();
225 char buffer0[256] = {};
227 ImGui::InputTextWithHint(
"##_0",
ICON_TEXT_ROW(
" ", ss0.str().c_str()), buffer0,
sizeof(buffer0));
228 ImGui::PopItemWidth();
229 }
230
231 {
233
234 char buffer1[256] = {};
236 auto meshPack = *
m_Mesh->GetPacks().find_value(
static_cast<uint32_t
>(i));
237 ImGui::InputTextWithHint(
"##_2",
ICON_TEXT_ROW(
" ", meshPack->GetMaterial()->GetName().c_str()), buffer1,
sizeof(buffer1));
238 ImGui::PopItemWidth();
239 }
240
241 {
243
246 char buffer2[256] = {};
248 ImGui::InputTextWithHint(
"##_1",
ICON_TEXT_ROW(
" ",
"PathTracing Material"), buffer2,
sizeof(buffer2));
249 ImGui::PopItemWidth();
250 }
251 ImGui::EndGroup();
252
253 ImGui::Columns(1);
254 ImGui::PopID();
255 ImGui::Spacing();
256 }
257
258 ImGui::PopStyleVar();
259 ImGui::TreePop();
260 }
261 }
262 }
263
264 ImGui::TreePop();
265 }
266
267 ImGui::PopStyleColor(4);
268 }
269
270 ImGui::PopStyleVar();
271 ImGui::Spacing();
272 }
#define ICON_TEXT_ROW(icon, text)
#define SPICES_PROFILE_ZONEN(...)
#define SPICES_PROFILE_ZONE
uint32_t m_PickMaterial
Identify of selected material.
static FrameInfo & Get()
Get FrameInfo.
std::shared_ptr< World > m_World
The shared pointer of specific world.
static ImVec2 GetLineItemSize()
Get Line Width's Square Size.
static bool DrawResetIcon(const bool &isMove)
Draw Reset Icon.
static void DrawPropertyItem(const std::string &itemName, float columeWidth, std::function< void()> nameFunc, std::function< void()> valFunc)
Draw a single property.
static void Checkbox(bool *isChecked)
ImGuiHelper Style Checkbox.
std::shared_ptr< Mesh > m_Mesh
The Mesh this component handled.
void CenteredText(const char *label, const ImVec2 &size_arg)
Draw a center text.