Clarisse 5.0 SP8 SDK  5.0.5.8.0
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
Classes | Public Types | Public Member Functions | Static Public Member Functions | List of all members
OfSceneDescription Class Reference

Class holding a light description of a scene. Basically, it allows to manipulate all the items of a context without loading all OF items and their modules. It is generated when calling OfContextEngine::get_scene(), which compute the description of all the scene under its context. It can be processed by scene assembly rules. For all items, it is possible to know such information as project or kinematic paths, the name, the OF class, whether the item has been overidden, etc... More...

Classes

struct  Item
 describe an OF item More...
 
struct  Override
 describes an override of an OF item in a scene assembly context More...
 

Public Types

enum  Flag {
  FLAG_NONE = 0,
  FLAG_ISOLATED = 1 << 0,
  FLAG_EXTERNAL = 1 << 1
}
 Give some information about the item in the scene. More...
 
typedef void * ItemId
 the ID to give to the context engine to create the item
 

Public Member Functions

 OfSceneDescription ()
 constructor
 
 ~OfSceneDescription ()
 destructor
 
const CoreOrderedHashTable
< ItemId, Item > & 
get_table () const
 get the list of all item descriptors of the scene
 
Itemget_item (ItemId item_id)
 
const Itemget_item (ItemId item_id) const
 
bool add_item (ItemId key, Item &item)
 add a new item descriptor in the scene
 
void add_items (const OfContextEngine *source_engine, const CoreBasicArray< ItemId > &item_ids, const CoreBasicArray< ItemId > &context_ids, const CoreBasicArray< ItemId > &parent_ids, const CoreBasicArray< CoreString > &item_names, const CoreBasicArray< OfClass * > &item_classes)
 add a list of item descriptors to the scene
 
bool add_of_item (OfItem &of_item, ItemId context_id=NULL_ID, ItemId parent_id=NULL_ID)
 add an OF item already created in the scene
 
void add_override (ItemId item_id, const OfSceneAssemblyContextEngine *override_context)
 flag the item as an override in the scene assembly in the scene
 
void add_override (Item &item, const OfSceneAssemblyContextEngine *override_context)
 flag the item as an override in the scene assembly in the scene
 
void remove_item (ItemId item_id)
 remove an item descriptor from the scene
 
void create_items ()
 create the OF item in the source engine for all items of the scene
 
CoreString get_local_path (const Item &item, const bool &name_include=true) const
 returns the project path of a given item descriptor in the scene
 
CoreString get_local_path (ItemId item, const bool &name_include=true) const
 returns the project path of a given item id in the scene
 
CoreString get_world_path (const Item &item, const bool &name_include=true) const
 returns the kinematic path of a given item descriptor in the scene
 
OfItemget_item_by_path (const CoreString &local_path) const
 returns the source item given a project path in the scene
 
ItemId get_item_key_by_path (const CoreString &local_path) const
 returns the key of the item given a project path in the scene
 
ItemId get_item_key_by_item (const OfItem &of_item) const
 returns the key of the item given an of item
 
void get_all_items_paths (CoreVector< CoreString > &paths) const
 returns the project path of all items in the scene
 
void remove_all ()
 clear the content of all the scene
 
void get_external_items (CoreVector< ItemId > &external_items) const
 
const unsigned int & get_counter () const
 
void set_counter (const unsigned int &new_counter)
 

Static Public Member Functions

static const ItemIdget_null_id ()
 
static const Itemget_null_desc ()
 

Detailed Description

Class holding a light description of a scene. Basically, it allows to manipulate all the items of a context without loading all OF items and their modules. It is generated when calling OfContextEngine::get_scene(), which compute the description of all the scene under its context. It can be processed by scene assembly rules. For all items, it is possible to know such information as project or kinematic paths, the name, the OF class, whether the item has been overidden, etc...

Member Enumeration Documentation

Give some information about the item in the scene.

Enumerator:
FLAG_EXTERNAL 

all the references of the item that are not in the scene must be considered as external references

Member Function Documentation

bool OfSceneDescription::add_item ( ItemId  key,
Item item 
)

add a new item descriptor in the scene

Parameters
keythe id of the item in the engine
itemthe descriptor of the item
Returns
true if the item was really added, false if it fails
void OfSceneDescription::add_items ( const OfContextEngine source_engine,
const CoreBasicArray< ItemId > &  item_ids,
const CoreBasicArray< ItemId > &  context_ids,
const CoreBasicArray< ItemId > &  parent_ids,
const CoreBasicArray< CoreString > &  item_names,
const CoreBasicArray< OfClass * > &  item_classes 
)

add a list of item descriptors to the scene

Parameters
source_enginethe engine in which the items will be created
item_idsthe ids of the items in source_engine
context_idsids of the context for each item, NULL_ID if the context is the root context
parent_idsids of the kinematic parent for each item, NULL_ID if not a scene item or no parent
item_namesnames for each item
item_classesOF class for each item
bool OfSceneDescription::add_of_item ( OfItem of_item,
ItemId  context_id = NULL_ID,
ItemId  parent_id = NULL_ID 
)

add an OF item already created in the scene

Parameters
of_itemthe OF item to add
context_idthe ID of the context in which to add the OF item, if it is not set, the item is considered under the root
parent_idthe ID of the kinematic parent of the item in the scene
Returns
true if the item was correctly inserted, false if the item was already added into the scene
Note
this function is very usefull to call in OfContextEngine::get_scene() for scene assembly contexts generating items
void OfSceneDescription::add_override ( ItemId  item_id,
const OfSceneAssemblyContextEngine override_context 
)

flag the item as an override in the scene assembly in the scene

Parameters
itemthe id of the item on which the override will be applied
override_contextthe engine of the context applying an override on the item
Note
this function must be called in OfContextEngine::get_scene() on all objects that are overidden, otherwise, the objects will be never considered as override items by the scene assembly engine
void OfSceneDescription::add_override ( Item item,
const OfSceneAssemblyContextEngine override_context 
)

flag the item as an override in the scene assembly in the scene

Parameters
itemthe item on which the override will be applied
override_contextthe engine of the context applying an override on the item
Note
this function must be called in OfContextEngine::get_scene() on all objects that are overidden, otherwise, the objects will be never considered as override items by the scene assembly engine
OfItem * OfSceneDescription::get_item_by_path ( const CoreString local_path) const

returns the source item given a project path in the scene

Note
returns nullptr if the there is no item with the given path in the scene
OfSceneDescription::ItemId OfSceneDescription::get_item_key_by_item ( const OfItem of_item) const

returns the key of the item given an of item

Note
returns null_key if the there is no item associated to the given of item in the scene
OfSceneDescription::ItemId OfSceneDescription::get_item_key_by_path ( const CoreString local_path) const

returns the key of the item given a project path in the scene

Note
returns null_key if the there is no item with the given path in the scene
CoreString OfSceneDescription::get_local_path ( const Item item,
const bool &  name_include = true 
) const

returns the project path of a given item descriptor in the scene

Note
returns empty string if the item is not in the scene
CoreString OfSceneDescription::get_local_path ( ItemId  item_id,
const bool &  name_include = true 
) const

returns the project path of a given item id in the scene

Note
returns empty string if the item is not in the scene
CoreString OfSceneDescription::get_world_path ( const Item item,
const bool &  name_include = true 
) const

returns the kinematic path of a given item descriptor in the scene

Note
returns empty string if the item is not in the scene
void OfSceneDescription::remove_item ( ItemId  item_id)

remove an item descriptor from the scene

Parameters
item_idthe id of the item in the engine