← Back to team overview

yade-users team mailing list archive

Re: [Question #265275]: Inheritance of State Class - add variables

 

Question #265275 on Yade changed:
https://answers.launchpad.net/yade/+question/265275

Bruno Chareyre proposed the following answer:
Hi,
You can use conventional C++ inheritance and add the new variables with the YADE_CLASS macro:

class MyState: State
{
   YADE_CLASS(...
      ((int, myNewVariable,...))
}

A python code generating a body with this new State  would read:

b=Body()
b.state=MyState()

-- 
You received this question notification because you are a member of
yade-users, which is an answer contact for Yade.