Quantcast

Use AnnotationEventHandler to pick up a AnnotationNode

classic Classic list List threaded Threaded
4 messages Options
Lv Qing Lv Qing
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Use AnnotationEventHandler to pick up a AnnotationNode

Hi:

     I am Using AnnotationEventHandler to pick up a AnnotationNode,or pick up some osgText object in a AnnotationNode class specificly.

     Then there is a problem,it seems the osgText's alignment and DrawMode effect the result whether it  can pick up a AnnotationNode or not.

      For example ,If an osgText's DrawMode  is  osgText::Text::BOUNDINGBOX or  osgText::Text::FILLEDBOUNDINGBOX,it can pick up perfectly.

     If osgText's DrawMode is only osgText::Text::TEXT ,and only has one line,it can pick perfectly.
     
     If osgText's DrawMode is only osgText::Text::TEXT ,but  has multi lines.Such as:

      A
      B
      C

     Then if we click the last line of osgText "C",or the half down part of "C" specificly ,it can not pick.

     I have used osgEarth::TextSymbol::ALIGN_LEFT_BOTTOM as a default alignment,if I change to another alignment.It still can not fully pick up a multi lines osgText (without boundingBox) either.The only difference is which part of multi lines I can not pick.

     So is there a better way I can fully pick up a mutil lines osgText in the AnnotationNode?


                                                                                                                                            ThX!


       

     
gwaldron gwaldron
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Use AnnotationEventHandler to pick up a AnnotationNode

Lv Qing,

AnnotationEventHandler is deprecated for picking annotation objects because of limitations like this. Instead I encourage you to look into using the RTTPicker instead. (See the osgearth_pick example for usage.)
Glenn Waldron / Pelican Mapping / @glennwaldron
Lv Qing Lv Qing
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Use AnnotationEventHandler to pick up a AnnotationNode

ThX!

      I have been still using  osgEarth 2.4 , is RTTPicker available in the osgEarth 2.4?
gwaldron gwaldron
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Use AnnotationEventHandler to pick up a AnnotationNode

No, you will need to upgrade to at least 2.8.
Glenn Waldron / Pelican Mapping / @glennwaldron
Loading...