Hi Christophe (again),

 

You're part of the way there: that code will handle calls from C# to C++.  
You'll need to add code to the adapter and unknown object classes in the same 
file to complete the support.  Take a look at, for example, the generated 
wrapper code for osg::Group::replaceChild for a model of what the code should 
look like.

 

The GeneratedCode.uml file in the doc directory has some class and sequence 
diagrams covering the design of the virtual function support if you'd like more 
background.  It can be viewed with StarUML. 

 

-Mike

 

________________________________

From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Christophe Medard
Sent: Friday, August 17, 2007 8:32 AM
To: [email protected]
Subject: [osg-users] osgDotNet : Used from C#

 

Continuing on that second issue (still trying to uderstand the first one) :

 

> Virtual function invocation among wrappers, user-defined subclasses of 
> wrappers, and native code 

> works in all directions by virtue of the design of osgDotNet. This support 
> also extends to hand-coded 

> virtual function wrappers if their implementations mimic the auto-generated 
> support code for virtual

> functions.

 

Well I managed to add the following code in osgDotNet's Osg's NodeCallback.cpp :

void NodeCallback::operator()(Osg::Node ^ node, Osg::NodeVisitor ^ nv)
{
___vtnp(this)->operator()(___vtnp(node), ___vtnp(nv));
}

and of course this one in osgDotNet's Osg's NodeCallback.h :

virtual void operator()(Osg::Node ^ node, Osg::NodeVisitor ^ nv);

 

 

Everything builds right and I can see the following addition : 
Osg.NodeCallback.op_FunctionCall(Osg.Node node, Osg.NodeVisitor nv)  from my C# 
application which allows me to write my UpdateCB inherited from 
Osg.NodeCallback, but in real time my UpdateCB.op_FunctionCall(...) isn't 
called. 

 

In fact, I don't see the mecanics that'd allow in the first place the osgDotNet 
NodeCallback.operator()() to be called when native NodeCallback.operator()() 
is...

Are you sure this use case works ?

 

Sorry for bothering with that, but I don't see any other way to manage to do 
scenegraph update without having it colliding with cull and draw (at least in 
osg >= 2.0.0).

 

-- 
Christophe Médard
Société OKTAL (http://www.oktal.fr)
2 impasse Boudeville
31100 Toulouse (France)
Tél. : (+33) 5 62 11 50 10
Fax : (+33) 5 62 11 50 29

 

_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to