Callbacks¶
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Details¶
- v_sim.CommitVertices(vertices, id, rgba, material, data)¶
- Parameters:
Prototype of function used by the various
v_sim.ElementRendererobjects when they are drawing their shape.New in version 3.9.
- v_sim.ConfigFileEnumFunc(label, value)¶
- Parameters:
- Returns:
Trueif found.- Return type:
Try to match label with a enum value.
New in version 3.8.
- v_sim.ConfigFileExportFunc(data, dataObj)¶
- Parameters:
data (
GLib.String) – an emptyGLib.Stringto store the export ;dataObj (
v_sim.DataorNone) – av_sim.Dataobject ;
This prototype defines a method that is used to export some resources or parameters. The data argument is an empty
GLib.Stringwhere the export has to be written. If the argument dataObj is not null, only resources related to thev_sim.Dataobject should be exported (for parameters files, dataObj is alwaysNone).
- v_sim.ConfigFileReadFunc(entry, lines, nbLines, position)¶
- Parameters:
entry (
v_sim.ConfigFileEntry) – thev_sim.ConfigFileEntrythat raises this callback.lines (
str) – an array of strings ;nbLines (
int) – an integer ;position (
int) – an integer ;
- Returns:
- Return type:
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:
self (
v_sim.DataLoader) – av_sim.DataLoaderobject.data (
v_sim.DataLoadable) – thev_sim.DataLoadableobject to populate.type (
int) – the type of file to populate in data.iSet (
int) – an integer specifying the set to load, if any.cancel (
Gio.CancellableorNone) – aGio.Cancellableobject.
- Returns:
Trueif the file matches the format defined by self, even if some parsing errors may occur.- Return type:
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:
cr (
cairo.Context) – acairo.Contextcontext.width (
int) – width of the surface.height (
int) – height of the surface.
A method to be called by V_Sim after exportation to allow post-processing.
- v_sim.DumpDataWriteFunc(format, fileName, dataObj)¶
- Parameters:
format (
v_sim.DumpData) – av_sim.DumpDataobject ;fileName (
str) – a string that defined the file to write to ;dataObj (
v_sim.Data) – thev_sim.Datato be exported ;
- Returns:
Trueif everything went right.- Return type:
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:
Trueif filename is a valid name for a file format.- Return type:
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:
element (
v_sim.Element) – av_sim.Elementobject ;value (
GObject.Value) – aGObject.Value.
Prototype of routine used to initialise an element property.
New in version 3.7.
- v_sim.NodeArrayIterFunc(array, iter, *data)¶
- Parameters:
array (
v_sim.NodeArray) – thev_sim.NodeArrayobject the function deals with.iter (
v_sim.NodeArrayIter) – thev_sim.NodeArrayIterobject the function works on.
- Return type:
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:
masker (
v_sim.NodeMasker) – av_sim.NodeMaskerobject ;at (
v_sim.NodeValuesIter) – av_sim.NodeValuesIterpointer
- Returns:
Trueto hide a node depending on values in at.- Return type:
Function to decide to hide a node or not.
New in version 3.8.
- v_sim.NodeValuesFarrayNrm2(vect, value)¶
- Parameters:
vect (
v_sim.NodeValuesFarray) – av_sim.NodeValuesFarrayobject.value (
GObject.Value) – a value.
- Return type:
Prototype of method used to compute the square norm of value.
New in version 3.8.
- v_sim.NodeValuesFromString(vals, node, string)¶
- Parameters:
vals (
v_sim.NodeValues) – av_sim.NodeValuesobject.node (
v_sim.Node) – av_sim.Nodepointer.string (
str) – a string.
- Returns:
Trueon success.- Return type:
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:
vals (
v_sim.NodeValues) – av_sim.NodeValuesobject.node (
v_sim.Node) – av_sim.Nodestructure.
- Returns:
Trueif 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:
vals (
v_sim.NodeValues) – av_sim.NodeValuesobject.node (
v_sim.Node) – av_sim.Nodepointer.value (
GObject.Value) – some value.
- Returns:
Trueif value is actually changed.- Return type:
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:
vect (
v_sim.NodeValuesVector) – av_sim.NodeValuesVectorobject.node (
v_sim.Node) – av_sim.Nodepointer:dxyz ([
float]) – a shift in cartesian coordinates.
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:
vals (
v_sim.NodeValues) – av_sim.NodeValuesobject.node (
v_sim.Node) – av_sim.Nodepointer.
- Returns:
a newly created string representing the values of node.
- Return type:
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:
pair (
v_sim.Pair) – av_sim.Pairobject.data (
v_sim.PairLink) – av_sim.PairLinkobject ;
Prototype of functions called with the foreach method apply to each links in a pair.
- v_sim.PairPoolForeachFunc(pair, *user_data)¶
- Parameters:
pair (
v_sim.Pair) – av_sim.Pairobject.
Prototype of functions called with the foreach method apply to each pairs.
- v_sim.PlaneSetItemFree(plane, data)¶
- Parameters:
plane (
v_sim.Plane) – av_sim.Planeobject.
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:
plane (
v_sim.Plane) – av_sim.Planeobject.
- Return type:
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:
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()¶
-
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:
meth (
v_sim.ScalarFieldMethod) – av_sim.ScalarFieldMethodobject ;data (
v_sim.ScalarFieldMethodData) – the various data the load method requires.cancel (
Gio.CancellableorNone) – aGio.Cancellableobject ;
- Returns:
Trueif the read file is in a valid format (even with minor errors),Falseotherwise.- Return type:
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:
panel (
Gtk.Window) – a location for aGtk.Windowdescribing the panel.renderWindow (
Gtk.Window) – a location for aGtk.Window;renderArea (
Gtk.Widget) – a location for aGtk.Widget.
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) – thev_sim.UiMainobject.
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:
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:
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)¶
-
These methods are used when no specific argument is required except a user-defined object and when void is the return type.