0025442: Visualization, TKOpenGl - prevent inclusion of system header glxext.h
[occt.git] / src / OpenGl / OpenGl_GraphicDriver_Export.cxx
old mode 100755 (executable)
new mode 100644 (file)
index 75a9b8f..abed43e
@@ -1,43 +1,31 @@
-// Copyright (c) 1999-2012 OPEN CASCADE SAS
+// Copyright (c) 1999-2014 OPEN CASCADE SAS
 //
-// The content of this file is subject to the Open CASCADE Technology Public
-// License Version 6.5 (the "License"). You may not use the content of this file
-// except in compliance with the License. Please obtain a copy of the License
-// at http://www.opencascade.org and read it completely before using this file.
+// This file is part of Open CASCADE Technology software library.
 //
-// The Initial Developer of the Original Code is Open CASCADE S.A.S., having its
-// main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France.
+// This library is free software; you can redistribute it and/or modify it under
+// the terms of the GNU Lesser General Public License version 2.1 as published
+// by the Free Software Foundation, with special exception defined in the file
+// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
+// distribution for complete text of the license and disclaimer of any warranty.
 //
-// The Original Code and all software distributed under the License is
-// distributed on an "AS IS" basis, without warranty of any kind, and the
-// Initial Developer hereby disclaims all such warranties, including without
-// limitation, any warranties of merchantability, fitness for a particular
-// purpose or non-infringement. Please see the License for the specific terms
-// and conditions governing the rights and limitations under the License.
-
-/************************************************************************/
-/* Includes                                                             */
-/************************************************************************/
+// Alternatively, this file may be used under the terms of Open CASCADE
+// commercial license or contractual agreement.
 
 #include <OpenGl_GraphicDriver.hxx>
 #include <OpenGl_Context.hxx>
 #include <OpenGl_CView.hxx>
-#include <OSD_Localizer.hxx>
 
-#ifdef HAVE_CONFIG_H
-# include <config.h>
-#endif
+#include <Standard_CLocaleSentry.hxx>
 
 #ifdef HAVE_GL2PS
 #include <gl2ps.h>
 #endif
 
-#include <locale.h>
-
 /************************************************************************/
 /* Print Methods                                                        */
 /************************************************************************/
 
+#ifdef HAVE_GL2PS
 Standard_Boolean OpenGl_GraphicDriver::Export (const Standard_CString theFileName,
                                                const Graphic3d_ExportFormat theFormat,
                                                const Graphic3d_SortType theSortType,
@@ -50,7 +38,6 @@ Standard_Boolean OpenGl_GraphicDriver::Export (const Standard_CString theFileNam
                                                const Standard_Address /*theProgressBarFunc*/,
                                                const Standard_Address /*theProgressObject*/)
 {
-#ifdef HAVE_GL2PS
   // gl2psBeginPage() will call OpenGL functions
   // so we should activate correct GL context before redraw scene call
   const OpenGl_CView* aCView = (const OpenGl_CView* )theView.ptrView;
@@ -110,7 +97,7 @@ Standard_Boolean OpenGl_GraphicDriver::Export (const Standard_CString theFileNam
   GLint anErrCode = GL2PS_SUCCESS;
 
   // gl2ps uses standard write functions and do not check locale
-  OSD_Localizer locate (LC_NUMERIC, "C");
+  Standard_CLocaleSentry aLocaleSentry;
 
   while (aBufferSize > 0)
   {
@@ -138,10 +125,21 @@ Standard_Boolean OpenGl_GraphicDriver::Export (const Standard_CString theFileNam
     else
       break;
   }
-
-  locate.Restore();
   return anErrCode == GL2PS_SUCCESS;
+}
 #else
-  return Standard_False;
-#endif
+Standard_Boolean OpenGl_GraphicDriver::Export (const Standard_CString /*theFileName*/,
+                                               const Graphic3d_ExportFormat /*theFormat*/,
+                                               const Graphic3d_SortType /*theSortType*/,
+                                               const Standard_Integer /*theWidth*/,
+                                               const Standard_Integer /*theHeight*/,
+                                               const Graphic3d_CView& /*theView*/,
+                                               const Aspect_CLayer2d& /*theLayerUnder*/,
+                                               const Aspect_CLayer2d& /*theLayerOver*/,
+                                               const Standard_Real    /*thePrecision*/,
+                                               const Standard_Address /*theProgressBarFunc*/,
+                                               const Standard_Address /*theProgressObject*/)
+{
+    return Standard_False;
 }
+#endif