VisuScalarFieldMethod

VisuScalarFieldMethod — Defines a specialised VisuScalarField class based on data on a grid.

Functions

Types and Values

Object Hierarchy

    GBoxed
    ╰── VisuScalarFieldMethodData
    GObject
    ╰── ToolDbgObj
        ├── ToolFileFormat
           ╰── VisuScalarFieldMethod
        ╰── VisuScalarField
            ╰── VisuScalarFieldData

Implemented Interfaces

VisuScalarFieldData implements VisuBoxed and VisuPointset.

Description

This kind of scalar fields is a simple scalar field with data available on a grid, regular or not. Data can be read from a file or set directly.

Functions

visu_scalar_field_data_new_fromFile ()

GList *
visu_scalar_field_data_new_fromFile (const gchar *filename,
                                     GHashTable *table,
                                     GCancellable *cancel,
                                     GAsyncReadyCallback callback,
                                     gpointer user_data);

Read the given file and try to load it as a scalar field file. If succeed, all read fields are appended to the fieldList argument. If an error occurs, it is stored into error . When entering the routine, *error must be NULL. If table is given, it means that the caller routine gives some options to the loader routine. These options are a set of names and values.

If the file contains several fields, they must be loaded and added to fieldList .

Parameters

filename

the path to the file to be loaded ;.

[type filename]

table

a set of different options (can be NULL).

[allow-none]

cancel

a GCancellable object.

[allow-none]

callback

a callback when the load finishes.

[allow-none]

user_data

some user data to pass to the callback.

[scope async]

Returns

a GList to store read field(s).

[transfer full][element-type VisuScalarField*]


visu_scalar_field_data_new_fromFileSync ()

GList *
visu_scalar_field_data_new_fromFileSync
                               (const gchar *filename,
                                GHashTable *table,
                                GCancellable *cancel,
                                GError **error);

Like visu_scalar_field_data_new_fromFile(), but synchronous.

Parameters

filename

the path to the file to be loaded ;.

[type filename]

table

a set of different options (can be NULL).

[allow-none]

cancel

a GCancellable object.

[allow-none]

error

an error location.

[allow-none]

Returns

a GList to store read field(s).

[transfer full][element-type VisuScalarField*]

Since: 3.8


visu_scalar_field_data_set ()

void
visu_scalar_field_data_set (VisuScalarFieldData *field,
                            GArray *data,
                            VisuScalarFieldDataOrder xyzOrder);

Set the data of the given field . The array data should be stored in z direction first, followed by y and x if xyzOrder is FALSE, or in the other order when TRUE. The number of elements in the x, y and z directions are read from field->priv->nElements. Then use visu_scalar_field_setGridSize() before using this method.

Parameters

field

a VisuScalarFieldData object ;

 

data

an array containing data to be copied ;.

[element-type double]

xyzOrder

a boolean.

 

visu_scalar_field_data_getArray ()

const GArray *
visu_scalar_field_data_getArray (const VisuScalarFieldData *field);

The data are stored z first in a flatten array.

Parameters

field

a VisuScalarFieldData object.

 

Returns

a pointer on the allocated data array.

[transfer none][element-type double]

Since: 3.7


VisuScalarFieldMethodLoadFunc ()

gboolean
(*VisuScalarFieldMethodLoadFunc) (VisuScalarFieldMethod *meth,
                                  VisuScalarFieldMethodData *data,
                                  GCancellable *cancel,
                                  GError **error);

Read the given file try to load it as a scalar field file. If succeed (i.e. with none fatal errors) the method should return TRUE. If an error occurs, it is stored into error .

If the file contains several fields, they must be loaded and added to data with visu_scalar_field_method_data_addField().

Parameters

meth

a VisuScalarFieldMethod object ;

 

data

the various data the load method requires.

 

cancel

a GCancellable object ;.

[allow-none]

error

a location on a error pointer.

 

Returns

TRUE if the read file is in a valid format (even with minor errors), FALSE otherwise.


visu_scalar_field_method_new ()

VisuScalarFieldMethod *
visu_scalar_field_method_new (const gchar *descr,
                              const gchar **patterns,
                              VisuScalarFieldMethodLoadFunc method,
                              int priority);

This routine is used to add a new method to load scalar field. The priority uses the scale of the GLib (G_PRIORITY_DEFAULT is 0, G_PRIORITY_LOW is 300 for instance).

Parameters

descr

the name of the method ;

 

patterns

a NULL terminated list of strings ;.

[array zero-terminated=1]

method

a VisuScalarFieldMethodLoadFunc method ;.

[scope call]

priority

a priority value (the lower value, the higher priority).

 

Returns

a newly create method to load scalar fields.

[transfer full]


visu_scalar_field_method_load ()

GList *
visu_scalar_field_method_load (VisuScalarFieldMethod *fmt,
                               const gchar *filename,
                               GHashTable *options,
                               GCancellable *cancel,
                               GAsyncReadyCallback callback,
                               gpointer user_data);

Call the load routine of the given scalar field file format fmt .

Parameters

fmt

a VisuScalarFieldMethod object ;

 

filename

a path ;.

[type filename]

options

some key / value options.

[allow-none]

cancel

a GCancellable object.

[allow-none]

callback

a method to call on load finished.

[allow-none]

user_data

some user data.

[scope async]

Returns

a list of VisuScalarField on success.

[element-type VisuScalarField][transfer full]

Since: 3.7


visu_scalar_field_method_loadSync ()

GList *
visu_scalar_field_method_loadSync (VisuScalarFieldMethod *fmt,
                                   const gchar *filename,
                                   GHashTable *options,
                                   GCancellable *cancel,
                                   GError **error);

Same as visu_scalar_field_method_load(), but blocking variant.

Parameters

fmt

a VisuScalarFieldMethod object ;

 

filename

a path ;.

[type filename]

options

some key / value options.

[allow-none]

cancel

a GCancellable object.

[allow-none]

error

an error location.

[allow-none]

Returns

a list of VisuScalarField on success.

[element-type VisuScalarField][transfer full]

Since: 3.8


visu_scalar_field_method_data_getFilename ()

const gchar *
visu_scalar_field_method_data_getFilename
                               (const VisuScalarFieldMethodData *data);

Get the filename that is currently parsed.

Parameters

data

a VisuScalarFieldMethodData structure.

 

Returns

a filename.

Since: 3.8


visu_scalar_field_method_data_addField ()

void
visu_scalar_field_method_data_addField
                               (VisuScalarFieldMethodData *data,
                                VisuScalarField *field);

When parsing a file with several scalar field, use this method to store a new one.

Parameters

data

a VisuScalarFieldMethodData structure.

 

field

a VisuScalarField object.

[transfer none]

Since: 3.8


visu_scalar_field_method_data_ready ()

void
visu_scalar_field_method_data_ready (VisuScalarFieldMethodData *data);

While parsing a file, call this method when all scalar fields are known, but not yet populated.

Parameters

data

a VisuScalarFieldMethodData structure.

 

Since: 3.8


visu_scalar_field_method_getAll ()

GList *
visu_scalar_field_method_getAll (void);

This routine gives access to all the registered load method for scamlar fields.

Returns

returns a list of V_Sim owned VisuScalarFieldMethod objects.

[transfer none][element-type VisuScalarFieldMethod*]


visu_scalar_field_method_class_finalize ()

void
visu_scalar_field_method_class_finalize
                               (void);

Free allocated memory for all known VisuScalarFieldMethod.

[skip]

Since: 3.8

Types and Values

struct VisuScalarFieldData

struct VisuScalarFieldData;

An opaque structure for the scalar field.


struct VisuScalarFieldDataClass

struct VisuScalarFieldDataClass {
  VisuScalarFieldClass parent;
};

An opaque structure for the class.

Members

VisuScalarFieldClass parent;

the parent class.

 

enum VisuScalarFieldDataOrder

Members

VISU_SCALAR_FIELD_DATA_XYZ

   

VISU_SCALAR_FIELD_DATA_ZYX

   

struct VisuScalarFieldMethodClass

struct VisuScalarFieldMethodClass {
  ToolFileFormatClass parent;
};

An opaque structure.

Members

ToolFileFormatClass parent;

the parent class.

 

struct VisuScalarFieldMethod

struct VisuScalarFieldMethod;

An opaque structure.