MCPcopy Create free account
hub / github.com/Illation/ETEngine / RefillTreeView

Method RefillTreeView

Engine/source/EtEditor/Tools/Outliner.cpp:205–227  ·  view source on GitHub ↗

-------------------------- Outliner::RefillTreeView Initialize the outliners tree from the Entity hierachy in the current scenes scene graph

Source from the content-addressed store, hash-verified

203// Initialize the outliners tree from the Entity hierachy in the current scenes scene graph
204//
205void Outliner::RefillTreeView()
206{
207 ET_ASSERT(fw::UnifiedScene::Instance().GetSceneId() != 0u);
208 fw::EcsController& ecs = fw::UnifiedScene::Instance().GetEcs();
209
210 Gtk::TreeModel::Row row = *(m_TreeModel->append());
211 row[m_Columns.m_Name] = fw::UnifiedScene::Instance().GetSceneId().ToStringDbg();
212 row[m_Columns.m_Id] = fw::INVALID_ENTITY_ID;
213
214 for (fw::T_EntityId const id : ecs.GetEntities())
215 {
216 // #todo: make this recurse
217 ET_ASSERT(ecs.HasComponent<EditorMetaComponent>(id));
218 EditorMetaComponent const& meta = ecs.GetComponent<EditorMetaComponent>(id);
219
220 Gtk::TreeModel::iterator iter = m_TreeModel->append(row.children());
221 (*iter)[m_Columns.m_Name] = meta.name;
222 (*iter)[m_Columns.m_Id] = id;
223 }
224
225 m_TreeView->show_all_children();
226 m_TreeView->expand_all();
227}
228
229//--------------------------
230// Outliner::RecursiveGetChild

Callers

nothing calls this directly

Calls 2

GetSceneIdMethod · 0.80
ToStringDbgMethod · 0.80

Tested by

no test coverage detected