43 #include "visp3/core/vpConfig.h"
46 #ifndef DOXYGEN_SHOULD_SKIP_THIS
47 #include <visp3/robot/vpMy.h>
48 #include <visp3/robot/vpArit.h>
49 #include <visp3/robot/vpBound.h>
50 #include <visp3/robot/vpToken.h>
51 #include <visp3/robot/vpSkipio.h>
52 #include <visp3/robot/vpLex.h>
57 void fscanf_Point3f_list (Point3f_list *);
58 void fscanf_Face_list (Face_list *);
65 void fscanf_Bound (Bound *bp)
69 skip_keyword (T_TYPE,
"bound: keyword \"type\" expected");
71 lexerr (
"start",
"bound_type: boolean expected (0=FALSE|~0=TRUE)", NULL);
72 bp->is_polygonal = (myint ? 1 : 0);
76 skip_keyword (T_POINT_LIST,
"bound: keyword \"point_list\" expected");
77 pusherr (
"bound_point_list: ");
78 fscanf_Point3f_list (&bp->point);
83 skip_keyword (T_FACE_LIST,
"bound: keyword \"face_list\" expected");
84 pusherr (
"bound_face_list: ");
85 fscanf_Face_list (&bp->face);
94 void fscanf_Face_list (Face_list *lp)
96 static char proc_name[] =
"fscanf_Face_list";
105 lexerr (
"start",
"integer expected (number of faces)", NULL);
106 lp->nbr = (Index) myint;
112 else if ((lp->ptr = (Face *) malloc (lp->nbr * sizeof (Face)))
122 for (; fp < fend; fp++) {
123 Vertex_list *vlp = &fp->vertex;
130 lexerr (
"start",
"boolean expected (0=FALSE|~0=TRUE)", NULL);
131 fp->is_polygonal = (myint ? 1 : 0);
136 lexerr (
"start",
"integer expected (number of vertices)", NULL);
137 vlp->nbr = (Index) myint;
141 if (vlp->nbr <= DEFAULT_VSIZE)
143 else if ((vlp->ptr = (Index *) malloc (vlp->nbr * sizeof (Index)))
152 vend = vp + vlp->nbr;
153 for (; vp < vend; *vp++ = (Index) myint)
155 lexerr (
"start",
"integer expected (index of points 3D)", NULL);
164 void fscanf_Point3f_list (Point3f_list *lp)
166 static const char proc_name[] =
"fscanf_Point3f_list";
168 static const char *err_tbl[] = {
169 "float expected (coordinate ",
178 lexerr (
"start",
"integer expected (number of points 3D)", NULL);
179 lp->nbr = (Index) myint;
185 else if ((lp->ptr = (Point3f *) malloc (lp->nbr * sizeof (Point3f)))
195 for (; pp < pend; pp++) {
198 if ((t = lex ()) != T_FLOAT && t != T_INT)
199 lexerr (
"start", err_tbl[0],
"X", err_tbl[1], NULL);
201 pp->x = (t == T_INT) ? (
float) myint : myfloat;
203 if ((t = lex ()) != T_FLOAT && t != T_INT)
204 lexerr (
"start", err_tbl[0],
"Y", err_tbl[1], NULL);
206 pp->y = (t == T_INT) ? (
float) myint : myfloat;
208 if ((t = lex ()) != T_FLOAT && t != T_INT)
209 lexerr (
"start", err_tbl[0],
"Z", err_tbl[1], NULL);
211 pp->z = (t == T_INT) ? (
float) myint : myfloat;