panelSurfaces

panelSurfaces — Gtk interface to load isosurfaces.

Synopsis

#define             VISU_UI_SURFACE_NAME_CHOOSE
#define             VISU_UI_SURFACE_NAME_STR
enum                VisuUiSurfacesFieldId;
void                visu_ui_panel_surfaces_add          (gchar *filename,
                                                         float value,
                                                         gchar *name);
void                visu_ui_panel_surfaces_addField     (VisuScalarField *field,
                                                         GtkTreeIter *iter);
void                visu_ui_panel_surfaces_addSurfaces  (VisuSurfaces *surf,
                                                         const gchar *name,
                                                         GtkTreeIter *iter);
const VisuSurfaces * visu_ui_panel_surfaces_compute     (GtkTreeIter *iter,
                                                         const float *values,
                                                         const gchar **names,
                                                         guint nValues);
const VisuSurfaces * visu_ui_panel_surfaces_computeAuto (GtkTreeIter *iter);
void                visu_ui_panel_surfaces_editProperties
                                                        (GtkTreeIter *iter);
gboolean            visu_ui_panel_surfaces_exportXMLFile
                                                        (const gchar *filename,
                                                         GError **error);
GtkWidget *         visu_ui_panel_surfaces_generateValues
                                                        (int *nbValues,
                                                         float **values,
                                                         gchar **name,
                                                         float minVal,
                                                         float maxVal);
GtkListStore *      visu_ui_panel_surfaces_getFields    ();
gboolean            visu_ui_panel_surfaces_hide         (VisuPlane **planes);
VisuUiPanel *       visu_ui_panel_surfaces_init         ();
gboolean            visu_ui_panel_surfaces_loadFile     (const char *file_name,
                                                         VisuBox *boxToFit,
                                                         GHashTable *table,
                                                         VisuScalarFieldMethod *meth);
gboolean            visu_ui_panel_surfaces_parseXMLFile (const gchar *filename,
                                                         GError **error);
gboolean            visu_ui_panel_surfaces_setUsed      (gboolean used);
gboolean            visu_ui_panel_surfaces_showAll      (gboolean show);
void                visu_ui_panel_surfaces_updateAtIter (GtkTreeIter *iter);

Description

This module contains the panel used to draw isosurfaces. From it, you can draw isosurfaces on screen after they are loaded through the surfaces module. You can also access tools to manage and create .surf files, these tools are related to the panelSurfacesTools module.

Details

VISU_UI_SURFACE_NAME_CHOOSE

#define VISU_UI_SURFACE_NAME_CHOOSE "<span size=\"smaller\"><i>"VISU_UI_SURFACE_NAME_STR"</i></span>"

The string used in the tree view to represent the surfaces that don't share surface resources.


VISU_UI_SURFACE_NAME_STR

#define VISU_UI_SURFACE_NAME_STR    "Choose an id name"

The default string used to name surfaces that are not associated to any public surface ressource.


enum VisuUiSurfacesFieldId

typedef enum {
    VISU_UI_SURFACES_FIELD_LABEL,
    VISU_UI_SURFACES_FIELD_POINTER,
    VISU_UI_SURFACES_FIELD_N_COLUMNS
} VisuUiSurfacesFieldId;

Thesse are the description of the columns stored in the GtkListStore of this panel. See visu_ui_panel_surfaces_getFields() to access this liststore.

VISU_UI_SURFACES_FIELD_LABEL

a string, the description of the scalar field.

VISU_UI_SURFACES_FIELD_POINTER

the pointer to the VisuScalarField object.

VISU_UI_SURFACES_FIELD_N_COLUMNS

the number of columns.

visu_ui_panel_surfaces_add ()

void                visu_ui_panel_surfaces_add          (gchar *filename,
                                                         float value,
                                                         gchar *name);

Create and add a surface created from the given scalar field. This field must already be loaded. If name is not given, the surface will be called "Isosurface id" where id is an increasing counter.

filename :

the name of the scalar field from which to add a surface ;

value :

the iso value ;

name :

the name used to identify the new surface (can be NULL).

visu_ui_panel_surfaces_addField ()

void                visu_ui_panel_surfaces_addField     (VisuScalarField *field,
                                                         GtkTreeIter *iter);

This routine can be used to add a VisuScalarField to the tree view. iter is then populated with the row it has been inserted to.

field :

a VisuScalarField object. [transfer full]

iter :

a location to store the iter. [out caller-allocates]

Since 3.7


visu_ui_panel_surfaces_addSurfaces ()

void                visu_ui_panel_surfaces_addSurfaces  (VisuSurfaces *surf,
                                                         const gchar *name,
                                                         GtkTreeIter *iter);

This routine can be used to add a VisuSurfaces to the tree view. iter is then populated with the row it has been inserted to.

surf :

a VisuSurfaces object. [transfer full]

name :

a name surf comes from.

iter :

a location to store the iter. [out caller-allocates]

Since 3.7


visu_ui_panel_surfaces_compute ()

const VisuSurfaces * visu_ui_panel_surfaces_compute     (GtkTreeIter *iter,
                                                         const float *values,
                                                         const gchar **names,
                                                         guint nValues);

This routine will generate nValues surfaces for the VisuScalarField located at iter. It will redraw if necessary.

iter :

a GtkTreeIter.

values :

values to create surfaces at. [array length=nValues]

names :

names for the new surfaces. [array length=nValues]

nValues :

number of surfaces to create.

Returns :

a VisuSurfaces object. [transfer none]

Since 3.7


visu_ui_panel_surfaces_computeAuto ()

const VisuSurfaces * visu_ui_panel_surfaces_computeAuto (GtkTreeIter *iter);

Add new surfaces to the entry pointed by iter. This entry must be a VisuScalarField object. This routine will redraw if necessary.

iter :

a GtkTreeIter.

Returns :

a VisuSurfaces object. [transfer none]

Since 3.7


visu_ui_panel_surfaces_editProperties ()

void                visu_ui_panel_surfaces_editProperties
                                                        (GtkTreeIter *iter);

Opens a new window allowing to edit surface properties.

iter :

the currently selected row iter (or NULL).

visu_ui_panel_surfaces_exportXMLFile ()

gboolean            visu_ui_panel_surfaces_exportXMLFile
                                                        (const gchar *filename,
                                                         GError **error);

Export to filename the list of isosurfaces values of the selected scalar-field file.

filename :

a filename to export to.

error :

a location to store an error. [allow-none]

Returns :

TRUE if everything goes right.

Since 3.7


visu_ui_panel_surfaces_generateValues ()

GtkWidget *         visu_ui_panel_surfaces_generateValues
                                                        (int *nbValues,
                                                         float **values,
                                                         gchar **name,
                                                         float minVal,
                                                         float maxVal);

This method opens a little dialog window that is made to help the user enter a list of values for creation of iso-surfaces. These values are generated between minVal and maxVal.

nbValues :

a location of an integer to store the number of generated values ;

values :

a pointer on a float array. The target of this pointer must be NULL and it will be allocated after a call to this method. Use g_free() after use to free it.

name :

a pointer to store a name. The target of this pointer must be NULL on enter. It is associated only if a name is given.

minVal :

the minimum value for the range ;

maxVal :

the maximum value for the range.

Returns :

the dialog widget. [transfer full]

visu_ui_panel_surfaces_getFields ()

GtkListStore *      visu_ui_panel_surfaces_getFields    ();

This method gives read access to the GtkListStore used to store the scalar field files.

Returns :

the GtkListStore used by this panel to store its scalar fields. It should be considered read-only. [transfer none]

visu_ui_panel_surfaces_hide ()

gboolean            visu_ui_panel_surfaces_hide         (VisuPlane **planes);

Must be called after the initialisation of the plane subpanel. It applies the masking scheme of planes on current surfaces.

planes :

an array of planes to be applied (NULL terminated).

Returns :

TRUE if the surface should be rebuilt.

visu_ui_panel_surfaces_init ()

VisuUiPanel *       visu_ui_panel_surfaces_init         ();

Should be used in the list declared in externalModules.h to be loaded by V_Sim on start-up. This routine will create the VisuUiPanel where the iso-surfaces stuff can be done, such as creating a surface, loading a scalar field, changing the properties...

Returns :

a newly created VisuUiPanel object.

visu_ui_panel_surfaces_loadFile ()

gboolean            visu_ui_panel_surfaces_loadFile     (const char *file_name,
                                                         VisuBox *boxToFit,
                                                         GHashTable *table,
                                                         VisuScalarFieldMethod *meth);

Tries to load the given file_name and if it succeeds, adds loaded surfaces to the isosurfaces panel. If file_name is a VisuScalarField then, meth is used to load it. If fitToBox is not NULL, the load surfaces or scalar fields are fit to it.

file_name :

the file you want to try to load. [type filename]

boxToFit :

a VisuBox object to fit to ;. [allow-none]

table :

a set of different Option (can be NULL). [allow-none]

meth :

a VisuScalarFieldMethod object.

Returns :

TRUE in case of success.

visu_ui_panel_surfaces_parseXMLFile ()

gboolean            visu_ui_panel_surfaces_parseXMLFile (const gchar *filename,
                                                         GError **error);

This routine reads an XML file and setup the resources and the isovalues to the selected row accordingly.

filename :

a location to read the XML data.

error :

a location to store possible error.

Returns :

TRUE on success.

visu_ui_panel_surfaces_setUsed ()

gboolean            visu_ui_panel_surfaces_setUsed      (gboolean used);

Change the status of the isosurface extension, drawn or not.

used :

a boolean.

Returns :

TRUE if the OpenGLAskForReDraw signal should be emitted.

visu_ui_panel_surfaces_showAll ()

gboolean            visu_ui_panel_surfaces_showAll      (gboolean show);

Shows or hides all surfaces and check their "draw" status in the panel accordingly.

show :

TRUE to show all surfaces, FALSE to hide them.

Returns :

TRUE if surface list should be rebuild and redraw.

visu_ui_panel_surfaces_updateAtIter ()

void                visu_ui_panel_surfaces_updateAtIter (GtkTreeIter *iter);

Reset the shown surfaces at iter.

iter :

an iterator.

Since 3.7