v_sim.Surface¶
- Subclasses:
 None
Methods¶
- Inherited:
 - Structs:
 
class  | 
  | 
class  | 
  | 
class  | 
|
class  | 
  | 
class  | 
  | 
class  | 
  | 
class  | 
  | 
class  | 
  | 
class  | 
  | 
  | 
|
  | 
|
  | 
|
  | 
|
  | 
|
  | 
Virtual Methods¶
- Inherited:
 
Properties¶
- Inherited:
 
Name  | 
Type  | 
Flags  | 
Short Description  | 
|---|---|---|---|
r/w  | 
resource  | 
Signals¶
- Inherited:
 
Name  | 
Short Description  | 
|---|---|
Gets emitted when a surface is shown or hidden by a plane.  | 
Fields¶
- Inherited:
 
Name  | 
Type  | 
Access  | 
Description  | 
|---|---|---|---|
parent  | 
r  | 
Class Details¶
- class v_sim.Surface(**kwargs)¶
 - Bases:
 - Abstract:
 No
- Structure:
 
All fields are private, use the access routines.
- classmethod createFromPotentialFile(surf_file_to_write, pot_file_to_read, nsurfs_to_build, surf_value, surf_name)¶
 - Parameters:
 - Returns:
 0 in case of success, n!=0 otherwise.
- Return type:
 
Read the given pot file and produce an associated surf file. WARNING, it may be removed later.
Deprecated since version 3.7.
- classmethod exportXMLFile(filename, values, res, n)¶
 - Parameters:
 filename (
str) – a path to a file.values (
float) – an array of n values.res (
v_sim.SurfaceResource) – an array of nv_sim.SurfaceResource.n (
int) – number of surface resources to export.
- Raises:
 - Returns:
 Falseif a error occured.- Return type:
 
Export the surface resources into an XML file.
- classmethod getErrorQuark()¶
 - Returns:
 the #GQuark associated to errors related to surface files.
- Return type:
 
Internal routine for error handling.
- classmethod loadFile(file)¶
 - Parameters:
 file (
str) – target file to load ;- Raises:
 - Returns:
 Truein case of success,Falseotherwise. Even in case of success error may have been set.- surf:
 a set of surfaces (location) ;
- Return type:
 (
bool, surf: [v_sim.Surface])
This loads a surface file and set default material properties for it. See surf file specifications.
- classmethod new(label, points, polys)¶
 - Parameters:
 label (
str) – a string.points ([
v_sim.SurfacePoint]) – a set of point coordinates.polys ([
v_sim.SurfacePoly]) – a set of polygons.
- Returns:
 a newly allocated
v_sim.Surfacestructure.- Return type:
 
Create a new
v_sim.Surfaceobject as defined by points and polys.
- classmethod new_defaultFromScalarField(field)¶
 - Parameters:
 field (
v_sim.ScalarField) – av_sim.ScalarFieldobject.- Returns:
 - neg:
 a
v_sim.Surfacelocation.- pos:
 a
v_sim.Surfacelocation.
- Return type:
 (neg:
v_sim.Surface, pos:v_sim.Surface)
Creates one or two surface from field. If field is mostly positive, one surface is generated at the mean value. If field has equivalent negative and positive values, two surfaces are generated, one for th mean negative value and one for the mean positive value.
New in version 3.8.
- classmethod new_fromDefinition(label, definition)¶
 - Parameters:
 label (
str) – a string.definition (
v_sim.SurfaceDefinition) – Some points and polys.
- Returns:
 a newly allocated
v_sim.Surfacestructure.- Return type:
 
Same as
v_sim.Surface.new(), mainly for language bindings.New in version 3.8.
- classmethod new_fromScalarField(field, isoValue, name)¶
 - Parameters:
 field (
v_sim.ScalarField) – the scalar field to create the surface from ;isoValue (
float) – the value of the isosurface ;name (
strorNone) – the name of the surface to use (can beNone).
- Returns:
 the newly created surface, if any.
- Return type:
 
Create on the fly a surface from the scalar field field. If name is given, the surface is created with it, if not, “Isosurface id + 1” is used. surf can already contains several surfaces, in that case, the new surface is added. If surf is
None, then a newv_sim.Surfaceobject is created and returned.
- classmethod parseXMLFile(filename, surfaces, field)¶
 - Parameters:
 filename (
str) – a path to a file.surfaces ([
v_sim.Surface]) – a location on av_sim.Surfacepointer.field (
v_sim.ScalarField) – the scalar field to create the surface from.
- Raises:
 - Returns:
 Falseif a error occured.- surfaces:
 a location on a
v_sim.Surfacepointer.
- Return type:
 (
bool, surfaces: [v_sim.Surface])
Parse the given XML file, looking for the <surfaces> tag and create the given surfaces.
- addPropertyFloat(name)¶
 - Parameters:
 name (
str) – the name of the property to add.- Returns:
 a newly allocated array that can be populated.
- Return type:
 
Some properties can be associated to the surfaces stored in self. This method is add a new property.
- checkConsistency()¶
 Check if all arrays in the structures are consistent (without overflow).
- getPropertyFloat(name)¶
 - Parameters:
 name (
str) – the name of the property to look for.- Returns:
 a table with the values if the property is found,
Noneotherwise.- Return type:
 
Some properties can be associated to the surfaces stored in self. This method is used to retrieve floating point values properties.
- getPropertyValueFloat(name, value)¶
 - Parameters:
 - Returns:
 Trueif a value is indeed found.- Return type:
 
This method retrieves a float value stored as a property called name for the surface defined by its number idSurf.
- getResource()¶
 - Returns:
 the resource of the surface or
None, if i is invalid.- Return type:
 
This returns the resource of the self.
New in version 3.7.
- iter_poly_new()¶
 - Returns:
 a
v_sim.SurfaceIterPolystructure.- Return type:
 iter:
v_sim.SurfaceIterPoly
Setup a new iter to iterate on drawn polygons of self.
New in version 3.8.
- setMask(mask)¶
 - Parameters:
 mask (
v_sim.PlaneSetorNone) – av_sim.PlaneSetobject.- Returns:
 Trueif mask is changed.- Return type:
 
Use mask to hide portion of self (when maskable, depending on their resources). Set mask to
Noneto remove the mask.New in version 3.8.
- setResource(res)¶
 - Parameters:
 res (
v_sim.SurfaceResource) – the new resource.- Returns:
 Trueif the resource is changed.- Return type:
 
This method is used to change the resource of a surface.
Signal Details¶
- v_sim.Surface.signals.masked(surface)¶
 - Signal Name:
 masked- Flags:
 - Parameters:
 surface (
v_sim.Surface) – The object which received the signal
Gets emitted when a surface is shown or hidden by a plane.
New in version 3.7.
Property Details¶
- v_sim.Surface.props.resource¶
 - Name:
 resource- Type:
 - Default Value:
 - Flags:
 
resource