X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FGLViewer%2FGLViewer_Viewer2d.cxx;h=b91b6248a06ee626798685744e943e25b998d576;hb=ee2404a020ff8bb9db84f624af1179804f8c8dbe;hp=d801cb6425c65a1d3e9bba79a482e0cc953fa6a9;hpb=1c889394b028b786898a995d38c07c8f3d564837;p=modules%2Fgui.git diff --git a/src/GLViewer/GLViewer_Viewer2d.cxx b/src/GLViewer/GLViewer_Viewer2d.cxx index d801cb642..b91b6248a 100644 --- a/src/GLViewer/GLViewer_Viewer2d.cxx +++ b/src/GLViewer/GLViewer_Viewer2d.cxx @@ -1,24 +1,25 @@ -// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE +// Copyright (C) 2007-2016 CEA/DEN, EDF R&D, OPEN CASCADE // -// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, -// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS +// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, +// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS // -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License. +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License, or (at your option) any later version. // -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Lesser General Public License for more details. +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. // -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // + // Author : OPEN CASCADE // File: GLViewer_Viewer2d.cxx // Created: November, 2004 @@ -103,7 +104,7 @@ void GLViewer_Viewer2d::onChangeBgColor() return; GLViewer_ViewPort2d* vp = ( ( GLViewer_ViewPort2d* )getActiveView()->getViewPort() ); - QColor selColor = QColorDialog::getColor( vp->backgroundColor(), vp ); + QColor selColor = QColorDialog::getColor( vp->backgroundColor(), vp ); if ( selColor.isValid() ) { vp->setBackgroundColor( selColor ); } @@ -136,7 +137,7 @@ void GLViewer_Viewer2d::updateColors( QColor colorH, QColor colorS ) */ - activateAllDrawers( TRUE ); + activateAllDrawers( true ); } /*! @@ -667,7 +668,7 @@ void GLViewer_Viewer2d::insertHeader( VectorFileType aType, QFile& hFile ) header += "%%Pages: 1\n"; header += "%%Page: 1\n\n"; - hFile.write( header.toAscii() ); + hFile.write( header.toLatin1() ); } else if( aType == HPGL ) { @@ -681,7 +682,7 @@ void GLViewer_Viewer2d::insertHeader( VectorFileType aType, QFile& hFile ) header += "LT;\n"; header += "VS36;\n"; - hFile.write( header.toAscii() ); + hFile.write( header.toLatin1() ); } } @@ -695,12 +696,12 @@ void GLViewer_Viewer2d::insertEnding( VectorFileType aType, QFile& hFile ) if( aType == POST_SCRIPT ) { QString ending = "showpage\n\n%%EOF"; - hFile.write( ending.toAscii() ); + hFile.write( ending.toLatin1() ); } else if( aType == HPGL ) { QString ending = "PU;PA0,0;SP;EC;PG1;EC1;OE\n"; - hFile.write( ending.toAscii() ); + hFile.write( ending.toLatin1() ); } } @@ -730,7 +731,7 @@ bool GLViewer_Viewer2d::translateTo( VectorFileType aType, QString FileName, Pap if ( !getActiveView() ) return false; - QFile hFile( FileName.toAscii() ); + QFile hFile( FileName.toLatin1() ); #ifdef WIN32 HDC hMetaFileDC; @@ -792,7 +793,7 @@ bool GLViewer_Viewer2d::translateTo( VectorFileType aType, QString FileName, Pap HDC screen_dc = GetDC( 0 ); //The screen device context HDC bitDC = CreateCompatibleDC ( screen_dc ); //The context compatible with screen - hMetaFileDC = CreateEnhMetaFile( bitDC, FileName.toAscii(), &r, "" ); + hMetaFileDC = CreateEnhMetaFile( bitDC, FileName.toLatin1().data(), &r, "" ); SetMapMode( hMetaFileDC, MM_HIMETRIC ); SetWindowOrgEx( hMetaFileDC, 0, r.bottom, NULL ); HRGN ClipRgn = CreateRectRgn( 0, 0, AW, AH ); @@ -818,7 +819,7 @@ bool GLViewer_Viewer2d::translateTo( VectorFileType aType, QString FileName, Pap arg( AW-mmLeft-mmRight ).arg( AH-mmBottom-mmTop ); //It is set clipping path - hFile.write( aBuffer.toAscii() ); + hFile.write( aBuffer.toLatin1() ); aCurVP->getGLWidget()->translateBackgroundToPS( hFile, &aViewerCS, &aPaperCS ); }