v_sim.Pair¶
- Subclasses:
 None
Methods¶
- Inherited:
 - Structs:
 
class  | 
  | 
class  | 
  | 
class  | 
  | 
  | 
|
  | 
|
  | 
|
  | 
|
  | 
|
  | 
|
  | 
|
  | 
Virtual Methods¶
- Inherited:
 
Properties¶
Name  | 
Type  | 
Flags  | 
Short Description  | 
|---|---|---|---|
r/w/co  | 
first element  | 
||
r  | 
array of links  | 
||
r/w/co  | 
second element  | 
Signals¶
- Inherited:
 
Fields¶
- Inherited:
 
Name  | 
Type  | 
Access  | 
Description  | 
|---|---|---|---|
parent  | 
r  | 
Class Details¶
- class v_sim.Pair(**kwargs)¶
 - Bases:
 - Abstract:
 No
- Structure:
 
An opaque structure to define links (i.e. several
v_sim.PairLink) between elements.- classmethod new(ele1, ele2)¶
 - Parameters:
 ele1 (
v_sim.Element) – av_sim.Elementobject.ele2 (
v_sim.Element) – av_sim.Elementobject.
- Returns:
 a newly created object.
- Return type:
 
Creates a
v_sim.Pairbetween ele1 and ele2.New in version 3.8.
- classmethod pool_foreach(whatToDo, *user_data)¶
 - Parameters:
 whatToDo (
v_sim.PairPoolForeachFunc) – a VisuPairSetForeachFunc() method ;
The way
v_sim.Pairare stored in V_Sim is private and could changed between version. This method is used to apply some method each pairs.
- classmethod pool_readLinkFromLabel(label)¶
 - Parameters:
 label (
str) – a string.- Returns:
 Trueon success.- data:
 a
v_sim.PairLinklocation.- errorMessage:
 a string location.
- Return type:
 (
bool, data:v_sim.PairLink, errorMessage:str)
Reads label and parses it to detect the definition of a
v_sim.PairLink. This pair link is added to thev_sim.Pairfrom the pool.New in version 3.8.
- addLink(minMax)¶
 - Parameters:
 minMax ([
float]) – the two min and max distances.- Returns:
 the
v_sim.PairLinkobject associated to the given two elements and distances. If none exists it is created. The returned value should not be freed.- Return type:
 
A link between two elements is characterized by its boundary distances.
- contains(link)¶
 - Parameters:
 link (
v_sim.PairLink) – av_sim.PairLinkobject.- Returns:
 Trueif link is a member of self.- Return type:
 
Tests if link is contained in self.
New in version 3.8.
- foreach(whatToDo, *user_data)¶
 - Parameters:
 whatToDo (
v_sim.PairForeachFunc) – method to apply.
Apply whatToDo on every
v_sim.PairLinkof self.New in version 3.8.
- getBondDistance(dataObj)¶
 - Parameters:
 dataObj (
v_sim.Data) – av_sim.Dataobject.- Returns:
 Trueif a significant bond length can be found.- from_:
 a location for a float.
- to:
 a location for a float.
- Return type:
 
Compute the bond distribution for the given self and look for the first peak and returns its span. When given, from and to contains the lengths between which the bond for self is the most probable.
New in version 3.8.
- getElements()¶
 - Returns:
 - ele1:
 a location to store a
v_sim.Elementobject pointer.- ele2:
 a location to store a
v_sim.Elementobject pointer.
- Return type:
 (ele1:
v_sim.Element, ele2:v_sim.Element)
Retrieve the
v_sim.Elementconstituting the pair.New in version 3.7.
- getLinks()¶
 - Returns:
 a list of
v_sim.PairLink. The list content is owned by V_Sim but the list should be freed with g_list_free() after use.- Return type:
 
There can be one or several links between elements, retrieve them with this routine.
- getNthLink(pos)¶
 - Parameters:
 pos (
int) – the position in the list of links.- Returns:
 the
v_sim.PairLinkobject associated to the given two elements and distances. If none existsNoneis returned.- Return type:
 
A link can also be retrieved by its position.
- removeLink(data)¶
 - Parameters:
 data (
v_sim.PairLink) – a link object.- Returns:
 Trueif the link exists and has been successfully removed.- Return type:
 
Delete the given link.
Property Details¶
- v_sim.Pair.props.first_element¶
 - Name:
 first-element- Type:
 - Default Value:
 - Flags:
 
first element
- v_sim.Pair.props.links¶
 - Name:
 links- Type:
 - Default Value:
 - Flags:
 
array of links
- v_sim.Pair.props.second_element¶
 - Name:
 second-element- Type:
 - Default Value:
 - Flags:
 
second element