pot2surf

pot2surf — Creates surfaces from scalar fields.

Synopsis

int                 visu_surfaces_createFromPotentialFile
                                                        (const gchar *surf_file_to_write,
                                                         const gchar *pot_file_to_read,
                                                         int nsurfs_to_build,
                                                         const float *surf_value,
                                                         const gchar **surf_name);
gboolean            visu_surfaces_createFromScalarField (VisuSurfaces **surf,
                                                         VisuScalarField *field,
                                                         double isoValue,
                                                         int id,
                                                         const gchar *name);
gboolean            visu_surfaces_exportXMLFile         (const gchar *filename,
                                                         float *values,
                                                         VisuSurfacesResources **res,
                                                         int n,
                                                         GError **error);
gboolean            visu_surfaces_parseXMLFile          (const gchar *filename,
                                                         VisuSurfaces **surfaces,
                                                         VisuScalarField *field,
                                                         GError **error);

Description

Originally written by Luc Billard for his program VISUALISE. It has been since transformed to a single function and integrated in V_Sim. .pot file are text files which specification are the following :

  • 1st line: full pathname of the potential file to read

  • 2nd line: full pathname of the surface file to build

  • 3rd line: an integer giving the nbr n of isosurfaces to build

  • Each of the n following lines must match the pattern [value name] where value is a real number for the isovalue and name is the name given for the corresponding isosurface to build. Each surface should be named surface_*.

The function will fail if it finds no isosurface corresponding to some of the given isovalues. The panelSurfacesTools contains a frontend to build valid .instruc files. This panel is originally integrated in V_Sim. You can access it through the Convert tab in the Isosurfaces panel.

Details

visu_surfaces_createFromPotentialFile ()

int                 visu_surfaces_createFromPotentialFile
                                                        (const gchar *surf_file_to_write,
                                                         const gchar *pot_file_to_read,
                                                         int nsurfs_to_build,
                                                         const float *surf_value,
                                                         const gchar **surf_name);

Warning

visu_surfaces_createFromPotentialFile is deprecated and should not be used in newly-written code. 3.7

Read the given pot file and produce an associated surf file. WARNING, it may be removed later.

surf_file_to_write :

target surf file

pot_file_to_read :

source pot file

nsurfs_to_build :

number of surfaces to build

surf_value :

an array with iso-values

surf_name :

an array with iso-surface names.

Returns :

0 in case of success, n!=0 otherwise.

visu_surfaces_createFromScalarField ()

gboolean            visu_surfaces_createFromScalarField (VisuSurfaces **surf,
                                                         VisuScalarField *field,
                                                         double isoValue,
                                                         int id,
                                                         const gchar *name);

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 NULL, then a new VisuSurfaces object is created and returned.

surf :

a location on a VisuSurfaces pointer ;. [inout][allow-none]

field :

the scalar field to create the surface from ;

isoValue :

the value of the isosurface ;

id :

an integer identifying the surface ;

name :

the name of the surface to use (can be NULL). [allow-none]

Returns :

TRUE if the surface is created.

visu_surfaces_exportXMLFile ()

gboolean            visu_surfaces_exportXMLFile         (const gchar *filename,
                                                         float *values,
                                                         VisuSurfacesResources **res,
                                                         int n,
                                                         GError **error);

Export the surface resources into an XML file.

filename :

a path to a file.

values :

an array of n values.

res :

an array of n VisuSurfacesResources.

n :

number of surface resources to export.

error :

a location to store a possible error.

Returns :

FALSE if a error occured.

visu_surfaces_parseXMLFile ()

gboolean            visu_surfaces_parseXMLFile          (const gchar *filename,
                                                         VisuSurfaces **surfaces,
                                                         VisuScalarField *field,
                                                         GError **error);

Parse the given XML file, looking for the <surfaces> tag and create the given surfaces.

filename :

a path to a file.

surfaces :

a location on a VisuSurfaces pointer.

field :

the scalar field to create the surface from.

error :

a location to store a possible error.

Returns :

FALSE if a error occured.