Number of elements in a list of list

May 1, 2013 at 5:45pm
Hello everyone, I have a problem like this: I do not know how to count the number of elements in a list of lists. Let me explain:
I have the following list of list.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#define VAR(V, init) __typeof(init) V=(init)
#define FOR_EACH(I,C) for(VAR(I, (C).begin()), ite = (C).end();
                          (I) != ite; 
                          ++(I))
   
std::vector<std::vector<GLdouble> > contours;
   
   FOR_EACH( contour, contours )
  {
        gluTessBeginContour(tobj);

        for( size_t v = 0; v < contours.size() ; v += 3 )
            gluTessVertex(tobj, &(*contour)[v], &(*contour)[v]);

        gluTessEndContour(tobj);
  }

I do not know how to write the part indicated in Bold that represents the number of elements of contour.
Can you help me, I'm going crazy.
As seen from the code used for the tesselation OpenGL.
May 2, 2013 at 11:51am
Nobody can help me?
May 2, 2013 at 12:07pm
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#define VAR(V, init) __typeof(init) V=(init)
#define FOR_EACH(I,C) for(VAR(I, (C).begin()), ite = (C).end();
                          (I) != ite; 
                          ++(I))
   
std::vector<std::vector<GLdouble> > contours;
   
FOR_EACH( contour, contours )
{
        gluTessBeginContour(tobj);

        for( size_t v = 0; v < contour->size() ; v += 3 )
            gluTessVertex(tobj, &(*contour)[v], &(*contour)[v]);

        gluTessEndContour(tobj);
}
May 3, 2013 at 5:52pm
Thanks vlad
Topic archived. No new replies allowed.