Functions¶
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Details¶
- v_sim.XML_substitute(output, filename, tag)¶
- Parameters:
output (
GLib.String) – aGLib.Stringto store the substitution ;filename (
str) – the file to read the data from ;tag (
str) – the tag to substitute ;
- Raises:
- Returns:
Trueif no error occured.- Return type:
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:
- Returns:
a newly allocated
GLib.Array.- nColumns:
a location for an integer.
- Return type:
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:
Internal routine for error handling.
New in version 3.8.
- v_sim.array_sizedFromFile(filename, size)¶
- Parameters:
- Raises:
- Returns:
a newly allocated
GLib.Array.- nColumns:
number of read columns;
- Return type:
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:
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:
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:
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:
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:
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:
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:
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:
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:
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:
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:
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:
This method is called when V_Sim is in export mode from the command line.
- v_sim.basic_parseConfigFiles()¶
- Raises:
- Returns:
a newly allocated
GLib.Stringif some error occured.- Return type:
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) – av_sim.Unitsvalue.- Returns:
Trueif the prefered unit is actually changed.- Return type:
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)¶
-
xlib.Displaya 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 isTrue, 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.Coloror 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.Coloror the already existing one.- Return type:
This method adds a new color in the list of stored colors with the given values.
- v_sim.color_convertHSLtoRGB(rgb, hsl)¶
- Parameters:
This methods convert a HSL color to a RGB one.
- v_sim.color_convertHSVtoRGB(rgb, hsv)¶
- Parameters:
This methods convert a HSV color to a RGB one.
- v_sim.color_convertRGBtoHSL(hsl, rgb)¶
- Parameters:
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, seev_sim.Color.getStorage().New in version 3.8.
- v_sim.color_getByValues(red, green, blue, alpha)¶
- Parameters:
- Returns:
the found color, or
Noneif 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.Poolobject.- Return type:
Give access to the
v_sim.Poolinstance storing all the colors.New in version 3.8.
- v_sim.color_invertRGBA(inv, rgba)¶
- Parameters:
Invert the colour on the stack.
New in version 3.8.
- v_sim.data_atomic_class_addLoader(loader)¶
- Parameters:
loader (
v_sim.DataLoader) – av_sim.DataLoaderobject.
Add loader to the list of
v_sim.DataLoaderto be used whenv_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:
Returns a translated string describing what is files loaded by
v_sim.DataAtomicobjects.New in version 3.8.
- v_sim.data_atomic_class_getLoaders()¶
- Returns:
a list of
v_sim.DataLoaderowned by V_Sim.- Return type:
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) – av_sim.DataSpinobject.
Add loader to the list of
v_sim.DataLoaderto be used whenv_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:
Returns a translated string describing what is files loaded by
v_sim.DataSpinobjects.New in version 3.8.
- v_sim.data_spin_class_getLoaders()¶
- Returns:
a list of
v_sim.DataLoaderowned by V_Sim.- Return type:
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:
- Returns:
the angle value in radians.
- at:
a buffer for coordinates.
- Return type:
Generate vertices in
v_sim.GlExtPackingModels.XYZlayout describing an angle. The vertices are packed usingv_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:
Generate vertices in
v_sim.GlExtPackingModels.XYZ_NRMlayout describing an arrow made of a cylinder and a cone. The vertices are packed usingv_sim.GlExtPrimitives.TRIANGLES.New in version 3.9.
- v_sim.drawCone(vertices, xyz1, xyz2, radius, nlat, filled)¶
- Parameters:
Generate vertices in
v_sim.GlExtPackingModels.XYZ_NRMlayout describing a cone. The vertices are packed usingv_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:
Generate vertices in
v_sim.GlExtPackingModels.XYZ_NRMlayout describing a cube. The vertices are packed usingv_sim.GlExtPrimitives.TRIANGLES.New in version 3.9.
- v_sim.drawCylinder(vertices, xyz1, xyz2, radius, nlat, filled)¶
- Parameters:
Generate vertices in
v_sim.GlExtPackingModels.XYZ_NRMlayout describing a cylinder. The vertices are packed usingv_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_NRMlayout describing an ellipsoid shape. The discretisation of the volume is the same than the one used byv_sim.drawSphere() but with non homogeneous axis.New in version 3.9.
- v_sim.drawIcosahedron(vertices, xyz, radius, nlat)¶
- Parameters:
Add vertices in vertices array, using a
v_sim.GlExtPackingModels.XYZ_NRMlayout. Vertices are describingv_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:
Add vertices in vertices array, using a
v_sim.GlExtPackingModels.XYZ_NRMlayout. Vertices are describingv_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_NRMlayout describing a torus shape. The vertices are packed usingv_sim.GlExtPrimitives.TRIANGLES.New in version 3.9.
- v_sim.getValidPath(pathList, filenames, accessMode)¶
- Parameters:
- Returns:
the first valid complete path (from pathList plus an entry of filenames) if one can be found depnding on accessMode or
Noneif none found. Free it withGLib.free() after use.- Return type:
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.Listindicates at the end the first valid entry in theGLib.List.
- v_sim.gl_light_newDefault()¶
- Returns:
the newly created
v_sim.GlLight. UseGLib.free() to deallocate this light.- Return type:
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) – av_sim.GlCameraobject.- Returns:
a location to store a
v_sim.GlMatrix.- Return type:
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:
camera (
v_sim.GlCamera) – av_sim.GlCameraobject.width (
int) – a width.height (
int) – a height.
- Returns:
a location to store a
v_sim.GlMatrix.- Return type:
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:
v (
float) – a GL vector locationmatrix (
v_sim.GlMatrix) – a GL matrixu (
float) – a GL vector
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:
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:
- Returns:
the newly allocated
v_sim.LineorNone.- Return type:
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:
A method to transform cartesian coordinates in spherical coordinates (radius, phi and theta).
New in version 3.3.
- v_sim.matrix_determinant(mat)¶
-
Calculate the determinant of matrix mat.
New in version 3.6.
- v_sim.matrix_dtof(mf, md)¶
-
Cast md into mf.
New in version 3.7.
- v_sim.matrix_getInter2D(lambda_, a, b, A, B)¶
- Parameters:
- Returns:
Trueif [ab] and [AB] have an intersection.- Return type:
Get the intersection coeeficient of lines [ab] and [AB].
- v_sim.matrix_getRotationFromFull(rot, full, box)¶
- Parameters:
- Returns:
Trueif full does not describe properly a 3D box.- Return type:
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:
- Returns:
a value into [0;1].
- Return type:
Transform x into [0;1] with a linear scale.
New in version 3.5.
- v_sim.matrix_getScaledLinearInv(x, minmax)¶
- Parameters:
- Returns:
a value into [0;1].
- Return type:
Reverse function for
v_sim.matrix_getScaledLinear().New in version 3.5.
- v_sim.matrix_getScaledLog(x, minmax)¶
- Parameters:
- Returns:
a value into [0;1].
- Return type:
Transform x into [0;1] with a log scale.
New in version 3.5.
- v_sim.matrix_getScaledLogInv(x, minmax)¶
- Parameters:
- Returns:
a value into [0;1].
- Return type:
Reverse function for
v_sim.matrix_getScaledLog().New in version 3.5.
- v_sim.matrix_getScaledZeroCentredLog(x, minmax)¶
- Parameters:
- Returns:
a value into [0;1].
- Return type:
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:
- Returns:
a value into [0;1].
- Return type:
Reverse function for
v_sim.matrix_getScaledZeroCentredLog().New in version 3.5.
- v_sim.matrix_invert(inv, mat)¶
- Parameters:
- Returns:
Falseif mat is singular.- Return type:
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:
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:
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:
Falseif the given matrix is planar.- reduced:
a storage for 6 floating point values ;
- Return type:
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:
mat (
float) – a matrix.angle (
float) – an angle in degrees.dir (
v_sim.XyzDir) – a direction.
Create a rotation matrix along axis dir of the given angle.
New in version 3.8.
- v_sim.matrix_set(mat, orig)¶
-
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:
A method to transform spherical coordinates (radius, phi and theta) to cartesian coordinates.
New in version 3.3.
- v_sim.minmax(global_, minmax)¶
- Parameters:
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:
Same as
v_sim.minmax() for double inputs.New in version 3.8.
- v_sim.modulo_float(a, b)¶
- Parameters:
- Returns:
the new float value after the modulo.
- Return type:
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:
type (
v_sim.NodeArrayIterType) – a iteration type.vals (
v_sim.NodeValues) – av_sim.NodeValuesobject.
- Returns:
Trueif 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:
Create a new #Option using the name as identifier.
- v_sim.pair_cylinder_getDefaultColorType()¶
- Returns:
an integer corresponding to the color scheme.
- Return type:
Get the color scheme.
- v_sim.pair_cylinder_getDefaultRadius()¶
- Returns:
the default value for cylinder radius.
- Return type:
Get the default value for cylinder radius.
- v_sim.pair_cylinder_getDefaultRadiusType()¶
- Returns:
an integer corresponding to the radius scheme.
- Return type:
Get the radius scheme.
New in version 3.9.
- v_sim.pair_wire_getDefaultStipple()¶
- Returns:
the default stipple pattern.
- Return type:
Retrieves the default stipple pattern.
New in version 3.8.
- v_sim.pair_wire_getDefaultWidth()¶
- Returns:
the default width.
- Return type:
Retrieves the default width.
New in version 3.8.
- v_sim.path_normalize(path)¶
- Parameters:
- Returns:
a newly created string.
- Return type:
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:
filename (
str) – a location on disk.paths (
v_sim.Paths) – av_sim.Pathsobject.
- Raises:
- Returns:
Trueon success.- Return type:
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:
Trueif zele is known in the atomic built-in list.- Return type:
Get the symbol or the covalence radius of the argument zele.
- v_sim.physic_getUnitConversionFactor(from_, to)¶
- Parameters:
from (
v_sim.Units) – av_sim.Units.to (
v_sim.Units) – av_sim.Units.
- Returns:
a factor.
- Return type:
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:
Find the unit corresponding to the name. If none is found,
v_sim.Units.UNDEFINEDis 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:
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) – av_sim.Units.- Returns:
a factor.
- Return type:
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:
Trueif symbol is known in the atomic built-in list.- Return type:
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 ofv_sim.Plane,Noneterminated ;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:
Trueif the intersections are found.- Return type:
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.Listowned by V_Sim ofv_sim.Pluginobjects.- Return type:
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:
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.Shadefrom the pool.- Return type:
Convenience function calling
v_sim.Pool.getById() on the defaultv_sim.Shadestorage.New in version 3.8.
- v_sim.shade_getStorage()¶
- Returns:
a pointer to the internal shade list.
- Return type:
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 (seev_sim.ShadeColorModeenumeration).
- Returns:
the newly created
v_sim.Shade.- Return type:
Create a
v_sim.Shadefrom 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:
labelUTF8 (
str) – a UTF8 string that shortly named this new shade ;lst ([
v_sim.ShadeStep]) – a list of color steps.colorMode (
v_sim.ShadeColorMode) – av_sim.ShadeColorModemode.
- Returns:
the newly created
v_sim.Shade.- Return type:
Create a
v_sim.Shadefrom 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:
labelUTF8 (
str) – a UTF8 string that shortly named this new shade ;descr (
str) – a string with the shade description.colorMode (
v_sim.ShadeColorMode) – av_sim.ShadeColorModemode.
- Raises:
- Returns:
the newly created
v_sim.Shade.- Return type:
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:
- Returns:
a location to a
v_sim.SurfacePointstructure.- Return type:
Initialise pt with at and normal.
New in version 3.8.
- v_sim.ui_buildRenderingWindow(renderWindow)¶
- Parameters:
renderWindow (
v_sim.UiRenderingWindow) – av_sim.UiRenderingWindowobject.- Returns:
a newly created
Gtk.Window.- Return type:
Create a
Gtk.Windowwith 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:
list ([
v_sim.FileFormat]) – aGLib.Listofv_sim.FileFormat;fileChooser (
Gtk.Widget) – a file chooser to associate filters with.
- Returns:
a list of
v_sim.UiFileFilter. This list should be freed after use.- Return type:
Create a list of
Gtk.FileFiltercreated from the given list of file formats and attach it to the given fileChooser.
- v_sim.ui_createInterface(panel, renderWindow, renderArea)¶
- Parameters:
panel (
Gtk.Window) – alwaysNonehere.renderWindow (
Gtk.Window) – a location for aGtk.Window;renderArea (
Gtk.Widget) – a location for aGtk.Widget.
A convenient routine that creates a
v_sim.UiRenderingWindowalone. 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.Pixbufon success.- Return type:
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:
A convenient function to get the command panel window.
- v_sim.ui_getRenderWidget()¶
- Returns:
a
Gtk.Widget.- Return type:
A convenient function to get the rendering area widget.
- v_sim.ui_getRenderWindow()¶
- Returns:
a
Gtk.Window.- Return type:
A convenient function to get the rendering area window.
- v_sim.ui_interactive_pick_getSelection()¶
- Returns:
a
v_sim.UiSelectionobject.- Return type:
Retrieves the
v_sim.UiSelectionof this panel.New in version 3.8.
- v_sim.ui_interactive_pick_getSelectionLabel()¶
- Returns:
a
Gtk.Widgetobject.- Return type:
Retrieves the
Gtk.Widgetused as label for the selection.New in version 3.8.
- v_sim.ui_interactive_pick_start(window)¶
- Parameters:
window (
v_sim.UiRenderingWindow) – av_sim.UiRenderingWindowobject.
Initialise a pick session.
- v_sim.ui_interactive_pick_stop(window)¶
- Parameters:
window (
v_sim.UiRenderingWindow) – av_sim.UiRenderingWindowobject.
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:
panel (
Gtk.Window) – a location for av_sim.UiMainpanel ;renderWindow (
Gtk.Window) – a location for aGtk.Window;renderArea (
Gtk.Widget) – a location for aGtk.Widget.
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:
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:
Get the rendering window of V_Sim.
- v_sim.ui_main_class_getRememberPosition()¶
-
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:
iter (
Gtk.TreeIter) – theGtk.TreeIterto set the label ;label (
str) – the value of the label to be set.
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:
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:
This routine can be used to know all existing
v_sim.UiDockWindow.
- v_sim.ui_panel_class_getCommandPanel()¶
- Returns:
the
v_sim.UiDockWindowthat is inside the command panel.- Return type:
There is always a
v_sim.UiDockWindowthat is inside the command panel. This routine gets it.
- v_sim.ui_panel_class_getDockById(id)¶
- Parameters:
id (
str) – av_sim.UiDockWindowidentifier.- Returns:
the
v_sim.UiDockWindowthat corresponds to this identifier. The dock window is built if not currently exist.- Return type:
This routine associates a
v_sim.UiDockWindowidentifier to the object pointer.
- v_sim.ui_panel_class_getHeaderVisibility()¶
-
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) – av_sim.UiPanelidentifier.- Returns:
the
v_sim.UiPanelthat corresponds to this identifier orNoneif none exists.- Return type:
This routine associates a
v_sim.UiPanelidentifier to the object pointer.
- v_sim.ui_panel_class_setCurrent(dataObj, view)¶
- Parameters:
dataObj (
v_sim.Data) – av_sim.Dataobject.view (
v_sim.GlView) – av_sim.GlViewobject.
Set the currently focussed
v_sim.Data. It then can be retrieve usingv_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.WindoworNone) – 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 (
objectorNone) – a pointer to the command panel (seev_sim.UiMain).- Returns:
Falsealways.- Return type:
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) – av_sim.UiRenderingWindowwidget.
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)¶
-
Normalise v.
New in version 3.9.
- v_sim.vector_prod(w, u, v)¶
-
Compute in w the vector product of u and v.
New in version 3.9.
- v_sim.vector_set(dest, orig)¶
- Parameters:
- Returns:
Trueif dest is different from orig.- Return type:
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:
cart ([
float]) – a vector in cartesian coordinates.at (
v_sim.MatrixSphericalCoord) – a spherical direction.
- Returns:
the coodinate in spherical.
- Return type:
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.