How can I know the number of GUIEventAdapter::USER in the message queue for GUIEventHandler?

57 views
Skip to first unread message

mirr...@gmail.com

unread,
Nov 11, 2020, 12:44:26 AM11/11/20
to OpenSceneGraph Users
system Win10 ,osg 3.6.4, osgearth 2.10.0,GTX1660   

OpenSceneGraph Users

unread,
Nov 11, 2020, 2:51:21 PM11/11/20
to OpenSceneGraph Users
EventHandlers are given single events not queues.

If you want to process the while event queue then you'll need to do this in the main loop.

mirr...@gmail.com

unread,
Nov 15, 2020, 11:56:38 PM11/15/20
to OpenSceneGraph Users
sorry,I mean  what method  get the number of GUIEventAdapter::USER  in OSG?

OpenSceneGraph Users

unread,
Nov 16, 2020, 4:42:05 AM11/16/20
to OpenSceneGraph Users
On Mon, 16 Nov 2020 at 05:05, OpenSceneGraph Users <osg-...@lists.openscenegraph.org> wrote:
sorry,I mean  what method  get the number of GUIEventAdapter::USER  in OSG?

You'll need to get the osgGA::EventQueue which you are pushing the user events to and then traverse through the events in the queue and check each one.

The application can have multiple EventQueue, one per osgViewer::Window and one osgGA::Device, and one per osgViewer::View.  The viewer EventTraversal will collate these and then pass them on to the event handlers and do the event traversal.

I know nothing about your application so really can't provide any specific advice.

Robert.

mirr...@gmail.com

unread,
Nov 17, 2020, 2:09:54 AM11/17/20
to OpenSceneGraph Users
Thank you for your questions.I want to know if the sent GUIEventAdapter::USER message has been processed completely.

Check whether GUIEventAdapter::USER has been processed completely. Should I count the USER by myself?  

OpenSceneGraph Users

unread,
Nov 17, 2020, 11:30:37 AM11/17/20
to OpenSceneGraph Users
On Tue, 17 Nov 2020 at 11:55, OpenSceneGraph Users <osg-...@lists.openscenegraph.org> wrote:
Thank you for your questions.I want to know if the sent GUIEventAdapter::USER message has been processed completely.

Check whether GUIEventAdapter::USER has been processed completely. Should I count the USER by myself? 

It's up to your application to decide when your USER events are "processed completely", as what "processed completely" is completely meaningless to the OSG itself.

It really feels like you are asking questions from the community when you are the only one who can answer it.

You have access to the whole OSG code base.  You can build in debug, step through every single line of code.  You have everything you need to figure out what is going on.

We know NOTHING about your application, only *you* know about your application and what you mean.  We aren't omnipotent. We can't see inside your head, look over your shoulder to your code.

You will need to determine the answers from here.

 
Message has been deleted

mirr...@gmail.com

unread,
Nov 24, 2020, 9:04:44 PM11/24/20
to OpenSceneGraph Users
I Send  USER  events  loading model  from qt . Is this the right approach?  

I want the progress bar in the QT to show that the  model  is loaded. So, Check whether USER evnet has been processed completely.

Are there any good Suggestions?  

OpenSceneGraph Users

unread,
Nov 25, 2020, 2:56:36 AM11/25/20
to OpenSceneGraph Users
On Wed, 25 Nov 2020 at 02:04, OpenSceneGraph Users <osg-...@lists.openscenegraph.org> wrote:
I Send  USER  events  loading model  from qt . Is this the right approach?  

I want the progress bar in the QT to show that the  model  is loaded. So, Check whether USER evnet has been processed completely.

I don't have any idea why you are talking about USER events in the context of loading.  The OSG doesn't generate any events when loading files, the loaders get passed a filename or istream and load the data and when completed return the loaded object.  THere is no tracking of progress, there is no event scheme that pass information about loading progress.

If you have your own loading scheme that uses USER events then this it entirely down to your program and nothing to do with the OSG, it really isn't something we can help you with,
 
 

mirr...@gmail.com

unread,
Nov 28, 2020, 1:46:54 AM11/28/20
to OpenSceneGraph Users

Is there a problem with adding or removing OSG nodes directly in the Qt Widget events?  

My idea is to send OSG USER events to complete the operation of adding and removing OSG nodes.

OpenSceneGraph Users

unread,
Nov 28, 2020, 6:12:43 AM11/28/20
to OpenSceneGraph Users
On Sat, 28 Nov 2020 at 06:47, OpenSceneGraph Users <osg-...@lists.openscenegraph.org> wrote:

Is there a problem with adding or removing OSG nodes directly in the Qt Widget events?  


If your application is running single threaded then adding/removing objects from the scene graph should not be an issue.  It'll only be something to be careful about when the application is multi-threaded.  The Qt aspect should not have any bearing on the operation as long as race condition isn't introduced.
 

My idea is to send OSG USER events to complete the operation of adding and removing OSG nodes.


Technically you could do it, I don't know why you think it's useful, it's not something I know of others doing.  This is entirely something your application will be doing, you can't ask use about how your code works or doesn't work.

 Perhaps a far better thing to do would be to take a big step back and rather aks about implementation details on a "solution" to a problem you've dreamed up and only lives in your code, tell us about what you want your application to do at a high level,  Perhaps then we can just tell you what is normally done in this situation. 
Reply all
Reply to author
Forward
0 new messages