Sofa.Core.Link
- class Sofa.Core.Link
Bases:
pybind11_object
Connection created between Data instances of two different Components
A Link allows you to access a sofa component from another one anywhere in the simulation graph. In your scene creation file, it usually appear as : input=@../component.
Example: .. code-block:: python
import Sofa.Core import SofaRuntime SofaRuntime.importPlugin(“SofaComponentAll”)
root = Sofa.Core.Node(“root”) root.addObject(“MechanicalObject”, name=”t”) link = root.findLink(“mechanicalState”) # access the link link.getValueString() # will print ‘@/t’ link.getHelp() # will print the help message for all mechanical states
- getHelp(self: Sofa.Core.Link) str
Get the help message. :rtype: string
- getLinkedBase(self: Sofa.Core.Link, index: int = 0) object
Get the linked base. :param index: index of the linked base. :type index: int
- getLinkedPath(self: Sofa.Core.Link, index: int = 0) str
Get the linked path. :param index: index of the linked path. :type index: int
- getName(self: Sofa.Core.Link) str
Get the name of the link. :rtype: string
- getOwnerBase(self: Sofa.Core.Link) object
Get the base owner of the link. :rtype: Base
- getPathName(self: Sofa.Core.Link) str
Get the linked path. :param index: index of the linked path. :type index: int
- getSize(self: Sofa.Core.Link) int
Get the size of the link. :rtype: size_t
- getValueString(self: Sofa.Core.Link) str
Print the value of the associated variable.
- getValueTypeString(self: Sofa.Core.Link) str
Print the value of the associated variable.
- isMultiLink(self: Sofa.Core.Link) bool
Checks whether the link is an array. :return: true if link is an array. :rtype: boolean
- isPersistent(self: Sofa.Core.Link) bool
Alias to match BaseData API. Checks whether the link requires a path in order to be created. :return: true if the link requires a path. :rtype: boolean
- isReadOnly(self: Sofa.Core.Link) bool
Alias to match BaseData API. Checks whether the link requires a path in order to be created. :return: true if the link doesn’t require a path. :rtype: boolean
- read(self: Sofa.Core.Link, arg0: str) bool
Read the command line. :param str: the content of the command line :type str: string
- setHelp(self: Sofa.Core.Link, arg0: str) None
Set the help message. :param message: the new help message :type message: string
- setLinkedBase(self: Sofa.Core.Link, arg0: Sofa.Core.Base) None
Get the linked base. :param index: index of the linked base. :type index: int
- setName(self: Sofa.Core.Link, arg0: str) None
Set a new name for the link. :param name: the name to be given to the link :type name: string
- setPersistent(self: Sofa.Core.Link, arg0: bool) None
Alias to match BaseData API. Changes the value of a flag, that should be set to true if link requires a path string in order to be created. :param bool: new value for the flag. :type bool: boolean