2 #include <Engine/Scene/ItemEntry.hpp>
4 #include <Engine/RadiumEngine.hpp>
6 #include <Engine/Scene/EntityManager.hpp>
7 #include <Engine/Scene/SystemDisplay.hpp>
9 #include <Engine/Rendering/RenderObject.hpp>
10 #include <Engine/Rendering/RenderObjectManager.hpp>
16 std::string getEntryName(
const Engine::RadiumEngine* engine,
const ItemEntry& ent ) {
17 if ( ent.isValid() ) {
18 if ( ent.isRoNode() ) {
19 return engine->getRenderObjectManager()->getRenderObject( ent.m_roIndex )->getName();
21 else if ( ent.isComponentNode() ) {
return ent.m_component->getName(); }
22 else if ( ent.isEntityNode() ) {
return ent.m_entity->getName(); }
24 return "Invalid Entry";
27 std::vector<Ra::Core::Utils::Index> getItemROs(
const Engine::RadiumEngine* ,
28 const ItemEntry& ent ) {
29 std::vector<Ra::Core::Utils::Index> result;
30 if ( ent.isValid() ) {
31 if ( ent.isRoNode() ) { result.push_back( ent.m_roIndex ); }
32 else if ( ent.isComponentNode() ) { result = ent.m_component->m_renderObjects; }
33 else if ( ent.isEntityNode() ) {
34 for (
const auto& c : ent.m_entity->getComponents() ) {
35 result.insert( result.end(), c->m_renderObjects.begin(), c->m_renderObjects.end() );
55 if (
m_entity->getIndex() == SystemEntity::getInstance()->getIndex() ) {
return false; }
60 Rendering::RenderObjectType::UI;
63 Rendering::RenderObjectType::Debug;
64 return ( !( isUI || isDebug ) );
Scene::EntityManager * getEntityManager() const
Rendering::RenderObjectManager * getRenderObjectManager() const
Manager getters.
Ra::Core::Utils::Index m_roIndex
RO index of the represented object.
bool isValid() const
Returns true if the item represents any valid object.
bool isSelectable() const
Returns true if the item can be selected.
void checkConsistency() const
Debug checks.
Entity * m_entity
The entity represented by the item, or owning the object represented.
bool isRoNode() const
Returns true if the item represents a render object.