libmove3d  3.13.0
Classes | Functions | Variables
/home/slemaign/softs-local/BioMove3D-git/p3d/p3d_rw_jnt.c File Reference

Save and write a joint. More...

#include "Util-pkg.h"
#include "P3d-pkg.h"

Classes

struct  p3d_jnt_type_name

Functions

int p3d_rw_jnt_get_type_by_name (const char *name, p3d_type_joint *type)
 Get the joint type with the joint type name.
int p3d_rw_jnt_get_type_by_num (int num, p3d_type_joint *type)
 Get the joint type with the joint type number.
const char * p3d_rw_jnt_get_name_by_type (p3d_type_joint type)
 Get the joint type name with the joint type.
int p3d_rw_jnt_get_num_by_type (p3d_type_joint type)
 Get the joint type num with the joint type.
const char * p3d_rw_jnt_get_name_by_num (int num)
 Get the joint type name with the joint type number.
p3d_read_jnt_link_datap3d_rw_jnt_create_joint_link (void)
 Create a link with a joint.
void p3d_rw_jnt_destroy_joint_link (p3d_read_jnt_link_data *jnt_linkPt)
 Destroy a link with a joint.
p3d_read_jnt_datap3d_create_read_jnt_data (p3d_type_joint type)
 Create a structure to store the parameters of the joints.
void p3d_destroy_read_jnt_data (p3d_read_jnt_data *data)
 Destroy a structure to store the parameters of the joints.
int s_p3d_build_jnt_data (p3d_read_jnt_data *data)
 Build the joint with the data read.
int p3d_parse_jnt_desc (FILE *f, char **line, int *size, int *num_line, p3d_read_jnt_data *data)
 Read the description of a joint in a file.
int p3d_env_beg_jnt_desc (FILE *f, p3d_type_joint type, double scale)
 Read the description of a joint in a file.
void p3d_rw_jnt_write_jnt_desc (FILE *f, p3d_jnt *jntPt)
 Write a joint description in a file.

Variables

const p3d_jnt_type_name jnt_type_name_array [NB_JNT_TYPE]

Detailed Description

Save and write a joint.

Describe the file format use in the scenario or in .p3d.


Function Documentation

p3d_read_jnt_data* p3d_create_read_jnt_data ( p3d_type_joint  type)

Create a structure to store the parameters of the joints.

Parameters:
type,:the joint type.
Returns:
the joint data.
void p3d_destroy_read_jnt_data ( p3d_read_jnt_data data)

Destroy a structure to store the parameters of the joints.

Parameters:
data,:the joint data.
int p3d_env_beg_jnt_desc ( FILE *  f,
p3d_type_joint  type,
double  scale 
)

Read the description of a joint in a file.

Parameters:
f,:the file.
type,:the type of joint.
scale,:the scale factor apply on the joint.
Returns:
wether or not it is possible to create this joint.
int p3d_parse_jnt_desc ( FILE *  f,
char **  line,
int *  size,
int *  num_line,
p3d_read_jnt_data data 
)

Read the description of a joint in a file.

Parameters:
f,:the file.
size,:the allocated size of the string.
line,:the string use to store the data of the file.
data,:the data needed to compute the joint.
Return values:
size,:the new string that store the line.
num_line,:the new line number.
Parameters:
data,:the data needed to compute the joint.
Returns:
wether or not it is possible to create this joint.
p3d_read_jnt_link_data* p3d_rw_jnt_create_joint_link ( void  )

Create a link with a joint.

Parameters:
jntPt,:the joint to link with
Returns:
the new link with a joint structure
void p3d_rw_jnt_destroy_joint_link ( p3d_read_jnt_link_data jnt_linkPt)

Destroy a link with a joint.

Parameters:
jnt_linkPt,:the link to destroy
const char* p3d_rw_jnt_get_name_by_num ( int  num)

Get the joint type name with the joint type number.

Parameters:
num,:the joint type number (between 0 and ::NB_JNT_TYPE -1).
Returns:
the joint type name, NULL if num is not valid.
const char* p3d_rw_jnt_get_name_by_type ( p3d_type_joint  type)

Get the joint type name with the joint type.

Parameters:
type,:the joint type.
Returns:
the joint type name, NULL if type is not valid.
int p3d_rw_jnt_get_num_by_type ( p3d_type_joint  type)

Get the joint type num with the joint type.

Parameters:
type,:the joint type.
Returns:
the joint type num, -1 if type is not valid.
int p3d_rw_jnt_get_type_by_name ( const char *  name,
p3d_type_joint *  type 
)

Get the joint type with the joint type name.

Parameters:
name,:the joint type name.
Return values:
type,:the joint type.
Returns:
TRUE if name is valid.
int p3d_rw_jnt_get_type_by_num ( int  num,
p3d_type_joint *  type 
)

Get the joint type with the joint type number.

Parameters:
num,:the joint type number (between 0 and ::NB_JNT_TYPE -1).
Return values:
type,:the joint type.
Returns:
TRUE if the joint type number is between 0 and ::NB_JNT_TYPE -1.
void p3d_rw_jnt_write_jnt_desc ( FILE *  f,
p3d_jnt jntPt 
)

Write a joint description in a file.

Parameters:
f,:the file.
jntPt,:the joint.
int s_p3d_build_jnt_data ( p3d_read_jnt_data data)

Build the joint with the data read.

Parameters:
data,:the data used to build a joint.
Returns:
wether or not it is possible to create this joint.

Variable Documentation

const p3d_jnt_type_name jnt_type_name_array[NB_JNT_TYPE]
Initial value:
         { { (char*)"P3D_FIXED",     P3D_FIXED },
           { (char*)"P3D_ROTATE",    P3D_ROTATE },
           { (char*)"P3D_TRANSLATE", P3D_TRANSLATE },
           { (char*)"P3D_PLAN",      P3D_PLAN },
           { (char*)"P3D_FREEFLYER", P3D_FREEFLYER },
           { (char*)"P3D_KNEE",      P3D_KNEE },
           { (char*)"P3D_BASE",      P3D_BASE } }
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Friends Defines