## visu_basic

visu_basic — Main functions of V_Sim (except graphical ones).

## Synopsis

    #define             V_SIM_DATA_DIR
    #define             V_SIM_LEGAL_DIR
    #define             V_SIM_LOCALE_DIR
    #define             V_SIM_LOCAL_CONF_DIR
    #define             V_SIM_OLD_LOCAL_CONF_DIR
    #define             V_SIM_PIXMAPS_DIR
    #define             V_SIM_PLUGINS_DIR

    void                visuBasicInit                       ();
    gboolean            visuBasicQuit                       (gpointer data);

    const gchar*        visuBasicGet_dataDir                ();
    const gchar*        visuBasicGet_legalDir               ();
    const gchar*        visuBasicGet_localDir               ();
    const gchar*        visuBasicGet_localeDir              ();
    const gchar*        visuBasicGet_oldLocalDir            ();
    const gchar*        visuBasicGet_pixmapsDir             ();
    const gchar*        visuBasicGet_pluginsDir             ();
    int                 visuBasicExport_main                (void);
    gboolean            visuBasicLoad_dataFromFile          (VisuData *data,
                                                             FileFormat *format,
                                                             int nSet,
                                                             GError **error);
    void                visuBasicSet_paths                  ();
    gboolean            visuBasicApply_commandLine          (VisuData *data,
                                                             VisuOptionSet *set,
                                                             GError **error);
    void                visuBasicCreate_extensions          (VisuData *data,
                                                             VisuOptionSet *set,
                                                             gboolean rebuild);
    GString*            visuBasicParse_configFiles          ();
    VisuData*           visuBasicSet_dataFromCommandLine    ();
    void                visuBasicSet_extInfos               (VisuData *dataObj,
                                                             DrawMethod method,
                                                             int *nodes,
                                                             DataNode *data);

## Description

There are here the main functions of V_Sim (except for graphical methods) such as open file.

## Details

### V_SIM_DATA_DIR

    #define V_SIM_DATA_DIR           visuBasicGet_dataDir()

### V_SIM_LEGAL_DIR

    #define V_SIM_LEGAL_DIR          visuBasicGet_legalDir()

### V_SIM_LOCALE_DIR

    #define V_SIM_LOCALE_DIR         visuBasicGet_localeDir()

### V_SIM_LOCAL_CONF_DIR

    #define V_SIM_LOCAL_CONF_DIR     visuBasicGet_localDir()

### V_SIM_OLD_LOCAL_CONF_DIR

    #define V_SIM_OLD_LOCAL_CONF_DIR visuBasicGet_oldLocalDir()

### V_SIM_PIXMAPS_DIR

    #define V_SIM_PIXMAPS_DIR        visuBasicGet_pixmapsDir()

### V_SIM_PLUGINS_DIR

    #define V_SIM_PLUGINS_DIR        visuBasicGet_pluginsDir()

### visuBasicInit ()

    void                visuBasicInit                       ();

A call to this method is done at startup after having probe the locale of the file system and having initialized the rendering window. It makes the following actions : create the visu object to store the signals, initialize the module part (parameters, and resources), initialize the dump part, the OpenGL part and its extensions, the storage of elements and the 'colorize with data' part.

### visuBasicQuit ()

    gboolean            visuBasicQuit                       (gpointer data);

A call to this method makes the GMainLoop stop.

`data` : | a pointer to the GMainLoop.
Returns : | FALSE, always.

### visuBasicGet_dataDir ()

    const gchar*        visuBasicGet_dataDir                ();

### visuBasicGet_legalDir ()

    const gchar*        visuBasicGet_legalDir               ();

### visuBasicGet_localDir ()

    const gchar*        visuBasicGet_localDir               ();

### visuBasicGet_localeDir ()

    const gchar*        visuBasicGet_localeDir              ();

### visuBasicGet_oldLocalDir ()

    const gchar*        visuBasicGet_oldLocalDir            ();

### visuBasicGet_pixmapsDir ()

    const gchar*        visuBasicGet_pixmapsDir             ();

### visuBasicGet_pluginsDir ()

    const gchar*        visuBasicGet_pluginsDir             ();

### visuBasicExport_main ()

    int                 visuBasicExport_main                (void);

This method is called when V_Sim is in export mode from the command line.

Returns : | 0 if everything is normal, 1 if an error occured.

### visuBasicLoad_dataFromFile ()

    gboolean            visuBasicLoad_dataFromFile          (VisuData *data,
                                                             FileFormat *format,
                                                             int nSet,
                                                             GError **error);

This calls the load method of the current rendering method. Some informations may be store in `error->message` if the returned value is FALSE. The file(s) which is(are) opened is(are) stored in the VisuData. The `nSet` argument is used to load a specific set of nodes if the input format supports it. If `nSet` is 0, then the default set of nodes is loaded.

`data` : | a VisuData object ;
`format` : | a pointer on a format (can be NULL if format is to be guessed) ;
`nSet` : | an integer ;
`error` : | a pointer to store a possible error, location must be initialized to (GError*)0.
Returns : | TRUE if everithing is OK, if FALSE, the `error` is set and should be freed with `g_error_free()`.

### visuBasicSet_paths ()

    void                visuBasicSet_paths                  ();

This method sets the paths. On Unix systems, this method sets the paths from macros defined by configure. On Win32 systems, it reads paths in a v_sim.ini file found in the current directory or in the C:\windows.

`exeLocation` : | give argv[0] which is the complete path to the executable.

### visuBasicApply_commandLine ()

    gboolean            visuBasicApply_commandLine          (VisuData *data,
                                                             VisuOptionSet *set,
                                                             GError **error);

Call all the get methods on the command line options to tune the given `data`. This will create some static internal data. Use `visuBasicFree_commandLine()` to free them after use.

`data` : | a VisuData object to apply the options on ;
`set` : | a table of options ;
`error` : | a location for error report.
Returns : | TRUE if complete without error.

### visuBasicCreate_extensions ()

    void                visuBasicCreate_extensions          (VisuData *data,
                                                             VisuOptionSet *set,
                                                             gboolean rebuild);

Create all extensions (planes, surfaces...) for the given data. Use static values read from `visuBasicApply_commandLine()`. This method is mainly used when V_Sim run without the command panel.

`data` : | a VisuData object ;
`set` : | a table of options ;
`rebuild` : | a boolean.

### visuBasicParse_configFiles ()

    GString*            visuBasicParse_configFiles          ();

Parse the parameter and the resource file. Used once at startup.

Returns : | a newly allocated GString if some error occured.

### visuBasicSet_dataFromCommandLine ()

    VisuData*           visuBasicSet_dataFromCommandLine    ();

Read the command line option and set the filenames for a new VisuData. The object is not loaded (files are not parsed), just prepared.

Returns : | a newly allocated VisuData if required.

### visuBasicSet_extInfos ()

    void                visuBasicSet_extInfos               (VisuData *dataObj,
                                                             DrawMethod method,
                                                             int *nodes,
                                                             DataNode *data);

Create and draw possible information on nodes. This method is mainly used when V_Sim run without the command panel.

`dataObj` : | a VisuData object ;
`method` : | where to draw information ;
`nodes` : | a possible list of selected nodes, or NULL ;
`data` : | the information to draw.