Hi Marcus,

Marcus Lindblom wrote:
> Hi,
> 
> We're using VisitSubTree to reduce the amount of nodes needed, as we 
> have one largish component (~200 nodes) in two places, and looking at 
> the debug output (my graph generator in the utils dir on the wiki) is a 
> bit horrible with many nodes.
> 
> So, VisitSubTree works fine, but IntersectAction probably needs some 
> work in order to show the correct path.
> 
> (Yes, I know, I'm going down a multiple-parents-per-node path here, 
> which OpenSG tries to avoid)

Yup. Bad boy! ;)

> Nevertheless, what I mostly need is the actual to-world transform of the 
> intersected node, not necessarily the entire path from root to node. 
> (Although it might be handy to have as well...)

IMHO that's the only way to do multi-parent right (and Inventor is the only one 
that does it). It's just much more expensive than dealing with a single 
pointer, 
which is why I would like to avoid it, and it's why OpenSG doesn't do 
multi-parent.

But given that we introduced multi-parent through the backdoor with 
VisitSubTree 
anyway we might as well get that one right and keep track of the path where 
it's 
needed.

> Does it seem a reasonable thing to fix?

Yup.

> If so, how should I go about patching that? Either just grab the 
> transform and add get-function for it (similar to Point/Object/Normal) 
> or is there some better way?

I would propose to add an optional feature to keep track of the path to the 
base 
Action. So whenever a node is pushed/popped the Action keeps track of it, if 
the 
application wants it, and just exposes it as a const std::vector<Node*>&. If 
the 
tracking is active the IntersectAction would have to copy it on intersect.

Then we would need some helper functions that do useful things on lists of 
Nodes, like calculate the accumulated matrix, but it would cover more general 
cases than just storing the transform.

Just my $.02

        Dirk

------------------------------------------------------------------------------
OpenSolaris 2009.06 is a cutting edge operating system for enterprises 
looking to deploy the next generation of Solaris that includes the latest 
innovations from Sun and the OpenSource community. Download a copy and 
enjoy capabilities such as Networking, Storage and Virtualization. 
Go to: http://p.sf.net/sfu/opensolaris-get
_______________________________________________
Opensg-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/opensg-users

Reply via email to