igor::iEntityScene Class Reference

#include <iEntityScene.h>

Public Member Functions

 iEntityScene (const iaString &name)
 
 ~iEntityScene ()
 
void setName (const iaString &name)
 
const iaStringgetName () const
 
iEntityPtr createEntity (const iaString &name="", const iEntityID &id=iEntityID::getInvalid())
 
iEntityPtr createEntity (iEntityPtr srcEntity, bool copyID=false)
 
iEntityPtr getEntity (iEntityID entityID)
 
iEntityPtr getRootEntity () const
 
std::vector< iEntityPtrgetCameras () const
 
iEntityPtr getActiveCamera () const
 
void destroyEntity (iEntityPtr entity)
 
void destroyEntity (iEntityID entityID)
 
const iEntitySceneIDgetID () const
 
void initializeQuadtree (const iaRectangled &rect, const uint32 splitThreshold=4, const uint32 maxDepth=16)
 
iQuadtreedgetQuadtree () const
 
bool hasQuadtree () const
 
void initializeOctree (const iAACubed &cube, const uint32 splitThreshold=8, const uint32 maxDepth=16)
 
iOctreedgetOctree () const
 
bool hasOctree () const
 
void addSystem (const iaString &systemName)
 
void removeSystem (const iaString &systemName)
 
const std::vector< iaStringgetSystems ()
 
void clear ()
 
const std::vector< iEntityPtrgetEntities ()
 
void setSelection (const std::vector< iEntityID > &selection)
 
const std::vector< iEntityID > & getSelection () const
 
void clearSelection ()
 
iEntitySelectionChangedEvent & getEntitySelectionChangedEvent ()
 
void cut ()
 
void copy ()
 
void paste ()
 
void duplicate ()
 

Static Public Member Functions

static void cut (const iEntitySceneID &sceneID, const std::vector< iEntityID > &entities)
 
static void copy (const iEntitySceneID &sceneID, const std::vector< iEntityID > &entities)
 
static void paste (const iEntitySceneID &sceneID, const iEntityID &entityID)
 
static void duplicate (const iEntitySceneID &sceneID, const std::vector< iEntityID > &entities)
 

Friends

class iEntitySystemModule
 
class iEntity
 
class iView
 
class iEntityTraverser
 
class iPrefabIO
 

Detailed Description

entity scene

Constructor & Destructor Documentation

◆ iEntityScene()

igor::iEntityScene::iEntityScene ( const iaString name)

ctor

Parameters
namethe name of the scene

◆ ~iEntityScene()

igor::iEntityScene::~iEntityScene ( )

dtor clean up

Member Function Documentation

◆ addSystem()

void igor::iEntityScene::addSystem ( const iaString systemName)

add system

Parameters
systemNamethe system to add

◆ clear()

void igor::iEntityScene::clear ( )

empty out scene

◆ clearSelection()

void igor::iEntityScene::clearSelection ( )

clears current selection

◆ copy() [1/2]

void igor::iEntityScene::copy ( )

copy selected entities

◆ copy() [2/2]

void igor::iEntityScene::copy ( const iEntitySceneID sceneID,
const std::vector< iEntityID > &  entities 
)
static

copy given entities

assumes entities match given scene

Parameters
sceneIDthe given scene
entitiesthe given entities

◆ createEntity() [1/2]

iEntityPtr igor::iEntityScene::createEntity ( const iaString name = "",
const iEntityID id = iEntityID::getInvalid() 
)

creates an entity, adds it to this scene and returns it

ownership stays with the scene

Parameters
namethe name of this entity
idoptional id to override the generated one
Returns
newly created entity

◆ createEntity() [2/2]

iEntityPtr igor::iEntityScene::createEntity ( iEntityPtr  srcEntity,
bool  copyID = false 
)

create entity from existing one

Parameters
srcEntitythe source entity to create a copy from
copyIDif true also copy the ID of the original entity else generate a new id
Returns
newly created entity

◆ cut() [1/2]

void igor::iEntityScene::cut ( )

cut selected entities

◆ cut() [2/2]

void igor::iEntityScene::cut ( const iEntitySceneID sceneID,
const std::vector< iEntityID > &  entities 
)
static

cut given entities

assumes entities match given scene

Parameters
sceneIDthe given scene
entitiesthe given entities

◆ destroyEntity() [1/2]

void igor::iEntityScene::destroyEntity ( iEntityID  entityID)

destroys given entity by id

Parameters
entityIDthe given entity id

◆ destroyEntity() [2/2]

void igor::iEntityScene::destroyEntity ( iEntityPtr  entity)

destroys given entity

Parameters
entitythe given entity

◆ duplicate() [1/2]

void igor::iEntityScene::duplicate ( )

duplicate selected entities

◆ duplicate() [2/2]

void igor::iEntityScene::duplicate ( const iEntitySceneID sceneID,
const std::vector< iEntityID > &  entities 
)
static

duplicate given entities from given scene

assumes entities match given scene

Parameters
sceneIDthe given scene
entitiesthe given entities

◆ getActiveCamera()

iEntityPtr igor::iEntityScene::getActiveCamera ( ) const
Returns
active camera

◆ getCameras()

std::vector< iEntityPtr > igor::iEntityScene::getCameras ( ) const
Returns
all entities with camera component

only if iCameraSystem was added to this scene

◆ getEntities()

const std::vector< iEntityPtr > igor::iEntityScene::getEntities ( )
Returns
all entities ordered by name

This is slow. Don't use it unless you really have to

◆ getEntity()

iEntityPtr igor::iEntityScene::getEntity ( iEntityID  entityID)
Returns
entity for given entity ID. zero if not found
Parameters
entityIDthe given entity ID

◆ getEntitySelectionChangedEvent()

iEntitySelectionChangedEvent & igor::iEntityScene::getEntitySelectionChangedEvent ( )
Returns
entity selection change event

◆ getID()

const iEntitySceneID & igor::iEntityScene::getID ( ) const
Returns
entity scene id

◆ getName()

const iaString & igor::iEntityScene::getName ( ) const
Returns
name of the scene

◆ getOctree()

iOctreed & igor::iEntityScene::getOctree ( ) const
Returns
internal octree

◆ getQuadtree()

iQuadtreed & igor::iEntityScene::getQuadtree ( ) const
Returns
internal quadtree

◆ getRootEntity()

iEntityPtr igor::iEntityScene::getRootEntity ( ) const
Returns
the root entity

◆ getSelection()

const std::vector< iEntityID > & igor::iEntityScene::getSelection ( ) const
Returns
selected entities

◆ getSystems()

const std::vector< iaString > igor::iEntityScene::getSystems ( )
Returns
list of systems running on this scene

◆ hasOctree()

bool igor::iEntityScene::hasOctree ( ) const
Returns
true if octree present

◆ hasQuadtree()

bool igor::iEntityScene::hasQuadtree ( ) const
Returns
true if quadtree present

◆ initializeOctree()

void igor::iEntityScene::initializeOctree ( const iAACubed cube,
const uint32  splitThreshold = 8,
const uint32  maxDepth = 16 
)

initialize octree which makes it available for use

Parameters
cubevolume of the whole octree
splitThresholdthreshold count of objects on a node before splitting the node
maxDepththe maximum depth of the tree

◆ initializeQuadtree()

void igor::iEntityScene::initializeQuadtree ( const iaRectangled rect,
const uint32  splitThreshold = 4,
const uint32  maxDepth = 16 
)

initialize quadtree which makes it available for use

Parameters
rectarea of the whole quadtree
splitThresholdthreshold count of objects on a node before splitting the node
maxDepththe maximum depth of the tree

◆ paste() [1/2]

void igor::iEntityScene::paste ( )

copy selected entities

◆ paste() [2/2]

void igor::iEntityScene::paste ( const iEntitySceneID sceneID,
const iEntityID entityID 
)
static

paste clipboard to given scene and entity

assumes entity matches given scene

Parameters
sceneIDthe given scene
entityIDthe given entity

◆ removeSystem()

void igor::iEntityScene::removeSystem ( const iaString systemName)

remove system

Parameters
systemNamethe system to remove

◆ setName()

void igor::iEntityScene::setName ( const iaString name)

sets name of scene

Parameters
namethe name of the scene

◆ setSelection()

void igor::iEntityScene::setSelection ( const std::vector< iEntityID > &  selection)

sets selection on this scene

Parameters
selectionthe entity IDs to select

Friends And Related Function Documentation

◆ iEntity

friend class iEntity
friend

◆ iEntitySystemModule

friend class iEntitySystemModule
friend

◆ iEntityTraverser

friend class iEntityTraverser
friend

◆ iPrefabIO

friend class iPrefabIO
friend

◆ iView

friend class iView
friend

The documentation for this class was generated from the following files: