panelSurfaces

panelSurfaces — Gtk interface to load isosurfaces.

Synopsis

ToolPanel*          panelIsosurfacesInit                ();
gboolean            panelIsosurfacesSet_used            (VisuData *dataObj,
                                                         gboolean used);
gboolean            panelIsosurfacesLoad_file           (const char *file_name,
                                                         gboolean fit_to_box,
                                                         VisuData *data,
                                                         GHashTable *table,
                                                         double **box);
gboolean            panelIsosurfacesParse_XMLFile       (const gchar *filename,
                                                         GError **error);
gboolean            panelIsosurfacesShow_all            (gboolean show);
void                panelIsosurfacesEdit_surfaceProperties
                                                        (GtkTreeIter *iter);
void                panelIsosurfacesAdd_withValue       (gchar *filename,
                                                         float value,
                                                         gchar *name);
enum                PanelIsosurfacesColumnId;
GtkListStore*       panelIsosurfacesGet_listStore       ();
gboolean            panelIsosurfacesHide                (Plane **planes);
#define             SURFACE_NAME_STR
#define             SURFACE_NAME_CHOOSE
GtkWidget*          panelIsosurfacesGenerate_isoValues  (int *nbValues,
                                                         float **values,
                                                         gchar **name,
                                                         float minVal,
                                                         float maxVal);

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

panelIsosurfacesInit ()

ToolPanel*          panelIsosurfacesInit                ();

panelIsosurfacesSet_used ()

gboolean            panelIsosurfacesSet_used            (VisuData *dataObj,
                                                         gboolean used);

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

dataObj :

the current VisuData (can be NULL) ;

used :

a boolean.

Returns :

TRUE if the OpenGLAskForReDraw signal should be emitted.

panelIsosurfacesLoad_file ()

gboolean            panelIsosurfacesLoad_file           (const char *file_name,
                                                         gboolean fit_to_box,
                                                         VisuData *data,
                                                         GHashTable *table,
                                                         double **box);

Tries to load the given file_name and if it succeeds, adds loaded surfaces to the isosurfaces panel. In all cases, all previously loaded surfaces are removed from the panel (and from memory).

file_name :

the file you want to try to load

fit_to_box :

whether these isosurfaces should be resized in order to fit to the current VisuBox ;

data :

the VisuData to fit the box to (can be NULL if fit_to_box is false ;

table :

a set of different Option (can be NULL).

box :

a location to store the 6 values defining the loaded box (can be NULL).

Returns :

TRUE in case of success.

panelIsosurfacesParse_XMLFile ()

gboolean            panelIsosurfacesParse_XMLFile       (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.

panelIsosurfacesShow_all ()

gboolean            panelIsosurfacesShow_all            (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.

panelIsosurfacesEdit_surfaceProperties ()

void                panelIsosurfacesEdit_surfaceProperties
                                                        (GtkTreeIter *iter);

Opens a new window allowing to edit surface properties.

iter :

the currently selected row iter (or NULL).

panelIsosurfacesAdd_withValue ()

void                panelIsosurfacesAdd_withValue       (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).

enum PanelIsosurfacesColumnId

typedef enum
  {
    COLUMN_FIELD_LABEL,
    COLUMN_FIELD_POINTER,
    NB_COLUMN_FIELD
  } PanelIsosurfacesColumnId;

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

COLUMN_FIELD_LABEL

a string, the description of the scalar field.

COLUMN_FIELD_POINTER

the pointer to the ScalarField object.

NB_COLUMN_FIELD

the number of columns.

panelIsosurfacesGet_listStore ()

GtkListStore*       panelIsosurfacesGet_listStore       ();

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.

panelIsosurfacesHide ()

gboolean            panelIsosurfacesHide                (Plane **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.

SURFACE_NAME_STR

#define SURFACE_NAME_STR    "Choose an id name"

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


SURFACE_NAME_CHOOSE

#define SURFACE_NAME_CHOOSE "<span size=\"smaller\"><i>"SURFACE_NAME_STR"</i></span>"

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


panelIsosurfacesGenerate_isoValues ()

GtkWidget*          panelIsosurfacesGenerate_isoValues  (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.