Top | ![]() |
![]() |
![]() |
![]() |
VisuPairVisuPair — V_Sim can draw link between nodes. This part defines a pair object and interface to draw pairs. |
VisuElement * | first-element | Read / Write / Construct Only |
GArray * | links | Read |
VisuElement * | second-element | Read / Write / Construct Only |
The visu_pairs.c defines only general methods to draw
pairs. It introduces a new object called VisuPairLink. This stores
some characteristics on links between two VisuElement. The main
characteristic is that pairs are drawn only if the length between
two nodes is in a specific range. Use visu_pair_link_setDistance()
and
visu_pair_link_getDistance()
to tune this range.
This file does not draw any pairs. But it gives some
interface to create rendering capabilities. To create a new pair
rendering module, called VisuPairExtension, use
visu_pair_extension_new()
. Basically, a VisuPairExtension is characterized
by it drawing method. But it can have other methods that are called
in different cases. See main()
and
startStop()
prototypes to have more informations.
VisuPair * visu_pair_new (VisuElement *ele1
,VisuElement *ele2
);
Creates a VisuPair between ele1
and ele2
.
Since: 3.8
void visu_pair_getElements (const VisuPair *pair
,VisuElement **ele1
,VisuElement **ele2
);
Retrieve the VisuElement constituting the pair.
pair |
a VisuPair object. |
|
ele1 |
a location to store a VisuElement object pointer. |
[out][allow-none][transfer none] |
ele2 |
a location to store a VisuElement object pointer. |
[out][allow-none][transfer none] |
Since: 3.7
VisuPairLink * visu_pair_addLink (VisuPair *pair
,const float minMax[2]
);
A link between two elements is characterized by its boundary distances.
the VisuPairLink object associated to the given two elements and distances. If none exists it is created. The returned value should not be freed.
[transfer none]
gboolean visu_pair_removeLink (VisuPair *pair
,VisuPairLink *data
);
Delete the given link.
GList *
visu_pair_getLinks (VisuPair *pair
);
There can be one or several links between elements, retrieve them with this routine.
a list of
VisuPairLink. The list content is owned by V_Sim but the list
should be freed with g_list_free()
after use.
[element-type VisuPairLink*][transfer container]
VisuPairLink * visu_pair_getNthLink (VisuPair *pair
,guint pos
);
A link can also be retrieved by its position.
the VisuPairLink object associated to the given two elements and distances. If none exists NULL is returned.
[transfer none]
gboolean visu_pair_contains (const VisuPair *pair
,const VisuPairLink *link
);
Tests if link
is contained in pair
.
Since: 3.8
gboolean visu_pair_getBondDistance (VisuPair *pair
,VisuData *dataObj
,gfloat *from
,gfloat *to
);
Compute the bond distribution for the given pair
and look for the
first peak and returns its span. When given, from
and to
contains
the lengths between which the bond for pair
is the most probable.
Since: 3.8
void (*VisuPairForeachFunc) (VisuPair *pair
,VisuPairLink *data
,gpointer user_data
);
Prototype of functions called with the foreach method apply to each links in a pair.
void visu_pair_foreach (VisuPair *pair
,VisuPairForeachFunc whatToDo
,gpointer user_data
);
Apply whatToDo
on every VisuPairLink of pair
.
pair |
a VisuPair object. |
|
whatToDo |
method to apply. |
[scope call][closure user_data] |
user_data |
some user data. |
[closure] |
Since: 3.8
VisuPairDistribution * visu_pair_getDistanceDistribution (VisuPair *pair
,VisuData *dataObj
,float step
,float min
,float max
);
This will compute the distance distribution of nodes for the given
pair
.
gboolean visu_pair_distribution_getNextPick (VisuPairDistribution *dd
,guint startStopId[2]
,guint *integral
,guint *max
,guint *posMax
);
Try to find the next pick in the distribution. A pick is a group of
consecutive non-null values, with a significant integral. On enter,
startStopId
contains the span to look into for the pick, and on
output, it contains the span of the pick itself.
dd |
a VisuPairDistribution object. |
|
startStopId |
two ids. |
|
integral |
a location for a guint value, can be NULL. |
|
max |
a location to store the value ; |
|
posMax |
a location to store the position of the pick. |
Since: 3.6
struct VisuPairDistribution { VisuElement *ele1, *ele2; guint *histo; guint nValues; float initValue, stepValue; guint nNodesEle1, nNodesEle2; };
This structure stores for a given pair, the distance distribution
on a given range [initValue
;nValues
* stepValue
[.
VisuElement * |
one VisuElement. |
|
VisuElement * |
one VisuElement. |
|
guint * |
an array containing the distribution ; |
|
guint |
the size of the array ; |
|
the initial distance value (usualy 0) ; |
||
the step increase in distance at each value ; |
||
guint |
the number of nodes used during the computation ; |
|
guint |
idem for VisuElement 2. |
“first-element”
property“first-element” VisuElement *
first element.
Flags: Read / Write / Construct Only
“second-element”
property“second-element” VisuElement *
second element.
Flags: Read / Write / Construct Only