Clarisse 5.0 SP8 SDK  5.0.5.8.0
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
Public Member Functions | Protected Member Functions | List of all members
OfSceneAssemblyReadContextEngine Class Referenceabstract

Base class for engine of scene assembly read contexts. A read context allows to read a custom file and load assets on demand. It must be able to translate a file into a scene description - see : get_scene(). and it must be able to create the objects that are needed by the scene assembly engine - see : get_items()). More...

Inheritance diagram for OfSceneAssemblyReadContextEngine:
OfSceneAssemblyContextEngine OfContextEngine CoreBaseObject CoreBaseType

Public Member Functions

 OfSceneAssemblyReadContextEngine (OfContext &ctx, const CoreBasicArray< CoreString > &extensions, bool is_multi_filenames=false)
 
bool can_reference_file () const override
 
virtual bool is_preloaded () const =0
 returns true if the file has been correctly read and converted into a scene description
 
virtual float get_loading_progress () const
 
OfAttrget_file_attr () const
 
bool file_exists () const
 
- Public Member Functions inherited from OfSceneAssemblyContextEngine
 OfSceneAssemblyContextEngine (OfContext &ctx)
 constructor
 
virtual ~OfSceneAssemblyContextEngine ()
 destructor
 
void init (ParserGroup *settings) override
 init the engine
 
OfObjectHandle get_object_handle (OfObject *object, OfClass *missing_class=0) const override
 Returns a handle for the given object in the context.
 
const CoreStringget_item_full_name (const OfItem &item) override
 Returns the full name of a given item in the context.
 
void get_item_references (OfSceneDescription::ItemId item_id, CoreVector< OfSceneDescription::ItemId > &references) const override
 returns the IDs of items referenced by an item
 
bool is_content_dirty () const override
 returns true if the content has to be updated
 
bool is_content_valid () const override
 returns true if the content has been correctly generated
 
void update_context () override
 Update the content of the context if needed. This is called each time we need to access to the content of a context.
 
void get_items_to_serialize (CoreArray< OfObject * > &objects, CoreArray< OfContext * > &contexts) const override
 
int on_item_event (const EventObject::EventInfo &event, OfItem *item) override
 called when an event occurs on an object located in the context engine
 
bool is_traversal () const override
 
OfItemHandle get_traversal_item () const override
 
OfAttrHandle get_traversal_attr (bool when_traversal_only=true) const override
 
OfAttrget_pass_through () const override
 
OfItemget_traversal_candidate () const override
 
bool has_cam_feature () const override
 
bool is_shadowable (const OfItem &item) override
 
virtual void set_content_dirty ()
 clear the content of the context and flag it as dirty so it is updated the next time we have to know its content
 
virtual void make_real (const CoreBasicArray< OfItemHandle > &items)
 create a real OF item for all the given items
 
bool is_scene_description_dirty () const
 
CoreString get_item_local_path (OfConstItemHandle item) const
 get the object path relatively to the context engine
 
virtual void on_object_removed (OfObject *removed_object)
 called when any object is removed
 
virtual void on_context_renamed (OfContext *renamed_context)
 called when any context is renamed
 
virtual void on_object_renamed (OfObject *renamed_object, const CoreString &old_name)
 called when any object is renamed
 
void remove_full_name (OfObject *object)
 
OfProxyId get_proxy_id (OfItemHandle item) const
 Get the ID of the given item in this scene assembly context.
 
OfProxyId get_proxy_id (OfPlugHandle plug) const
 Get the ID of the given plug in this scene assembly context.
 
OfItemHandle get_item_handle (OfProxyId id) const
 Get a valid item handle for the given ID.
 
OfPlugHandle get_plug_handle (OfProxyId id) const
 Get a valid plug handle for the given ID.
 
bool has_generate (const OfItem &item) const
 Return true if this scene assembly context has generard the given item.
 
- Public Member Functions inherited from OfContextEngine
virtual void set_content_dirty (const bool &dirty_sub_contexts=false)
 
bool is_unknown_engine () const
 
bool is_project_engine () const
 
bool is_override_engine () const
 
bool is_file_reference_engine () const
 
bool is_usd_reference_engine () const
 
bool is_scene_assembly_engine () const
 
bool is_scene_assembly_read_engine () const
 
bool is_build_package_engine () const
 
virtual bool supports_localize () const
 
OfContextget_context () const
 
virtual const GuiIconget_icon () const
 
const CoreStringget_attr_doc (const CoreString &attr) const
 
CoreString get_serial_name () const
 
void pre_serialize (const OfSerialOptions &options)
 
void post_serialize ()
 
bool is_serializing () const
 
bool is_deserializing () const
 
virtual ParserGroupget_settings () const
 
virtual CoreString get_pdir (void) const
 
virtual void get_scene (OfSceneDescription &scene) const
 generate a scene description of the engine context
 
OfItemget_item (OfSceneDescription::ItemId item_id) const
 create the OF item given the ID of the item in the engine
 
virtual void get_items (const CoreBasicArray< OfSceneDescription::ItemId > &item_ids, CoreArray< OfItem * > &items) const
 create the OF items given the IDs of the items in the engine
 
OfBuildPackageContextEngineget_build_package ()
 
virtual void on_add_cam (const CAMInfo &cam_info)
 React to the addition of a new cam, by gathering related attributes and applying the cam t them.
 
virtual CoreString get_cam_identifier () const
 
virtual void * predelete_items (const CoreSet< OfContext * > &contexts, const CoreSet< OfObjectHandle > &objects, const CoreVector< OfObjectHandle > &embedded, OfEndProtectionCallback &cleanup)
 
virtual void undelete_items (void *blind_data)
 
virtual void get_overrides (ParserGroup &overrides) const
 Returns a serialization group containing all the overrides applied on items in the context.
 
virtual void set_overrides (const ParserGroup &overrides, bool append_overrides=false)
 Apply overrides on items in the context given a serialization group containing all the overrides.
 
virtual bool merge_overrides (CoreBasicArray< OfContextEngine * > contexts)
 Merge overrides of the given contexts into the current one.
 
OfAttradd_attribute (const OfItem::AttrCreationParams &params)
 
OfAttradd_attribute (const CoreString &name, 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")
 
void remove_all_attributes ()
 
void remove_attribute (const CoreString &name)
 
void remove_attribute (OfAttr &attr)
 
OfAttradd_custom_attribute (const OfItem::AttrCreationParams &params)
 
OfAttradd_custom_attribute (const CoreString &name, 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")
 
void remove_all_custom_attributes ()
 
- Public Member Functions inherited from CoreBaseObject
bool is_kindof (const CoreBaseObject &object) const
 
virtual size_t get_memory_size () const
 
CoreString get_class_info_name () const
 
const unsigned long & get_class_info_id () const
 
virtual bool is_kindof (const CoreClassInfo &cinfo) const
 
virtual const CoreClassInfoget_class_info () 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
 

Protected Member Functions

void get_status_bar (ComponentInterfaceNodeStatus &status) const override
 customize the status bar of the context in the build view for example, it is possible to display a warning bar if something is going wrong
 
void populate_options () override
 
void on_options_changed (OfObject &options) override
 
void refresh_content () final
 refresh the content of the scene assembly context
 
- Protected Member Functions inherited from OfSceneAssemblyContextEngine
OfContextEngine::Result do_deserialize_objects (ParseSerialData *serial_data, const OfSerialOptions &options, AppProgressBar *progress_bar) override
 
ParserEntryserialize (ParserEntry *entry, const OfSerialOptions &options, AppProgressBar *progress_bar) const override
 
void clear ()
 clear all items that were created in the engine context
 
void send_event_content_dirty () const
 send an event to notify that the content of the scene assembly context is dirty
 
virtual void make_virtual (const CoreBasicArray< OfItemHandle > &items)
 inverse operation of make_real()
 
void add_input_context (OfContext *context)
 add an input context to the scene assembly context
 
void remove_input_context (OfContext *context)
 remove an input context from the scene assembly context
 
void set_input_items (const CoreBasicArray< OfItem * > &items)
 set the input items of the scene assembly context
 
OfItemHandle mirror_item (OfSceneDescription::Item &item_desc, const OfSceneDescription &scene, const VariationTables *tables=0, CoreSet< OfItemHandle > *items_to_move=0)
 Mirror an item from a description in the scene assembly context.
 
OfContextcreate_context_from_path (const CoreString &context_path) const
 create a context inside the engine context given its local path inside this context
 
void add_item_to_scene (OfItem &item, OfSceneDescription &scene, OfSceneDescription::ItemId parent_id=OfSceneDescription::get_null_id()) const
 add an OF item already created into the scene description the engine context
 
void override_resources (OfObject *object)
 apply the overrides on the resources that were done in this context
 
void clear_resource_override (const CoreString &object_path) const
 
void clear_resource_overrides () const
 
virtual void override_attributes (OfObject *object, OfSceneDescription::ItemId item_id=OfSceneDescription::get_null_id())
 modify the values of all the attributes of an object overridden in the scene assembly
 
- Protected Member Functions inherited from OfContextEngine
 OfContextEngine (OfContext &ctx)
 
virtual bool populate_settings (ParserGroup &group, OfContext *context) const
 
void register_component_implementation ()
 
void _populate_options ()
 
OfAttradd_option_attribute (const OfItem::AttrCreationParams &params)
 
OfAttradd_option_attribute (const CoreString &name, 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")
 
void remove_all_option_attributes ()
 
void _on_options_changed (OfObject &options)
 
virtual void on_context_event (const CoreString &event)
 
void add_state_deserializing (const int state)
 
void remove_state_deserializing (const int state)
 
bool is_state_deserializing (const int state) const
 
void add_private_flag (const int flag)
 
void remove_private_flag (const int flag)
 
bool is_private_flag (const int flag) const
 
virtual ParserEntryserialize_export (ParserEntry *entry, const OfSerialOptions &options, AppProgressBar *progress_bar) const
 
virtual Result deserialize_objects (ParseSerialData *serial_data, const OfSerialOptions &options, AppProgressBar *progress_bar)
 
virtual void deserialize_attrs (ParseSerialData *serial_data, const OfSerialOptions &options, AppProgressBar *progress_bar)
 
virtual void do_deserialize_attrs (ParseSerialData *serial_data, const OfSerialOptions &options, AppProgressBar *progress_bar)
 
virtual void suspend_objects (const CoreVector< OfItem * > &items)
 
void suspend_all_objects ()
 
void clean_all_suspended_objects (bool only_new=false)
 
const OfClassget_project_item_class () const
 

Additional Inherited Members

- Public Types inherited from OfContextEngine
typedef OfContextEngine *(* CreateEngineCallback )(OfContext &context)
 
typedef ParseSerialData *(* ParseSerialCallback )(CoreVector< ParserEntry * > &sub_ctx_entries, const CoreBasicArray< ParserEntry * > &serial_entries)
 
typedef const Descriptor &(* GetDescriptorCallback )()
 Typedef for the callback to get the engine's Descriptor.
 
- Static Public Member Functions inherited from OfSceneAssemblyContextEngine
static bool is_generated_in_sa_context (const OfObject &object)
 Specify if a given object has been generated in a scene assembly context.
 
static bool is_generated_in_sa_context (const OfContext &context)
 Specify if a given context has been generated in a scene assembly context.
 
static void gather_referenced_contexts (const OfObject &object, CoreSet< OfContext * > &contexts, const CoreSet< OfObject * > &stop_on_objects={})
 gather all contexts recursively referenced by the object
 
static void update_referenced_contexts (const OfObject &object)
 update all the contexts referenced by the object
 
- Protected Types inherited from OfSceneAssemblyContextEngine
enum  PrivateState {
  STATE_CONTENT_DIRTY = NEXT_PRIVATE_FLAG,
  STATE_FORCE_READ_ONLY = NEXT_PRIVATE_FLAG << 1
}
 
- Static Protected Member Functions inherited from OfContextEngine
static OfContextEnginecreate_engine (OfContext &ctx)
 
static ParseSerialDataparse_serial (CoreVector< ParserEntry * > &sub_ctx_entries, const CoreBasicArray< ParserEntry * > &serial_entries)
 
static void prepare_serial_data (ParseSerialData &serial_data, CoreVector< ParserEntry * > &sub_ctx_entries, const CoreBasicArray< ParserEntry * > &serial_entries)
 
static Result deserialize_data_objects (ParseSerialData &serial_data, OfContextEngine &target_context, const OfSerialOptions &options, AppProgressBar *progress_bar)
 
static void deserialize_data_attrs (ParseSerialData &serial_data, OfContextEngine &target_context, const OfSerialOptions &options, AppProgressBar *progress_bar)
 
static void deserialize_data_options (ParseSerialData &serial_data, OfContextEngine &target_context, const OfSerialOptions &options)
 
static ParserEntryserialize_options (const OfContext &context, const OfSerialOptions &serial_options)
 
static void deserialize_options (OfContext &context, const ParserEntry *serial, const OfSerialOptions &serial_options)
 
- Protected Attributes inherited from OfSceneAssemblyContextEngine
CoreHashTable< OfItem
*, OfItemHandle
m_items_mirrors
 
CoreHashTable< OfObject
*, OfObject * > 
m_substitute_objects
 objects that have been changed by another because of a conflict name
 
bool m_updating_content
 
bool m_clearing_content
 
bool m_is_scene_description_dirty
 specify if the scene description has never be computed while the node is dirty
 
CoreHashTable< CoreString,
CoreVector< ParserEntry * > > 
m_object_resources
 List of resource keys generated by the application per object.
 

Detailed Description

Base class for engine of scene assembly read contexts. A read context allows to read a custom file and load assets on demand. It must be able to translate a file into a scene description - see : get_scene(). and it must be able to create the objects that are needed by the scene assembly engine - see : get_items()).

Member Function Documentation

bool OfSceneAssemblyReadContextEngine::can_reference_file ( ) const
inlineoverridevirtual

Returns true if the context engine is able to reference a file For example, reference file engine, scene assembly read engine and build package in remote mode must return true

Reimplemented from OfContextEngine.

OfAttr * OfSceneAssemblyReadContextEngine::get_file_attr ( ) const

Get the filename attribute of the node

void OfSceneAssemblyReadContextEngine::get_status_bar ( ComponentInterfaceNodeStatus status) const
overrideprotectedvirtual

customize the status bar of the context in the build view for example, it is possible to display a warning bar if something is going wrong

Parameters
statusthe status to modify

Reimplemented from OfSceneAssemblyContextEngine.

void OfSceneAssemblyReadContextEngine::on_options_changed ( OfObject options)
overrideprotectedvirtual

Called when the options object of this engine's context has changed. Deriving engines need to override this method to handle changes on their options.

Parameters
optionsThe options OfObject.

Reimplemented from OfSceneAssemblyContextEngine.

void OfSceneAssemblyReadContextEngine::populate_options ( )
overrideprotectedvirtual

Add the options for this node.

Reimplemented from OfSceneAssemblyContextEngine.

void OfSceneAssemblyReadContextEngine::refresh_content ( )
finalprotectedvirtual

refresh the content of the scene assembly context

Note
this is the entry point where the scene description of the context is computed and then the of items that are needed for the scene are created in the context

Reimplemented from OfSceneAssemblyContextEngine.