VisuPairLink

VisuPairLink — An object to store rendering properties of a VisuPair for a given distance criterion.

Functions

Properties

ToolColor * color Read / Write
gboolean display-length Read / Write
gboolean drawn Read / Write
gfloat max Read / Write
gfloat min Read / Write
guint units Read / Write

Types and Values

Object Hierarchy

    GObject
    ╰── ToolDbgObj
        ╰── VisuPairLink

Implemented Interfaces

VisuPairLink implements VisuPairWire and VisuPairCylinder.

Description

VisuPair describes pairs between two VisuElement. Such a pair can have several VisuPairLink, depending on a distance criterion. Each link then has several rendering parameters, such as its color, its rendering method (wire or cylinder), if it is drawn...

Functions

visu_pair_link_new ()

VisuPairLink *
visu_pair_link_new (VisuElement *ele1,
                    VisuElement *ele2,
                    const float minMax[2]);

A link between two elements is characterized by its boundary distances.

Parameters

ele1

a VisuElement object ;

 

ele2

a VisuElement object ;

 

minMax

the two min and max distances.

[array fixed-size=2]

Returns

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]


visu_pair_link_getFirstElement ()

VisuElement *
visu_pair_link_getFirstElement (VisuPairLink *data);

Retrieve one of the VisuElement data is linking.

Parameters

data

a VisuPairLink object.

 

Returns

a VisuElement the link is linking.

[transfer full]

Since: 3.8


visu_pair_link_getSecondElement ()

VisuElement *
visu_pair_link_getSecondElement (VisuPairLink *data);

Retrieve one of the VisuElement data is linking.

Parameters

data

a VisuPairLink object.

 

Returns

a VisuElement the link is linking.

[transfer full]

Since: 3.8


visu_pair_link_setDrawn ()

gboolean
visu_pair_link_setDrawn (VisuPairLink *data,
                         gboolean drawn);

A pair can or cannot be drawn, use this method to tune it.

Parameters

data

a VisuPairLink object ;

 

drawn

a boolean.

 

Returns

TRUE if parameter has been changed.


visu_pair_link_getDrawn ()

gboolean
visu_pair_link_getDrawn (const VisuPairLink *data);

A pair can or cannot be drawn, use this method to retrieve its state.

Parameters

data

a VisuPairLink object ;

 

Returns

TRUE if pairs can be drawn.


visu_pair_link_setColor ()

gboolean
visu_pair_link_setColor (VisuPairLink *data,
                         const ToolColor *destColor);

Set the color of the given pair.

Parameters

data

a VisuPairLink object ;

 

destColor

a ToolColor object.

 

Returns

TRUE if parameter has been changed.


visu_pair_link_getColor ()

ToolColor *
visu_pair_link_getColor (const VisuPairLink *data);

Look for the properties of the pair data to find if a colour has been defined. If none, the default colour is returned instead.

Parameters

data

a VisuPairLink object.

 

Returns

a colour (don't free it).

[transfer none]


visu_pair_link_setPrintLength ()

gboolean
visu_pair_link_setPrintLength (VisuPairLink *data,
                               gboolean status);

Set the attribute that controls if the length of pairs are drawn near pairs.

Parameters

data

a VisuPairLink object ;

 

status

TRUE to print length near pairs.

 

Returns

TRUE if parameter has been changed.


visu_pair_link_getPrintLength ()

gboolean
visu_pair_link_getPrintLength (const VisuPairLink *data);

Get the print length parameter of a pair. This parameter is used to tell if length should be drawn near pairs of this kind.

Parameters

data

a VisuPairLink object.

 

Returns

TRUE if length are printed.


visu_pair_link_setDistance ()

gboolean
visu_pair_link_setDistance (VisuPairLink *data,
                            float val,
                            VisuPairLinkDistances minOrMax);

Set the minimum or the maximum length for the given pair.

Parameters

val

a floating point value ;

 

data

a VisuPairLink object ;

 

minOrMax

VISU_DISTANCE_MAX or VISU_DISTANCE_MIN.

 

Returns

TRUE if parameter has been changed.


visu_pair_link_getDistance ()

float
visu_pair_link_getDistance (const VisuPairLink *data,
                            VisuPairLinkDistances minOrMax);

A pair between ele1 and ele2 is drawn only if its length is between a minimum and a maximum value. This method can get these values.

Parameters

data

a VisuPairLink object ;

 

minOrMax

VISU_DISTANCE_MIN or VISU_DISTANCE_MAX.

 

Returns

the minimum or the maximum value for the pair between ele1 and ele2 .


visu_pair_link_setUnits ()

gboolean
visu_pair_link_setUnits (VisuPairLink *data,
                         ToolUnits units);

Define the unit used to store the distances.

Parameters

data

a VisuPairLink object.

 

units

a unit.

 

Returns

TRUE if value is actually changed.

Since: 3.8


visu_pair_link_getUnits ()

ToolUnits
visu_pair_link_getUnits (const VisuPairLink *data);

Get the units of distance definition of data .

Parameters

data

a VisuPairLink object.

 

Returns

TRUE if length are printed.


visu_pair_link_match ()

gboolean
visu_pair_link_match (const VisuPairLink *data,
                      const float minMax[2]);

Returns if data is a link with distance criterions defined by minMax .

Parameters

data

a VisuPairLink object.

 

minMax

two floats.

[array fixed-size=2]

Returns

TRUE, if data matches minMax .

Since: 3.8


visu_pair_link_isDrawn ()

gboolean
visu_pair_link_isDrawn (const VisuPairLink *data);

A link is used or not depending on a distance criterion and a flag, see visu_pair_link_setDrawn() and visu_pair_link_setDistance().

Parameters

data

a VisuPairLink object.

 

Returns

TRUE if the data is indeed drawn or not.

Since: 3.7


visu_pair_link_iter_new ()

gboolean
visu_pair_link_iter_new (VisuPairLink *link,
                         VisuData *data,
                         VisuPairLinkIter *iter,
                         gboolean usePeriodicty);

Initialise a new VisuPairLinkIter structure to iterate over links defined by link in data . If usePeriodicty is TRUE, all links between two nodes are kept if their smallest vector, using the periodicty, is within the link distance criterion.

Parameters

link

a VisuPairLink object.

 

data

a VisuData object.

 

iter

a pointer to a VisuPairLinkIter structure.

[out caller-allocates]

usePeriodicty

a boolean.

 

Returns

TRUE if there is a valid link to draw.

Since: 3.8


visu_pair_link_iter_next ()

gboolean
visu_pair_link_iter_next (VisuPairLinkIter *iter);

Iterate to the next VisuNode - VisuNode pair.

Parameters

iter

a VisuPairLinkIter object.

 

Returns

TRUE if iterator is still valid.

Since: 3.8

Types and Values

enum VisuPairLinkDistances

This is useful with the visu_pair_link_getDistance() and the visu_pair_link_setDistance() methods.

Members

VISU_DISTANCE_MIN

Flag used to define the minimum length to draw pair.

 

VISU_DISTANCE_MAX

Flag used to define the maximum length to draw pair.

 

Since: 3.8


struct VisuPairLink

struct VisuPairLink;

An opaque structure.


struct VisuPairLinkClass

struct VisuPairLinkClass {
  VisuObjectClass parent;
};

A short way to identify _VisuPairLinkClass structure.

Members

VisuObjectClass parent;

the parent class;

 

struct VisuPairLinkIter

struct VisuPairLinkIter {
  VisuPairLink *parent;

  VisuData *data;
  VisuNodeArrayIter iter1, iter2;

  float buffer;
  float l2[2], l2_buffered[2];

  VisuBox *box;
  gboolean periodic;
  float xyz1[3], xyz2[3], dxyz[3];
  float d2, coeff;
};

An iterator used to generate pairs with the characteristics given by parent , over the node in data .

Members

VisuPairLink *parent;

the VisuPairLink this iterator is inheriting his properties.

 

VisuData *data;

the VisuData this iterator have to work on.

 

VisuNodeArrayIter iter1;

a VisuNodeArrayIter.

 

VisuNodeArrayIter iter2;

a second VisuNodeArrayIter.

 

float buffer;

the length of the buffer around links, in percents.

 

float l2[2];

the current link length, squared.

 

float l2_buffered[2];

like l2 , but including the buffer.

 

VisuBox *box;

a given box to apply periodicity if needed.

[allow-none]

gboolean periodic;

a boolean specifying if periodicity is to be taken into account when computing the vector linking two nodes.

 

float xyz1[3];

the current coordinates of the starting node in the link.

 

float xyz2[3];

the current coordinates of the ending node in the link.

 

float dxyz[3];

the current vector (within periodicity) linking node1 to node2.

 

float d2;

the length of the link, squared.

 

float coeff;

a value used to characterised link length with respect to buffer (1. means that length is within link characteristics, while

  1. means that link is outside characteristics plus buffer).

 

Since: 3.8

Property Details

The “color” property

  “color”                    ToolColor *

rendering color.

Flags: Read / Write


The “display-length” property

  “display-length”           gboolean

link displays its length or not.

Flags: Read / Write

Default value: FALSE


The “drawn” property

  “drawn”                    gboolean

link is displayed or not.

Flags: Read / Write

Default value: TRUE


The “max” property

  “max”                      gfloat

maximal distance.

Flags: Read / Write

Allowed values: >= 0

Default value: 0


The “min” property

  “min”                      gfloat

minimal distance.

Flags: Read / Write

Allowed values: >= 0

Default value: 0


The “units” property

  “units”                    guint

Units of dimensions.

Flags: Read / Write

Allowed values: <= 3

Default value: 0