I was thinking of declaring two variables (idA and idB), and use a function getVariable() or setVariable(argument) to change it. So that I can asses information using "scene->body::[idA].get()->state->pos" and it doesn't get messed up. Or will it still?
Could you explain more about omp_get_thread_num() and static variable? How can I switch of f parallel processing (scons jobs=1)? Yours, Boon ---------------------------------------- > From: [email protected] > To: [email protected] > Date: Mon, 5 Apr 2010 16:54:57 +0200 > Subject: Re: [Yade-dev] How to use a plugin > >> Does doing this, mean that my file CWBoonPlugin.cpp will have assess to >> both YADE functions like interaction->id1 and state->pos, as well >> as the external C library? In other words, behave like any other >> Ig2Functor? > > Yes, you will have access to all functions. > > It is up to you to figure out how to find the interaction object when > that function is called, since getScene() only gives you the whole > scene. You could in principle set some static variables before passing > the pointer to the optimization library, but that would break badly if > you did it in parallel section (Ig2 functors are executed in parallel). > [you could in principle have static array of pointers and set > omp_get_thread_num()'th item each time, that would guarantee that eeach > thread uses pointers that are its own] > > v > > > > _______________________________________________ > Mailing list: https://launchpad.net/~yade-dev > Post to : [email protected] > Unsubscribe : https://launchpad.net/~yade-dev > More help : https://help.launchpad.net/ListHelp _________________________________________________________________ Hotmail: Free, trusted and rich email service. https://signup.live.com/signup.aspx?id=60969 _______________________________________________ Mailing list: https://launchpad.net/~yade-dev Post to : [email protected] Unsubscribe : https://launchpad.net/~yade-dev More help : https://help.launchpad.net/ListHelp

