Hi Sonya,

it is in Enviro.cpp there, see function -

void Enviro::SetWindowBox(const IPoint2 &p1, const IPoint2 &p2)

and also look at track of mouse movements see for MM_SELECTBOX in that file.

basically the approach is to render quad ( with border or without ), keep
track of mouse and resize this quad accordingly

rubber band is based on  common approach ( you might look for C++ rubber
bands in google ), and only osg one is to appropriately render  selection
quad, other tricks are non osg related.

Regards
Sergey




On Wed, Jul 2, 2014 at 1:32 PM, Sonya Blade <[email protected]>
wrote:

>  Hi Sergey,
>
> It really is very hard to locate the code portion where it implements the
> rubber
> drawing, I'm paving my way with osgHUD example to create the rubber
> banding.
>
> Your comments will be appreciated,
>
> Regards,
> ------------------------------
> Date: Wed, 2 Jul 2014 11:03:47 +0400
> From: [email protected]
> To: [email protected]
> Subject: Re: [osg-users] Rubber window for multiple selection
>
>
> Hi Sonya,
>
> if I'm not mistaken Enviro in vtp ( osg based app ) has rubber band
> implemented
>
> https://code.google.com/p/vtp/
>
> Regards
> Sergey
>
>
> On Wed, Jul 2, 2014 at 10:19 AM, Sonya Blade <[email protected]>
> wrote:
>
>  Dear All,
>
> Mainly I have 2 questions, both are to achieve the comprehensive selection
> task in OSG.
>
> #1 - How to draw a rectangle, polygonal, circle, lasso etc.. selection
> rubber?
> #2 - How to configure OSG to implement that selection defined at the first
> step?
>
> For selection part OSG Beginners book suggest to use 
> osgUtil::PolytopeIntersector
> for regional selection,
> but doesn't give any clue on how to draw the rubber or is it comes as an 
> intrinsic
> feature of
> sgUtil::PolytopeIntersector when you create it with WINDOW parameter set
> on.
>
> I also studied the osgkeyboardmouse.cpp example, but I couldn't find any
> visible difference when I switch
> from LineSegmentInteresect to PolytopeIntersector, while I was expecting
> to see the HUD window rubber
> to be drawn and objects falling into that rectangle to be selected.
>
> Your guidance will be appreciated!
>
> Regards,
>
>
> _______________________________________________
> 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
>
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to