The libvrmltree library was developed as a support library for the D.R.I.V.E. Project, requested by Politecnico di Milano and supervised by our tutor Timothy Barbieri. This library is designed for reusability in other simple project, however the library itself is not yet finished. The writing of a VRML97 parser was not required by the project, and it was developed only for the project purpose. So, it was written for best performance and expandibility, but it isn't usable at this moment for production systems. Use it at your own risk.
Go to the source code of this file.
Defines | |
#define | LIBVRMLTREE_H 1 /**< Protect from reinclusion. */ |
Protect from reinclusion. | |
#define | MAXINSTANCE 500 /**< Maximum context instance of nesting groups.*/ |
Maximum context instance of nesting groups. | |
#define | NODE_ORDER_ERROR 3 /**< Error code: The nodes are specified in the wrong order in the VRML source.*/ |
Error code: The nodes are specified in the wrong order in the VRML source. | |
#define | MAX_INLINE_DEPTH 10 /**< Maximum inline depth. */ |
Maximum inline depth. | |
#define | INLINE_FOUND 1 /**< Inline found. Just for avoid magic numbers.*/ |
Inline found. | |
#define | INLINE_NOT_FOUND 0 /**< Inline not found. Just for avoid magic numbers.*/ |
Inline not found. | |
#define | OUTFILE "mem-print.wrl" /**< Default name of the dump file generated by the --preprocess directive. @see D.R.I.V.E. user manual.*/ |
Default name of the dump file generated by the --preprocess directive. | |
Typedefs | |
typedef float | vector [4] |
An homogeneus vector. | |
typedef float | vrmlMatrix [4][4] |
An homogeneus roto-translation matrix. | |
Functions | |
void | vrmlinline (void) |
node * | createNode (char *, node_type) |
void | btf (void) |
void | initLexer (void) |
void | test (void *) |
void | analize (void) |
vector * | make_vector (sfvec3f) |
Transform an sfvec3f in an homogeneus vector. | |
vrmlMatrix * | make_identity (void) |
Creates an identity matrix. | |
void | negate (vrmlMatrix) |
Multiply the given matrix for -1. | |
void | matrix_premul (vrmlMatrix, vrmlMatrix) |
premoltiplica origin con la matrice pre e salva in origin. | |
vrmlMatrix * | make_rot_matrix (sfrotation) |
Transform a sfrotation in an homogeneus rotation matrix. | |
vrmlMatrix * | make_scale_matrix (sfvec3f) |
transform a sfvec3f in a scale matrix. | |
vrmlMatrix * | make_translation_matrix (sfvec3f) |
Transform a sfvec3f ina a translation matrix. | |
vrmlMatrix * | make_transform_matrix (vrmlMatrix, vrmlMatrix, vrmlMatrix, vrmlMatrix, vrmlMatrix, vrmlMatrix) |
Generates the transformation matrix from given ones. | |
float | det (vrmlMatrix) |
Return determinant of entire matrix. | |
float | det_minor (vrmlMatrix, int, int, int, int, int, int) |
Return determinant of 3x3 submatrix by given row and column indices. | |
int | mem_print () |
Dump internal vrml scene into OUTFILE file. | |
int | exploreout (node *what) |
Dump a branch of the vrml scene graph in the dump file. | |
int | addchild (node *, node *) |
Adds a child to a node. | |
int | tree_init (void) |
Initializes VRML Scene root. | |
node * | mknode (void) |
Creates an empty node. | |
node * | getsymFromRoot (char *) |
Search the scene for an identifier. | |
node * | getsym (char *, node *) |
Search the scene for an identifier into the given context. | |
node * | genUse (node *) |
Generates a USE Node. | |
node * | getInline (node *) |
Search the scene for an Inline node. | |
node * | lastin (node *) |
Gives the latest added node for the current context. | |
int | cleanup_tree (void) |
cleanup the entire tree. | |
int | cleanup (node *) |
Frees allocated memory for the given context. | |
char * | strduplicate (char *) |
Duplicate a string. | |
int | minus (int, int) |
The minor function. |
|
Inline found. Just for avoid magic numbers. |
|
Inline not found. Just for avoid magic numbers. |
|
Protect from reinclusion.
|
|
Maximum inline depth.
|
|
Maximum context instance of nesting groups.
|
|
Error code: The nodes are specified in the wrong order in the VRML source.
|
|
Default name of the dump file generated by the --preprocess directive.
|
|
An homogeneus vector.
|
|
An homogeneus roto-translation matrix.
|
|
Adds a child to a node.
|
|
|
|
|
|
Frees allocated memory for the given context. Note that this function is still in beta testing. It may cause a segfault if used over unchecked tree.
|
|
cleanup the entire tree.
Here is the call graph for this function: ![]() |
|
|
|
Return determinant of entire matrix.
Here is the call graph for this function: ![]() |
|
Return determinant of 3x3 submatrix by given row and column indices.
|
|
Dump a branch of the vrml scene graph in the dump file. Note that the dump file must be initialized before any call to this function. You can open the file by yourself and store it's descriptor in mem_out FILE* or use mem_print() function to dump the entire scene.
|
|
Generates a USE Node. The USE node is created generating a new node with the same fields of the given node.
Here is the call graph for this function: ![]() |
|
Search the scene for an Inline node.
|
|
Search the scene for an identifier into the given context.
|
|
Search the scene for an identifier.
Here is the call graph for this function: ![]() |
|
|
|
Gives the latest added node for the current context.
|
|
Creates an identity matrix.
|
|
Transform a sfrotation in an homogeneus rotation matrix.
|
|
transform a sfvec3f in a scale matrix.
|
|
Generates the transformation matrix from given ones.
Here is the call graph for this function: ![]() |
|
Transform a sfvec3f ina a translation matrix.
|
|
Transform an sfvec3f in an homogeneus vector.
|
|
premoltiplica origin con la matrice pre e salva in origin.
Here is the call graph for this function: ![]() |
|
Dump internal vrml scene into OUTFILE file. Explore node* vp_root writing a vrml file with the scene stored in the internal tree.
Here is the call graph for this function: ![]() |
|
The minor function. This function is required for a compatibilty problem of the minor template between win32 and linux.
|
|
Creates an empty node.
|
|
Multiply the given matrix for -1.
|
|
Duplicate a string. Equivalent to strdup, but not specific for BSD or SVID.
|
|
|
|
Initializes VRML Scene root.
Here is the call graph for this function: ![]() |
|
|