15#include "RNA_blender_cpp.hh"
24template<
typename K,
typename T,
typename Flags = u
int>
class id_map {
32 typename map<K, T *>::iterator jt;
33 for (jt =
b_map.begin(); jt !=
b_map.end(); jt++) {
34 nodes.insert(jt->second);
37 scene->delete_nodes(nodes);
96 if (parent.ptr.data && parent.ptr.data !=
id.ptr.data) {
154 using TMapPair = pair<const K, T *>;
155 typename map<K, T *>::iterator jt;
157 for (jt =
b_map.begin(); jt !=
b_map.end(); jt++) {
158 TMapPair &pair = *jt;
161 flags.erase(pair.second);
162 scene->delete_node(pair.second);
165 new_map[pair.first] = pair.second;
181 typename map<T *, uint>::iterator it =
flags.find(
data);
182 return it !=
flags.end() && (it->second & (1 << val)) != 0;
192 typename map<T *, uint>::iterator it =
flags.find(
data);
193 if (it !=
flags.end()) {
194 it->second &= ~(1 << val);
196 if (it->second == 0) {
227 memcpy(
id, id_,
sizeof(
id));
230 memset(
id, 0,
sizeof(
id));
248 return memcmp(
id, k.
id,
sizeof(
id)) < 0;
292 memcpy(
id, id_,
sizeof(
id));
295 memset(
id, 0,
sizeof(
id));
BMesh const char void * data
bool update(T *data, const BL::ID &id, const BL::ID &parent)
bool check_recalc(const BL::ID &id)
bool add_or_update(T **r_data, const BL::ID &id)
bool test_flag(T *data, Flags val)
void add(const K &key, T *data)
bool is_used(const K &key)
bool add_or_update(T **r_data, const BL::ID &id, const K &key)
bool update(T *data, const BL::ID &id)
void set_recalc(const BL::ID &id)
void set_flag(T *data, Flags val)
T * find(const BL::ID &id)
void set_recalc(void *id_ptr)
bool add_or_update(T **r_data, const BL::ID &id, const BL::ID &parent, const K &key)
void clear_flag(T *data, Flags val)
void post_sync(bool do_delete=true)
void set_default(T *data)
const map< K, T * > & key_to_scene_data()
#define CCL_NAMESPACE_END
#define assert(assertion)
@ 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