SofaPython3
xp-readthedocs
Overview
  • Compilation
  • Using the plugin
  • Modules
    • Sofa
      • Sofa.Simulation
        • Sofa.Simulation.animate
        • Sofa.Simulation.animateNSteps
        • Sofa.Simulation.init
        • Sofa.Simulation.initTextures
        • Sofa.Simulation.initVisual
        • Sofa.Simulation.load
        • Sofa.Simulation.print
        • Sofa.Simulation.reset
        • Sofa.Simulation.unload
        • Sofa.Simulation.updateVisual
      • Sofa.Core
        • Sofa.Core.Base
        • Sofa.Core.BaseContext
        • Sofa.Core.BaseMeshTopology
        • Sofa.Core.BaseNode
        • Sofa.Core.BasePrefab
        • Sofa.Core.Camera
        • Sofa.Core.ClassEntry
        • Sofa.Core.ContactListener
        • Sofa.Core.Context
        • Sofa.Core.Controller
        • Sofa.Core.Data
        • Sofa.Core.DataContainer
        • Sofa.Core.DataContainerContextManager
        • Sofa.Core.DataDict
        • Sofa.Core.DataDictIterator
        • Sofa.Core.DataEngine
        • Sofa.Core.DataLink
        • Sofa.Core.DataString
        • Sofa.Core.DataVectorString
        • Sofa.Core.ForceFieldRigid2d
        • Sofa.Core.ForceFieldRigid3d
        • Sofa.Core.ForceFieldVec1d
        • Sofa.Core.ForceFieldVec2d
        • Sofa.Core.ForceFieldVec3d
        • Sofa.Core.ForceFieldVec6d
        • Sofa.Core.Link
        • Sofa.Core.LinkPath
        • Sofa.Core.MassRigid2d
        • Sofa.Core.MassRigid3d
        • Sofa.Core.MassVec1d
        • Sofa.Core.MassVec2d
        • Sofa.Core.MassVec3d
        • Sofa.Core.MassVec6d
        • Sofa.Core.Node
        • Sofa.Core.NodeIterator
        • Sofa.Core.Object
        • Sofa.Core.ObjectFactory
        • Sofa.Core.PointSetTopologyModifier
        • Sofa.Core.PrefabLink
        • Sofa.Core.RawPrefab
        • Sofa.Core.Topology
      • Sofa.Gui
        • Sofa.Gui.BaseGUI
        • Sofa.Gui.GUIManager
      • Sofa.Helper
        • Sofa.Helper.msg_deprecated
        • Sofa.Helper.msg_error
        • Sofa.Helper.msg_fatal
        • Sofa.Helper.msg_info
        • Sofa.Helper.msg_warning
        • Sofa.Helper.MessageHandler
        • Sofa.Helper.StdVectorBaseData
        • Sofa.Helper.StdVectordouble
        • Sofa.Helper.StdVectorfloat
        • Sofa.Helper.StdVectorint
        • Sofa.Helper.StdVectorlong
        • Sofa.Helper.StdVectoruint
        • Sofa.Helper.StdVectorulong
        • Sofa.Helper.VectorBaseData
        • Sofa.Helper.Vectordouble
        • Sofa.Helper.Vectorfloat
        • Sofa.Helper.Vectorint
        • Sofa.Helper.Vectorlong
        • Sofa.Helper.Vectoruint
        • Sofa.Helper.Vectorulong
      • Sofa.Types
        • Sofa.Types.BoundingBox
      • Sofa.SofaTypes
        • Sofa.SofaTypes.SofaTypes
      • Sofa.prefab
        • Sofa.prefab.Prefab
      • Sofa.constants
        • Sofa.constants.KeyCode
        • Sofa.constants.Key
      • Sofa.msg_error
      • Sofa.msg_info
      • Sofa.msg_warning
      • Sofa.msg_deprecated
      • Sofa.SofaBaseTopology
        • Sofa.SofaBaseTopology.RegularGridTopology
        • Sofa.SofaBaseTopology.SparseGridTopology
      • Sofa.SofaConstraintSolver
        • Sofa.SofaConstraintSolver.ConstraintSolverImpl
      • Sofa.SofaDeformable
        • Sofa.SofaDeformable.LinearSpring
        • Sofa.SofaDeformable.SpringForceField_Rigid3d
        • Sofa.SofaDeformable.SpringForceField_Vec1d
        • Sofa.SofaDeformable.SpringForceField_Vec2d
        • Sofa.SofaDeformable.SpringForceField_Vec3d
        • Sofa.SofaDeformable.SpringForceField_Vec6d
      • Sofa.SofaGL
        • Sofa.SofaGL.draw
        • Sofa.SofaGL.glewInit
    • SofaExporter
      • SofaExporter.STLExporter
      • SofaExporter.VisualModelOBJExporter
    • SofaRuntime
      • SofaRuntime.importPlugin
      • SofaRuntime.unloadModules
      • SofaRuntime.formatStackForSofa
      • SofaRuntime.getStackForSofa
      • SofaRuntime.getPythonCallingPointAsString
      • SofaRuntime.getPythonCallingPoint
      • SofaRuntime.sendMessageFromException
      • SofaRuntime.sofaFormatHandler
      • SofaRuntime.sofaExceptHandler
      • SofaRuntime.getSofaFormattedStringFromException
  • Third party modules
  • Writing custom binding
  • Contributing
SofaPython3
  • Modules
  • Sofa
  • Sofa.Core
  • Sofa.Core.Link
  • View page source

Sofa.Core.Link

class Sofa.Core.Link

Bases: pybind11_object

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 of use:

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

Previous Next

© Copyright 2021, SOFA Framework.

Built with Sphinx using a theme provided by Read the Docs.