Esempio n. 1
0
/* Find specific item from the treestore */
static TreeElement *outliner_find_tree_element(ListBase *lb, TreeStoreElem *store_elem)
{
	TreeElement *te, *tes;
	for (te = lb->first; te; te = te->next) {
		if (te->store_elem == store_elem) return te;
		tes = outliner_find_tree_element(&te->subtree, store_elem);
		if (tes) return tes;
	}
	return NULL;
}
Esempio n. 2
0
/* Find ith item from the treestore */
static TreeElement *outliner_find_tree_element(ListBase *lb, int store_index)
{
	TreeElement *te= lb->first, *tes;
	while(te) {
		if(te->store_index==store_index) return te;
		tes= outliner_find_tree_element(&te->subtree, store_index);
		if(tes) return tes;
		te= te->next;
	}
	return NULL;
}
Esempio n. 3
0
/* tse is not in the treestore, we use its contents to find a match */
TreeElement *outliner_find_tse(SpaceOops *soops, TreeStoreElem *tse)
{
	TreeStoreElem *tselem;

	if (tse->id == NULL) return NULL;
	
	/* check if 'tse' is in treestore */
	tselem = BKE_treehash_lookup_any(soops->treehash, tse->type, tse->nr, tse->id);
	if (tselem) 
		return outliner_find_tree_element(&soops->tree, tselem);
	
	return NULL;
}
Esempio n. 4
0
/* tse is not in the treestore, we use its contents to find a match */
TreeElement *outliner_find_tse(SpaceOops *soops, TreeStoreElem *tse)
{
	TreeStore *ts= soops->treestore;
	TreeStoreElem *tselem;
	int a;
	
	if(tse->id==NULL) return NULL;
	
	/* check if 'tse' is in treestore */
	tselem= ts->data;
	for(a=0; a<ts->usedelem; a++, tselem++) {
		if((tse->type==0 && tselem->type==0) || (tselem->type==tse->type && tselem->nr==tse->nr)) {
			if(tselem->id==tse->id) {
				break;
			}
		}
	}
	if(tselem) 
		return outliner_find_tree_element(&soops->tree, a);
	
	return NULL;
}