Clarisse 4.0 SP16 SDK  4.0.5.16.0
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
Classes | Public Member Functions | Static Public Member Functions | Friends | List of all members
OfContext Class Reference

Contexts are similar to folders and allows to store and organize project objects. More...

Inheritance diagram for OfContext:
OfItem EventObject CoreCustomData CoreBaseObject CoreBaseType

Classes

struct  CAMInfo
 

Public Member Functions

virtual const CoreStringget_full_name () const
 return the full name (the full path from the root) of this context
 
void rename (const CoreString &name)
 change the name of this context
 
void propagate_rename_event (const CoreString &old_name)
 
OfContextget_parent () const
 return the parent context of this context
 
bool is_child_of (const OfContext &context, const bool &follow_instances=false) const
 return true if this context is a child (or grandchild...) of the given context
 
bool is_root () const
 return true if this context is the factory's root context
 
void set_parent (OfContext &parent)
 move this context inside the specified context
 
OfContextget_source () const
 return the instancing source of this context
 
virtual bool is_instance () const
 return true if this context is an instance
 
virtual bool is_source () const
 return true if this context is an instancing source
 
bool is_empty () const
 return true if this context is empty (it contains no sub-context, no object)
 
void set_read_only (const bool &value)
 
void set_user_locked (const bool &value)
 
void set_remote (const bool &value)
 
bool is_content_locked () const
 
bool is_writable () const
 returns true if all conditions are valid to write into the context, false otherwise
 
void copy_content_from (const OfContext &source, const bool &recursive=false, const bool &clear_content=true)
 Copies the content of specified source context to this context, the method will clear the content of this context before start copying.
 
void copy_content_to (const CoreBasicArray< OfContext * > &target_contexts, const bool &recursive=false, const bool &clear_content=true) const
 
OfItemadd_copy (const OfItem &source)
 create a copy of the specified item in the current context
 
OfObjectadd_copy (const OfObject &source)
 create a copy of the specified object in the current context
 
OfContextadd_copy (const OfContext &source)
 create a copy of the specified context in the current context
 
CoreString get_item_path (const OfItem &item) const
 return the path of the given item relative to this context
 
CoreString get_object_path (const OfObject &object) const
 return the path of the given object relative to this context
 
CoreString get_context_path (const OfContext &context) const
 return the path of the given context relative to this context
 
void get_object_path (const OfObject &object, CoreVector< OfContext * > &path) const
 return the vector of contexts from the given object to this context
 
OfContextadd_context (const CoreString &name, const CoreClassInfo *engine=0)
 add a sub-context to this context
 
OfContextadd_context (const CoreString &name, const CoreString &engine_name)
 add a sub-context to this context
 
OfContextadd_instance (OfContext &source, const CoreString &name="")
 instanciate the specified context into this context
 
OfItemadd_instance (OfItem &source, const CoreString &name="")
 instanciate the specified item into this context
 
void remove_context (OfContext &context)
 remove a sub-context from this context
 
void remove_context (const CoreString &name)
 remove a sub-context from this context
 
void remove_context (const unsigned int &index)
 remove a sub-context from this context
 
void remove_all_contexts ()
 remove all sub-contexts from this context
 
void remove_all_contexts (const bool remove_default)
 
OfItemget_item (const CoreString &name) const
 return an item by specifying its path
 
OfItemitem_exists (const CoreString &name) const
 return an item by specifying its path
 
OfItemget_item (const unsigned int index) const
 return an item by specifying its index
 
unsigned int find_item_index (const OfItem *item) const
 retrieve the item index in the context
 
OfItemfind_item_neighbour (const OfItem *item, const bool previous_neighbour=true) const
 retrieve the neighbour of the item in the context
 
void move_item_index (const unsigned int old_index, const unsigned int new_index)
 modify item position in the context from specified source index to target index
 
void move_item_indices (const CoreBasicArray< OfItem * > &items, const OfItem *tgt_item, const bool add_after=true)
 move specified items index to AFTER the target item position
 
unsigned int get_context_count (const CoreBitFieldHelper &flags=OfItem::enabled_flags_mask) const
 return the number of sub-contexts inside this context
 
unsigned int get_all_contexts_count (const CoreBitFieldHelper &flags=OfItem::enabled_flags_mask) const
 return the total number of sub-contexts recursively
 
const OfContextget_context (const unsigned &index, const CoreBitFieldHelper &flags=OfItem::enabled_flags_mask) const
 return the sub-context at the given index
 
OfContextget_context (const unsigned &index, const CoreBitFieldHelper &flags=OfItem::enabled_flags_mask)
 return the sub-context at the given index
 
const OfContextget_context (const CoreString &name) const
 return the sub-context by name
 
OfContextget_context (const CoreString &name)
 return the sub-context by name
 
OfContextcontext_exists (const CoreString &name) const
 return the sub-context by name
 
void get_contexts (CoreArray< OfContext * > &contexts, const CoreBitFieldHelper &flags=OfItem::enabled_flags_mask) const
 
OfObjectadd_generic_object (const CoreString &object_name, const int &object_flags=OfObject::FLAG_NONE)
 add a generic object (object of class "Generic") in this context
 
OfObjectadd_object (const CoreString &object_name, const CoreString &class_name, const int &flags=OfObject::FLAG_NONE, const OfItem::State &output_state=OfItem::STATE_LIVE)
 add an object of the specified class in this context
 
OfObjectadd_instance (const OfObject &source, const CoreString &name="", const int &flags=OfObject::FLAG_NONE, const OfItem::State &output_state=OfItem::STATE_LIVE)
 add an instance of the given source object
 
void resolve_contexts (CoreSet< OfContext * > &contexts, const CoreBitFieldHelper &flags=OfItem::enabled_flags_mask) const
 Get all the reachable contexts from this, resolving context instances to avoid multiple occurences.
 
void resolve_all_contexts (CoreSet< OfContext * > &contexts, const CoreBitFieldHelper &flags=OfItem::enabled_flags_mask) const
 Get all the reachable contexts from this (recursively or not), resolving context instances to avoid infinite recursion.
 
OfObjectget_object (const CoreString &object_name) const
 return an object by specifying its name
 
OfObjectobject_exists (const CoreString &object_name) const
 return an object by specifying its name
 
unsigned int get_object_count (const CoreBitFieldHelper &flags=OfItem::enabled_flags_mask) const
 return the number of objects inside this context
 
unsigned int get_all_objects_count (const CoreBitFieldHelper &flags=OfItem::enabled_flags_mask) const
 return the total number of objects inside this context (recursively)
 
void remove_object (const CoreString &object_name, const bool &remove_static=false)
 remove the specified object from this context
 
void remove_object (OfObject &object, const bool &remove_static=false)
 remove the specified object from this context
 
void remove_all_objects ()
 remove all the objects of this context
 
CoreString get_attribute_path (const OfAttr &attr) const
 return the path of the given attribute relative this the context
 
void clear ()
 
void rename_object (OfObject &object, const CoreString &new_name)
 
void rename_object (const CoreString &object, const CoreString &new_name)
 change the name of the specified object
 
virtual OfAttradd_attribute (const OfItem::AttrCreationParams &params)
 
virtual OfAttradd_attribute (const CoreString &attr, const OfAttr::Type &type, const OfAttr::Container &container=OfAttr::CONTAINER_SINGLE, const OfAttr::VisualHint &visual_hint=OfAttr::VISUAL_HINT_DEFAULT, const CoreString &group_name="general")
 add an attribute to the object
 
const OfAttrget_attribute (const CoreString &attr) const
 find an attribute by specifying its name
 
OfAttrget_attribute (const CoreString &attr)
 find an attribute by specifying its name
 
const OfAttrget_attribute (const unsigned int &index) const
 return the attribute at the given index
 
OfAttrget_attribute (const unsigned int &index)
 return the attribute at the given index
 
const OfAttrattribute_exists (const CoreString &attr) const
 tell whether an attribute exists by specifying its name
 
OfAttrattribute_exists (const CoreString &attr)
 tell whether an attribute exists by specifying its name
 
const unsigned int & get_attribute_count () const
 return the total number of attribute in the object
 
virtual const unsigned int find_attribute_index (const CoreString &attr_name) const
 returns the index of the attribute in the object if attribute found, -1 otherwise
 
virtual const unsigned int find_attribute_index (const OfAttr &attr) const
 returns the index of the attribute in the object if attribute found, -1 otherwise
 
virtual unsigned int set_attribute_index (const OfAttr &attr, const unsigned int &new_index)
 modifies the index of the specified attribute
 
void remove_all_attributes ()
 
void remove_attribute (const CoreString &name)
 
void remove_attribute (OfAttr &attr)
 
void reset_attributes ()
 reset the values of class attributes as if the object was just created
 
bool add_cam (const CoreString &cam_name, const CoreString &rule, const bool &builtin=false)
 defines a context attribute as a CAM by specifying its name and filtering rule
 
bool add_cam (const CoreString &cam_name, const CoreString &rule, const CoreString &exclusion_rule, const bool &builtin=false)
 defines a context attribute as a CAM by specifying its name and filtering rule
 
unsigned int find_cam (const CoreString &cam_name) const
 retrieves the index of the CAM specifying attribute name
 
unsigned int find_cam (const OfAttr *custom_attr) const
 retrieves the index of the CAM specifying the attribute itself
 
void remove_cam (const unsigned int &index, const bool remove_attr=true)
 removes a CAM specifying its index
 
void remove_cam (const OfAttr *custom_attr, const bool remove_attr=true)
 removes a CAM specifying attribute itself
 
void retarget_cam (const unsigned int &index, const CoreString &rule)
 modifies the rule of the CAM
 
void retarget_cam (const OfAttr *custom_attr, const CoreString &rule)
 modifies the rule of the CAM
 
void retarget_cam (const unsigned int &index, const CoreString &rule, const CoreString &exclusion_rule)
 modifies the rule of the CAM
 
void retarget_cam (const OfAttr *custom_attr, const CoreString &rule, const CoreString &exclusion_rule)
 modifies the rule of the CAM
 
void untarget_cam (const unsigned int &index)
 detaches the CAM custom attribute from overridden attributes
 
void untarget_cam (const OfAttr *custom_attr)
 detaches the CAM custom attribute from overridden attributes
 
void remove_all_cams (const bool remove_attr=true)
 remove alls CAM from this context
 
void disable_cam (const unsigned int &index, const bool &disabled)
 Sets the CAM as disabled (not applied)
 
bool is_cam_disabled (const unsigned int &index) const
 Gets the CAM disabled state.
 
void set_cam_builtin (const unsigned int &index, const bool &is_builtin)
 Sets the CAM as builting (cannot be removed, nor definition edited)
 
bool is_cam_builtin (const unsigned int &index) const
 Gets the CAM builtin state.
 
unsigned int get_cam_count () const
 
CoreString get_cam_rule (const unsigned int &index) const
 
CoreString get_cam_exclusion_rule (const unsigned int &index) const
 
const OfAttrget_cam_attribute (const unsigned int &index) const
 
OfObjectcreate_empty_CAM_set ()
 
bool create_CAM_set (OfObject &target_cam_set)
 
bool load_CAM_set (const OfObject &target_cam_set)
 
OfAttrfind_attribute (const CoreString &path) const
 
OfAttrfind_attribute (const CoreString &path, unsigned int &value_index) const
 
OfAttrfind_attribute (const CoreString &path, bool &index_specified, unsigned int &value_index) const
 
unsigned int find_attributes (CoreVector< OfAttr * > &attrs, const CoreString &name, const CoreString &class_name) const
 
OfOutputfind_output_plug (const CoreString &path, unsigned int &plug_index) const
 
void get_objects (const CoreString &class_name, CoreArray< OfObject * > &objects, const int &mask, const bool &inclusive) const
 
void get_all_objects (const CoreString &class_name, CoreArray< OfObject * > &objects, const int &mask, const bool &inclusive) const
 
void get_all_objects (const CoreBasicArray< CoreString > &class_names, CoreArray< OfObject * > &objects, const int &mask, const bool &inclusive) const
 
void get_all_objects (const CoreString &class_name, CoreSet< OfObject * > &objects, const int &mask, const bool &inclusive) const
 
void get_all_objects (const CoreBasicArray< CoreString > &class_names, CoreSet< OfObject * > &objects, const int &mask, const bool &inclusive) const
 
void get_objects (const CoreString &class_name, CoreArray< OfObject * > &objects, const CoreBitFieldHelper &flags=OfItem::enabled_but_private_flags_mask) const
 
void get_objects (const CoreBasicArray< CoreString > &class_names, CoreArray< OfObject * > &objects, const CoreBitFieldHelper &flags=OfItem::enabled_but_private_flags_mask) const
 
void get_objects (CoreArray< OfObject * > &objects, const CoreBitFieldHelper &flags=OfItem::enabled_flags_mask) const
 gather all the objects contained in this context (not recursively)
 
void get_items (CoreVector< OfItem * > &items, const CoreBitFieldHelper &flags=OfItem::enabled_flags_mask) const
 
void get_all_objects (const CoreString &class_name, CoreArray< OfObject * > &objects, const CoreBitFieldHelper &flags=OfItem::enabled_but_private_flags_mask, const bool &consider_embedded=false) const
 gather all the objects matching the given criteria recursively
 
void get_all_objects (const CoreBasicArray< CoreString > &class_names, CoreArray< OfObject * > &objects, const CoreBitFieldHelper &flags=OfItem::enabled_but_private_flags_mask, const bool &consider_embedded=false) const
 gather all the objects matching the given criteria recursively
 
void get_all_objects (const CoreString &class_name, CoreSet< OfObject * > &objects, const CoreBitFieldHelper &flags, const bool &consider_embedded=false) const
 gather all the objects matching the given criteria contained in this context not recursively
 
void get_all_objects (const CoreBasicArray< CoreString > &class_names, CoreSet< OfObject * > &objects, const CoreBitFieldHelper &flags, const bool &consider_embedded=false) const
 gather all the objects matching the given criteria recursively
 
void get_all_objects (CoreArray< OfObject * > &objects, const CoreBitFieldHelper &flags=OfItem::enabled_flags_mask, const bool &consider_embedded=false) const
 gather all the objects recursively
 
void get_all_objects (CoreSet< OfObject * > &objects, const CoreBitFieldHelper &flags=OfItem::enabled_flags_mask, const bool &consider_embedded=false) const
 gather all the objects recursively
 
void get_all_items (CoreVector< OfItem * > &items, const CoreBitFieldHelper &flags=OfItem::enabled_flags_mask) const
 gather all items (objects and contexts) of this context
 
void get_all_instances (CoreVector< OfContext * > &instances, const bool &recursive=false, const CoreBitFieldHelper &flags=OfItem::enabled_flags_mask) const
 gather all instances of the context and sub-instances if recursive flag is set
 
unsigned int get_instance_count (const CoreBitFieldHelper &flags=OfItem::enabled_flags_mask) const
 return the number of instances of this context
 
OfContextget_instance (const unsigned int &index, const CoreBitFieldHelper &flags=OfItem::enabled_flags_mask) const
 
OfItemget_last_event_item () const
 
OfObjectget_last_event_object () const
 
OfContextget_last_event_context () const
 
OfContextadd_pending_context (const CoreString &name)
 
OfContextadd_pending_context2 (const CoreString &ctx_path)
 
OfObjectadd_pending_object (const CoreString &object_name, const CoreString &class_name)
 
virtual CoreString get_as_string (const OfSerialOptions &options=OfSerialOptions::get_default()) const
 return the serialization of the context
 
ParserEntryserialize (const OfSerialOptions &options=OfSerialOptions::get_default(), AppProgressBar *progress_bar=0) const
 return a serialization of this context
 
bool deserialize (const ParserEntry &serial, const OfSerialOptions &options=OfSerialOptions::get_default(), AppProgressBar *progress_bar=0)
 deserialize the given serialization into this context
 
OfObjectadd_object (const ParserEntry &entry, const OfSerialOptions &options=OfSerialOptions::get_default(), const int &flags=OfObject::FLAG_NONE)
 add an object by specifying its serialization
 
OfObjectadd_embedded_object (OfObject &parent_object, ParserEntry &entry, const OfSerialOptions &options=OfSerialOptions::get_default())
 
OfContextadd_context (const ParserEntry &serial, const OfSerialOptions &options=OfSerialOptions::get_default())
 add a sub-context to this context and sets its content from the specified serialization
 
OfItempaste_item (const ParserEntry &serial, const OfSerialOptions &options=OfSerialOptions::get_default())
 paste an item by specifying its serialization
 
OfContextpaste_context (const ParserEntry &serial, const OfSerialOptions &options=OfSerialOptions::get_default())
 paste a context by specifying its serialization
 
OfObjectpaste_object (const ParserEntry &serial, const OfSerialOptions &options=OfSerialOptions::get_default())
 paste an object by specifying its serialization
 
void paste_items (const CoreBasicArray< ParserEntry * > &entries, CoreVector< OfItem * > &created_items, const OfSerialOptions &options=OfSerialOptions::get_default())
 
OfAttrdeserialize_cam (const ParserEntry &entry)
 
bool serialize_cams (ParserGroup &into_group) const
 
void deserialize_cams (ParserGroup &cam_group, CoreVector< OfAttr * > &added_cams)
 
void protect (const bool &enable) const
 tag the context to whether it is in use (for rendering for example)
 
bool is_protected () const
 return true if the context is in use (for rendering for example)
 
const bool & is_object () const
 
const bool & is_context () const
 
const OfObjectto_object () const
 
OfObjectto_object ()
 
const OfContextto_context () const
 
OfContextto_context ()
 
unsigned int get_level () const
 return how deep (the level) of this context
 
bool import_project (const CoreString &filename, const OfSerialOptions::Mode &serial_mode, const OfImportOptions::VariableMode &variable_mode, const OfImportOptions::AovMode &aov_mode, CoreVector< OfItem * > &items)
 import the items of a project into this context
 
void export_project (const CoreString &filename) const
 save all items of this context as a project
 
OfContextreference_file (const CoreString &filename, const OfImportOptions::VariableMode &import_variable_mode=OfImportOptions::VARIABLE_MODE_APPEND, const OfImportOptions::AovMode &import_aov_mode=OfImportOptions::AOV_MODE_IMPORT)
 reference an external project importing all items into this context
 
bool is_reference () const
 return true if this context references an external project
 
bool is_override () const
 
void get_external_dependencies (CoreSet< OfItem * > &external_refs, CoreSet< OfItem * > &external_srcs) const
 
void get_external_dependencies (CoreHashTable< OfItem *, CoreSet< OfItem * > > &external_refs, CoreHashTable< OfItem *, CoreSet< OfItem * > > &external_srcs) const
 get_external_dependencies
 
void get_statistics (SysStatistic &stats) const
 
OfContextEngineget_engine ()
 
const OfContextEngineget_engine () const
 
void set_engine (const CoreClassInfo &engine_info, ParserGroup *engine_settings=0)
 
void set_engine (const CoreString &engine_name, ParserGroup *engine_settings=0)
 
int get_protected_object_count () const
 
const bool & is_import_point () const
 Returns true if this context is an import point of a project or a reference.
 
void set_import_point (const bool &flag)
 Set this context as import point.
 
virtual const GuiIconget_item_icon () const
 Item icon get accessor.
 
virtual void set_disabled (const bool &value)
 
virtual void set_parent_disabled (const bool &value)
 
virtual void set_source_disabled (const bool &value)
 
bool options_exists () const
 
bool is_options (const OfObject &object) const
 
OfObjectget_options () const
 
bool is_child_of (const CoreSet< OfContext * > &parent_contexts) const
 
virtual void set_name_dirty ()
 
virtual void send_event (const CoreString &event)
 
virtual void _set_disabled (const bool &value, CoreSet< OfAttr * > &attrs_to_notify, CoreVector< int > &dependency_types)
 
void _set_parent_disabled (const bool &value, CoreSet< OfAttr * > &attrs_to_notify, CoreVector< int > &dependency_types)
 
void _set_source_disabled (const bool &value, CoreSet< OfAttr * > &attrs_to_notify, CoreVector< int > &dependency_types)
 
void forward_disable_state (const bool &old_value, const bool &new_value, CoreSet< OfAttr * > &attrs_to_notify, CoreVector< int > &dependency_types)
 
void activate_instance_flag (const int &flag)
 
void desactivate_instance_flag (const int &flag)
 
void set_instance_flags (const int &flag)
 
virtual void activate_flag (const int &flag)
 
virtual void desactivate_flag (const int &flag)
 
virtual void set_flags (const int &flag)
 
OfAttr_add_cam (const ParserEntry &attr_serial, const CoreString &rule, const CoreString &exclusion_rule, const bool &disabled, const bool &builtin)
 
void _resolve_cam_rule (const CoreVector< CoreString > &inclusive_rules, const CoreVector< CoreString > &exclusion_rules, CoreVector< OfAttr * > &retrieved_attrs) const
 
void _recreate_engine (OfContextEngine::GetDescriptorCallback &creation_cb, ParserGroup *engine_settings)
 
bool process_copy_paste (const CoreVector< OfContext * > &contexts_to_copy, const CoreVector< OfObject * > &objects_to_copy, CoreVector< OfItem * > &created_items)
 
- Public Member Functions inherited from OfItem
void clear_caps ()
 
bool get_flag_is_active (const int &flag) const
 
virtual const int & get_flags () const
 
void clear_flags ()
 
virtual bool is_private () const
 
virtual bool is_static () const
 
virtual bool is_remote () const
 
bool is_user_locked () const
 
virtual bool is_pending () const
 
virtual bool is_zombie () const
 
virtual bool is_overriden () const
 
virtual bool is_external () const
 
bool is_enabled () const
 
bool is_disabled () const
 
bool is_read_only () const
 Returns true if this item has been flagged read_only ! for more complex usage see is_editable.
 
bool is_in_undo_process () const
 
void set_in_undo_process (const bool &flag)
 
bool is_editable (const int &read_only_mask=RO_ALL_MASK) const
 
virtual void set_private (const bool &value)
 
virtual void set_static (const bool &value)
 
virtual void set_content_locked (const bool &value)
 
virtual void set_zombie (const bool &value)
 
virtual void set_pending (const bool &value)
 
virtual void set_external (const bool &value)
 
virtual void set_overriden (const bool &value)
 
bool get_can_delete () const
 
bool get_can_copy () const
 
bool get_can_paste () const
 
bool get_can_move () const
 
bool get_can_instantiate () const
 
bool get_can_localize () const
 
bool get_can_rename () const
 
void set_name (const CoreString &new_name)
 
bool is_name_dirty () const
 
const CoreStringget_name () const
 
OfObjectFactoryget_factory () const
 return the object factory
 
OfChannelManagerget_channel_manager () const
 
OfAppget_application () const
 return the application
 
bool has_position (const CoreString &pos_slot) const
 
void set_position (const CoreString &pos_slot, const GMathVec2i &pos)
 
void set_position (const CoreString &pos_slot, const GMathVec3i &pos)
 
const CoreHashTable
< CoreString, GMathVec3i > & 
get_nodal_properties () const
 
void set_position (const CoreString &pos_slot, const int &x, const int &y, const int &property=-1)
 
bool get_position (const CoreString &pos_slot, GMathVec2i &pos) const
 
bool get_position (const CoreString &pos_slot, GMathVec3i &pos) const
 
bool get_nodal_property (const CoreString &pos_slot, int &value) const
 
void set_nodal_property (const CoreString &pos_slot, const int &value)
 
void remove_position (const CoreString &position_slot)
 
const CoreStringget_last_changed_position () const
 
void serialize_positions (ParserGroup &group) const
 
void deserialize_positions (const ParserGroup &group)
 
const long unsigned long & get_creation_date () const
 
const long unsigned long & get_modified_date () const
 
virtual size_t get_memory_size () const
 
OfItemget_parent_item () const
 return the immediate parent of the item
 
OfContextget_context ()
 return the context of the item
 
const OfContextget_context () const
 return the context of the item
 
OfItemget_source () const
 return the source of the instance
 
const State & get_state () const
 
void set_state (const State &new_state)
 
CoreString set_comment (const CoreString &comment)
 sets comment value
 
CoreString get_comment () const
 
CoreString set_colortag (const CoreString &tag)
 sets tag value
 
CoreString get_colortag () const
 
bool is_cap_delete () const
 
bool is_cap_rename () const
 
bool is_cap_copy () const
 
bool is_cap_paste () const
 
bool is_cap_move () const
 
bool is_cap_instantiate () const
 
bool is_cap_localize () const
 
bool is_cap_localize_attributes () const
 
bool is_cap_display () const
 
void set_cap_delete (bool is_active)
 
void set_cap_rename (bool is_active)
 
void set_cap_copy (bool is_active)
 
void set_cap_paste (bool is_active)
 
void set_cap_move (bool is_active)
 
void set_cap_instantiate (bool is_active)
 
void set_cap_localize (bool is_active)
 
void set_cap_localize_attributes (bool is_active)
 
void set_cap_display (bool is_active)
 
- Public Member Functions inherited from EventObject
 EventObject ()
 Constructor.
 
 EventObject (const EventObject &src)
 Copy Constructor.
 
virtual ~EventObject ()
 Destructor.
 
void connect (EventObject &sender, const CoreString &event_id, EventMethod event_cb, void *data=0)
 Connects this to an object to listen to a specific event.
 
void connect (EventObject &sender, EventMethod event_cb, void *data=0)
 Connects this to an object to listen any of its events.
 
void raise_event (const CoreString &event_id) const
 sends an event
 
void connect (EventObject &sender, const CoreString &event_id, EventInfoMethod event_cb, void *data=0)
 Connects this to an object to listen to a specific event.
 
void connect (EventObject &sender, EventInfoMethod event_cb, void *data=0)
 Connects this to an object to listen any of its events.
 
void raise_event (const EventInfo &event_info) const
 sends an event
 
bool disconnect_all (EventObject &sender)
 Disconnects from all objects sender was listening on.
 
void disconnect_all ()
 Disconnects from all objects we were listening on.
 
void remove_all_connection ()
 Disconnects object from other objects it is listening to, and also disconnects all objects listening to it.
 
bool is_connected (EventObject &sender, const CoreString &event_id, void *data)
 
void set_mute (const bool &mute)
 Asks for object muting. This will increase or decrease the muting counter. Unmuting may not be immediat since it will happen only when counter reaches 0.
 
bool is_mute () const
 Returns if object is muted.
 
bool disconnect (EventObject &sender, const CoreString &event_id, EventMethod event_cb, void *data=0)
 Disconnects this from an object for a specific event.
 
bool disconnect (EventObject &sender, const CoreString &event_id, EventInfoMethod event_cb, void *data=0)
 
unsigned int get_sender_count () const
 
unsigned int get_receiver_count () const
 
- Public Member Functions inherited from CoreCustomData
 CoreCustomData (const CoreCustomData &src)
 
void add_custom_data (void *key, const bool &data)
 
void add_custom_data (void *key, const int &data)
 
void add_custom_data (void *key, const unsigned int &data)
 
void add_custom_data (void *key, const char *data)
 
void add_custom_data (void *key, const CoreString &data)
 
void add_custom_data (void *key, const double &data)
 
void add_custom_data (void *key, void *data)
 
void remove_custom_data (void *key)
 
void remove_all_custom_data ()
 
void set_custom_data (void *key, const bool &data)
 
void set_custom_data (void *key, const int &data)
 
void set_custom_data (void *key, const unsigned int &data)
 
void set_custom_data (void *key, const double &data)
 
void set_custom_data (void *key, const char *data)
 
void set_custom_data (void *key, const CoreString &data)
 
void set_custom_data (void *key, void *data)
 
void get_custom_data (void *key, bool &data) const
 
void get_custom_data (void *key, int &data) const
 
void get_custom_data (void *key, unsigned int &data) const
 
void get_custom_data (void *key, double &data) const
 
void get_custom_data (void *key, CoreString &data) const
 
void get_custom_data (void *key, void *&data) const
 
- Public Member Functions inherited from CoreBaseObject
bool is_kindof (const CoreBaseObject &object) const
 
CoreString get_class_info_name () const
 
CoreString get_class_interface () const
 
const unsigned long & get_class_info_id () const
 
bool is_kindof (const CoreClassInfo &cinfo) const
 
virtual const CoreClassInfoget_class_info () const
 
bool operator== (const CoreBaseObject &obj) const
 
template<class T >
T * cast ()
 
template<class T >
const T * cast () const
 
- Public Member Functions inherited from CoreBaseType
bool is_kindof (const CoreClassInfo &cinfo) const
 

Static Public Member Functions

static CoreString get_object_name (const CoreString &full_path)
 
static const CoreStringget_global_context_name ()
 
static const CoreStringget_default_context_name ()
 
static CoreString get_cam_group_name ()
 
static bool check_cam_rule (const CoreString &rule, CoreString &error_message)
 checks quality of cam rule
 
static bool check_cam_exclusion_rule (const CoreString &exclusion_rule, CoreString &error_message)
 checks quality of cam exclusion rule
 
static bool is_cam_type_managed (const OfAttr::Type &type, const OfAttr::VisualHint &hint)
 
static bool parse_attribute (const CoreString &str, CoreString &name, unsigned int &index, bool &is_array, bool &index_specified)
 
static ParserEntryserialize_cam (const OfAttr *attr, const CoreString &rule, const CoreString &exclusion_rule, const bool &disabled, const bool &builtin)
 
static ParserEntryserialize_cam (ParserEntry *attr_cid_serial, const CoreString &rule, const CoreString &exclusion_rule, const bool &disabled, const bool &builtin)
 
static bool deserialize_cam (const ParserEntry &entry, ParserEntry *&attr_serial, CoreString &rule, CoreString &exclusion_rule, bool &disabled, bool &builtin)
 
static CoreString get_name_from_filename (const CoreString &filename)
 
static void register_engine (const CoreClassInfo &engine_class_info, OfContextEngine::GetDescriptorCallback callback)
 
static bool is_valid_serial (const ParserEntry *serial)
 
static bool is_valid_serial_name (const CoreString &serial_name)
 
static const GuiIconget_default_icon ()
 Provides default icon for context, this method is for convenience usage.
 
static unsigned int get_context_cap (const OfContext *context)
 
static bool is_observed_context (const OfContext *observed_context, const OfContext *event_context)
 returns result of is_same_or_source OR is_child_of_source means that something that happend in event_context is in concern with the observed context
 
static bool is_same_or_source (const OfContext *context_1, const OfContext *context_2)
 Returns true if the context_2 is same as context_1 or the source of context_1.
 
static bool is_child_of_source (const OfContext *context_1, const OfContext *context_2)
 \ brief Returns true if the context_2 (or one of its instance) is a child of context_1 (or child of source of context_1 is it is an instance)
 
static const CoreStringget_options_object_name ()
 checks if specified object is the options object of the context
 
static void gather_items_to_remove (CoreSet< OfContext * > &context_to_process, CoreSet< OfObject * > &objects_to_process, const CoreBasicArray< OfObject * > &explicit_embedded, CoreVector< OfContext * > &contexts_to_remove, CoreVector< OfObject * > &objects_to_remove, CoreVector< OfObject * > &embedded_to_remove)
 
static void do_remove_items (OfObjectFactory &factory, const CoreSet< OfContext * > &gathered_contexts, const CoreSet< OfObject * > &gathered_objects, const CoreBasicArray< OfContext * > &contexts_to_remove, const CoreBasicArray< OfObject * > &objects_to_remove, const CoreBasicArray< OfObject * > &embedded_to_remove, AppProgressBar *progress_bar)
 
static void remove_items (OfObjectFactory &factory, const CoreBasicArray< CoreString > &full_names, AppProgressBar *progress_bar)
 
static void remove_items (OfObjectFactory &factory, const CoreBasicArray< OfItem * > &items, AppProgressBar *progress_bar)
 
static bool _is_matching_cam_rule (const OfObjectFactory &factory, const CoreString &ctx_name, const OfAttr *attr, const CoreVector< CoreString > &inclusive_rules, const CoreVector< CoreString > &exclusion_rules)
 
static void _unapply_cams (OfItem *item)
 
static void _unapply_cams (OfContext *context)
 
static void _unapply_cams (OfObject *object)
 
static void _apply_cams (OfItem *item)
 
static void _apply_cams (OfContext *context)
 
static void _apply_cams (OfObject *object)
 
static void _apply_cams (OfAttr *attr)
 
static int clear_cam_cb (const OfAction &action, OfObject &object, void *data)
 
static int save_cam_set_cb (const OfAction &action, OfObject &object, void *data)
 
static int load_cam_set_cb (const OfAction &action, OfObject &object, void *data)
 
static int import_cam_set_cb (const OfAction &action, OfObject &object, void *data)
 
static void process_gather_context_to_remove (const OfContext *context, CoreSet< OfContext * > &context_to_process, CoreSet< OfObject * > &objects_to_process)
 
static void process_gather_object_to_remove (const OfObject *object, CoreSet< OfObject * > &objects_to_process)
 
static void process_gather_embedded_to_remove (const OfObject *object, CoreSet< OfObject * > &objects_to_process)
 
- Static Public Member Functions inherited from OfItem
static void set_disabled (const CoreVector< OfItem * > &items_to_disable, const bool &disabled_state)
 
static void make_creation_params (const OfItem::AttrCreationParams &creation_params, CoreVector< CoreString > &additionnal_params, CoreVector< CoreString > &additionnal_params_values)
 
static void extract_creation_params (const CoreBasicArray< CoreString > &additionnal_params, const CoreBasicArray< CoreString > &additionnal_params_values, OfItem::AttrCreationParams &creation_params)
 
- Static Public Member Functions inherited from EventObject
static void connect (EventObject &sender, const CoreString &event_id, EventObject &receiver, EventMethod event_cb, void *data=0)
 Static version of the above function.
 
static void connect (EventObject &sender, EventObject &receiver, EventMethod event_cb, void *data=0)
 Static version of the above function.
 
static void connect (EventObject &sender, const CoreString &event_id, EventObject &receiver, EventInfoMethod event_cb, void *data=0)
 Static version of the above function.
 
static void connect (EventObject &sender, EventObject &receiver, EventInfoMethod event_cb, void *data=0)
 Static version of the above function.
 
static void raise_event (EventObject &sender, const CoreString &event_id)
 Sends an event.
 
static void raise_event (EventObject &sender, const EventInfo &event_info)
 Sends an event.
 
static void connect (EventObject &sender, const CoreString &event_id, EventFunction event_cb, void *data=0)
 Connects to an object to listen to a specific event.
 
static void connect (EventObject &sender, EventFunction event_cb, void *data=0)
 Connects to an object to listen any of its events.
 
static void connect (EventObject &sender, const CoreString &event_id, EventInfoFunction event_cb, void *data=0)
 Connects to an object to listen to a specific event.
 
static void connect (EventObject &sender, EventInfoFunction event_cb, void *data=0)
 Connects to an object to listen any of its events.
 
static bool disconnect (EventObject &sender, const CoreString &event_id, EventFunction event_cb, void *data=0)
 Disconnects this from an object for a specific event.
 
static bool disconnect (EventObject &sender, const CoreString &event_id, EventInfoFunction event_cb, void *data=0)
 
- Static Public Member Functions inherited from CoreCustomData
static void * get_custom_data_key (const CoreString &key)
 
- Static Public Member Functions inherited from CoreBaseObject
static const CoreClassInfoclass_info ()
 
static bool ___class_destructor__ (void *instance, const bool &is_array)
 
template<class T >
static T * cast (CoreBaseObject *object)
 
template<class T >
static const T * cast (const CoreBaseObject *object)
 
- Static Public Member Functions inherited from CoreBaseType
static const CoreClassInfoclass_info ()
 Get the type descriptor of this instance.
 
static bool ___class_destructor__ (void *instance, const bool &is_array)
 

Friends

class OfObject
 
class OfAttr
 
class OfClassFactory
 
class OfObjectFactory
 
class OfClass
 
class OfTime
 
class OfContextEngine
 
class OfOverridesContextEngine
 
class OfContextCallBacks
 
class OfContextImpl
 

Additional Inherited Members

- Public Types inherited from OfItem
enum  Flag {
  FLAG_NONE = 0,
  FLAG_READ_ONLY = 1 << 0,
  FLAG_PRIVATE = 1 << 1,
  FLAG_STATIC = 1 << 2,
  FLAG_REMOTE = 1 << 3,
  FLAG_CONTENT_LOCKED = 1 << 4,
  FLAG_USER_LOCKED = 1 << 5,
  FLAG_PENDING = 1 << 6,
  FLAG_OVERRIDEN = 1 << 7,
  FLAG_EXTERNAL = 1 << 8,
  FLAG_DISABLED = 1 << 9,
  FLAG_PARENT_DISABLED = 1 << 10,
  FLAG_SOURCE_DISABLED = 1 << 11,
  FLAG_UNDO_PROCESS = 1 << 12,
  FLAG_ZOMBIE = 1 << 13,
  FLAG_COUNT = 14
}
 
enum  Caps {
  CAPS_NONE = 0,
  CAPS_DELETE = 1 << 0,
  CAPS_RENAME = 1 << 1,
  CAPS_COPY = 1 << 2,
  CAPS_PASTE = 1 << 3,
  CAPS_MOVE = 1 << 4,
  CAPS_INSTANTIATE = 1 << 5,
  CAPS_LOCALIZE = 1 << 6,
  CAPS_DISPLAY = 1 << 7,
  CAPS_LOCALIZE_ATTRIBUTES = 1 << 8,
  CAPS_ALL = 0xFFFFFFFF,
  CAPS_COUNT = 10
}
 
enum  State {
  STATE_LIVE = 0,
  STATE_NEW = 1,
  STATE_DELETE = 2,
  STATE_DESERIALIZE = 3
}
 
enum  ItemReadOnlyMask { RO_USER_LOCKED_MASK = 1 << 2 }
 
- Static Public Attributes inherited from OfItem
static CoreBitFieldHelper empty_flags_mask = CoreBitFieldHelper( OfItem::FLAG_NONE, OfItem::FLAG_NONE, CoreBitFieldHelper::MODE_DISABLE, CoreBitFieldHelper::MODE_DISABLE )
 
static CoreBitFieldHelper enabled_flags_mask = CoreBitFieldHelper( OfItem::FLAG_NONE, OfItem::FLAG_DISABLED | OfItem::FLAG_PARENT_DISABLED | OfItem::FLAG_SOURCE_DISABLED | OfItem::FLAG_EXTERNAL | OfItem::FLAG_PENDING, CoreBitFieldHelper::MODE_DISABLE, CoreBitFieldHelper::MODE_ONE_BIT )
 
static CoreBitFieldHelper enabled_but_static_flags_mask = CoreBitFieldHelper( OfItem::FLAG_NONE, OfItem::FLAG_DISABLED | OfItem::FLAG_PARENT_DISABLED | OfItem::FLAG_SOURCE_DISABLED | OfItem::FLAG_EXTERNAL | OfItem::FLAG_PENDING | OfItem::FLAG_STATIC, CoreBitFieldHelper::MODE_DISABLE, CoreBitFieldHelper::MODE_ONE_BIT )
 
static CoreBitFieldHelper enabled_but_private_flags_mask = CoreBitFieldHelper( OfItem::FLAG_NONE, OfItem::FLAG_DISABLED | OfItem::FLAG_PARENT_DISABLED | OfItem::FLAG_SOURCE_DISABLED | OfItem::FLAG_EXTERNAL | OfItem::FLAG_PENDING | OfItem::FLAG_PRIVATE, CoreBitFieldHelper::MODE_DISABLE, CoreBitFieldHelper::MODE_ONE_BIT )
 
static CoreBitFieldHelper enabled_but_static_and_private_flags_mask = CoreBitFieldHelper( OfItem::FLAG_NONE, OfItem::FLAG_DISABLED | OfItem::FLAG_PARENT_DISABLED | OfItem::FLAG_SOURCE_DISABLED | OfItem::FLAG_EXTERNAL | OfItem::FLAG_PENDING | OfItem::FLAG_PRIVATE | OfItem::FLAG_STATIC, CoreBitFieldHelper::MODE_DISABLE, CoreBitFieldHelper::MODE_ONE_BIT )
 
static CoreBitFieldHelper enabled_but_static_and_read_only_flags_mask = CoreBitFieldHelper( OfItem::FLAG_NONE, OfItem::FLAG_DISABLED | OfItem::FLAG_PARENT_DISABLED | OfItem::FLAG_SOURCE_DISABLED | OfItem::FLAG_EXTERNAL | OfItem::FLAG_PENDING | OfItem::FLAG_READ_ONLY | OfItem::FLAG_STATIC, CoreBitFieldHelper::MODE_DISABLE, CoreBitFieldHelper::MODE_ONE_BIT )
 
static CoreBitFieldHelper no_static_and_read_only_flags_mask = CoreBitFieldHelper( OfItem::FLAG_NONE, OfItem::FLAG_READ_ONLY | OfItem::FLAG_STATIC, CoreBitFieldHelper::MODE_DISABLE, CoreBitFieldHelper::MODE_ONE_BIT )
 
- Protected Member Functions inherited from OfItem
unsigned int get_caps () const
 
void set_caps (unsigned int caps)
 
bool is_cap_active (OfItem::Caps cap) const
 
void set_cap_active (OfItem::Caps cap, bool is_active)
 
void set_creation_date (const long unsigned long &creation_date) const
 set the item creation date
 
void set_modified_date (const long unsigned long &modified_date) const
 set the item modification date
 
bool _is_disabled () const
 
 OfItem (OfObjectFactory &factory)
 
- Static Protected Member Functions inherited from OfItem
static void notify_disable_attrs (OfObjectFactory &factory, const CoreSet< OfAttr * > &attrs, const CoreVector< int > &dep_types)
 
- Protected Attributes inherited from OfItem
CoreAtomic64 m_full_name_cached
 
int m_flags
 
OfObjectFactorym_factory
 
CoreHashTable< CoreString,
GMathVec3i > 
m_positions
 

Detailed Description

Contexts are similar to folders and allows to store and organize project objects.

Member Function Documentation

void OfContext::_recreate_engine ( OfContextEngine::GetDescriptorCallback &  creation_cb,
ParserGroup engine_settings 
)

Replace current context's engine. Custom attributes and CAMs are preserved, option attributes are removed.

For example, this is used to localize a reference context, converting it into a regular context (the OfFileReferenceContextEngine is replaced by an OfProjectContextEngine).

Parameters
creation_cbCallback to create the new engine.
engine_settingsOptional engine settings, contains the serialized engine's options.
OfAttr * OfContext::add_attribute ( const CoreString attr,
const OfAttr::Type type,
const OfAttr::Container container = OfAttr::CONTAINER_SINGLE,
const OfAttr::VisualHint visual_hint = OfAttr::VISUAL_HINT_DEFAULT,
const CoreString group_name = "general" 
)
virtual

add an attribute to the object

Parameters
attrthe name of the attribute
typespecifies which type the attribute is (ex: OfAttr::TYPE_BOOL, OfAttr::TYPE_DOUBLE...)
containertell whether the attribute is an array or not
visual_hintspecifies how the attribute should be displayed (ex: OfAttr::VISUAL_HINT_COLOR, OfAttr::VISUAL_HINT_PERCENTAGE...)

Implements OfItem.

bool OfContext::add_cam ( const CoreString cam_name,
const CoreString rule,
const bool &  builtin = false 
)

defines a context attribute as a CAM by specifying its name and filtering rule

Parameters
cam_namethe name of the custom attribute that will be used for the CAM
rulerule used to filter attribute in sub items. The rule must be relative.
Returns
true on success, false otherwise
bool OfContext::add_cam ( const CoreString cam_name,
const CoreString rule,
const CoreString exclusion_rule,
const bool &  builtin = false 
)

defines a context attribute as a CAM by specifying its name and filtering rule

Parameters
cam_namethe name of the custom attribute that will be used for the CAM
rulerule used to filter attribute in sub items. The rule must be relative.
exclusion_rulerule used to exclude attribute in sub items. The rule must be relative.
Returns
true on success, false otherwise
OfContext * OfContext::add_context ( const CoreString name,
const CoreClassInfo engine = 0 
)

add a sub-context to this context

Parameters
namethe name of the sub-context
enginethe context engine used for the new context. If no engine is specified, the default engine is used.
Returns
0 if the sub-context cannot be created
OfContext * OfContext::add_context ( const CoreString name,
const CoreString engine_name 
)

add a sub-context to this context

Parameters
namethe name of the sub-context
engine_namethe context engine used for the new context.
Returns
0 if the sub-context cannot be created
OfContext * OfContext::add_context ( const ParserEntry serial,
const OfSerialOptions options = OfSerialOptions::get_default() 
)

add a sub-context to this context and sets its content from the specified serialization

Parameters
serialthe context serialization
Returns
0 if the sub-context cannot be created (maybe a bad serial was given)
OfItem * OfContext::add_copy ( const OfItem source)

create a copy of the specified item in the current context

Note
this method is used to abstract whether the item is an object or a context
OfContext * OfContext::add_copy ( const OfContext source)

create a copy of the specified context in the current context

Note
sub-contexts and objects inside the specified context are copied too
OfObject * OfContext::add_generic_object ( const CoreString object_name,
const int &  object_flags = OfObject::FLAG_NONE 
)

add a generic object (object of class "Generic") in this context

Parameters
object_namethe name of the object to create
Returns
the created object
OfContext * OfContext::add_instance ( OfContext source,
const CoreString name = "" 
)

instanciate the specified context into this context

Parameters
sourcethe instancing source context
namethe name of the instance
Note
if no name is specified, the instance name will be the source name
OfItem * OfContext::add_instance ( OfItem source,
const CoreString name = "" 
)

instanciate the specified item into this context

Parameters
sourcethe instancing source item
namethe name of the instance
Note
if no name is specified, the instance name will be the source name
OfObject * OfContext::add_instance ( const OfObject source,
const CoreString name = "",
const int &  flags = OfObject::FLAG_NONE,
const OfItem::State &  output_state = OfItem::STATE_LIVE 
)

add an instance of the given source object

Parameters
namethe optional name of the instance. If no name is given, the object will have the same name as its source
Returns
the created object
OfObject * OfContext::add_object ( const CoreString object_name,
const CoreString class_name,
const int &  flags = OfObject::FLAG_NONE,
const OfItem::State &  output_state = OfItem::STATE_LIVE 
)

add an object of the specified class in this context

Parameters
object_namethe name of the object to create
class_namethe name of the class
Returns
the created object
OfObject * OfContext::add_object ( const ParserEntry entry,
const OfSerialOptions options = OfSerialOptions::get_default(),
const int &  flags = OfObject::FLAG_NONE 
)

add an object by specifying its serialization

Parameters
entrythe object serialization
Returns
the created object
Note
the object is first created (the class is given by the serialization) and then deserialized
const OfAttr * OfContext::attribute_exists ( const CoreString attr) const
virtual

tell whether an attribute exists by specifying its name

Returns
the attribute of 0 if the attribute does not exist
Note
const method: the attrbute is read-only

Implements OfItem.

OfAttr * OfContext::attribute_exists ( const CoreString attr)
virtual

tell whether an attribute exists by specifying its name

Returns
the attribute of 0 if the attribute does not exist
Note
non-const method: the attrbute can be edited

Implements OfItem.

bool OfContext::check_cam_exclusion_rule ( const CoreString exclusion_rule,
CoreString error_message 
)
static

checks quality of cam exclusion rule

Parameters
exclusion_rulethe exclusion rule to test
error_messageerror message for reasons of failure
Returns
true if rule is acceptable, false otherwise
bool OfContext::check_cam_rule ( const CoreString rule,
CoreString error_message 
)
static

checks quality of cam rule

Parameters
rulethe rule to test
error_messageerror message for reasons of failure
Returns
true if rule is acceptable, false otherwise
OfContext * OfContext::context_exists ( const CoreString name) const

return the sub-context by name

Returns
0 if the sub-context is not found
void OfContext::copy_content_from ( const OfContext source,
const bool &  recursive = false,
const bool &  clear_content = true 
)

Copies the content of specified source context to this context, the method will clear the content of this context before start copying.

Parameters
themethod will only copy objects if specified recursive is false
relativedependencies true means that a dependency between two source objects will exist as a dependency between the two relative copied objects. If false specified, the dependency will exist between the copy and the source object.
bool OfContext::deserialize ( const ParserEntry serial,
const OfSerialOptions options = OfSerialOptions::get_default(),
AppProgressBar progress_bar = 0 
)

deserialize the given serialization into this context

Returns
true if the deserialization is a success
void OfContext::disable_cam ( const unsigned int &  index,
const bool &  disabled 
)

Sets the CAM as disabled (not applied)

Parameters
indexthe index of the CAM to disable
disabledtrue to disabled the CAM, false otherwise
unsigned int OfContext::find_cam ( const CoreString cam_name) const

retrieves the index of the CAM specifying attribute name

Returns
index of the CAM if retrived, -1 otherwise
unsigned int OfContext::find_cam ( const OfAttr custom_attr) const

retrieves the index of the CAM specifying the attribute itself

Returns
index of the CAM if retrived, -1 otherwise
unsigned int OfContext::find_item_index ( const OfItem item) const

retrieve the item index in the context

Parameters
itemthe item to retrieve
Returns
returns -1 if item is not found, the index of the item otherwise
OfItem * OfContext::find_item_neighbour ( const OfItem item,
const bool  previous_neighbour = true 
) const

retrieve the neighbour of the item in the context

Parameters
itemthe item to retrieve
previous_neighbourspecify the neighbour to get, the previous (true) or the next item (false)
Returns
returns the neighbour item if it exists, null otherwise
void OfContext::get_all_objects ( const CoreString class_name,
CoreArray< OfObject * > &  objects,
const CoreBitFieldHelper flags = OfItem::enabled_but_private_flags_mask,
const bool &  consider_embedded = false 
) const

gather all the objects matching the given criteria recursively

Parameters
class_namesnames of the class of the objects we want to gather
objectsthe set containing the gathered objects
maskthe object flags mask
inclusivetells whether the gathered objects must feature the given flag mask or not
void OfContext::get_all_objects ( const CoreBasicArray< CoreString > &  class_names,
CoreArray< OfObject * > &  objects,
const CoreBitFieldHelper flags = OfItem::enabled_but_private_flags_mask,
const bool &  consider_embedded = false 
) const

gather all the objects matching the given criteria recursively

Parameters
class_namesnames of the class of the objects we want to gather
objectsthe set containing the gathered objects
maskthe object flags mask
inclusivetells whether the gathered objects must feature the given flag mask or not
void OfContext::get_all_objects ( const CoreString class_name,
CoreSet< OfObject * > &  objects,
const CoreBitFieldHelper flags,
const bool &  consider_embedded = false 
) const

gather all the objects matching the given criteria contained in this context not recursively

Parameters
class_namethe name of the class of the objects we want to gather
objectsthe array containing the gathered objects
maskthe object flags mask
inclusivetells whether the gathered objects must feature the given flag mask or not
void OfContext::get_all_objects ( const CoreBasicArray< CoreString > &  class_names,
CoreSet< OfObject * > &  objects,
const CoreBitFieldHelper flags,
const bool &  consider_embedded = false 
) const

gather all the objects matching the given criteria recursively

Parameters
class_namethe name of the class of the objects we want to gather
objectsthe set containing the gathered objects
maskthe object flags mask
inclusivetells whether the gathered objects must feature the given flag mask or not
void OfContext::get_all_objects ( CoreArray< OfObject * > &  objects,
const CoreBitFieldHelper flags = OfItem::enabled_flags_mask,
const bool &  consider_embedded = false 
) const

gather all the objects recursively

Parameters
objectsthe array containing the gathered objects
void OfContext::get_all_objects ( CoreSet< OfObject * > &  objects,
const CoreBitFieldHelper flags = OfItem::enabled_flags_mask,
const bool &  consider_embedded = false 
) const

gather all the objects recursively

Parameters
objectsthe set containing the gathered objects
CoreString OfContext::get_as_string ( const OfSerialOptions options = OfSerialOptions::get_default()) const
virtual

return the serialization of the context

Returns
a stringified version of the serialization

Implements OfItem.

const OfAttr * OfContext::get_attribute ( const CoreString attr) const
virtual

find an attribute by specifying its name

Returns
0 if the attribute is not found
Note
const method: the attrbute is read-only

Implements OfItem.

OfAttr * OfContext::get_attribute ( const CoreString attr)
virtual

find an attribute by specifying its name

Returns
0 if the attribute is not found
Note
non-const method: the attribute can be edited

Implements OfItem.

const OfAttr * OfContext::get_attribute ( const unsigned int &  index) const
virtual

return the attribute at the given index

Note
const method: the attrbute is read-only

Implements OfItem.

OfAttr * OfContext::get_attribute ( const unsigned int &  index)
virtual

return the attribute at the given index

Note
non-const method: the attrbute can be edited

Implements OfItem.

CoreString OfContext::get_attribute_path ( const OfAttr attr) const

return the path of the given attribute relative this the context

Note
if the given attribute is not inside the context it returns the attribute's full name
CoreString OfContext::get_cam_group_name ( )
static

returns the name of the CAM attribute group

const OfContext * OfContext::get_context ( const unsigned &  index,
const CoreBitFieldHelper flags = OfItem::enabled_flags_mask 
) const

return the sub-context at the given index

Note
low level method, no safeguard is provided
OfContext * OfContext::get_context ( const unsigned &  index,
const CoreBitFieldHelper flags = OfItem::enabled_flags_mask 
)

return the sub-context at the given index

Note
low level method, no safeguard is provided
const OfContext * OfContext::get_context ( const CoreString name) const

return the sub-context by name

Returns
0 if the sub-context is not found
OfContext * OfContext::get_context ( const CoreString name)

return the sub-context by name

Returns
0 if the sub-context is not found
unsigned int OfContext::get_context_cap ( const OfContext context)
static

Get the capabilities of the context.

See Also
OfItem::Caps
CoreString OfContext::get_context_path ( const OfContext context) const

return the path of the given context relative to this context

Note
if the given context is not inside the context it returns the context's full name
not very efficient, must be optimized
const GuiIcon * OfContext::get_default_icon ( )
static

Provides default icon for context, this method is for convenience usage.

Returns
a const pointer on the icon
void OfContext::get_external_dependencies ( CoreHashTable< OfItem *, CoreSet< OfItem * > > &  external_refs,
CoreHashTable< OfItem *, CoreSet< OfItem * > > &  external_srcs 
) const

get_external_dependencies

Parameters
external_refsgets set of externed items with their user items
external_srcsgets set of externed sources with their user items
OfItem * OfContext::get_item ( const CoreString name) const

return an item by specifying its path

Parameters
namethe name of the item
Returns
0 and a warning if the object is not found
OfItem * OfContext::get_item ( const unsigned int  index) const

return an item by specifying its index

Parameters
indexthe index of the item
Returns
0 and a warning if the index is out of bound
const GuiIcon * OfContext::get_item_icon ( ) const
virtual

Item icon get accessor.

Returns
a const pointer on the icon

Implements OfItem.

CoreString OfContext::get_item_path ( const OfItem item) const

return the path of the given item relative to this context

Note
if the given item is not inside the context it returns the item's full name
not very efficient, must be optimized
unsigned int OfContext::get_level ( void  ) const

return how deep (the level) of this context

Note
level 0 is the factory's root context
OfObject * OfContext::get_object ( const CoreString object_name) const

return an object by specifying its name

Parameters
object_namethe name of the object
Returns
0 if the object is not found
CoreString OfContext::get_object_path ( const OfObject object) const

return the path of the given object relative to this context

Note
if the given object is not inside the context it returns the object's full name
not very efficient, must be optimized
void OfContext::get_object_path ( const OfObject object,
CoreVector< OfContext * > &  path 
) const

return the vector of contexts from the given object to this context

Note
if the given object is not inside the context (or its sub-context) it returns the branch from the object up to the root
void OfContext::get_objects ( CoreArray< OfObject * > &  objects,
const CoreBitFieldHelper flags = OfItem::enabled_flags_mask 
) const

gather all the objects contained in this context (not recursively)

Parameters
objectsthe array containing the gathered objects
const CoreString & OfContext::get_options_object_name ( )
static

checks if specified object is the options object of the context

Parameters
theobject to test
Returns
true if specified object is the options object of the context, false otherwise
OfContext * OfContext::get_parent ( ) const

return the parent context of this context

Returns
0 if this context has no parent
Note
the root context has no parent
bool OfContext::import_project ( const CoreString filename,
const OfSerialOptions::Mode &  serial_mode,
const OfImportOptions::VariableMode &  variable_mode,
const OfImportOptions::AovMode &  aov_mode,
CoreVector< OfItem * > &  items 
)

import the items of a project into this context

  • filename the project to be loaded
  • serial_mode deserialization mode: DEFAULT, RELOAD, REFERENCE
bool OfContext::is_cam_builtin ( const unsigned int &  index) const

Gets the CAM builtin state.

Parameters
indexthe index of the CAM to check
Returns
true is the CAM is builtin, false otherwise
bool OfContext::is_cam_disabled ( const unsigned int &  index) const

Gets the CAM disabled state.

Parameters
indexthe index of the CAM to check
Returns
true is the CAM is disabled, false otherwise
bool OfContext::is_child_of ( const OfContext context,
const bool &  follow_instances = false 
) const

return true if this context is a child (or grandchild...) of the given context

Parameters
contextthe parent (or grandparent...) context
OfItem * OfContext::item_exists ( const CoreString name) const

return an item by specifying its path

Parameters
namethe name of the item
Returns
0 if the object is not found
void OfContext::move_item_index ( const unsigned int  old_index,
const unsigned int  new_index 
)

modify item position in the context from specified source index to target index

Parameters
old_indexthe source index to move the item from
new_indexthe target index to move the item to
void OfContext::move_item_indices ( const CoreBasicArray< OfItem * > &  items,
const OfItem tgt_item,
const bool  add_after = true 
)

move specified items index to AFTER the target item position

Parameters
itemsthe items to move
tgt_itemspecifies the target item position, 0 means head position
add_afterboolean specifies to add after or before the specified target
OfObject * OfContext::object_exists ( const CoreString object_name) const

return an object by specifying its name

Parameters
object_namethe name of the object
Returns
0 if the object is not found
bool OfContext::parse_attribute ( const CoreString str,
CoreString name,
unsigned int &  index,
bool &  is_array,
bool &  index_specified 
)
static

Parse a string and extract the name of an attribute, and its index if specified.

OfItem * OfContext::paste_item ( const ParserEntry serial,
const OfSerialOptions options = OfSerialOptions::get_default() 
)

paste an item by specifying its serialization

Note
return 0 if the given serialization is neither a context's nor an object's one
OfContext * OfContext::reference_file ( const CoreString filename,
const OfImportOptions::VariableMode &  import_variable_mode = OfImportOptions::VARIABLE_MODE_APPEND,
const OfImportOptions::AovMode &  import_aov_mode = OfImportOptions::AOV_MODE_IMPORT 
)

reference an external project importing all items into this context

  • filename the filename of the external project to reference. If empty, an empty reference is created with default name.
void OfContext::remove_all_attributes ( )
virtual

Remove all context's custom attributes. Option attributes are kept.

Implements OfItem.

void OfContext::remove_all_cams ( const bool  remove_attr = true)

remove alls CAM from this context

Parameters
remove_attrtrue to remove also used custom attributes
void OfContext::remove_attribute ( const CoreString name)
virtual

Remove the specified option or custom attribute if it exists.

Parameters
nameName of the attribute to remove.

Implements OfItem.

void OfContext::remove_attribute ( OfAttr attr)
virtual

Remove the specified option or custom attribute if it exists.

Parameters
attrThe attribute to remove.

Implements OfItem.

void OfContext::remove_cam ( const unsigned int &  index,
const bool  remove_attr = true 
)

removes a CAM specifying its index

Parameters
indexthe index to remove
remove_attrtrue to remove also used custom attribute
void OfContext::remove_cam ( const OfAttr custom_attr,
const bool  remove_attr = true 
)

removes a CAM specifying attribute itself

Parameters
custom_attrthe index to remove
remove_attrtrue to remove also used custom attribute
void OfContext::remove_context ( OfContext context)

remove a sub-context from this context

Parameters
contextreference to the sub-context to remove
Note
low level method, no safeguard is provided
void OfContext::remove_context ( const CoreString name)

remove a sub-context from this context

Parameters
namename of the sub-context to remove
Note
this method does nothing if the sub-context is not found
void OfContext::remove_context ( const unsigned int &  index)

remove a sub-context from this context

Parameters
indexindex of the sub-context to remove
Note
no safeguard is provided
void OfContext::remove_object ( const CoreString object_name,
const bool &  remove_static = false 
)

remove the specified object from this context

Parameters
namename of the object to remove
void OfContext::remove_object ( OfObject object,
const bool &  remove_static = false 
)

remove the specified object from this context

Parameters
objectreference to the object to remove
void OfContext::rename ( const CoreString name)
virtual

change the name of this context

Parameters
namethe new name of the context

Implements OfItem.

void OfContext::rename_object ( const CoreString object,
const CoreString name 
)

change the name of the specified object

Parameters
objectthe name of the object whose name will change
namethe new name of the object
void OfContext::reset_attributes ( )
virtual

reset the values of class attributes as if the object was just created

Note
if the object is an instance, the attribute is unlocalized to match the source object attribute value
custom attributes cannot be reset as there is no default value to match

Implements OfItem.

void OfContext::resolve_all_contexts ( CoreSet< OfContext * > &  contexts,
const CoreBitFieldHelper flags = OfItem::enabled_flags_mask 
) const

Get all the reachable contexts from this (recursively or not), resolving context instances to avoid infinite recursion.

Parameters
contextsset of all found contexts, without any instances but with their source instead.
void OfContext::resolve_contexts ( CoreSet< OfContext * > &  contexts,
const CoreBitFieldHelper flags = OfItem::enabled_flags_mask 
) const

Get all the reachable contexts from this, resolving context instances to avoid multiple occurences.

Parameters
contextsset of all found contexts
void OfContext::retarget_cam ( const unsigned int &  index,
const CoreString rule 
)

modifies the rule of the CAM

Parameters
indexthe index of the CAM to modify
rulethe new rule to use
void OfContext::retarget_cam ( const OfAttr custom_attr,
const CoreString rule 
)

modifies the rule of the CAM

Parameters
custom_attrthe custom attribute used for the CAM to modify
rulethe new rule to use
void OfContext::retarget_cam ( const unsigned int &  index,
const CoreString rule,
const CoreString exclusion_rule 
)

modifies the rule of the CAM

Parameters
indexthe index of the CAM to modify
rulethe new rule to use
exclusion_rulethe new exclusion rule to use
void OfContext::retarget_cam ( const OfAttr custom_attr,
const CoreString rule,
const CoreString exclusion_rule 
)

modifies the rule of the CAM

Parameters
custom_attrthe custom attribute used for the CAM to modify
rulethe new rule to use
exclusion_rulethe new exclusion rule to use
void OfContext::set_cam_builtin ( const unsigned int &  index,
const bool &  is_builtin 
)

Sets the CAM as builting (cannot be removed, nor definition edited)

Parameters
indexthe index of the CAM to set
is_builtintrue to set the CAM as builtin, false otherwise
void OfContext::set_parent ( OfContext parent)

move this context inside the specified context

Parameters
contextnew parent of this context
Note
unparented contexts (like root) cannot be reparented
void OfContext::untarget_cam ( const unsigned int &  index)

detaches the CAM custom attribute from overridden attributes

Parameters
indexthe index of the CAM to detach
void OfContext::untarget_cam ( const OfAttr custom_attr)

detaches the CAM custom attribute from overridden attributes

Parameters
custom_attrthe attribute used for the CAM to detach