X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FGLViewer%2FGLViewer_Viewer2d.cxx;h=11028eb0ac45e63e1c748e76a020b6084a934969;hb=5d44d2f6ea60a50bbbc593f2b45a6075fe9e5154;hp=b11c4d710a0e62b2d758b67d0cdcb53dd1762dc2;hpb=79c2eda1036d9bd398f65f1c22a9fafc83435fae;p=modules%2Fgui.git diff --git a/src/GLViewer/GLViewer_Viewer2d.cxx b/src/GLViewer/GLViewer_Viewer2d.cxx index b11c4d710..11028eb0a 100644 --- a/src/GLViewer/GLViewer_Viewer2d.cxx +++ b/src/GLViewer/GLViewer_Viewer2d.cxx @@ -1,4 +1,4 @@ -// Copyright (C) 2007-2016 CEA/DEN, EDF R&D, OPEN CASCADE +// Copyright (C) 2007-2023 CEA, EDF, OPEN CASCADE // // Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS @@ -113,30 +113,8 @@ void GLViewer_Viewer2d::onChangeBgColor() /*! Updates colors for all drawers (does not work) */ -void GLViewer_Viewer2d::updateColors( QColor colorH, QColor colorS ) +void GLViewer_Viewer2d::updateColors( QColor /*colorH*/, QColor /*colorS*/ ) { -// cout << "GLViewer_Viewer2d::updateColors" << endl; - -/* - for ( DrawerMap::Iterator it = myDrawers.begin(); it != myDrawers.end(); ++it ) - { - it.key()->setHColor( colorH ); - it.key()->setSColor( colorS ); - } -*/ - /* - ObjList anObjects = myGLContext->getObjects(); - ObjList::Iterator beginIt = anObjects.begin(); - ObjList::Iterator endIt = anObjects.end(); - for ( ObjList::Iterator it = beginIt; it != endIt; ++it ) - { - //GLViewer_Drawer* aDrawer = (*it)->getDrawer(); - //aDrawer->setHColor( colorH ); - //aDrawer->setSColor( colorS ); - } - */ - - activateAllDrawers( true ); } @@ -215,12 +193,8 @@ void GLViewer_Viewer2d::updateAll() /*! \param onlyUpdate is passed to method activateAllDrawers drawers */ -void GLViewer_Viewer2d::updateDrawers( GLboolean update, GLfloat scX, GLfloat scY ) +void GLViewer_Viewer2d::updateDrawers( GLboolean update, GLfloat /*scX*/, GLfloat /*scY*/ ) { -// cout << "GLViewer_Viewer2d::updateDrawers" << endl; - - //myGLContext->updateScales( scX, scY ); - //myGLSketcher->drawContour(); activateAllDrawers( update ); } @@ -639,7 +613,7 @@ void GLViewer_Viewer2d::onMouseEvent( SUIT_ViewWindow*, QMouseEvent* e ) */ bool GLViewer_Viewer2d::testRotation( QMouseEvent* e ) { - if ( ( e->button() == GLViewer_View2dTransformer::rotateButton() ) && + if ( ( (int)e->button() == GLViewer_View2dTransformer::rotateButton() ) && // todo Qt::MouseButton is unsigned int: comparison of int with uint ( e->type() == QEvent::MouseButtonPress ) && ( e->modifiers() & GLViewer_ViewTransformer::accelKey() ) ) { @@ -794,15 +768,19 @@ bool GLViewer_Viewer2d::translateTo( VectorFileType aType, QString FileName, Pap HDC bitDC = CreateCompatibleDC ( screen_dc ); //The context compatible with screen #ifdef UNICODE - LPTSTR str = new TCHAR[FileName.length() + 1]; - str[FileName.toWCharArray(str)] = '\0'; - LPTSTR empty = L""; + LPTSTR str = new TCHAR[FileName.length() + 1]; + str[FileName.toWCharArray(str)] = '\0'; + LPTSTR empty = L""; #else - LPTSTR str = FileName.toLatin1().constData(); - LPTSTR empty = ""; + QByteArray arr = FileName.toLatin1(); + LPTSTR str = arr.constData(); + LPTSTR empty = ""; #endif hMetaFileDC = CreateEnhMetaFile( bitDC, str, &r, empty ); +#ifdef UNICODE + delete str; +#endif SetMapMode( hMetaFileDC, MM_HIMETRIC ); SetWindowOrgEx( hMetaFileDC, 0, r.bottom, NULL ); HRGN ClipRgn = CreateRectRgn( 0, 0, AW, AH ); @@ -817,7 +795,7 @@ bool GLViewer_Viewer2d::translateTo( VectorFileType aType, QString FileName, Pap ReleaseDC( 0, screen_dc ); DeleteDC( bitDC ); - aCurVP->getGLWidget()->translateBackgroundToEMF( hMetaFileDC, &aViewerCS, &aPaperCS ); + aCurVP->getGLWidget()->translateBackgroundToEMF( hMetaFileDC, &aViewerCS, &aPaperCS ); } #endif