renderingAtomic_ascii

renderingAtomic_ascii — Method to load ascii position file.

Synopsis

void                visu_meth_asciiFree                 (gpointer data);
void                visu_meth_asciiValToType            (gpointer key,
                                                         gpointer value,
                                                         gpointer data);
void                visu_meth_asciiValToNb              (gpointer key,
                                                         gpointer value,
                                                         gpointer data);
void                initAtomicAscii                     (VisuRendering *method);

Description

Ascii format is a plain text format to store elements and their position. The first line is a commentary and is not read. Then, the next two lines must contains each three numbers, describing the box containing the data. The first number is the length on x direction. The next two numbers are on one hand the component on the same x direction and on the other hand the other component on a direction orthogonal to the x direction, setting thus the y direction. The three other numbers are the component of the z direction on first, the x direction, then the y direction and finally in a direction orthogonal both to x and y directions. After these three first lines, all other lines can be blank, beginning with a '#' character or containing three numbers and a label name for the element.

Some public methods here have been put for other loader which wants to share the code of this loader (see the XYZ loader for instance).

Details

visu_meth_asciiFree ()

void                visu_meth_asciiFree                 (gpointer data);

This method is used to free an allocated stuct VisuMethAscii, and can be used as a destructor when creating an hashtable with such datas.

data :

a pointer to stuct VisuMethAscii instances.

visu_meth_asciiValToType ()

void                visu_meth_asciiValToType            (gpointer key,
                                                         gpointer value,
                                                         gpointer data);

This method is used in a g_hash_table_foreach() method that work on data. data is an array of pointers to VisuElement and this method puts its nth value to point to key. The value nth is read from the pos attribute of the structure object pointed by value.

key :

a VisuElement pointer ;

value :

a struct VisuMethAscii pointer ;

data :

a pointer on array of pointers of VisuElement.

visu_meth_asciiValToNb ()

void                visu_meth_asciiValToNb              (gpointer key,
                                                         gpointer value,
                                                         gpointer data);

This method is used in a g_hash_table_foreach() method that work on data. data is an array of int and this method puts its nth value to the value read from the nbNodes attribute of the structure object pointed by value.

key :

a VisuElement pointer ;

value :

a struct VisuMethAscii pointer ;

data :

a pointer on array of int.

initAtomicAscii ()

void                initAtomicAscii                     (VisuRendering *method);