43 #include <visp3/core/vpConfig.h>
44 #include <visp3/core/vpException.h>
46 #ifndef DOXYGEN_SHOULD_SKIP_THIS
48 #include "vpBoundio.h"
63 void fscanf_Bound(Bound *bp)
67 skip_keyword(T_TYPE,
"bound: keyword \"type\" expected");
69 lexerr(
"start",
"bound_type: boolean expected (0=FALSE|~0=TRUE)", NULL);
70 bp->is_polygonal = (myint ? 1 : 0);
74 skip_keyword(T_POINT_LIST,
"bound: keyword \"point_list\" expected");
75 pusherr(
"bound_point_list: ");
76 fscanf_Point3f_list(&bp->point);
81 skip_keyword(T_FACE_LIST,
"bound: keyword \"face_list\" expected");
82 pusherr(
"bound_face_list: ");
83 fscanf_Face_list(&bp->face);
92 void fscanf_Face_list(Face_list *lp)
100 lexerr(
"start",
"integer expected (number of faces)", NULL);
101 lp->nbr = (Index)myint;
107 else if ((lp->ptr = (Face *)malloc(lp->nbr *
sizeof(Face))) == NULL) {
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))) == NULL) {
139 static char proc_name[] =
"fscanf_Face_list";
147 vend =
vp + vlp->nbr;
148 for (;
vp < vend; *
vp++ = (Index)myint)
150 lexerr(
"start",
"integer expected (index of points 3D)", NULL);
159 void fscanf_Point3f_list(Point3f_list *lp)
161 static const char *err_tbl[] = {
"float expected (coordinate ",
" of point)"};
168 lexerr(
"start",
"integer expected (number of points 3D)", NULL);
169 lp->nbr = (Index)myint;
175 else if ((lp->ptr = (Point3f *)malloc(lp->nbr *
sizeof(Point3f))) == NULL) {
176 static const char proc_name[] =
"fscanf_Point3f_list";
185 for (; pp < pend; pp++) {
188 if ((t = lex()) != T_FLOAT && t != T_INT)
189 lexerr(
"start", err_tbl[0],
"X", err_tbl[1], NULL);
191 pp->x = (t == T_INT) ? (
float)myint : myfloat;
193 if ((t = lex()) != T_FLOAT && t != T_INT)
194 lexerr(
"start", err_tbl[0],
"Y", err_tbl[1], NULL);
196 pp->y = (t == T_INT) ? (
float)myint : myfloat;
198 if ((t = lex()) != T_FLOAT && t != T_INT)
199 lexerr(
"start", err_tbl[0],
"Z", err_tbl[1], NULL);
201 pp->z = (t == T_INT) ? (
float)myint : myfloat;
error that can be emitted by ViSP classes.