Functions

XML_substitute (output, filename, tag)

array_fromFile (filename)

array_getErrorQuark ()

array_sizedFromFile (filename, size)

basic_freeAll ()

basic_getDataDir ()

basic_getIconsDir ()

basic_getLegalDir ()

basic_getLocalDir ()

basic_getLocaleDir ()

basic_getMainContext ()

basic_getOldLocalDir ()

basic_getPixmapsDir ()

basic_getPluginsDir ()

basic_getPreferedUnit ()

basic_init ()

basic_initConfigFiles ()

basic_mainExport ()

basic_parseConfigFiles ()

basic_setExePath (exePath)

basic_setPreferedUnit (unit)

basic_showOptionHelp (force)

color_addFloatRGBA (rgba)

color_addIntRGBA (rgba)

color_convertHSLtoRGB (rgb, hsl)

color_convertHSVtoRGB (rgb, hsv)

color_convertRGBtoHSL (hsl, rgb)

color_forSymbol (symbol)

color_fromName (name)

color_fromStr (str)

color_getByValues (red, green, blue, alpha)

color_getStorage ()

color_invertRGBA (inv, rgba)

data_atomic_class_addLoader (loader)

data_atomic_class_finalize ()

data_atomic_class_getFileDescription ()

data_atomic_class_getLoaders ()

data_spin_class_addLoader (loader)

data_spin_class_finalize ()

data_spin_class_getFileDescription ()

data_spin_class_getLoaders ()

dbg_obj_class_summarize ()

drawAngle (vertices, xyzRef, xyzRef2, xyz)

drawArrow (vertices, xyz1, xyz2, tailRadius, hatRadius, ratio, nlat)

drawCone (vertices, xyz1, xyz2, radius, nlat, filled)

drawCube (vertices, xyz, size)

drawCylinder (vertices, xyz1, xyz2, radius, nlat, filled)

drawEllipsoid (vertices, xyz, theta, phi, radius, ratio, nlat)

drawIcosahedron (vertices, xyz, radius, nlat)

drawSphere (vertices, xyz, radius, nlat)

drawTorus (vertices, xyz, theta, phi, radius, ratio, nlat)

getValidPath (pathList, filenames, accessMode)

gl_light_newDefault ()

gl_matrix_modelize (camera)

gl_matrix_project (camera, width, height)

gl_matrix_vectorProd (v, matrix, u)

interactive_class_getPreferedObserveMethod ()

interactive_class_setPreferedObserveMethod (method)

line_newFromTriangles (data, nTriangles, isoValue)

matrix_cartesianToSpherical (spherical, cartesian)

matrix_determinant (mat)

matrix_dtof (mf, md)

matrix_getInter2D (lambda_, a, b, A, B)

matrix_getRotationFromFull (rot, full, box)

matrix_getScaledLinear (x, minmax)

matrix_getScaledLinearInv (x, minmax)

matrix_getScaledLog (x, minmax)

matrix_getScaledLogInv (x, minmax)

matrix_getScaledZeroCentredLog (x, minmax)

matrix_getScaledZeroCentredLogInv (x, minmax)

matrix_invert (inv, mat)

matrix_productMatrix (matRes, matA, matB)

matrix_productVector (vectRes, mat, vect)

matrix_reducePrimitiveVectors (full)

matrix_rotate (mat, angle, dir)

matrix_set (mat, orig)

matrix_setIdentity (mat)

matrix_sphericalToCartesian (cartesian, spherical)

minmax (global_, minmax)

minmax_fromDbl (global_, minmax)

modulo_float (a, b)

node_values_iter_new (type, vals)

option_new (name, label, g_type)

pair_cylinder_getDefaultColorType ()

pair_cylinder_getDefaultRadius ()

pair_cylinder_getDefaultRadiusType ()

pair_wire_getDefaultStipple ()

pair_wire_getDefaultWidth ()

path_normalize (path)

paths_parseFromXML (filename, paths)

physic_getSymbolFromZ (zele)

physic_getUnitConversionFactor (from_, to)

physic_getUnitFromName (name)

physic_getUnitLabel (unit)

physic_getUnitNames ()

physic_getUnitValueInMeter (unit)

physic_getZFromSymbol (symbol)

plane_class_getOrderedIntersections (nVisuPlanes, listOfVisuPlanes, pointA, pointB, inter, index)

plugins_free ()

plugins_getListLoaded ()

plugins_init ()

shade_getById (id)

shade_getStorage ()

shade_newFromData (labelUTF8, len, vectCh1, vectCh2, vectCh3, colorMode)

shade_newFromSteps (labelUTF8, lst, colorMode)

shade_newFromString (labelUTF8, descr, colorMode)

surface_point_new (at, normal)

ui_buildRenderingWindow (renderWindow)

ui_createFilter (list, fileChooser)

ui_createInterface (panel, renderWindow, renderArea)

ui_createPixbuf (filename)

ui_getPanel ()

ui_getRenderWidget ()

ui_getRenderWindow ()

ui_interactive_pick_getSelection ()

ui_interactive_pick_getSelectionLabel ()

ui_interactive_pick_start (window)

ui_interactive_pick_stop (window)

ui_mainCreate (panelFunc)

ui_main_class_createMain (panel, renderWindow, renderArea)

ui_main_class_getCurrentPanel ()

ui_main_class_getDefaultRendering ()

ui_main_class_getRememberPosition ()

ui_main_class_setRememberPosition (val)

ui_pairs_initBuild (main)

ui_pairs_setSpecificLabels (iter, label)

ui_panel_class_getAllPanels ()

ui_panel_class_getAllWindows ()

ui_panel_class_getCommandPanel ()

ui_panel_class_getDockById (id)

ui_panel_class_getHeaderVisibility ()

ui_panel_class_getPanelById (id)

ui_panel_class_setCurrent (dataObj, view)

ui_panel_class_setHeaderVisibility (status)

ui_raiseWarning (action, message, window)

ui_raiseWarningLong (action, message, window)

ui_runCommandLine (data)

ui_setRenderWidget (render)

ui_storeRecent (filename)

ui_wait ()

vector_nrm (v)

vector_prod (w, u, v)

vector_set (dest, orig)

vector_spherical (cart, at)

Details

v_sim.XML_substitute(output, filename, tag)
Parameters:
  • output (GLib.String) – a GLib.String to store the substitution ;

  • filename (str) – the file to read the data from ;

  • tag (str) – the tag to substitute ;

Raises:

GLib.Error

Returns:

True if no error occured.

Return type:

bool

Read filename (must be XML file) and remove the tag zone from it. At that place, it puts the contain of output.

v_sim.array_fromFile(filename)
Parameters:

filename (str) – a filename.

Raises:

GLib.Error

Returns:

a newly allocated GLib.Array.

nColumns:

a location for an integer.

Return type:

([float], nColumns: int)

Read a data column file.

New in version 3.8.

v_sim.array_getErrorQuark()
Returns:

the #GQuark associated to errors related to data files.

Return type:

int

Internal routine for error handling.

New in version 3.8.

v_sim.array_sizedFromFile(filename, size)
Parameters:
  • filename (str) – a path;

  • size (int) – expected number of read lines;

Raises:

GLib.Error

Returns:

a newly allocated GLib.Array.

nColumns:

number of read columns;

Return type:

([float], nColumns: int)

Like v_sim.array_fromFile(), but check that the number of read lines corresponds to the expected value given by size.

New in version 3.8.

v_sim.basic_freeAll()

This routine is called by V_Sim when quiting and it frees the memory used by visu_basic.

New in version 3.5.

v_sim.basic_getDataDir()
Returns:

a string owned by V_Sim.

Return type:

str

Get the static string where V_Sim looks for its data files.

New in version 3.4.

v_sim.basic_getIconsDir()
Returns:

a string owned by V_Sim.

Return type:

str

Get the static string where V_Sim looks for its icon files.

New in version 3.4.

v_sim.basic_getLegalDir()
Returns:

a string owned by V_Sim.

Return type:

str

Get the static string where V_Sim looks for its legal files.

New in version 3.4.

v_sim.basic_getLocalDir()
Returns:

a string owned by V_Sim.

Return type:

str

Get the static string where V_Sim looks for its user configuration files.

New in version 3.4.

v_sim.basic_getLocaleDir()
Returns:

a string owned by V_Sim.

Return type:

str

Get the static string where V_Sim looks for its localisation files.

New in version 3.4.

v_sim.basic_getMainContext()
Returns:

the main loop, as defined in GLib.

Return type:

GLib.MainContext

Even without GUI, V_Sim requires to run a main loop. This method is to get the main loop.

New in version 3.6.

v_sim.basic_getOldLocalDir()
Returns:

a string owned by V_Sim.

Return type:

str

Get the static string where V_Sim looks for its user configuration files (old location).

New in version 3.4.

v_sim.basic_getPixmapsDir()
Returns:

a string owned by V_Sim.

Return type:

str

Get the static string where V_Sim looks for its pixmap files.

New in version 3.4.

v_sim.basic_getPluginsDir()
Returns:

a string owned by V_Sim.

Return type:

str

Get the static string where V_Sim looks for its plug-in files.

New in version 3.4.

v_sim.basic_getPreferedUnit()
Returns:

the prefered unit set by the user (default is v_sim.Units.UNDEFINED).

Return type:

v_sim.Units

By setting the prefered unit, when a file is load, V_Sim tries to render it in this prefered unit.

New in version 3.5.

v_sim.basic_init()

A call to this method is done at startup after having probe the locale of the file system and having initialized the rendering window. It makes the following actions : create the visu object to store the signals, initialize the module part (parameters, and resources), initialize the dump part, the OpenGL part and its extensions, the storage of elements and the ‘colorize with data’ part.

v_sim.basic_initConfigFiles()
Raises:

GLib.Error

Same as v_sim.basic_parseConfigFiles(), but perform the operation only once.

New in version 3.8.

v_sim.basic_mainExport()
Returns:

0 if everything is normal, 1 if an error occured.

Return type:

int

This method is called when V_Sim is in export mode from the command line.

v_sim.basic_parseConfigFiles()
Raises:

GLib.Error

Returns:

a newly allocated GLib.String if some error occured.

Return type:

bool

Parse the parameter and the resource file. Used once at startup.

v_sim.basic_setExePath(exePath)
Parameters:

exePath (str) – a path where the V_Sim executable is running in.

This method is used to tell V_Sim where V_Sim is running (usually reading from argv[0]. This makes it possible to relocate everything on the fly. exePath is copied.

New in version 3.6.

v_sim.basic_setPreferedUnit(unit)
Parameters:

unit (v_sim.Units) – a v_sim.Units value.

Returns:

True if the prefered unit is actually changed.

Return type:

bool

By setting the prefered unit, when a file is load, V_Sim tries to render it in this prefered unit.

New in version 3.5.

v_sim.basic_showOptionHelp(force)
Parameters:

force (bool) – a boolean.

Returns:

True if something is displayed.

Return type:

bool

xlib.Display a small help for some options. The output is different from the -h command line options, here some details about running time options is displayed like the available file format for exportation… If force is True, all possible values are output, otherwise only those relevant to the user provided command line options.

New in version 3.6.

v_sim.color_addFloatRGBA(rgba)
Parameters:

rgba (float) – four values between 0. and 1. that represent [Red, Green, Blue, Alpha] ;

Returns:

a newly created v_sim.Color or the already existing one.

position:

an int pointer to store the position of the returned colour.

Return type:

(v_sim.Color, position: int)

This method adds a new color in the list of stored colors with the given values. If it already exits it returns the pointer of that color.

v_sim.color_addIntRGBA(rgba)
Parameters:

rgba (int) – four values between 0 and 255 that represent [Red, Green, Blue, Alpha].

Returns:

a newly created v_sim.Color or the already existing one.

Return type:

v_sim.Color

This method adds a new color in the list of stored colors with the given values.

v_sim.color_convertHSLtoRGB(rgb, hsl)
Parameters:
  • rgb (float) – an allocated 3 elements array to receive the RGB values ;

  • hsl (float) – a 3 elements array to retrieve the HSL values from.

This methods convert a HSL color to a RGB one.

v_sim.color_convertHSVtoRGB(rgb, hsv)
Parameters:
  • rgb (float) – an allocated 3 elements array to receive the RGB values ;

  • hsv (float) – a 3 elements array to retrieve the HSV values from.

This methods convert a HSV color to a RGB one.

v_sim.color_convertRGBtoHSL(hsl, rgb)
Parameters:
  • hsl (float) – three float to store the HSL value ;

  • rgb (float) – three floats giving the RGB values.

Convert a RGB colour into a HSL one.

v_sim.color_forSymbol(symbol)
Parameters:

symbol (str) – a symbol of the periodic table.

Returns:

a color.

pos:

the number of the color.

Return type:

(v_sim.Color, pos: int)

Give a default color for the given symbol.

New in version 3.9.

v_sim.color_fromName(name)
Parameters:

name (str) – a string.

Returns:

a corresponding v_sim.Color, creating it if necessary.

pos:

a location.

Return type:

(v_sim.Color, pos: int)

Parse a name like ‘black’ and generate a colour. This color is added to the pool, see v_sim.Color.getStorage().

New in version 3.8.

v_sim.color_fromStr(str)
Parameters:

str (str) – a string.

Returns:

a corresponding v_sim.Color, creating it if necessary.

pos:

a location.

Return type:

(v_sim.Color, pos: int)

This method parse str with the format %RRGGBB or %RRGGBBAA to create a v_sim.Color. This color is added to the pool, see v_sim.Color.getStorage().

New in version 3.8.

v_sim.color_getByValues(red, green, blue, alpha)
Parameters:
  • red (float) – a value between 0. and 1. ;

  • green (float) – a value between 0. and 1. ;

  • blue (float) – a value between 0. and 1. ;

  • alpha (float) – a value between 0. and 1..

Returns:

the found color, or None if none exists.

pos:

an allocated int to store the position of the found color ;

Return type:

(v_sim.Color, pos: int)

This method is used to look for a specific color in the stored list. The argument pos is -1 if nothing is found or stores the position (beginning at 0) of the found color.

v_sim.color_getStorage()
Returns:

a v_sim.Pool object.

Return type:

v_sim.Pool

Give access to the v_sim.Pool instance storing all the colors.

New in version 3.8.

v_sim.color_invertRGBA(inv, rgba)
Parameters:
  • inv (float) – a location to store the inverted colour.

  • rgba (float) – a colour defined in RGBA.

Invert the colour on the stack.

New in version 3.8.

v_sim.data_atomic_class_addLoader(loader)
Parameters:

loader (v_sim.DataLoader) – a v_sim.DataLoader object.

Add loader to the list of v_sim.DataLoader to be used when v_sim.DataLoadable.load() is called.

New in version 3.8.

v_sim.data_atomic_class_finalize()

Empty the list of known loaders.

New in version 3.8.

v_sim.data_atomic_class_getFileDescription()
Returns:

a string owned by V_Sim.

Return type:

str

Returns a translated string describing what is files loaded by v_sim.DataAtomic objects.

New in version 3.8.

v_sim.data_atomic_class_getLoaders()
Returns:

a list of v_sim.DataLoader owned by V_Sim.

Return type:

[v_sim.DataLoader]

Returns a list of available v_sim.DataLoader.

New in version 3.8.

v_sim.data_spin_class_addLoader(loader)
Parameters:

loader (v_sim.DataLoader) – a v_sim.DataSpin object.

Add loader to the list of v_sim.DataLoader to be used when v_sim.DataLoadable.load() is called.

New in version 3.8.

v_sim.data_spin_class_finalize()

Empty the list of known loaders.

New in version 3.8.

v_sim.data_spin_class_getFileDescription()
Returns:

a string owned by V_Sim.

Return type:

str

Returns a translated string describing what is files loaded by v_sim.DataSpin objects.

New in version 3.8.

v_sim.data_spin_class_getLoaders()
Returns:

a list of v_sim.DataLoader owned by V_Sim.

Return type:

[v_sim.DataLoader]

Returns a list of available v_sim.DataLoader.

New in version 3.8.

v_sim.dbg_obj_class_summarize()

Debug function displaying the currently in-memory v_sim.DbgObj.

New in version 3.8.

v_sim.drawAngle(vertices, xyzRef, xyzRef2, xyz)
Parameters:
  • vertices ([float]) – a buffer.

  • xyzRef (float) – coordinates of the angle reference.

  • xyzRef2 (float) – coordinates of one branch.

  • xyz (float) – coordinates of the other branch.

Returns:

the angle value in radians.

at:

a buffer for coordinates.

Return type:

(float, at: float)

Generate vertices in v_sim.GlExtPackingModels.XYZ layout describing an angle. The vertices are packed using v_sim.GlExtPrimitives.TRIANGLE_FAN. at contains on output coordinates close to the middle of the angle shape.

New in version 3.9.

v_sim.drawArrow(vertices, xyz1, xyz2, tailRadius, hatRadius, ratio, nlat)
Parameters:
  • vertices ([float]) – a buffer.

  • xyz1 (float) – coordinates of the bottom end.

  • xyz2 (float) – coordinates of the pointy end.

  • tailRadius (float) – radius of the cylinder.

  • hatRadius (float) – radius of the cone.

  • ratio (float) – ratio between the cylinder and the cone.

  • nlat (int) – discretisation value.

Generate vertices in v_sim.GlExtPackingModels.XYZ_NRM layout describing an arrow made of a cylinder and a cone. The vertices are packed using v_sim.GlExtPrimitives.TRIANGLES.

New in version 3.9.

v_sim.drawCone(vertices, xyz1, xyz2, radius, nlat, filled)
Parameters:
  • vertices ([float]) – a buffer.

  • xyz1 (float) – coordinates of the bottom end.

  • xyz2 (float) – coordinates of the pointy end.

  • radius (float) – radius at the bottom.

  • nlat (int) – discretisation value.

  • filled (bool) – a boolean.

Generate vertices in v_sim.GlExtPackingModels.XYZ_NRM layout describing a cone. The vertices are packed using v_sim.GlExtPrimitives.TRIANGLES. If filled, a disk is drawn on xyz1 to close the cone.

New in version 3.9.

v_sim.drawCube(vertices, xyz, size)
Parameters:
  • vertices ([float]) – a buffer.

  • xyz (float) – coordinates of the centre.

  • size (float) – size of the cube.

Generate vertices in v_sim.GlExtPackingModels.XYZ_NRM layout describing a cube. The vertices are packed using v_sim.GlExtPrimitives.TRIANGLES.

New in version 3.9.

v_sim.drawCylinder(vertices, xyz1, xyz2, radius, nlat, filled)
Parameters:
  • vertices ([float]) – a buffer.

  • xyz1 (float) – coordinates of one end.

  • xyz2 (float) – coordinates of the other end.

  • radius (float) – radius of the cylinder.

  • nlat (int) – discretisation value.

  • filled (bool) – a boolean.

Generate vertices in v_sim.GlExtPackingModels.XYZ_NRM layout describing a cylinder. The vertices are packed using v_sim.GlExtPrimitives.TRIANGLES. If filled, a disk is drawn on xyz1 to close the cylinder.

New in version 3.9.

v_sim.drawEllipsoid(vertices, xyz, theta, phi, radius, ratio, nlat)
Parameters:
  • vertices ([float]) – a buffer.

  • xyz (float) – coordinates of the centre.

  • theta (float) – alignment of the main axis along the theta angle in polar coordinates.

  • phi (float) – alignment of the main axis along the phi angle in polar coordinates.

  • radius (float) – main axis half length.

  • ratio (float) – ratio between the main and minor axis.

  • nlat (int) – discretisation value.

Generate vertices in v_sim.GlExtPackingModels.XYZ_NRM layout describing an ellipsoid shape. The discretisation of the volume is the same than the one used by v_sim.drawSphere() but with non homogeneous axis.

New in version 3.9.

v_sim.drawIcosahedron(vertices, xyz, radius, nlat)
Parameters:
  • vertices ([float]) – a buffer.

  • xyz (float) – coordinates of the centre.

  • radius (float) – radius of the sphere.

  • nlat (int) – discretisation value.

Add vertices in vertices array, using a v_sim.GlExtPackingModels.XYZ_NRM layout. Vertices are describing v_sim.GlExtPrimitives.TRIANGLES. The sphere is approximated by a discretisation of nlat elements along an icosahedron.

New in version 3.9.

v_sim.drawSphere(vertices, xyz, radius, nlat)
Parameters:
  • vertices ([float]) – a buffer.

  • xyz (float) – coordinates of the centre.

  • radius (float) – radius of the sphere.

  • nlat (int) – discretisation value.

Add vertices in vertices array, using a v_sim.GlExtPackingModels.XYZ_NRM layout. Vertices are describing v_sim.GlExtPrimitives.TRIANGLES. The sphere is approximated by a discretisation of nlat elements along the theta and phi angles (in polar coordinates).

See v_sim.drawIcosahedron() for another discretisation using triangles.

New in version 3.9.

v_sim.drawTorus(vertices, xyz, theta, phi, radius, ratio, nlat)
Parameters:
  • vertices ([float]) – a buffer.

  • xyz (float) – coordinates of the centre.

  • theta (float) – alignment of the axis along the theta angle in polar coordinates.

  • phi (float) – alignment of the axis along the phi angle in polar coordinates.

  • radius (float) – external radius of the torus.

  • ratio (float) – ratio between the main and minor axis.

  • nlat (int) – discretisation value.

Generate vertices in v_sim.GlExtPackingModels.XYZ_NRM layout describing a torus shape. The vertices are packed using v_sim.GlExtPrimitives.TRIANGLES.

New in version 3.9.

v_sim.getValidPath(pathList, filenames, accessMode)
Parameters:
  • pathList ([str]) – a pointer to a GLib.List with all the possible path,

  • filenames ([str]) – an array of strings,

  • accessMode (int) – a value from R_OK, W_OK and X_OK as described in unistd.h.

Returns:

the first valid complete path (from pathList plus an entry of filenames) if one can be found depnding on accessMode or None if none found. Free it with GLib.free() after use.

Return type:

str

pathList contains a list of directories (first is most prefered) and fileName is the file name which one likes have informations on. This routine look for the first directory where fileName can be writen or read (depending on accessMode parameter). The pointer to the GLib.List indicates at the end the first valid entry in the GLib.List.

v_sim.gl_light_newDefault()
Returns:

the newly created v_sim.GlLight. Use GLib.free() to deallocate this light.

Return type:

v_sim.GlLight

Create a new light with default value (white color and position in the front, right, top position of the screen).

v_sim.gl_matrix_modelize(camera)
Parameters:

camera (v_sim.GlCamera) – a v_sim.GlCamera object.

Returns:

a location to store a v_sim.GlMatrix.

Return type:

M: v_sim.GlMatrix

Compute the modelview matrix associated to the given camera. The up axis and the eye position are updated by this call.

New in version 3.9.

v_sim.gl_matrix_project(camera, width, height)
Parameters:
Returns:

a location to store a v_sim.GlMatrix.

Return type:

P: v_sim.GlMatrix

Compute the projection matrix associated to the camera. width and height represents the size of the projection plane.

New in version 3.9.

v_sim.gl_matrix_vectorProd(v, matrix, u)
Parameters:

4x4 matrix product with a vector.

New in version 3.9.

v_sim.interactive_class_getPreferedObserveMethod()
Returns:

an integer that identify the method, see #OPENGL_OBSERVE_CONSTRAINED, and #OPENGL_OBSERVE_WALKER flags.

Return type:

v_sim.InteractiveMethod

There are two methods to move the camera in a pick and observe sesion. These two methods are described in the commentary of the keys #OPENGL_OBSERVE_CONSTRAINED an d#OPENGL_OBSERVE_WALKER.

v_sim.interactive_class_setPreferedObserveMethod(method)
Parameters:

method (v_sim.InteractiveMethod) – an integer that identify the method, see #OPENGL_OBSERVE_CONSTRAINED, and #OPENGL_OBSERVE_WALKER flags.

There are two methods to move the camera in a pick and observe sesion. These two methods are described in the commentary of the keys #OPENGL_OBSERVE_CONSTRAINED an d#OPENGL_OBSERVE_WALKER.

v_sim.line_newFromTriangles(data, nTriangles, isoValue)
Parameters:
  • data (float) – the lines to be computed ;

  • nTriangles (int) – the surface to compute isoline from ;

  • isoValue (float) – the value of the computed isoline.

Returns:

the newly allocated v_sim.Line or None.

Return type:

v_sim.Line

Create on the fly an isoline from a given set of triangles. If the lines are created, isoline will be allocated and should be freed with v_sim.Line.free() after use.

New in version 3.6.

v_sim.matrix_cartesianToSpherical(spherical, cartesian)
Parameters:
  • spherical (float) – an allocated array of 3 floating point values to store the result ;

  • cartesian (float) – an allocated array of 3 floating point values to read the input.

A method to transform cartesian coordinates in spherical coordinates (radius, phi and theta).

New in version 3.3.

v_sim.matrix_determinant(mat)
Parameters:

mat (float) – a matrix.

Returns:

the determinant value.

Return type:

float

Calculate the determinant of matrix mat.

New in version 3.6.

v_sim.matrix_dtof(mf, md)
Parameters:
  • mf (float) – a matrix in single precision.

  • md (float) – a matrix in double precision.

Cast md into mf.

New in version 3.7.

v_sim.matrix_getInter2D(lambda_, a, b, A, B)
Parameters:
  • lambda (float) – a location to store a float.

  • a (float) – a point.

  • b (float) – another point.

  • A (float) – a point.

  • B (float) – another point.

Returns:

True if [ab] and [AB] have an intersection.

Return type:

bool

Get the intersection coeeficient of lines [ab] and [AB].

v_sim.matrix_getRotationFromFull(rot, full, box)
Parameters:
  • rot (float) – a rotation matrix (out values).

  • full (float) – the description of basis set in full development.

  • box (float) – the description of basis set in align X axis.

Returns:

True if full does not describe properly a 3D box.

Return type:

bool

There is a rotation matrix to transform from full cartesian coordinates into reduced box cartesian coordinates.

New in version 3.6.

v_sim.matrix_getScaledLinear(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] with a linear scale.

New in version 3.5.

v_sim.matrix_getScaledLinearInv(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

Reverse function for v_sim.matrix_getScaledLinear().

New in version 3.5.

v_sim.matrix_getScaledLog(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] with a log scale.

New in version 3.5.

v_sim.matrix_getScaledLogInv(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

Reverse function for v_sim.matrix_getScaledLog().

New in version 3.5.

v_sim.matrix_getScaledZeroCentredLog(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] with a log scale with zero centred values.

New in version 3.5.

v_sim.matrix_getScaledZeroCentredLogInv(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

Reverse function for v_sim.matrix_getScaledZeroCentredLog().

New in version 3.5.

v_sim.matrix_invert(inv, mat)
Parameters:
  • inv (float) – a matrix (out values).

  • mat (float) – a matrix.

Returns:

False if mat is singular.

Return type:

bool

Calculate the inverse matrix of matrix mat and store it in inv.

New in version 3.6.

v_sim.matrix_productMatrix(matRes, matA, matB)
Parameters:
  • matRes (float) – an array of floating point values of size 3x3 ;

  • matA (float) – an array of floating point values of size 3x3 ;

  • matB (float) – an array of floating point values of size 3x3.

Compute the mathematical product between matA and matB and put the result matrix in matRes.

New in version 3.2.

v_sim.matrix_productVector(vectRes, mat, vect)
Parameters:
  • vectRes (float) – an array of floating point values of size 3 ;

  • mat (float) – an array of floating point values of size 3x3 ;

  • vect (float) – an array of floating point values of size 3.

Compute the mathematical product between matA and vect and put the result vector in vectRes.

New in version 3.2.

v_sim.matrix_reducePrimitiveVectors(full)
Parameters:

full ([float]) – a full 3x3 matrix to be transformed.

Returns:

False if the given matrix is planar.

reduced:

a storage for 6 floating point values ;

Return type:

(bool, reduced: [float])

This routine transforms the given matrix full into a reduced array used by V_Sim to store box definition.

v_sim.matrix_rotate(mat, angle, dir)
Parameters:

Create a rotation matrix along axis dir of the given angle.

New in version 3.8.

v_sim.matrix_set(mat, orig)
Parameters:
  • mat (float) – a matrix.

  • orig (float) – a matrix.

Copy orig into mat.

New in version 3.8.

v_sim.matrix_setIdentity(mat)
Parameters:

mat ([float]) – a matrix location.

Initialise mat with the identity.

New in version 3.7.

v_sim.matrix_sphericalToCartesian(cartesian, spherical)
Parameters:
  • cartesian (float) – an allocated array of 3 floating point values to store the result ;

  • spherical (float) – an allocated array of 3 floating point values to read the input.

A method to transform spherical coordinates (radius, phi and theta) to cartesian coordinates.

New in version 3.3.

v_sim.minmax(global_, minmax)
Parameters:
  • global ([float]) – the global min and max values.

  • minmax ([float]) – some min and max values.

Take the minimum and maximum of global and minmax and put them into global. global should be initialised.

New in version 3.8.

v_sim.minmax_fromDbl(global_, minmax)
Parameters:
  • global ([float]) – the global min and max values.

  • minmax ([float]) – some min and max values.

Same as v_sim.minmax() for double inputs.

New in version 3.8.

v_sim.modulo_float(a, b)
Parameters:
  • a (float) – a float ;

  • b (int) – an int.

Returns:

the new float value after the modulo.

Return type:

float

This function is just like a%b except it works with a float a argument. a can be negative, but the return value of the function is always positive.

v_sim.node_values_iter_new(type, vals)
Parameters:
Returns:

True if the iterator is in a valid state.

iter:

an iterator location.

Return type:

(bool, iter: v_sim.NodeValuesIter)

Creates an iterator to run over node values stored in vals, following type way of iterate.

New in version 3.8.

v_sim.option_new(name, label, g_type)
Parameters:
  • name (str) – a string identifying the option ;

  • label (str) – a string describing shortly the option (must be in UTF-8).

  • g_type (GObject.GType) – the type of option to create.

Returns:

a newly created option, use v_sim.Option.free() to free it.

Return type:

v_sim.Option

Create a new #Option using the name as identifier.

v_sim.pair_cylinder_getDefaultColorType()
Returns:

an integer corresponding to the color scheme.

Return type:

v_sim.PairCylinderColorId

Get the color scheme.

v_sim.pair_cylinder_getDefaultRadius()
Returns:

the default value for cylinder radius.

Return type:

float

Get the default value for cylinder radius.

v_sim.pair_cylinder_getDefaultRadiusType()
Returns:

an integer corresponding to the radius scheme.

Return type:

v_sim.PairCylinderRadiusId

Get the radius scheme.

New in version 3.9.

v_sim.pair_wire_getDefaultStipple()
Returns:

the default stipple pattern.

Return type:

int

Retrieves the default stipple pattern.

New in version 3.8.

v_sim.pair_wire_getDefaultWidth()
Returns:

the default width.

Return type:

int

Retrieves the default width.

New in version 3.8.

v_sim.path_normalize(path)
Parameters:

path (str) – a string, None terminated.

Returns:

a newly created string.

Return type:

str

This function normalizes the path, i.e. it removes all . and .. It should work also on Windows. It must take an absolute path as argument, if not it is converted assuming the current working directory.

v_sim.paths_parseFromXML(filename, paths)
Parameters:
Raises:

GLib.Error

Returns:

True on success.

Return type:

bool

Read an XML containing a description of paths. paths is newly created on success and should be freed with v_sim.Paths.free().

New in version 3.6.

v_sim.physic_getSymbolFromZ(zele)
Parameters:

zele (int) – the atomic number.

Returns:

True if zele is known in the atomic built-in list.

name:

a pointer on an unallocated string (can be None) ;

radcov:

a pointer on a float (can be None) ;

mass:

a pointer on a float (can be None) ;

Return type:

(bool, name: str, radcov: float, mass: float)

Get the symbol or the covalence radius of the argument zele.

v_sim.physic_getUnitConversionFactor(from_, to)
Parameters:
Returns:

a factor.

Return type:

float

Retrieve the factor used to convert from from to to.

New in version 3.8.

v_sim.physic_getUnitFromName(name)
Parameters:

name (str) – a unit name.

Returns:

a v_sim.Units.

Return type:

v_sim.Units

Find the unit corresponding to the name. If none is found, v_sim.Units.UNDEFINED is returned.

New in version 3.5.

v_sim.physic_getUnitLabel(unit)
Parameters:

unit (v_sim.Units) – a given unit.

Returns:

a UTF8 string, not translated.

Return type:

str

This routine provides the label representing the unit, not its name, see v_sim.physic_getUnitNames().

New in version 3.8.

v_sim.physic_getUnitNames()
Returns:

an array, null terminated of strings. It is owned by V_Sim.

Return type:

[str]

It provides the names corresponding to each units.

New in version 3.5.

v_sim.physic_getUnitValueInMeter(unit)
Parameters:

unit (v_sim.Units) – a v_sim.Units.

Returns:

a factor.

Return type:

float

It provides the factor used to transform unit into meters.

New in version 3.5.

v_sim.physic_getZFromSymbol(symbol)
Parameters:

symbol (str) – the symbol of an atom.

Returns:

True if symbol is known in the atomic built-in list.

zele:

a pointer on an integer (can be None) ;

radcov:

a pointer on a float (can be None) ;

mass:

a pointer on a float (can be None) ;

Return type:

(bool, zele: int, radcov: float, mass: float)

Get the the covalence radius or the atomic number of a given atomic symbol.

v_sim.plane_class_getOrderedIntersections(nVisuPlanes, listOfVisuPlanes, pointA, pointB, inter, index)
Parameters:
  • nVisuPlanes (int) – the number of planes (must be consistent with the number of planes in listOfVisuPlanes!)

  • listOfVisuPlanes (v_sim.Plane) – an array of v_sim.Plane, None terminated ;

  • pointA (float) – three cartesian coordinates.

  • pointB (float) – three cartesian coordinates.

  • inter (float) – a pointer to the location to store the intersection points. Supposing you know the number of intersection points !

  • index (int) – a pointer to the location to store the indices of ordering of the planes.

Returns:

True if the intersections are found.

Return type:

bool

Compute the location of the intersection points of segment AB with list of planes listOfVisuPlanes. If there are several intersections, they are ordered by the proximity to point A.

v_sim.plugins_free()

Finalise the part of V_Sim related to plug-ins. Should not be called (called once by V_Sim on stopping only).

New in version 3.7.

v_sim.plugins_getListLoaded()
Returns:

a GLib.List owned by V_Sim of v_sim.Plugin objects.

Return type:

[v_sim.Plugin]

On startup, plugins are loaded according to a list present in the configuration file. It is possible to access the list of all loaded plugins with this method.

v_sim.plugins_init()
Raises:

GLib.Error

Initialise this part of code. Should not be called (called once by V_Sim on startup only). It try to load all plugins found in the installation directory and in the user directory.

v_sim.shade_getById(id)
Parameters:

id (int) – an id.

Returns:

a v_sim.Shade from the pool.

Return type:

v_sim.Shade

Convenience function calling v_sim.Pool.getById() on the default v_sim.Shade storage.

New in version 3.8.

v_sim.shade_getStorage()
Returns:

a pointer to the internal shade list.

Return type:

v_sim.Pool

It returns a read-only pointer to the internal shade list. Use tool_shade_appendList() to add new shades to this list.

New in version 3.8.

v_sim.shade_newFromData(labelUTF8, len, vectCh1, vectCh2, vectCh3, colorMode)
Parameters:
  • labelUTF8 (str) – a UTF8 string that shortly named this new shade ;

  • len (int) – the size of arguments vectCh1, vectCh2 and vectCh3 ;

  • vectCh1 (float) – an array of floating point values for the first channel ;

  • vectCh2 (float) – an array of floating point values for the second channel ;

  • vectCh3 (float) – an array of floating point values for the third channel ;

  • colorMode (v_sim.ShadeColorMode) – an integer that describes the color code (see v_sim.ShadeColorMode enumeration).

Returns:

the newly created v_sim.Shade.

Return type:

v_sim.Shade

Create a v_sim.Shade from direct data for three channels. These channels are defined by the colorMode parameter. All given values are copied when the new shade is created.

v_sim.shade_newFromSteps(labelUTF8, lst, colorMode)
Parameters:
Returns:

the newly created v_sim.Shade.

Return type:

v_sim.Shade

Create a v_sim.Shade from a set of steps defining colours at given indexes. These channels are defined by the colorMode parameter. All given values are copied when the new shade is created. The values of indexes will be normalised by this call to range in [0;1]. Colour channel values must be in [0;1] for each step.

New in version 3.7.

v_sim.shade_newFromString(labelUTF8, descr, colorMode)
Parameters:
Raises:

GLib.Error

Returns:

the newly created v_sim.Shade.

Return type:

v_sim.Shade

As v_sim.Shade.newFromSteps() routine, but it takes an unparsed string describing the steps in descr.

New in version 3.7.

v_sim.surface_point_new(at, normal)
Parameters:
  • at ([float]) – coordinates.

  • normal ([float]) – normal.

Returns:

a location to a v_sim.SurfacePoint structure.

Return type:

pt: v_sim.SurfacePoint

Initialise pt with at and normal.

New in version 3.8.

v_sim.ui_buildRenderingWindow(renderWindow)
Parameters:

renderWindow (v_sim.UiRenderingWindow) – a v_sim.UiRenderingWindow object.

Returns:

a newly created Gtk.Window.

Return type:

Gtk.Widget

Create a Gtk.Window with V_sim render window icon and wmclass set to “V_Sim:v_sim_render”. It also set the accelerators of renderWindow to the newly created window and pack renderWindow inside.

New in version 3.7.

v_sim.ui_createFilter(list, fileChooser)
Parameters:
Returns:

a list of v_sim.UiFileFilter. This list should be freed after use.

Return type:

[v_sim.UiFileFilter]

Create a list of Gtk.FileFilter created from the given list of file formats and attach it to the given fileChooser.

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

A convenient routine that creates a v_sim.UiRenderingWindow alone. To create also a command panel, v_sim.UiMainClass.createMain() should be used instead.

v_sim.ui_createPixbuf(filename)
Parameters:

filename (str) – a file name (must be a base name).

Returns:

a newly created GdkPixbuf.Pixbuf on success.

Return type:

GdkPixbuf.Pixbuf

Replace the create_pixbuf() routine from Glade. It looks only in the default pixmap directory of V_Sim to find the given file.

v_sim.ui_getPanel()
Returns:

a Gtk.Window.

Return type:

Gtk.Window

A convenient function to get the command panel window.

v_sim.ui_getRenderWidget()
Returns:

a Gtk.Widget.

Return type:

Gtk.Widget

A convenient function to get the rendering area widget.

v_sim.ui_getRenderWindow()
Returns:

a Gtk.Window.

Return type:

Gtk.Window

A convenient function to get the rendering area window.

v_sim.ui_interactive_pick_getSelection()
Returns:

a v_sim.UiSelection object.

Return type:

v_sim.UiSelection

Retrieves the v_sim.UiSelection of this panel.

New in version 3.8.

v_sim.ui_interactive_pick_getSelectionLabel()
Returns:

a Gtk.Widget object.

Return type:

Gtk.Widget

Retrieves the Gtk.Widget used as label for the selection.

New in version 3.8.

v_sim.ui_interactive_pick_start(window)
Parameters:

window (v_sim.UiRenderingWindow) – a v_sim.UiRenderingWindow object.

Initialise a pick session.

v_sim.ui_interactive_pick_stop(window)
Parameters:

window (v_sim.UiRenderingWindow) – a v_sim.UiRenderingWindow object.

Finalise a pick session.

v_sim.ui_mainCreate(panelFunc)
Parameters:

panelFunc (v_sim.UiInitWidgetFunc) – function to be called to create the different windows.

It initializses the GTK part of V_Sim. During this initialisation, the panelFunc is called. It should create all the windows needed by V_Sim, like the command panel and the rendering area. The return widget is the widget returned itself by panelFunc. It must be the main widget: it is the command panel if used, the window containing the rendering area if no command panel or the rendering area itself if no container window.

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

A convenience routine to create a command panel, a rendering window and links them together.

v_sim.ui_main_class_getCurrentPanel()
Returns:

the command Panel.

Return type:

v_sim.UiMain

This routine can be used to get the command panel, everywhere from V_Sim.

v_sim.ui_main_class_getDefaultRendering()
Returns:

the rendering window.

Return type:

v_sim.UiRenderingWindow

Get the rendering window of V_Sim.

v_sim.ui_main_class_getRememberPosition()
Returns:

True if set.

Return type:

bool

V_Sim can store the position of its main windows. Use this routine to get the status of this capability.

v_sim.ui_main_class_setRememberPosition(val)
Parameters:

val (bool) – an boolean.

V_Sim can try to remember the position of its main windows, then open them again will result in a positioning on screen equivalent to previous position.

v_sim.ui_pairs_initBuild(main)
Parameters:

main (v_sim.UiMain) – the command panel the about dialog is associated to.

Create the dialog window for pairs.

v_sim.ui_pairs_setSpecificLabels(iter, label)
Parameters:

Change the specific label shown in the treeview of pairs for the given iter. An iter in this treeview can be retrieve using the #_VisuUiPairsIter objects.

v_sim.ui_panel_class_getAllPanels()
Returns:

a newly created list (use g_list_free() on it after use).

Return type:

[v_sim.UiPanel]

This routine can be used to know all existing v_sim.UiPanel.

v_sim.ui_panel_class_getAllWindows()
Returns:

a newly created list (use g_list_free() on it after use).

Return type:

[v_sim.UiDockWindow]

This routine can be used to know all existing v_sim.UiDockWindow.

v_sim.ui_panel_class_getCommandPanel()
Returns:

the v_sim.UiDockWindow that is inside the command panel.

Return type:

v_sim.UiDockWindow

There is always a v_sim.UiDockWindow that is inside the command panel. This routine gets it.

v_sim.ui_panel_class_getDockById(id)
Parameters:

id (str) – a v_sim.UiDockWindow identifier.

Returns:

the v_sim.UiDockWindow that corresponds to this identifier. The dock window is built if not currently exist.

Return type:

v_sim.UiDockWindow

This routine associates a v_sim.UiDockWindow identifier to the object pointer.

v_sim.ui_panel_class_getHeaderVisibility()
Returns:

True if the header uses text and label.

Return type:

bool

The header can be represented using the full image and label always or only the image when the tab is not on top.

New in version 3.8.

v_sim.ui_panel_class_getPanelById(id)
Parameters:

id (str) – a v_sim.UiPanel identifier.

Returns:

the v_sim.UiPanel that corresponds to this identifier or None if none exists.

Return type:

v_sim.UiPanel

This routine associates a v_sim.UiPanel identifier to the object pointer.

v_sim.ui_panel_class_setCurrent(dataObj, view)
Parameters:

Set the currently focussed v_sim.Data. It then can be retrieve using v_sim.UiPanel.getData().

New in version 3.7.

v_sim.ui_panel_class_setHeaderVisibility(status)
Parameters:

status (bool) – a boolean.

The header can be represented using the full image and label always or only the image when the tab is not on top.

v_sim.ui_raiseWarning(action, message, window)
Parameters:
  • action (str) – a string ;

  • message (str) – another string ;

  • window (Gtk.Window or None) – the parent window to raise the warning on.

Raise a warning window with the action in bold and the message written underneath.

v_sim.ui_raiseWarningLong(action, message, window)
Parameters:
  • action (str) – a string ;

  • message (str) – another string ;

  • window (Gtk.Window) – the parent window to raise the warning on.

Same as v_sim.ui_raiseWarning() except that the message is displayed in a text buffer, ideal for a log.

v_sim.ui_runCommandLine(data)
Parameters:

data (object or None) – a pointer to the command panel (see v_sim.UiMain).

Returns:

False always.

Return type:

bool

Call the get routines from the command line module and deal with them. This method is not aware of the panels and is intended to be called only when the command panel is not used. In the opposite case, use v_sim.UiMain.runCommandLine() instead.

v_sim.ui_setRenderWidget(render)
Parameters:

render (v_sim.UiRenderingWindow) – a v_sim.UiRenderingWindow widget.

A convenient function to set the rendering area widget.

New in version 3.7.

v_sim.ui_storeRecent(filename)
Parameters:

filename (str) – a filename.

Add filename to the list of recent files.

New in version 3.8.

v_sim.ui_wait()

It runs the Gtk event loop, flushing it before returning.

v_sim.vector_nrm(v)
Parameters:

v (float) – three floats.

Return type:

float

Normalise v.

New in version 3.9.

v_sim.vector_prod(w, u, v)
Parameters:

Compute in w the vector product of u and v.

New in version 3.9.

v_sim.vector_set(dest, orig)
Parameters:
  • dest (float) – a vector.

  • orig (float) – a vector.

Returns:

True if dest is different from orig.

Return type:

bool

Copy orig into dest and also test if dest was already equals to orig.

New in version 3.8.

v_sim.vector_spherical(cart, at)
Parameters:
Returns:

the coodinate in spherical.

Return type:

float

Convert cart in spherical coordinates. It is equivalent to v_sim.matrix_cartesianToSpherical() but returns the value in a given direction only. This is intended for bindings.

New in version 3.8.