Commit: e2eeb46a1bda8cf49a70e78a45d12fede27a1af9
Author: Campbell Barton
Date:   Tue Apr 7 11:01:47 2015 +1000
Branches: master
https://developer.blender.org/rBe2eeb46a1bda8cf49a70e78a45d12fede27a1af9

Cleanup: rename treehash -> outliner_treehash

This is an API specifically for the outliner,
not some generic hierarchical hash structure.

===================================================================

A       source/blender/blenkernel/BKE_outliner_treehash.h
D       source/blender/blenkernel/BKE_treehash.h
M       source/blender/blenkernel/CMakeLists.txt
A       source/blender/blenkernel/intern/outliner_treehash.c
D       source/blender/blenkernel/intern/treehash.c
M       source/blender/blenloader/intern/readfile.c
M       source/blender/editors/space_outliner/outliner_tree.c
M       source/blender/editors/space_outliner/space_outliner.c

===================================================================

diff --git a/source/blender/blenkernel/BKE_treehash.h 
b/source/blender/blenkernel/BKE_outliner_treehash.h
similarity index 66%
rename from source/blender/blenkernel/BKE_treehash.h
rename to source/blender/blenkernel/BKE_outliner_treehash.h
index 16ab02c..454edb4 100644
--- a/source/blender/blenkernel/BKE_treehash.h
+++ b/source/blender/blenkernel/BKE_outliner_treehash.h
@@ -19,10 +19,10 @@
  *
  * ***** END GPL LICENSE BLOCK *****
  */
-#ifndef __BKE_TREEHASH_H__
-#define __BKE_TREEHASH_H__
+#ifndef __BKE_OUTLINER_TREEHASH_H__
+#define __BKE_OUTLINER_TREEHASH_H__
 
-/** \file BKE_treehash.h
+/** \file BKE_outliner_treehash.h
  *  \ingroup bke
  */
 
@@ -31,21 +31,21 @@ struct BLI_mempool;
 struct TreeStoreElem;
 
 /* create and fill hashtable with treestore elements */
-void *BKE_treehash_create_from_treestore(struct BLI_mempool *treestore);
+void *BKE_outliner_treehash_create_from_treestore(struct BLI_mempool 
*treestore);
 
 /* full rebuild for already allocated hashtable */
-void *BKE_treehash_rebuild_from_treestore(void *treehash, struct BLI_mempool 
*treestore);
+void *BKE_outliner_treehash_rebuild_from_treestore(void *treehash, struct 
BLI_mempool *treestore);
 
 /* full rebuild for already allocated hashtable */
-void BKE_treehash_add_element(void *treehash, struct TreeStoreElem *elem);
+void BKE_outliner_treehash_add_element(void *treehash, struct TreeStoreElem 
*elem);
 
 /* find first unused element with specific type, nr and id */
-struct TreeStoreElem *BKE_treehash_lookup_unused(void *treehash, short type, 
short nr, struct ID *id);
+struct TreeStoreElem *BKE_outliner_treehash_lookup_unused(void *treehash, 
short type, short nr, struct ID *id);
 
 /* find user or unused element with specific type, nr and id */
-struct TreeStoreElem *BKE_treehash_lookup_any(void *treehash, short type, 
short nr, struct ID *id);
+struct TreeStoreElem *BKE_outliner_treehash_lookup_any(void *treehash, short 
type, short nr, struct ID *id);
 
 /* free treehash structure */
-void BKE_treehash_free(void *treehash);
+void BKE_outliner_treehash_free(void *treehash);
 
 #endif
diff --git a/source/blender/blenkernel/CMakeLists.txt 
b/source/blender/blenkernel/CMakeLists.txt
index f19c106..67c8f0f 100644
--- a/source/blender/blenkernel/CMakeLists.txt
+++ b/source/blender/blenkernel/CMakeLists.txt
@@ -135,6 +135,7 @@ set(SRC
        intern/object_deform.c
        intern/object_dupli.c
        intern/ocean.c
+       intern/outliner_treehash.c
        intern/packedFile.c
        intern/paint.c
        intern/particle.c
@@ -172,7 +173,6 @@ set(SRC
        intern/tracking_solver.c
        intern/tracking_stabilize.c
        intern/tracking_util.c
-       intern/treehash.c
        intern/unit.c
        intern/world.c
        intern/writeavi.c
@@ -211,6 +211,8 @@ set(SRC
        BKE_depsgraph.h
        BKE_displist.h
        BKE_dynamicpaint.h
+       BKE_editmesh.h
+       BKE_editmesh_bvh.h
        BKE_effect.h
        BKE_fcurve.h
        BKE_fluidsim.h
@@ -246,6 +248,7 @@ set(SRC
        BKE_object.h
        BKE_object_deform.h
        BKE_ocean.h
+       BKE_outliner_treehash.h
        BKE_packedFile.h
        BKE_paint.h
        BKE_particle.h
@@ -266,12 +269,9 @@ set(SRC
        BKE_speaker.h
        BKE_subsurf.h
        BKE_suggestions.h
-       BKE_editmesh.h
-       BKE_editmesh_bvh.h
        BKE_text.h
        BKE_texture.h
        BKE_tracking.h
-       BKE_treehash.h
        BKE_unit.h
        BKE_utildefines.h
        BKE_world.h
diff --git a/source/blender/blenkernel/intern/treehash.c 
b/source/blender/blenkernel/intern/outliner_treehash.c
similarity index 81%
rename from source/blender/blenkernel/intern/treehash.c
rename to source/blender/blenkernel/intern/outliner_treehash.c
index 43eeae7..1cce615 100644
--- a/source/blender/blenkernel/intern/treehash.c
+++ b/source/blender/blenkernel/intern/outliner_treehash.c
@@ -20,7 +20,7 @@
  * ***** END GPL LICENSE BLOCK *****
  */
 
-/** \file treehash.c
+/** \file outliner_treehash.c
  *  \ingroup bke
  *
  * Tree hash for the outliner space.
@@ -28,7 +28,7 @@
 
 #include <stdlib.h>
 
-#include "BKE_treehash.h"
+#include "BKE_outliner_treehash.h"
 
 #include "BLI_utildefines.h"
 #include "BLI_ghash.h"
@@ -104,11 +104,11 @@ static void fill_treehash(void *treehash, BLI_mempool 
*treestore)
        BLI_mempool_iter iter;
        BLI_mempool_iternew(treestore, &iter);
        while ((tselem = BLI_mempool_iterstep(&iter))) {
-               BKE_treehash_add_element(treehash, tselem);
+               BKE_outliner_treehash_add_element(treehash, tselem);
        }
 }
 
-void *BKE_treehash_create_from_treestore(BLI_mempool *treestore)
+void *BKE_outliner_treehash_create_from_treestore(BLI_mempool *treestore)
 {
        GHash *treehash = BLI_ghash_new_ex(tse_hash, tse_cmp, "treehash", 
BLI_mempool_count(treestore));
        fill_treehash(treehash, treestore);
@@ -120,14 +120,14 @@ static void free_treehash_group(void *key)
        tse_group_free(key);
 }
 
-void *BKE_treehash_rebuild_from_treestore(void *treehash, BLI_mempool 
*treestore)
+void *BKE_outliner_treehash_rebuild_from_treestore(void *treehash, BLI_mempool 
*treestore)
 {
        BLI_ghash_clear_ex(treehash, NULL, free_treehash_group, 
BLI_mempool_count(treestore));
        fill_treehash(treehash, treestore);
        return treehash;
 }
 
-void BKE_treehash_add_element(void *treehash, TreeStoreElem *elem)
+void BKE_outliner_treehash_add_element(void *treehash, TreeStoreElem *elem)
 {
        TseGroup *group;
        void **val_p;
@@ -139,7 +139,7 @@ void BKE_treehash_add_element(void *treehash, TreeStoreElem 
*elem)
        tse_group_add(group, elem);
 }
 
-static TseGroup *BKE_treehash_lookup_group(GHash *th, short type, short nr, 
struct ID *id)
+static TseGroup *BKE_outliner_treehash_lookup_group(GHash *th, short type, 
short nr, struct ID *id)
 {
        TreeStoreElem tse_template;
        tse_template.type = type;
@@ -148,9 +148,9 @@ static TseGroup *BKE_treehash_lookup_group(GHash *th, short 
type, short nr, stru
        return BLI_ghash_lookup(th, &tse_template);
 }
 
-TreeStoreElem *BKE_treehash_lookup_unused(void *treehash, short type, short 
nr, struct ID *id)
+TreeStoreElem *BKE_outliner_treehash_lookup_unused(void *treehash, short type, 
short nr, struct ID *id)
 {
-       TseGroup *group = BKE_treehash_lookup_group(treehash, type, nr, id);
+       TseGroup *group = BKE_outliner_treehash_lookup_group(treehash, type, 
nr, id);
        if (group) {
                int i;
                for (i = 0; i < group->size; i++) {
@@ -162,13 +162,13 @@ TreeStoreElem *BKE_treehash_lookup_unused(void *treehash, 
short type, short nr,
        return NULL;
 }
 
-TreeStoreElem *BKE_treehash_lookup_any(void *treehash, short type, short nr, 
struct ID *id)
+TreeStoreElem *BKE_outliner_treehash_lookup_any(void *treehash, short type, 
short nr, struct ID *id)
 {
-       TseGroup *group = BKE_treehash_lookup_group(treehash, type, nr, id);
+       TseGroup *group = BKE_outliner_treehash_lookup_group(treehash, type, 
nr, id);
        return group ? group->elems[0] : NULL;
 }
 
-void BKE_treehash_free(void *treehash)
+void BKE_outliner_treehash_free(void *treehash)
 {
        BLI_ghash_free(treehash, NULL, free_treehash_group);
 }
diff --git a/source/blender/blenloader/intern/readfile.c 
b/source/blender/blenloader/intern/readfile.c
index 4eb7413..9a269ca 100644
--- a/source/blender/blenloader/intern/readfile.c
+++ b/source/blender/blenloader/intern/readfile.c
@@ -139,7 +139,7 @@
 #include "BKE_scene.h"
 #include "BKE_screen.h"
 #include "BKE_sequencer.h"
-#include "BKE_treehash.h"
+#include "BKE_outliner_treehash.h"
 #include "BKE_sound.h"
 
 
@@ -6041,7 +6041,7 @@ static void lib_link_screen(FileData *fd, Main *main)
                                                        }
                                                        if (so->treehash) {
                                                                /* rebuild hash 
table, because it depends on ids too */
-                                                               
BKE_treehash_rebuild_from_treestore(so->treehash, so->treestore);
+                                                               
BKE_outliner_treehash_rebuild_from_treestore(so->treehash, so->treestore);
                                                        }
                                                }
                                        }
@@ -6392,7 +6392,7 @@ void blo_lib_link_screen_restore(Main *newmain, bScreen 
*curscreen, Scene *cursc
                                                }
                                                if (so->treehash) {
                                                        /* rebuild hash table, 
because it depends on ids too */
-                                                       
BKE_treehash_rebuild_from_treestore(so->treehash, so->treestore);
+                                                       
BKE_outliner_treehash_rebuild_from_treestore(so->treehash, so->treestore);
                                                }
                                        }
                                }
diff --git a/source/blender/editors/space_outliner/outliner_tree.c 
b/source/blender/editors/space_outliner/outliner_tree.c
index 9239d9c..17a6e952 100644
--- a/source/blender/editors/space_outliner/outliner_tree.c
+++ b/source/blender/editors/space_outliner/outliner_tree.c
@@ -66,7 +66,7 @@
 #include "BKE_modifier.h"
 #include "BKE_sequencer.h"
 #include "BKE_idcode.h"
-#include "BKE_treehash.h"
+#include "BKE_outliner_treehash.h"
 
 #include "ED_armature.h"
 #include "ED_screen.h"
@@ -114,7 +114,7 @@ static void outliner_storage_cleanup(SpaceOops *soops)
                                        BLI_mempool_destroy(ts);
                                        soops->treestore = NULL;
                                        if (soops->treehash) {
-                                               
BKE_treehash_free(soops->treehash);
+                                               
BKE_outliner_treehash_free(soops->treehash);
                                                soops->treehash = NULL;
                                        }
                                }
@@ -133,7 +133,7 @@ static void outliner_storage_cleanup(SpaceOops *soops)
                                        soops->treestore = new_ts;
                                        if (soops->treehash) {
                                                /* update hash table to fix 
broken pointers */
-                                               
BKE_treehash_rebuild_from_treestore(soops->treehash, soops->treestore);
+                                               
BKE_outliner_treehash_rebuild_from_treestore(soops->treehash, soops->treestore);
                                        }
                                }
                        }
@@ -151,12 +151,12 @@ static void check_persistent(SpaceOops *soops, 
TreeElement *te, ID *id, short ty
                
        }
        if (soops->treehash == NULL) {
-               soops->treehash = 
BKE_treehash_create_from_treestore(soops->treestore);
+               soops->treehash = 
BKE_outliner_treehash_create_from_treestore(soops->treestore);
        }
 
        /* find any unused tree element in treestore and mark it as used
         * (note that there may be multiple unused elements in case of linked 
objects) */
-       tselem = BKE_treehash_lookup_unused(soops->treehash, type, nr, id);
+       tselem = BKE_outliner_treehash_lookup_unused(soops->treehash, type, nr, 
id);
        if (tselem) {
                te->store_elem = tselem;
                tselem->used = 1;
@@ -171,7 +171,7 @@ static void check_persistent(SpaceOops *soops, TreeElement 
*te, ID *id, short ty
        tselem->used = 0;
        tselem->flag = TSE_CLOSED;
        te->store_elem = tselem;
-       BKE_treehash_add_element(soops->treehash, tselem);
+       BKE_outliner_treehash_add_element(soops->treehash, tselem);
 }
 
 /* ********************************************************* */
@@ -216,7 +216,7 @@ TreeElement *outliner_find_tse(SpaceOops *soops, 
TreeStoreElem *t

@@ Diff output truncated at 10240 characters. @@

_______________________________________________
Bf-blender-cvs mailing list
[email protected]
http://lists.blender.org/mailman/listinfo/bf-blender-cvs

Reply via email to