add: unsigned int ntris = 0; unsigned int nquads = 0; unsigned int ngons = 0;  osg::FaceIterator fi       = plane_geo->beginFaces(); osg::FaceIterator endFaces = plane_geo->endFaces();  for(; fi != endFaces; ++fi) { if ( fi.getLength() == 3 ) ntris ++ ; else if ( fi.getLength() == 4 ) nquads ++ ; else ngons ++ ;  fi.getLength(); }  fprintf(stderr, "%d tris %d quats %d gons\n", ntris, nquads, ngons);
context: int main (int argc, char **argv){	// GLUT init    osgInit(argc, argv);    FieldContainerPtr pProto = Geometry::getClassType().getPrototype();    GeometryPtr pGeoProto = GeometryPtr::dcast(pProto);    if(pGeoProto != NullFC)    {        pGeoProto->setDlistCache(false);    }	glutInit(&argc, argv);	glutInitDisplayMode( GLUT_RGB | GLUT_DEPTH | GLUT_DOUBLE);	glutCreateWindow("OpenSG");	// glutKeyboardFunc(key);	// glutReshapeFunc(resize);	glutDisplayFunc(display);       	// glutMouseFunc(mouse);   	// glutMotionFunc(motion); 		glutIdleFunc(display);	glMatrixMode( GL_PROJECTION );	glLoadIdentity();	gluPerspective( 60, 1, 0.1, 10 );	glMatrixMode( GL_MODELVIEW );	glLoadIdentity();	gluLookAt( 3, 3, 3,  0, 0, 0,   0, 0, 1 );		glEnable( GL_DEPTH_TEST );	glEnable( GL_LIGHTING );	glEnable( GL_LIGHT0 );	// OSG	plane = makePlane( 2, 2, 8, 8 );	torus = makeTorus( .2, 1, 16, 8 );	GeometryPtr plane_geo, torus_geo;	plane_geo = GeometryPtr::dcast(plane->getCore());	torus_geo = GeometryPtr::dcast(torus->getCore());			SimpleMaterialPtr pm, tm;			pm = SimpleMaterial::create();	pm->setDiffuse( Color3f( 1,0,0 ) );	pm->setAmbient( Color3f( 1,0,0 ) );	pm->setSpecular( Color3f( 1,1,1 ) );	pm->setShininess( 10 );		plane_geo->setMaterial( pm );			tm = SimpleMaterial::create();	tm->setDiffuse( Color3f( 0,1,0 ) );	tm->setAmbient( Color3f( 0,1,0 ) );		torus_geo->setMaterial( tm );		// as there no useful except Material yet adding Chunks will 	// have to wait a little...		dact = DrawAction::create();		glutMainLoop();	    return 0;}