43 #include <visp3/core/vpConfig.h>
44 #include <visp3/core/vpException.h>
46 #ifndef DOXYGEN_SHOULD_SKIP_THIS
48 #include "vpBoundio.h"
64 void fscanf_Bound(Bound *bp)
68 skip_keyword(T_TYPE,
"bound: keyword \"type\" expected");
70 lexerr(
"start",
"bound_type: boolean expected (0=FALSE|~0=TRUE)", NULL);
71 bp->is_polygonal = (myint ? 1 : 0);
75 skip_keyword(T_POINT_LIST,
"bound: keyword \"point_list\" expected");
76 pusherr(
"bound_point_list: ");
77 fscanf_Point3f_list(&bp->point);
82 skip_keyword(T_FACE_LIST,
"bound: keyword \"face_list\" expected");
83 pusherr(
"bound_face_list: ");
84 fscanf_Face_list(&bp->face);
93 void fscanf_Face_list(Face_list *lp)
101 lexerr(
"start",
"integer expected (number of faces)", NULL);
102 lp->nbr = (Index)myint;
108 else if ((lp->ptr = (Face *)malloc(lp->nbr *
sizeof(Face))) == NULL) {
109 static char proc_name[] =
"fscanf_Face_list";
118 for (; fp < fend; fp++) {
119 Vertex_list *vlp = &fp->vertex;
126 lexerr(
"start",
"boolean expected (0=FALSE|~0=TRUE)", NULL);
127 fp->is_polygonal = (myint ? 1 : 0);
132 lexerr(
"start",
"integer expected (number of vertices)", NULL);
133 vlp->nbr = (Index)myint;
137 if (vlp->nbr <= DEFAULT_VSIZE)
139 else if ((vlp->ptr = (Index *)malloc(vlp->nbr *
sizeof(Index))) == NULL) {
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[] = {
"float expected (coordinate ",
" of point)" };
169 lexerr(
"start",
"integer expected (number of points 3D)", NULL);
170 lp->nbr = (Index)myint;
176 else if ((lp->ptr = (Point3f *)malloc(lp->nbr *
sizeof(Point3f))) == NULL) {
177 static const char proc_name[] =
"fscanf_Point3f_list";
186 for (; pp < pend; pp++) {
189 if ((t = lex()) != T_FLOAT && t != T_INT)
190 lexerr(
"start", err_tbl[0],
"X", err_tbl[1], NULL);
192 pp->x = (t == T_INT) ? (
float)myint : myfloat;
194 if ((t = lex()) != T_FLOAT && t != T_INT)
195 lexerr(
"start", err_tbl[0],
"Y", err_tbl[1], NULL);
197 pp->y = (t == T_INT) ? (
float)myint : myfloat;
199 if ((t = lex()) != T_FLOAT && t != T_INT)
200 lexerr(
"start", err_tbl[0],
"Z", err_tbl[1], NULL);
202 pp->z = (t == T_INT) ? (
float)myint : myfloat;
error that can be emitted by ViSP classes.