1 /************************************************************************/
3 /************************************************************************/
5 #include <OpenGl_GraphicDriver.jxx>
6 #include <OSD_Localizer.hxx>
16 /************************************************************************/
18 /************************************************************************/
20 void OpenGl_GraphicDriver::Export( const Standard_CString FileName,
21 const Graphic3d_ExportFormat Format,
22 const Graphic3d_SortType aSortType,
23 const Standard_Integer W,
24 const Standard_Integer H,
25 const Graphic3d_CView& View,
26 const Aspect_CLayer2d& Under,
27 const Aspect_CLayer2d& Over,
28 const Standard_Real Precision,
29 const Standard_Address ProgressBarFunc,
30 const Standard_Address ProgressObject )
34 OSD_Localizer locate(LC_NUMERIC,"C");
36 Standard_Integer mode = -1;
37 Standard_Integer sortType = Graphic3d_ST_BSP_Tree;
40 case Graphic3d_EF_PostScript:
43 case Graphic3d_EF_EnhPostScript:
46 case Graphic3d_EF_TEX:
49 case Graphic3d_EF_PDF:
52 case Graphic3d_EF_SVG:
55 case Graphic3d_EF_PGF:
62 case Graphic3d_ST_Simple:
63 sortType = GL2PS_SIMPLE_SORT;
65 case Graphic3d_ST_BSP_Tree:
66 sortType = GL2PS_BSP_SORT;
76 GLint buffersize = 1024*1024;
80 FILE *file = fopen(FileName,"wb");
81 gl2psBeginPage( "", "", viewport, mode, sortType,
82 GL2PS_DRAW_BACKGROUND | GL2PS_OCCLUSION_CULL | GL2PS_BEST_ROOT/* | GL2PS_SIMPLE_LINE_OFFSET*/,
84 0, 0, 0, buffersize, file, FileName);
86 Redraw( View, Under, Over );
88 GLint num = gl2psEndPage();
92 if( num==GL2PS_OVERFLOW )