0022337: V3d_View::Print crashes in OCCT 6.5.0
[occt.git] / src / OpenGl / OpenGl_togl_polygon.cxx
1 /***********************************************************************
2
3 FONCTION :
4 ----------
5 File OpenGl_togl_polygon.c :
6
7
8 REMARQUES:
9 ---------- 
10
11
12 HISTORIQUE DES MODIFICATIONS   :
13 --------------------------------
14 05-08-97 : PCT ; Support texture mapping
15
16 ************************************************************************/
17
18 /*----------------------------------------------------------------------*/
19 /*
20 * Includes
21 */
22
23 #include <OpenGl_tgl_all.hxx>
24 #include <InterfaceGraphic_Graphic3d.hxx>
25 #include <OpenGl_tgl.hxx>
26 #include <OpenGl_tgl_funcs.hxx>
27 #include <OpenGl_tgl_subrs.hxx>
28 #include <OpenGl_tgl_utilgr.hxx>
29
30 void EXPORT
31 call_togl_polygon
32 (
33  CALL_DEF_GROUP * agroup,
34  CALL_DEF_FACET * afacet
35  )
36 {
37   if (! agroup->IsOpen) call_togl_opengroup (agroup);
38   switch (afacet->TypePoints) {
39     case 1 : /* Vertex Coordinates Specified */
40       if (afacet->NormalIsDefined)
41         call_subr_polygon_data (afacet);
42       else
43         call_subr_polygon (afacet);
44       break;
45     case 2 : /* Coordinates and Vertex Normal Specified */
46     case 5 : /* Coordinates and Vertex Normal and Texture Coordinate Specified */
47       call_subr_polygon_data (afacet);
48       break;
49   }
50   if (! agroup->IsOpen) call_togl_closegroup (agroup);
51   return;
52 }