Callbacks

CommitVertices (vertices, id, rgba, material, data)

ConfigFileEnumFunc (label, value)

ConfigFileExportFunc (data, dataObj)

ConfigFileReadFunc (entry, lines, nbLines, position)

DataLoaderFunc (self, data, type, iSet, cancel)

DumpCairoAdd (cr, width, height)

DumpDataWriteFunc (format, fileName, dataObj)

FileFormatValidate (filename)

InitFunc ()

NodeArrayElementPropertyInit (element, value)

NodeArrayIterFunc (array, iter, *data)

NodeMaskerFunc (masker, at, *data)

NodeValuesFarrayNrm2 (vect, value)

NodeValuesFromString (vals, node, string)

NodeValuesGetAt (vals, node)

NodeValuesSetAt (vals, node, value)

NodeValuesVectorShift (vect, node, dxyz)

NodeValuestoString (vals, node)

PairForeachFunc (pair, data, *user_data)

PairPoolForeachFunc (pair, *user_data)

PlaneSetItemFree (plane, data)

PlaneSetItemNew (plane, data)

PluginFreeFunc ()

PluginInfoFunc ()

PluginInitFunc ()

ScalarFieldMethodLoadFunc (meth, data, cancel)

UiInitWidgetFunc (panel, renderWindow, renderArea)

UiMainInitFunc (ui)

UiNewWidgetFunc ()

UiPairsInitFunc ()

UiPairsSetValuesFunc (data)

UiPairsToLabelFunc (data)

VoidDataFunc (data)

matrix_getScaledValue (x, minmax)

Details

v_sim.CommitVertices(vertices, id, rgba, material, data)
Parameters:
  • vertices ([float]) – vertices to be commited.

  • id (int) – a buffer id.

  • rgba (float) – the colour used for the vertices.

  • material (float) – the material for the vertices.

  • data (object or None) – some user defined data.

Prototype of function used by the various v_sim.ElementRenderer objects when they are drawing their shape.

New in version 3.9.

v_sim.ConfigFileEnumFunc(label, value)
Parameters:
  • label (str) – a string.

  • value (int) – a location to store an enum value.

Returns:

True if found.

Return type:

bool

Try to match label with a enum value.

New in version 3.8.

v_sim.ConfigFileExportFunc(data, dataObj)
Parameters:

This prototype defines a method that is used to export some resources or parameters. The data argument is an empty GLib.String where the export has to be written. If the argument dataObj is not null, only resources related to the v_sim.Data object should be exported (for parameters files, dataObj is always None).

v_sim.ConfigFileReadFunc(entry, lines, nbLines, position)
Parameters:
Returns:

True if everything goes right, False otherwise.

Return type:

bool

This prototype corresponds to methods called when an entry is found. The lines argument is an array of lines read from the files. These strings are copies and can be modified but not freed. There are nbLines and this value correspond to the number of lines defined for the entry. The error argument is used to store some text messages and error ids. They should be in UTF8. The error argument must be initialised with (GLib.Error)0. The position argument give the number of the first line given in lines argument.

v_sim.DataLoaderFunc(self, data, type, iSet, cancel)
Parameters:
Returns:

True if the file matches the format defined by self, even if some parsing errors may occur.

Return type:

bool

Prototype of function to load a file and populate data accordingly. The file is taken from v_sim.DataLoadable.getFilename() using type.

New in version 3.8.

v_sim.DumpCairoAdd(cr, width, height)
Parameters:

A method to be called by V_Sim after exportation to allow post-processing.

v_sim.DumpDataWriteFunc(format, fileName, dataObj)
Parameters:
Returns:

True if everything went right.

Return type:

bool

This is a prototype of a method implemented by a dumping extension that is called when the current rendering must be dumped to a file.

v_sim.FileFormatValidate(filename)
Parameters:

filename (str) – a path.

Returns:

True if filename is a valid name for a file format.

Return type:

bool

Function to match a given filename for a file format. See v_sim.FileFormat.setValidator().

New in version 3.7.

v_sim.InitFunc()

These methods are used by V_Sim to initialise some part of the program. They are called once on start-up.

v_sim.NodeArrayElementPropertyInit(element, value)
Parameters:

Prototype of routine used to initialise an element property.

New in version 3.7.

v_sim.NodeArrayIterFunc(array, iter, *data)
Parameters:
Return type:

bool

Prototype of function that evaluates a boolean condition on a given node in a node iteration.

New in version 3.8.

v_sim.NodeMaskerFunc(masker, at, *data)
Parameters:
Returns:

True to hide a node depending on values in at.

Return type:

bool

Function to decide to hide a node or not.

New in version 3.8.

v_sim.NodeValuesFarrayNrm2(vect, value)
Parameters:
Return type:

float

Prototype of method used to compute the square norm of value.

New in version 3.8.

v_sim.NodeValuesFromString(vals, node, string)
Parameters:
Returns:

True on success.

Return type:

bool

Prototype of functions used to parse string and store its content for node in vals.

New in version 3.8.

v_sim.NodeValuesGetAt(vals, node)
Parameters:
Returns:

True if value is properly retrieved.

value:

a value location.

Return type:

(bool, value: GObject.Value)

Prototype of functions used to store in value the values associated to node from vals.

New in version 3.8.

v_sim.NodeValuesSetAt(vals, node, value)
Parameters:
Returns:

True if value is actually changed.

Return type:

bool

Prototype of functions used to store the content of value for node in vals.

New in version 3.8.

v_sim.NodeValuesVectorShift(vect, node, dxyz)
Parameters:

Prototype of functions used to define a shift between the centre of node and the origin of the stored vector for this node.

v_sim.NodeValuestoString(vals, node)
Parameters:
Returns:

a newly created string representing the values of node.

Return type:

str

Prototype of functions used to stringify the node values of node from vals.

New in version 3.8.

v_sim.PairForeachFunc(pair, data, *user_data)
Parameters:

Prototype of functions called with the foreach method apply to each links in a pair.

v_sim.PairPoolForeachFunc(pair, *user_data)
Parameters:

Prototype of functions called with the foreach method apply to each pairs.

v_sim.PlaneSetItemFree(plane, data)
Parameters:

A method to free a given plane item in the plane set for plane. This method is called when plane is removed from the plane set.

New in version 3.8.

v_sim.PlaneSetItemNew(plane, data)
Parameters:
Return type:

object or None

A method to generate a new plane item in the plane set for plane. This method is called to encapsulate plane when plane is added to the plane set.

New in version 3.8.

v_sim.PluginFreeFunc()

This kind of method may exist in all plugins with the name ‘{module_name}Free’. It is called by V_Sim when it stops.

New in version 3.7.

v_sim.PluginInfoFunc()
Returns:

a string in UTF-8 owned by the plugin.

Return type:

str

This kind of method should exist in all plugins it give a description of what the plugin does. It must be named ‘{module_name}Get_description’.

v_sim.PluginInitFunc()
Returns:

True if it loads correctly.

Return type:

bool

This kind of method should exist in all plugins with the name ‘{module_name}Init’. It is called by V_Sim when the module is loaded.

v_sim.ScalarFieldMethodLoadFunc(meth, data, cancel)
Parameters:
Returns:

True if the read file is in a valid format (even with minor errors), False otherwise.

Return type:

bool

Read the given file try to load it as a scalar field file. If succeed (i.e. with none fatal errors) the method should return True. If an error occurs, it is stored into error.

If the file contains several fields, they must be loaded and added to data with v_sim.ScalarFieldMethodData.addField().

v_sim.UiInitWidgetFunc(panel, renderWindow, renderArea)
Parameters:

This prototype is used whenever a method is required to initialise the GTK interface of V_Sim. panel must be set to point on the window of the command panel, renderWindow must point to the window containing the rendering area (can be the same than panel) and renderArea contains the widget that does the OpenGL rendering.

v_sim.UiMainInitFunc(ui)
Parameters:

ui (v_sim.UiMain) – the v_sim.UiMain object.

These methods are used by V_Sim to initialise some part of the interface. They are called once on start-up.

New in version 3.8.

v_sim.UiNewWidgetFunc()
Returns:

a newly created Gtk.Widget.

Return type:

Gtk.Widget

This prototype is used whenever a method is required to create a Gtk.Widget.

v_sim.UiPairsInitFunc()

Prototype of functions called once on V_Sim start-up.

v_sim.UiPairsSetValuesFunc(data)
Parameters:

data (v_sim.PairLink) – informations about a pair.

Prototype of functions used to update the widgets with given pair data.

v_sim.UiPairsToLabelFunc(data)
Parameters:

data (v_sim.PairLink) – information about a pair.

Returns:

a newly created string.

Return type:

str

Create a string, internationalised and in UTF-8, that describes the given pair data. This string is used in a column tree view to summarize the pair description.

v_sim.VoidDataFunc(data)
Parameters:

data (object or None) – a pointer to some user defined object.

These methods are used when no specific argument is required except a user-defined object and when void is the return type.

v_sim.matrix_getScaledValue(x, minmax)
Parameters:
  • x (float) – the initial value ;

  • minmax (float) – the boundaries for the x argument.

Returns:

a value into [0;1].

Return type:

float

Transform x into [0;1] using the given minmax values.

New in version 3.4.