Top | ![]() |
![]() |
![]() |
![]() |
VisuScalarFieldMethodVisuScalarFieldMethod — Defines a specialised VisuScalarField class based on data on a grid. |
struct | VisuScalarFieldData |
struct | VisuScalarFieldDataClass |
enum | VisuScalarFieldDataOrder |
struct | VisuScalarFieldMethodClass |
struct | VisuScalarFieldMethod |
GBoxed ╰── VisuScalarFieldMethodData GObject ╰── ToolDbgObj ├── ToolFileFormat │ ╰── VisuScalarFieldMethod ╰── VisuScalarField ╰── VisuScalarFieldData
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.
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
.
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] |
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.
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] |
Since: 3.8
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.
field |
a VisuScalarFieldData object ; |
|
data |
an array containing data to be copied ;. |
[element-type double] |
xyzOrder |
a boolean. |
const GArray *
visu_scalar_field_data_getArray (const VisuScalarFieldData *field
);
The data are stored z first in a flatten array.
Since: 3.7
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()
.
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. |
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).
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). |
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
.
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] |
Since: 3.7
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.
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] |
Since: 3.8
const gchar *
visu_scalar_field_method_data_getFilename
(const VisuScalarFieldMethodData *data
);
Get the filename that is currently parsed.
Since: 3.8
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.
data |
a VisuScalarFieldMethodData structure. |
|
field |
a VisuScalarField object. |
[transfer none] |
Since: 3.8
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.
Since: 3.8
GList *
visu_scalar_field_method_getAll (void
);
This routine gives access to all the registered load method for scamlar fields.
returns a list of V_Sim owned VisuScalarFieldMethod objects.
[transfer none][element-type VisuScalarFieldMethod*]
void
visu_scalar_field_method_class_finalize
(void
);
Free allocated memory for all known VisuScalarFieldMethod.
[skip]
Since: 3.8