Top | ![]() |
![]() |
![]() |
![]() |
VisuColorizationVisuColorization — Adds a possibility to colorize nodes depending on data read in an input file. |
gboolean | apply-all | Read / Write |
VisuBox * | box | Read / Write |
gint | column-blue | Read / Write |
gint | column-green | Read / Write |
gint | column-red | Read / Write |
gint | column-size | Read / Write |
GArray * | data-min-max | Read |
guint | n-columns | Read |
guint | normalisation | Read / Write |
GArray * | range-min-max | Read / Write |
ToolShade * | shade | Read / Write |
gint | single-param | Read / Write |
ToolMinmax * | single-range | Read |
gchar * | source-file | Read |
enum | VisuColorizationInputScaleId |
#define | VISU_COLORIZATION_UNSET |
#define | VISU_COLORIZATION_FROM_X |
#define | VISU_COLORIZATION_FROM_Y |
#define | VISU_COLORIZATION_FROM_Z |
#define | VISU_COLORIZATION_LABEL |
struct | VisuColorization |
struct | VisuColorizationClass |
With this module, it is possible to colorize nodes depending
on data read in an input file. An input file can be associated to a
VisuData object using visu_colorization_new()
. Doing this, the
rendering is changed and nodes are colorized following a scheme
describe later. To turn off colorization without removing the data
file (for temporary turn off for instance), use
visu_data_colorizer_setActive()
.
The input file must have the same numbers of uncommented lines as there are nodes in the VisuData associated with. If less data is given, missing data are treaded as min values data. The input data file can has as much column as desired. The colorization is based on a linear color transformation. This transformation is applied on color channel in RGB mode or in HSV mode. Resulting color is given by : [resulting color vect] = [vectB] + [input data][vectA], where [input data] are input data scaled to [0;1]. It is possible to choose which column multiplies which color channel.
It is implementing VisuNodeMasker interface, thus allowing to hide nodes depending on colorization values.
VisuColorization * visu_colorization_new ();
Create a new object to store colorisation data.
Since: 3.7
VisuColorization * visu_colorization_new_fromCLI (VisuData *dataObj
,GError **error
);
Use all command line options related to colorization to create a
new colorization object, storing its values in dataObj
.
Since: 3.8
gboolean visu_colorization_setBox (VisuColorization *dt
,VisuBox *box
);
Change the associated box
for dt
. This box is used for the
coordinate colourisation.
Since: 3.8
void visu_colorization_setNodeModel (VisuColorization *dt
,VisuNodeValuesFarray *values
);
Change the VisuNodeValuesFarray this dt
is associated to.
Since: 3.8
gboolean visu_colorization_setScaleType (VisuColorization *dt
,VisuColorizationInputScaleId scale
);
This method is used to change the scale method used on input data.
See VisuColorizationInputScaleId for further informations. This method raises
a error if no input file has already been associated to the give visuData
.
VisuColorizationInputScaleId
visu_colorization_getScaleType (const VisuColorization *dt
);
Retrieve the scaling method of input data associated to the given dt
.
gboolean visu_colorization_setMin (VisuColorization *dt
,float min
,int column
);
When the scaling method is VISU_COLORIZATION_MINMAX (see VisuColorizationInputScaleId)
min and max value for convert input data are user defined. Use this method
to choose the minimum bound. This method raises
a error if no input file has already been associated to the give visuData
.
gboolean visu_colorization_setMax (VisuColorization *dt
,float max
,int column
);
When the scaling method is VISU_COLORIZATION_MINMAX (see VisuColorizationInputScaleId)
min and max value for convert input data are user defined. Use this method
to choose the maximum bound. This method raises
a error if no input file has already been associated to the give visuData
.
float visu_colorization_getMin (const VisuColorization *dt
,int column
);
Retrieve the minimum value used when scaling is user defined.
float visu_colorization_getMax (const VisuColorization *dt
,int column
);
Retrieve the maximum value used when scaling is user defined.
gboolean visu_colorization_setColUsed (VisuColorization *dt
,int val
,int pos
);
Choose if the loaded value should change the given channel of the colour.
dt |
a VisuColorization object ; |
|
val |
a column id a special value ; |
|
pos |
an integer in [0;2]. |
gboolean visu_colorization_setColUsedArr (VisuColorization *dt
,const int vals[3]
);
Setup all three channels at once, see visu_colorization_setColUsed()
.
dt |
a VisuColorization object. |
|
vals |
the new columns to be used per channel. |
[array fixed-size=3] |
Since: 3.8
const int *
visu_colorization_getColUsed (const VisuColorization *dt
);
This method is used to retrieve the vector used to adapt or not the colour to the value of the loaded data.
int
visu_colorization_getNColumns (const VisuColorization *dt
);
This method is used to retrieve the number of columns of data read in the loaded file.
gboolean visu_colorization_getSingleColumnId (const VisuColorization *dt
,gint *id
);
The colourisation can be applied from values coming from several
columns. But, if only one column is used, this routine will give it
in id
.
gboolean visu_colorization_setShade (VisuColorization *dt
,const ToolShade *shade
);
Apply all caracteristic of the given shade to the colorization dt
.
dt |
the VisuColorization object which the colour data are associated to ; |
|
shade |
a valid ToolShade object. |
const ToolShade *
visu_colorization_getShade (const VisuColorization *dt
);
Return the shade used to colourise the nodes.
gboolean visu_colorization_setScalingUsed (VisuColorization *dt
,int val
);
Give the column id to used to take the scaling values from. Set -1 if no scaling used. The scaling is used to change the size of each node, using an homothetic factor.
int
visu_colorization_getScalingUsed (const VisuColorization *dt
);
Retrieve if a column is used as entry to scale the nodes.
gboolean visu_colorization_setRestrictInRange (VisuColorization *dt
,gboolean status
);
The colourisation can be applied on all nodes or on nodes within
range. See visu_colorization_getRestrictInRange()
and
visu_colorization_setMin()
and visu_colorization_setMax()
.
Since: 3.7
gboolean
visu_colorization_getRestrictInRange (const VisuColorization *dt
);
The colourisation can be applied on all nodes or on nodes within
range. See visu_colorization_setRestrictInRange()
.
Since: 3.7
const gchar *
visu_colorization_getFile (const VisuColorization *dt
);
If the given dt
has an input data file already loaded, it returns its name.
Control how input data are converted into [0;1], after conversion, values are clamped if needed.
#define VISU_COLORIZATION_UNSET -4
To be used when a column id is awaited. A constant value will then be used.
#define VISU_COLORIZATION_FROM_X -3
To be used when a column id is awaited. The reduced coordinate in x direction will then be used.
#define VISU_COLORIZATION_FROM_Y -2
To be used when a column id is awaited. The reduced coordinate in y direction will then be used.
#define VISU_COLORIZATION_FROM_Z -1
To be used when a column id is awaited. The reduced coordinate in z direction will then be used.
#define VISU_COLORIZATION_LABEL _("Colorization data")
Default label used to name colourisation data.
struct VisuColorization;
An opaque structure to store colorisation settings.
Since: 3.7
struct VisuColorizationClass { VisuDataColorizerClass parent; };
Common name to refer to a _VisuColorizationClass.
“apply-all”
property“apply-all” gboolean
apply colorization on all nodes.
Flags: Read / Write
Default value: TRUE
“column-blue”
property“column-blue” gint
column the blue channel is read from.
Flags: Read / Write
Allowed values: >= -4
Default value: -4
“column-green”
property“column-green” gint
column the green channel is read from.
Flags: Read / Write
Allowed values: >= -4
Default value: -4
“column-red”
property“column-red” gint
column the red channel is read from.
Flags: Read / Write
Allowed values: >= -4
Default value: -4
“column-size”
property“column-size” gint
column the size factor is read from.
Flags: Read / Write
Allowed values: >= -4
Default value: -4
“normalisation”
property“normalisation” guint
input normalisation scheme.
Flags: Read / Write
Allowed values: <= 1
Default value: 0
“range-min-max”
property“range-min-max” GArray *
min / max range to normalise data.
Flags: Read / Write
“single-param”
property“single-param” gint
colorization data is single variable.
Flags: Read / Write
Allowed values: >= -4
Default value: -4
“source-file”
property“source-file” gchar *
Source file if any.
Flags: Read
Default value: NULL