43 #include <visp3/core/vpConfig.h>
45 #ifndef DOXYGEN_SHOULD_SKIP_THIS
48 #include "vpBoundio.h"
62 void fscanf_Bound (Bound *bp)
66 skip_keyword (T_TYPE,
"bound: keyword \"type\" expected");
68 lexerr (
"start",
"bound_type: boolean expected (0=FALSE|~0=TRUE)", NULL);
69 bp->is_polygonal = (myint ? 1 : 0);
73 skip_keyword (T_POINT_LIST,
"bound: keyword \"point_list\" expected");
74 pusherr (
"bound_point_list: ");
75 fscanf_Point3f_list (&bp->point);
80 skip_keyword (T_FACE_LIST,
"bound: keyword \"face_list\" expected");
81 pusherr (
"bound_face_list: ");
82 fscanf_Face_list (&bp->face);
91 void fscanf_Face_list (Face_list *lp)
99 lexerr (
"start",
"integer expected (number of faces)", NULL);
100 lp->nbr = (Index) myint;
106 else if ((lp->ptr = (Face *) malloc (lp->nbr * sizeof (Face)))
108 static char proc_name[] =
"fscanf_Face_list";
117 for (; fp < fend; fp++) {
118 Vertex_list *vlp = &fp->vertex;
125 lexerr (
"start",
"boolean expected (0=FALSE|~0=TRUE)", NULL);
126 fp->is_polygonal = (myint ? 1 : 0);
131 lexerr (
"start",
"integer expected (number of vertices)", NULL);
132 vlp->nbr = (Index) myint;
136 if (vlp->nbr <= DEFAULT_VSIZE)
138 else if ((vlp->ptr = (Index *) malloc (vlp->nbr * sizeof (Index)))
140 static char proc_name[] =
"fscanf_Face_list";
148 vend = vp + vlp->nbr;
149 for (; vp < vend; *vp++ = (Index) myint)
151 lexerr (
"start",
"integer expected (index of points 3D)", NULL);
160 void fscanf_Point3f_list (Point3f_list *lp)
162 static const char *err_tbl[] = {
163 "float expected (coordinate ",
172 lexerr (
"start",
"integer expected (number of points 3D)", NULL);
173 lp->nbr = (Index) myint;
179 else if ((lp->ptr = (Point3f *) malloc (lp->nbr * sizeof (Point3f)))
181 static const char proc_name[] =
"fscanf_Point3f_list";
190 for (; pp < pend; pp++) {
193 if ((t = lex ()) != T_FLOAT && t != T_INT)
194 lexerr (
"start", err_tbl[0],
"X", err_tbl[1], NULL);
196 pp->x = (t == T_INT) ? (
float) myint : myfloat;
198 if ((t = lex ()) != T_FLOAT && t != T_INT)
199 lexerr (
"start", err_tbl[0],
"Y", err_tbl[1], NULL);
201 pp->y = (t == T_INT) ? (
float) myint : myfloat;
203 if ((t = lex ()) != T_FLOAT && t != T_INT)
204 lexerr (
"start", err_tbl[0],
"Z", err_tbl[1], NULL);
206 pp->z = (t == T_INT) ? (
float) myint : myfloat;