17 #ifndef __BLENDER_ID_MAP_H__
18 #define __BLENDER_ID_MAP_H__
36 template<
typename K,
typename T>
class id_map {
46 typename map<K, T *>::iterator jt;
47 for (jt =
b_map.begin(); jt !=
b_map.end(); jt++) {
48 nodes.insert(jt->second);
105 if (parent.ptr.data && parent.ptr.data !=
id.ptr.data) {
163 typedef pair<const K, T *> TMapPair;
164 typename map<K, T *>::iterator jt;
166 for (jt =
b_map.begin(); jt !=
b_map.end(); jt++) {
167 TMapPair &pair = *jt;
173 new_map[pair.first] = pair.second;
211 memcpy(
id, id_,
sizeof(
id));
213 memset(
id, 0,
sizeof(
id));
221 else if (
ob == k.
ob) {
230 return memcmp(
id, k.
id,
sizeof(
id)) < 0;
257 else if (
id == k.
id) {
276 memcpy(
id, id_,
sizeof(
id));
278 memset(
id, 0,
sizeof(
id));
@ OBJECT_PERSISTENT_ID_SIZE
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
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)