On Aug 14, 2013, at 9:41 AM, Check Nyah wrote:

> Looking at my current pull, I am thinking of using a linked list in moving 
> the matrices up one level, but looks like it'll have some debugging problems. 
> Could you please give me an alternative in moving the matrix transformation 
> up one level without using a linked list? like may be using db_walk_tree with 
> a leaf_func() routine that does that. Also, since there is no matrix 
> transformation for a combination, How do I create one when doing the pull. 
> Currently looking at push to see it it worked there.

You'll have to distinguish between pulling a matrix up a level of a combination 
vs. extracting a matrix from a primitive (i.e., a leaf node), because most 
primitives technically do not have a matrix.

I'm also not sure you'll be able to use db_walk_tree(), but you're welcome to 
try.  It works for push simply because we always push the matrices all the way 
down to the leaf nodes.  In your case, you're pulling UP the tree to arbitrary 
non-region combination nodes.  The db_preorder_traverse() function or one of 
the other tree walk functions that provide callbacks at all comb nodes will 
probably be more helpful.

The general idea might be to pass a matrix as a data parameter to the traversal 
function, find your combination node on the way back up the hierarchy, record 
the matrix at the matching comb node, unitize that comb's matrix, then 
propagate the matrix up one more level to the combs that reference it.

I suggest starting by taking the db_walk_tree() example [1] and getting it to 
work with a different tree walker (like db_preorder_traverse() or another) 
where you can make your callback print the combination names.

[1] http://brlcad.org/wiki/Example_db_walk_tree

Cheers!
Sean

------------------------------------------------------------------------------
Get 100% visibility into Java/.NET code with AppDynamics Lite!
It's a free troubleshooting tool designed for production.
Get down to code-level detail for bottlenecks, with <2% overhead. 
Download for free and get started troubleshooting in minutes. 
http://pubads.g.doubleclick.net/gampad/clk?id=48897031&iu=/4140/ostg.clktrk
_______________________________________________
BRL-CAD Developer mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/brlcad-devel

Reply via email to