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 Attributes | List of all members
GeometryObjectBundle Class Reference

Class implementing the base object that is used in GeometryBundles. More...

Inheritance diagram for GeometryObjectBundle:
ResourceData EventObject CoreCustomData CoreBaseObject CoreBaseType GeometrySceneInfo

Public Member Functions

 GeometryObjectBundle (ResourceBundleManager *resource_bundle_manager)
 
void clear ()
 Resets the bundle and release all geometries that it contains.
 
void copy_from (const GeometryObjectBundle &source)
 
void init_arrays (const unsigned int &geo_count)
 Creates the data arrays that will be needed to store all geometries.
 
void set_geometry (ResourceBundleItem *geo_resource, const unsigned int &index)
 Sets a geometry in a slot.
 
const CoreArray
< GeometryObject * > & 
get_geometries () const
 Accessor to geometries stored in the bundle.
 
const CoreStringget_geometry_hash_key (const unsigned int &index) const
 Return the hash_key of the i-th GeometryObject.
 
virtual unsigned int get_primitive_count () const
 Return the total number of primitives that are stored in the bundle.
 
virtual unsigned int get_geometry_count () const
 Return the number of geometries that are stored in the bundle.
 
virtual unsigned int get_uv_map_count () const
 Return the number of UV maps defined in the bundle.
 
size_t get_memory_size () const override
 Get the amount of memory occupied by the resource.
 
- Public Member Functions inherited from ResourceData
 ResourceData (const ResourceData &other)
 
ResourceImportDataget_import_data () const
 
void set_import_data (ResourceImportData *data)
 
virtual Core128BitHashKey get_hash_key () const
 Get the hash key of the resource.
 
virtual bool is_serializable () const
 Tell if the resource can be serialized or not.
 
virtual void * serialize (size_t &serial_size) const
 Serialize the resource data.
 
virtual bool deserialize (void *serial, const size_t &serial_size)
 Deserialize the resource data.
 
void advert_memory_changed () const
 Adverts that the memory usage of the resource has changed.
 
bool is_protected () const
 
- Public Member Functions inherited from EventObject
 EventObject ()
 Constructor.
 
 EventObject (const EventObject &src)
 Copy Constructor.
 
virtual ~EventObject () override
 Destructor.
 
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.
 
bool disconnect (EventObject &sender, const CoreString &event_id, EventInfoMethod event_cb, void *data=0)
 
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.
 
void raise_event (const CoreString &event_id) const
 sends an event
 
void raise_event (const EventInfo &event_info) const
 sends an event
 
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.
 
CoreArray< EventObject * > get_senders () const
 
unsigned int get_sender_count () const
 
unsigned int get_receiver_count () const
 
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.
 
bool disconnect (EventObject &sender, const CoreString &event_id, EventMethod event_cb, void *data=0)
 Disconnects this from an object for a specific event.
 
- 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
 
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 Attributes

ResourceBundleManagerm_resource_bundle_manager
 the lite resource manager
 
CoreArray< ResourceBundleItem * > m_resources_list
 list of resources, one per geometry
 
CoreArray< GeometryObject * > m_geometry_list
 list of unique (deduplicated) geometries
 
unsigned int m_primitive_count
 
unsigned int m_uv_map_count
 

Additional Inherited Members

- Public Types inherited from EventObject
typedef void(* EventInfoFunction )(EventObject &, const EventInfo &, void *)
 event callback signature for free functions / static methods.
 
typedef void(EventObject::* EventInfoMethod )(EventObject &, const EventInfo &, void *)
 event callback signature for methods.
 
typedef void(* EventFunction )(EventObject &, const CoreString &, void *)
 
typedef void(EventObject::* EventMethod )(EventObject &, const CoreString &, void *)
 
- Static Public Member Functions inherited from EventObject
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 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, EventInfoFunction event_cb, void *data=0)
 
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, 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 bool disconnect (EventObject &sender, const CoreString &event_id, EventFunction event_cb, void *data=0)
 Disconnects this from an object for a specific event.
 

Detailed Description

Class implementing the base object that is used in GeometryBundles.

This class implements a container object that stores multiple geometries into a single Clarisse object. The GeometryObjectBundle does not directly stores GeometryObjects: it stores ResourceBundleItems that are created by the ResourceBundleManager.

Note
This class is used by the GeometryBundle module to build and store geometries when building geometric resources. To generate your own bundle and create the base ID_RESOURCE_GEOMETRY, check the GeometrySceneInfo class.
See Also
ResourceBundleManager
ResourceBundleItem
GeometrySceneInfo

Member Function Documentation

const CoreArray<GeometryObject*>& GeometryObjectBundle::get_geometries ( ) const
inline

Accessor to geometries stored in the bundle.

Returns
An array of GeometryObjects.
const CoreString & GeometryObjectBundle::get_geometry_hash_key ( const unsigned int &  index) const

Return the hash_key of the i-th GeometryObject.

Parameters
[in]indexindex of the item to query
size_t GeometryObjectBundle::get_memory_size ( void  ) const
overridevirtual

Get the amount of memory occupied by the resource.

Returns an estimate in bytes of the data allocated by the object.

Reimplemented from ResourceData.

Reimplemented in GeometrySceneInfo.

void GeometryObjectBundle::init_arrays ( const unsigned int &  geo_count)

Creates the data arrays that will be needed to store all geometries.

Parameters
[in]geo_countnumber of geometries that will be added in the bundle
Note
This function must be called prior to building geometries. We allocate arrays before building geometries in order to be able to build and set them from multiple threads.
void GeometryObjectBundle::set_geometry ( ResourceBundleItem geo_resource,
const unsigned int &  index 
)

Sets a geometry in a slot.

Parameters
[in]geo_resourceResourceBundleItem that wraps the geometry.
[in]indexindex of the cell in which the item must be set.
Note
It is not possible to directly add a GeometryObject into a GeometryObjectBundle One must always first request a ResourceBundleItem from the ResourceBundleManager, which checks for duplicated geometries.