[osg-users] NodeVisitors and Synchronization

Argentieri, John-P63223 John.Argentieri at gdc4s.com
Tue Sep 30 13:56:20 PDT 2008


Thanks, Glenn. I must have made some other kind of mistake then :(

________________________________

From: osg-users-bounces at lists.openscenegraph.org
[mailto:osg-users-bounces at lists.openscenegraph.org] On Behalf Of Glenn
Waldron
Sent: Tuesday, September 30, 2008 4:44 PM
To: OpenSceneGraph Users
Subject: Re: [osg-users] NodeVisitors and Synchronization


John,

Node::accept is completely synchronous. When you call accept() it will
traverse immediately and return.

Glenn


On Tue, Sep 30, 2008 at 4:26 PM, Argentieri, John-P63223
<John.Argentieri at gdc4s.com> wrote:


	Let's forget semantics then.
	 
	If I run the following code:
	 
	Node.accept( NodeVisitor& );
	Viewer.frame();
	 
	What thread calls the NodeVisitor's various accept() methods? Or
at least what stage of execution? Does the accept() call block until the
NodeVisitor traverses the scene graph, or does it happen in the Viewer's
update traversal? 
	
________________________________

	From: osg-users-bounces at lists.openscenegraph.org
[mailto:osg-users-bounces at lists.openscenegraph.org] On Behalf Of
Tomlinson, Gordon
	Sent: Tuesday, September 30, 2008 2:44 PM
	To: OpenSceneGraph Users
	Subject: Re: [osg-users] NodeVisitors and Synchronization
	
	
	Hi
	 
	You should not be doing this from the GUI thread, you should be
doing this typically in the OSG app thread, so you need to have some
form of messaging between the GUI and APP threads, such that you can
kick off  your traversals at the appropriate time
	 

	Gordon

	__________________________________________________________
	Gordon Tomlinson

	Product Manager 3D
	Email  : gtomlinson @ overwatch.textron.com
	

	__________________________________________________________
	(C): (+1) 571-265-2612
	(W): (+1) 703-437-7651

	"Self defence is not a function of learning tricks 
	but is a function of how quickly and intensely one 
	can arouse one's instinct for survival" 
	- Master Tambo Tetsura

	 
	 

________________________________

	From: osg-users-bounces at lists.openscenegraph.org
[mailto:osg-users-bounces at lists.openscenegraph.org] On Behalf Of
Argentieri, John-P63223
	Sent: Tuesday, September 30, 2008 2:09 PM
	To: osg-users at openscenegraph.org
	Subject: [osg-users] NodeVisitors and Synchronization
	
	

	Folks, 

	Once I've called Node::accept(NodeVisitor&), does
osgViewer::Viewer wait until the update traversal to let the NodeVisitor
perform it's traversal? If I am in the GUI thread when I call accept(),
does NodeVisitor::apply happen in the GUI thread? Or does it happen in
an osgViewer thread based on the threading model?

	I'm trying to make sure my NodeVisitor's have done their work
before reacting to osg::Camera's PostDraw callback. 

	I am considering having nodes accept all visitors, waiting for a
single update callback, then registering for the osg::Camera's postdraw
callback. Do you guys think that will solve my synchronization problem?

	Thanks, 

	John Argentieri 
	Software Engineer 
	GENERAL DYNAMICS 
	C4 Systems 
	John.Argentieri at gdc4s.com 


	_______________________________________________
	osg-users mailing list
	osg-users at lists.openscenegraph.org
	
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.or
g
	
	




-- 
Glenn Waldron : Pelican Mapping : http://pelicanmapping.com :
+1.703.652.4791

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openscenegraph.org/pipermail/osg-users-openscenegraph.org/attachments/20080930/c63d77c1/attachment-0003.htm>


More information about the osg-users mailing list