Sofa.Core.BaseMeshTopology

class Sofa.Core.BaseMeshTopology

Bases: Topology

API providing all topology-related functions

addData(*args, **kwargs)

Overloaded function.

  1. addData(self: object, name: str, value: object = None, default: object = None, help: str = ‘’, group: str = ‘’, type: str = ‘’) -> Sofa.Core.Data

    Create a data field, then adds it to the base

    Note that this method should only be called if the field was not initialized with the initData method

    param self:

    the base itself

    param name:

    the name of the data to be added

    param value:

    the value from which the data can be created

    param help:

    help message that describes the data to be created

    param group:

    the group the data belongs to

    param type:

    the type of the data

    type self:

    object

    type name:

    string

    type value:

    object

    type help:

    string

    type group:

    string

    type type:

    string

  2. addData(self: Sofa.Core.Base, arg0: object) -> Sofa.Core.Data

    Add a data field

    param self:

    the base itself

    param d:

    the data to be added

    type self:

    Base*

    type d:

    object

    This method should only be called if the field was not initialized with the initData method

Create a Link to a SOFA component and adds it to the base

Parameters:
  • self (object) – the base itself

  • name (string) – the name of the link to be added

  • value (object) – the value from which the data can be created (either a pathname or a SofaBase)

  • help (string) – help message that describes the link to be created

This method should only be called if the field was not initialized with the initLink method

addSlave(self: Sofa.Core.Object, arg0: Sofa.Core.Object) None

Add a slave to the master BaseObject. :param slave: the slave to be added. :type slave: BaseObject

bwdInit(self: Sofa.Core.Object) None

Initialization method called at graph creation and modification, during bottom-up traversal.

cleanup(self: Sofa.Core.Object) None

Called just before deleting this object Any object in the tree bellow this object that are to be removed will be removed only after this call, so any references this object holds should still be valid.

clearLoggedMessages(self: Sofa.Core.Base) object

Remove all logged messages in the object’s logs

computeBBox(*args, **kwargs)

Overloaded function.

  1. computeBBox(self: Sofa.Core.Object) -> None

    Bounding Box computation method. Default to empty method.

  2. computeBBox(self: Sofa.Core.Object, arg0: sofa::core::ExecParams, arg1: bool) -> None

    Bounding Box computation method. Default to empty method.

countLoggedMessages(self: Sofa.Core.Base) object

Returns the number of messages in the object’s logs

findData(self: Sofa.Core.Base, arg0: str) Sofa.Core.Data

Find a data field given its name

If more than one field is found (due to aliases), only the first is returned.

:param name :type name: string :return: the data field or None

Find a link given its name

Return NULL if not found. If more than one link is found (due to aliases), only the first is returned.

Parameters:

name (string) – the name of the link

Returns:

the link

getAsACreateObjectParameter(self: Sofa.Core.Object) str

Return the full path name of this baseObject with an extra prefix ‘@’ :rtype: string

getCategories(self: Sofa.Core.Object) object

Return the list of categories the current object belongs to. :rtype: list

getClass(self: Sofa.Core.Base) Sofa.Core.BaseClass

Return the class of the object

getClassName(self: Sofa.Core.Base) str

Get the name of the class of the Base.

getContext(self: Sofa.Core.Object) object

Return the conext of the baseObject. :rtype: BaseContext

getData(self: Sofa.Core.Base, arg0: str) object

Get the data field given its name

Parameters:
  • self (Base&)

  • s (string)

Returns:

the first data found of this name

getDataFields(self: Sofa.Core.Base) list

Accessor to the vector containing all the fields of this object :return: A vector containing the data fields

getDefinitionSourceFileName(self: Sofa.Core.Base) str

Returns the name of the file that contains the object definition.

getDefinitionSourceFilePos(self: Sofa.Core.Base) int

Returns the line number where the object is defined.

getEdge(self: Sofa.Core.BaseMeshTopology, index: int) Annotated[list[int], FixedSize(2)]

Returns the vertices of Edge at index.

getEdgesAroundVertex(self: Sofa.Core.BaseMeshTopology, index: int) Sofa.Helper.Vectoruint

Returns the set of edges adjacent to a given vertex.

getEdgesInHexahedron(self: Sofa.Core.BaseMeshTopology, index: int) Annotated[list[int], FixedSize(12)]

Returns the set of edges adjacent to a given hexahedron.

getEdgesInQuad(self: Sofa.Core.BaseMeshTopology, index: int) Annotated[list[int], FixedSize(4)]

Returns the set of edges adjacent to a given quad.

getEdgesInTetrahedron(self: Sofa.Core.BaseMeshTopology, index: int) Annotated[list[int], FixedSize(6)]

Returns the set of edges adjacent to a given tetrahedron.

getEdgesInTriangle(self: Sofa.Core.BaseMeshTopology, index: int) Annotated[list[int], FixedSize(3)]

Returns the set of edges adjacent to a given triangle.

getHexahedraAroundEdge(self: Sofa.Core.BaseMeshTopology, index: int) Sofa.Helper.Vectoruint

Returns the set of hexahedra adjacent to a given edge.

getHexahedraAroundQuad(self: Sofa.Core.BaseMeshTopology, index: int) Sofa.Helper.Vectoruint

Returns the set of hexahedra adjacent to a given quad.

getHexahedraAroundVertex(self: Sofa.Core.BaseMeshTopology, index: int) Sofa.Helper.Vectoruint

Returns the set of hexahedra adjacent to a given vertex.

getHexahedron(self: Sofa.Core.BaseMeshTopology, index: int) Annotated[list[int], FixedSize(8)]

Returns the vertices of Hexahedron at index.

getInstanciationFileName(self: Sofa.Core.Base) str

Returns the line number where the object is instanciatiated.

getInstanciationSourceFilePos(self: Sofa.Core.Base) int

Returns the line number where the object is instanciatiated.

getLinkPath(*args, **kwargs)

Overloaded function.

  1. getLinkPath(self: Sofa.Core.Object) -> str

    Return the link of the baseObject :param self: the baseObject itself :type self: baseObject :rtype: string

  2. getLinkPath(self: Sofa.Core.Object) -> str

    Return the full path name of this baseObject with an extra prefix ‘@’ :rtype: string

Accessor to the vector containing all the links of this object

Returns:

A vector containing the links

getLocalEdgesInTetrahedron(self: Sofa.Core.BaseMeshTopology, index: int) Annotated[list[int], FixedSize(2)]

Returns for each index (between 0 and 5) the two vertex indices that are adjacent to that edge.

getLoggedMessagesAsString(self: Sofa.Core.Base) object

Returns a single string with all the messages logged in the internal buffer of a sofa object. Return empty string if there is no messages.

getMaster(self: Sofa.Core.Object) object

Return the master of the baseObject. :rtype: BaseObject

getName(self: Sofa.Core.Base) str

Return the name of the entity

Return type:

string

getNbEdges(self: Sofa.Core.BaseMeshTopology) int
getNbHexahedra(self: Sofa.Core.BaseMeshTopology) int
getNbLines(self: Sofa.Core.BaseMeshTopology) int
getNbPoints(self: Sofa.Core.BaseMeshTopology) int
getNbQuads(self: Sofa.Core.BaseMeshTopology) int
getNbTetrahedra(self: Sofa.Core.BaseMeshTopology) int
getNbTetras(self: Sofa.Core.BaseMeshTopology) int
getNbTriangles(self: Sofa.Core.BaseMeshTopology) int
getPathName(self: Sofa.Core.Object) str

Return the full path name of this baseObject :rtype: string

getQuad(self: Sofa.Core.BaseMeshTopology, index: int) Annotated[list[int], FixedSize(4)]

Returns the vertices of Quad at index.

getQuadsAroundEdge(self: Sofa.Core.BaseMeshTopology, index: int) Sofa.Helper.Vectoruint

Returns the set of quads adjacent to a given edge.

getQuadsAroundVertex(self: Sofa.Core.BaseMeshTopology, index: int) Sofa.Helper.Vectoruint

Returns the set of quads adjacent to a given vertex.

getQuadsInHexahedron(self: Sofa.Core.BaseMeshTopology, index: int) Annotated[list[int], FixedSize(6)]

Returns the set of quads adjacent to a given hexahedron.

getSlaves(self: Sofa.Core.Object) list

Return the slaves of the baseObject. :rtype: list

getTarget(self: Sofa.Core.Object) object

Return the target (plugin) that contains the current baseObject. :rtype: string

getTemplateName(self: Sofa.Core.Base) str

Get the name of the template of the Base.

getTetrahedraAroundEdge(self: Sofa.Core.BaseMeshTopology, index: int) Sofa.Helper.Vectoruint

Returns the set of tetrahedra adjacent to a given edge.

getTetrahedraAroundTriangle(self: Sofa.Core.BaseMeshTopology, index: int) Sofa.Helper.Vectoruint

Returns the set of tetrahedra adjacent to a given triangle.

getTetrahedraAroundVertex(self: Sofa.Core.BaseMeshTopology, index: int) Sofa.Helper.Vectoruint

Returns the set of tetrahedra adjacent to a given vertex.

getTetrahedron(self: Sofa.Core.BaseMeshTopology, index: int) Annotated[list[int], FixedSize(4)]

Returns the vertices of Tetrahedron at index.

getTriangle(self: Sofa.Core.BaseMeshTopology, index: int) Annotated[list[int], FixedSize(3)]

Returns the vertices of Triangle at index.

getTrianglesAroundEdge(self: Sofa.Core.BaseMeshTopology, index: int) Sofa.Helper.Vectoruint

Returns the set of triangles adjacent to a given edge.

getTrianglesAroundVertex(self: Sofa.Core.BaseMeshTopology, index: int) Sofa.Helper.Vectoruint

Returns the set of triangles adjacent to a given vertex.

getTrianglesInTetrahedron(self: Sofa.Core.BaseMeshTopology, index: int) Annotated[list[int], FixedSize(4)]

Returns the set of triangles adjacent to a given tetrahedron.

getVerticesAroundVertex(self: Sofa.Core.BaseMeshTopology, index: int) Sofa.Helper.Vectoruint

Returns the set of vertices adjacent to a given vertex (i.e. sharing an edge)

init(self: Sofa.Core.Object) None

Initialization method called at graph creation and modification, during top-down traversal.Initialize data.

reinit(self: Sofa.Core.Object) None

Update method called when variables used in precomputation are modified.

reset(self: Sofa.Core.Object) None

Reset to initial state. To save the initial state, see storeResetState().

setDataValues(self: Sofa.Core.Base, **kwargs) object

Set values for a the given data field, multiple pairs of args are allowed.

setDefinitionSourceFileName(self: Sofa.Core.Base, arg0: str) None

set the name of the file that contains the object definition.

setDefinitionSourceFilePos(self: Sofa.Core.Base, arg0: int) None

Set the line number where the object is defined.

setInstanciationSourceFileName(self: Sofa.Core.Base, arg0: str) None

Set the line number where the object is instanciatiated.

setInstanciationSourceFilePos(self: Sofa.Core.Base, arg0: int) None

Set the line number where the object is instanciatiated.

setName(self: Sofa.Core.Base, arg0: str) None

Set the name of this object

:param n :type n: string

setSrc(self: Sofa.Core.Object, arg0: str, arg1: Sofa.Core.Object) None

Set a source Object and parses it to collect dependent Data.

storeResetState(self: Sofa.Core.Object) None

Save the initial state for later uses in reset()