Hi Clay,

I don't have any object to making computeIntersections() virtual.  The only
sticking point is there are a collection of different
computerIntersections() methods with different parameters, you'd need to
override all of these.   What may be a better solution would be to change
the underlying intersection method - they effectively all currently use the
LineSegmentIntersector.  I don't know how you are changing the intersection
order, so really don't know if this side of things should be abstracted
away.

Robert.


On 7 March 2014 14:25, Clay Alberty <[email protected]> wrote:

> My main View class (extending osgViewer::View indirectly) uses a custom
> ordering to determine how objects in the scene are selected when a user
> e.g. clicks a mouse button.  I'm using one of the osg Draggers in a scene,
> and in its handle method it invokes View::computeIntersections to determine
> which node was clicked first, but this does not always agree with the
> custom selection routine.  As a result, clicking on the dragger when it is
> behind an object with a lower-priority selection order does not select the
> dragger and so does not work as intended.
>
> My first thought was to override the base View::computeIntersections
> method to reflect the custom logic elsewhere in the View class, but it is a
> non-virtual method.  Is there a particular reason this is so?  As a
> work-around, I overrode the handle method in the dragger, copied most of
> the code from the original implementation, and changed the selection order
> there to reflect the custom View logic, but this feels like an ugly
> solution.  Is there a better way of approaching a universal implementation
> of a custom selection order, or can View::computeIntersections be marked
> virtual?
>
> I'm using osg version 2.9.7, but I see the method is still non-virtual in
> the 3.3.0 branch.
>
> Thanks!
>
> --
> Clay Alberty
> Stellar Science
> 443-550-1151
>
>
> _______________________________________________
> osg-users mailing list
> [email protected]
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to