Hello Johannes,
[email protected] wrote:
> today I ask for some guidance with the following problem:
>
> I have written a pick framework which allows fast frustum picking of
> polygons, lines and points. In principle this works fine until recently.
> Problems show up the moment I have introduced the first 'InverseTransform'
> core into the scene graph. After some debugging I found that I have made a
> terrible mistake in my "SimpleSelectionFunctor" class. Eliminating this error
> did reveal a weakness, at least IMHO, of the OpenSG framework, which I would
> like to remove. But maybe I did it all completely wrong and should take
> another route. So allow me to lay done my design and implementation so that
> you can understand the core of my problem.
[SNIP - code]
> Now, I'm at the core of my problem. 'NodeCore' base class function
> 'accumulateMatrix' is protected, therefore preventing polymorphic dispatching
> to the correct implementation in my client code. Of course, I could write
> different handler functions for each class, like
> 'enterAccumulateInverseTransform', but that is cumbersome and does not scale
> very well.
hm, so far the experience was that actions need to handle different
cores in quite specific ways, so special handlers were needed anyways.
> So my point is that NodeCore::accumulateMatrix and NodeCore::adjustVolume
> should be public instead.
I can see an argument for accumulateMatrix, however the idea of
adjustVolume is that it modifies the volume in a way so that it contains
the core, e.g. for Geometry the volume is expanded to contain all points
of the Geometry.
For your case being able to call accumulateMatrix should allow you to
implement one handler that can handle a large number of cores.
> If there is a more elegant way to write custom actions I would be glad to
> learn about them. However, until now my solution did work quite fine.
>
> Any help and suggestions are appreciated.
I'll make accumulateMatrix public, but will keep adjustVolume protected
unless you have a pressing need for it (the code you posted did not
attempt to use it?).
Cheers,
Carsten
------------------------------------------------------------------------------
This SF.net email is sponsored by:
SourcForge Community
SourceForge wants to tell your story.
http://p.sf.net/sfu/sf-spreadtheword
_______________________________________________
Opensg-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/opensg-users