Create links
A Link allow you to access a SOFA component from another one anywhere in the simulation graph. In your scene creation file, it usually appears as : input=@../component. In this page we explain how to use it. In your .h, declare your link :
//Where it comes from (usually you do not need to include it, it is already included)
#include <sofa/core/objectmodel/Link.h>
//Use a typedef to make it readable
typedef sofa::core::objectmodel::SingleLink< FROM_CLASS, TO_CLASS, LINK_FLAG> MyLink;
MyLink mylink;
In your constructor use :
The list of flags you can use is available in the SOFA API in the LinkFlags enumeration "SofaAPIBaseLink. Here is a link to the BaseLink API. Here is an example from mapping.h. See the Mapping.inl for implementation also.