v_sim.Box

g GObject.GInterface GObject.GInterface v_sim.Boxed v_sim.Boxed GObject.GInterface->v_sim.Boxed v_sim.NodeMasker v_sim.NodeMasker GObject.GInterface->v_sim.NodeMasker GObject.Object GObject.Object v_sim.Box v_sim.Box GObject.Object->v_sim.Box v_sim.Boxed->v_sim.Box v_sim.NodeMasker->v_sim.Box

Subclasses:

None

Methods

Inherited:

GObject.Object (37), v_sim.Boxed (2), v_sim.NodeMasker (3)

Structs:

GObject.ObjectClass (5)

class

new (geometry, bc)

class

new_full (full, bc)

constrainInside (translat, xyz, withExt)

convertFullToCell (full)

convertReducedToXYZ (red)

convertXYZToReduced (xyz)

getBoundary ()

getCellMatrixv ()

getCentre ()

getExtension ()

getExtensionActive ()

getGeometry (vector)

getGlobalSize (withExt)

getHiddingStatus ()

getInside (vect, ratio)

getPeriodicArray (array, nEle)

getPeriodicVector (vect)

getPeriodicity ()

getUnit ()

getVertices (withExtension)

getVolume ()

setBoundary (bc)

setExtension (extension)

setExtensionActive (status)

setGeometry (geometry)

setGeometryFull (full)

setHiddingStatus (status)

setMargin (margin, emit)

setOrigin (orig)

setUnit (unit)

Virtual Methods

Inherited:

GObject.Object (7), v_sim.Boxed (1), v_sim.NodeMasker (2)

Properties

Inherited:

v_sim.Boxed (2)

Name

Type

Flags

Short Description

boundary

int

r/w

Boundary conditions

expansion

r/w

Expanion on all axis

hidding-scheme

int

r/w

hidding scheme used by the box.

units

int

r/w

Units of dimensions

use-expansion

bool

r/w

Expanion is active or not

Signals

Inherited:

GObject.Object (1), v_sim.Boxed (1), v_sim.NodeMasker (1)

Name

Short Description

SizeChanged

Gets emitted when the box size is changed (because of box duplication for instance).

UnitChanged

Gets emitted when the units are changed.

Fields

Inherited:

GObject.Object (1), v_sim.Boxed (1), v_sim.NodeMasker (1)

Name

Type

Access

Description

parent

GObject.Object

r

priv

v_sim.BoxPrivate

r

Class Details

class v_sim.Box(**kwargs)
Bases:

GObject.Object, v_sim.Boxed, v_sim.NodeMasker

Abstract:

No

Structure:

v_sim.BoxClass

Opaque structure to stores v_sim.Box object.

classmethod new(geometry, bc)
Parameters:
Returns:

create a new v_sim.Box object.

Return type:

v_sim.Box

A v_sim.Box object store the definition of a cell.

New in version 3.7.

classmethod new_full(full, bc)
Parameters:
Returns:

create a new v_sim.Box object.

Return type:

v_sim.Box

A v_sim.Box object stores the definition of a cell. This may fail, if full does not define a 3D basis set (the three vectors are not linearly independant). To check this, use v_sim.Box.getGeometry() to test if the first vector is GObject.G_MAXFLOAT.

New in version 3.7.

constrainInside(translat, xyz, withExt)
Parameters:
  • translat (float) – a translation in cartesian coordinates (out values).

  • xyz (float) – a set of cartesian coordinates.

  • withExt (bool) – True to take into account the box expansions.

Returns:

True if translat is not (0;0;0).

Return type:

bool

Given the box defintion self and the initial xyz cartesian coordinates, it returns the translation translat to be applied to xyz to move the node into the box.

New in version 3.7.

convertFullToCell(full)
Parameters:

full ([float]) –

Return type:

cell: [float]

Convert given cartesian coordinates of a full matrix definition (see v_sim.Box.setGeometryFull()) to cartesian coordinates in the cell definition used by V_Sim. It corresponds to two applied rotations.

New in version 3.7.

convertReducedToXYZ(red)
Parameters:

red ([float]) – floating point values that describes the cartesian coordinates.

Returns:

x:

the x coordinate.

y:

the y coordinate.

z:

the z coordinate.

Return type:

(x: float, y: float, z: float)

Use this method to transform box coordinates into cartesian.

New in version 3.7.

convertXYZToReduced(xyz)
Parameters:

xyz ([float]) – floating point values that describes the cartesian coordinates.

Returns:

u:

the x coordinate.

v:

the y coordinate.

w:

the z coordinate.

Return type:

(u: float, v: float, w: float)

Use this method to transform cartesian into box coordinates.

New in version 3.7.

getBoundary()
Returns:

a v_sim.BoxBoundaries flag.

Return type:

v_sim.BoxBoundaries

Get the boundary conditions defined for self.

New in version 3.7.

getCellMatrixv()
Returns:

m11:

an area to store the matrix.

m12:

an area to store the matrix.

m13:

an area to store the matrix.

m21:

an area to store the matrix.

m22:

an area to store the matrix.

m23:

an area to store the matrix.

m31:

an area to store the matrix.

m32:

an area to store the matrix.

m33:

an area to store the matrix.

Return type:

(m11: float, m12: float, m13: float, m21: float, m22: float, m23: float, m31: float, m32: float, m33: float)

This method is a binding method for visu_box_getCellMatrix().

New in version 3.7.

getCentre()
Returns:

coordinates of the centre.

Return type:

centre: [float]

centre contains on output the cartesian coordinates of the centre of the bounding box.

New in version 3.7.

getExtension()
Returns:

an allocated array to store the values.

Return type:

extension: [float]

Using v_sim.Box.setExtension(), it is possible to duplicate the primitive box in each directions. Use this method to know the current extension. Returned values are positive floating point values. An extension of 0. means that only the primitive box exists, while a value of one means a duplication of one box in each direction of the coordinate.

New in version 3.7.

getExtensionActive()
Returns:

True if extensions are applied.

Return type:

bool

Retrieve if extensions are applied or not.

New in version 3.8.

getGeometry(vector)
Parameters:

vector (v_sim.BoxVector) – an int corresponding to a vector of the box.

Returns:

the value of the required vector (always a positive value for vector = 0, 2 or 5 !), or GObject.G_MAXFLOAT if the box has not been initialised.

Return type:

float

Retrieve the value of a vector defining the bounding box. The vector is chosen with an int, see the v_sim.BoxVector enum for more details.

New in version 3.7.

getGlobalSize(withExt)
Parameters:

withExt (bool) – a boolean.

Returns:

GObject.G_MAXFLOAT on failure, otherwise a length for the biggest diagonal distance of the box, with or without extension.

Return type:

float

The box has a whole size that contains it (including margin, see v_sim.Box.setMargin()), this size can be retrieve taking into account the extension of the box, or not.

New in version 3.7.

getHiddingStatus()
Returns:

the current masking status.

Return type:

v_sim.BoxHiddingStatus

Retrieves the masking status of self.

New in version 3.8.

getInside(vect, ratio)
Parameters:
  • vect ([float]) – some cartesian coordinates.

  • ratio (float) – a ratio in [0;1].

Returns:

True if vect is actually changed.

vect:

some cartesian coordinates.

Return type:

(bool, vect: [float])

Update vect, taking into consideration the particular periodicity of self, for vect expressed in reduced coordinates to be within [-ratio;ratio].

New in version 3.8.

getPeriodicArray(array, nEle)
Parameters:
  • array (int) – an array of nEle * 3 floats.

  • nEle (int) – number of elements in array

Used for bindings.

New in version 3.7.

getPeriodicVector(vect)
Parameters:

vect ([float]) – a vector.

Returns:

x:

the new x part.

y:

the new y part.

z:

the new z part.

Return type:

(x: float, y: float, z: float)

Equivalent of v_sim.Box.getPeriodicVector() used for bindings.

New in version 3.7.

getPeriodicity()
Returns:

a location to store three periodicties.

Return type:

per: [bool]

Get for each {x, y, z} directions if the self is periodic.

New in version 3.7.

getUnit()
Returns:

the v_sim.Units of self or v_sim.Units.UNDEFINED.

Return type:

v_sim.Units

The lengths of self may be given in a certain unit using v_sim.Box.setUnit().

New in version 3.7.

getVertices(withExtension)
Parameters:

withExtension (bool) – a boolean.

Returns:

the position of the eight vertices of the bounding box.

Return type:

v: v_sim.BoxVertices

All nodes are rendered inside a bounding box, this method can be used to retrieve it. This box is not the drawn box but the box containing all the nodes, included possible extension. To get the box itself, use visu_box_getCellMatrix() instead. One can also get the vertices of the box itself using False as withExtension argument.

getVolume()
Returns:

the box volume.

Return type:

float

Compute the volume of the box.

New in version 3.8.

setBoundary(bc)
Parameters:

bc (v_sim.BoxBoundaries) – a boundary condition.

Returns:

True if the boundary conditions of self are changed.

Return type:

bool

Set up the boundary conditions of self.

New in version 3.7.

setExtension(extension)
Parameters:

extension ([float]) – an allocated array to store the values.

Returns:

True if the extension of box is actually changed.

Return type:

bool

Change the duplication of the box in the three directions.

New in version 3.7.

setExtensionActive(status)
Parameters:

status (bool) – a boolean.

Returns:

True if status has changed.

Return type:

bool

Change if extension values are used not not.

New in version 3.8.

setGeometry(geometry)
Parameters:

geometry ([float]) – a 6 floating point array ;

Returns:

True if the geometry is indeed changed.

Return type:

bool

This methods set the size of the box.

New in version 3.7.

setGeometryFull(full)
Parameters:

full (float) – a matrix defining a basis-set.

Returns:

True if the geometry is valid and changed.

Return type:

bool

As v_sim.Box.setGeometry(), but using a full matrix.

New in version 3.7.

setHiddingStatus(status)
Parameters:

status (v_sim.BoxHiddingStatus) – a status.

Returns:

True if the status is actually changed.

Return type:

bool

Changes the masking status of self for status.

New in version 3.8.

setMargin(margin, emit)
Parameters:
Returns:

True if the margin is actually changed.

Return type:

bool

This routine add some margin to defined the OpenGL rendering zone of self.

New in version 3.7.

setOrigin(orig)
Parameters:

orig ([float]) – the new origin

Returns:

True if origin is indeed changed.

Return type:

bool

Change the origin of self.

New in version 3.8.

setUnit(unit)
Parameters:

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

Returns:

True if the unit has been changed.

Return type:

bool

The lengths of self may be given in a certain unit by calling this routine. If the unit is different from the previously defined, the coordinate are scaled accordingly.

New in version 3.7.

Signal Details

v_sim.Box.signals.SizeChanged(box, extens)
Signal Name:

SizeChanged

Flags:

RUN_LAST, NO_RECURSE, NO_HOOKS

Parameters:
  • box (v_sim.Box) – The object which received the signal

  • extens (float) – the new longuest distance in the box taking into account the extension.

Gets emitted when the box size is changed (because of box duplication for instance).

New in version 3.7.

v_sim.Box.signals.UnitChanged(box, factor)
Signal Name:

UnitChanged

Flags:

RUN_LAST, NO_RECURSE, NO_HOOKS

Parameters:
  • box (v_sim.Box) – The object which received the signal

  • factor (float) – the factor that has been applied.

Gets emitted when the units are changed.

New in version 3.7.

Property Details

v_sim.Box.props.boundary
Name:

boundary

Type:

int

Default Value:

7

Flags:

READABLE, WRITABLE

Boundary conditions

v_sim.Box.props.expansion
Name:

expansion

Type:

Default Value:

None

Flags:

READABLE, WRITABLE

Expanion on all axis

v_sim.Box.props.hidding_scheme
Name:

hidding-scheme

Type:

int

Default Value:

0

Flags:

READABLE, WRITABLE

hidding scheme used by the box.

v_sim.Box.props.units
Name:

units

Type:

int

Default Value:

0

Flags:

READABLE, WRITABLE

Units of dimensions

v_sim.Box.props.use_expansion
Name:

use-expansion

Type:

bool

Default Value:

False

Flags:

READABLE, WRITABLE

Expanion is active or not