Hi, I want to programmatically extract top level objects for a g file (the ones 
you get when "tops" command is issued in mged). According to the definition top 
level objects are the ones which aren't referenced by any other combination. 
Looking at the ged_tops function I deduced that the only check is to see if 
"dp->d_nref == 0", where dp is a "struct directory" pointer.

But the problem that I have is that all objects seem to have dp->d_nref==0 and 
even when I use db_ls using "DB_LS_TOPS" flag still I get ALL objects.  Am I 
missing something?

Here is an excerpt from "ged_tops" (libged/tops.c)
        for (i = 0; i < RT_DBNHASH; i++)
            for (dp = gedp->ged_wdbp->dbip->dbi_Head[i];  dp != RT_DIR_NULL;  
dp = dp->d_forw) {
                if (dp->d_nref == 0)
                    *dirp++ = dp;
            }

Cheers,

Technische Universität München
Asad
MS Informatik


------------------------------------------------------------------------------
_______________________________________________
BRL-CAD Developer mailing list
brlcad-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/brlcad-devel

Reply via email to