4 #ifndef __BLENDER_ID_MAP_H__
5 #define __BLENDER_ID_MAP_H__
23 template<
typename K,
typename T>
class id_map {
33 typename map<K, T *>::iterator jt;
34 for (jt =
b_map.begin(); jt !=
b_map.end(); jt++) {
35 nodes.insert(jt->second);
92 if (parent.ptr.data && parent.ptr.data !=
id.ptr.data) {
150 typedef pair<const K, T *> TMapPair;
151 typename map<K, T *>::iterator jt;
153 for (jt =
b_map.begin(); jt !=
b_map.end(); jt++) {
154 TMapPair &pair = *jt;
160 new_map[pair.first] = pair.second;
198 memcpy(
id, id_,
sizeof(
id));
200 memset(
id, 0,
sizeof(
id));
208 else if (
ob == k.
ob) {
217 return memcmp(
id, k.
id,
sizeof(
id)) < 0;
244 else if (
id == k.
id) {
263 memcpy(
id, id_,
sizeof(
id));
265 memset(
id, 0,
sizeof(
id));
void add(const K &key, T *data)
void set_recalc(void *id_ptr)
bool add_or_update(T **r_data, const BL::ID &id)
bool update(T *data, const BL::ID &id, const BL::ID &parent)
const map< K, T * > & key_to_scene_data()
bool add_or_update(T **r_data, const BL::ID &id, const BL::ID &parent, const K &key)
void set_recalc(const BL::ID &id)
bool update(T *data, const BL::ID &id)
T * find(const BL::ID &id)
void set_default(T *data)
bool add_or_update(T **r_data, const BL::ID &id, const K &key)
bool is_used(const K &key)
void post_sync(bool do_delete=true)
#define CCL_NAMESPACE_END
@ OBJECT_PERSISTENT_ID_SIZE
GeometryKey(void *id, Geometry::Type geometry_type)
Geometry::Type geometry_type
bool operator<(const GeometryKey &k) const
ObjectKey(void *parent_, int id_[OBJECT_PERSISTENT_ID_SIZE], void *ob_, bool use_particle_hair_)
bool operator<(const ObjectKey &k) const
int id[OBJECT_PERSISTENT_ID_SIZE]
ParticleSystemKey(void *ob_, int id_[OBJECT_PERSISTENT_ID_SIZE])
int id[OBJECT_PERSISTENT_ID_SIZE]
bool operator<(const ParticleSystemKey &k) const
T * create_node(Args &&...args)
void delete_node(T *node)
void delete_nodes(const set< T * > &nodes)