From: Viktor Uzlov Date: Fri, 14 Aug 2020 13:23:51 +0000 (+0300) Subject: #18963 Minimize compiler warnings X-Git-Tag: V9_7_0a1~30 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=66361d5c4622d50741a14addc50c47895182c393;p=modules%2Fgui.git #18963 Minimize compiler warnings --- diff --git a/src/CAF/CAF_Study.cxx b/src/CAF/CAF_Study.cxx index 183fbf6af..08ca8708b 100644 --- a/src/CAF/CAF_Study.cxx +++ b/src/CAF/CAF_Study.cxx @@ -113,7 +113,7 @@ bool CAF_Study::createDocument( const QString& doc ) if ( !formats.IsEmpty() ) app->stdApp()->NewDocument( formats.First(), myStdDoc ); } - catch ( Standard_Failure ) { + catch ( Standard_Failure& ) { res = false; } } @@ -149,7 +149,7 @@ bool CAF_Study::openDocument( const QString& fname ) OCC_CATCH_SIGNALS; status = app->Open( CAF_Tools::toExtString( fname ), myStdDoc ) == PCDM_RS_OK; } - catch ( Standard_Failure ) { + catch ( Standard_Failure& ) { status = false; } @@ -189,7 +189,7 @@ bool CAF_Study::saveDocumentAs( const QString& fname ) status = app->SaveAs( stdDoc(), path ) == PCDM_SS_OK; } } - catch ( Standard_Failure ) { + catch ( Standard_Failure& ) { status = false; } @@ -219,7 +219,7 @@ bool CAF_Study::openTransaction() myStdDoc->OpenCommand(); } - catch ( Standard_Failure ) { + catch ( Standard_Failure& ) { res = false; } @@ -241,7 +241,7 @@ bool CAF_Study::abortTransaction() myStdDoc->AbortCommand(); update(); } - catch ( Standard_Failure ) { + catch ( Standard_Failure& ) { res = false; } return res; @@ -268,7 +268,7 @@ bool CAF_Study::commitTransaction( const QString& name ) d->SetName( CAF_Tools::toExtString( name ) ); } } - catch ( Standard_Failure ) { + catch ( Standard_Failure& ) { res = false; } return res; @@ -365,7 +365,7 @@ bool CAF_Study::undo() myStdDoc->Undo(); undoModified(); /* decrement modification counter */ } - catch ( Standard_Failure ) { + catch ( Standard_Failure& ) { SUIT_MessageBox::critical(application()->desktop(), tr( "ERR_ERROR" ), tr( "ERR_DOC_UNDO" )); return false; @@ -387,7 +387,7 @@ bool CAF_Study::redo() myStdDoc->Redo(); doModified(); /* increment modification counter */ } - catch ( Standard_Failure ) { + catch ( Standard_Failure& ) { SUIT_MessageBox::critical( application()->desktop(), tr( "ERR_ERROR" ), tr( "ERR_DOC_REDO" ) ); return false; diff --git a/src/CAM/CAM_Module.cxx b/src/CAM/CAM_Module.cxx index e68b56ac2..f5b7b43d5 100644 --- a/src/CAM/CAM_Module.cxx +++ b/src/CAM/CAM_Module.cxx @@ -1144,7 +1144,7 @@ void CAM_Module::updateModuleVisibilityState() { This method is called from CAM_Application::startOperation(). \param actionId is a numerical unique operation id. */ -bool CAM_Module::activateOperation( int actionId ) +bool CAM_Module::activateOperation( int /*actionId*/ ) { return false; } @@ -1154,7 +1154,7 @@ bool CAM_Module::activateOperation( int actionId ) This method is called from CAM_Application::startOperation(). \param actionId is a string unique operation id. */ -bool CAM_Module::activateOperation( const QString& actionId ) +bool CAM_Module::activateOperation( const QString& /*actionId*/ ) { return false; } @@ -1165,7 +1165,7 @@ bool CAM_Module::activateOperation( const QString& actionId ) \param actionId is a string unique operation id. \param pluginName is a name of a plugin where the operation is implemented. */ -bool CAM_Module::activateOperation( const QString& actionId, const QString& pluginName ) +bool CAM_Module::activateOperation( const QString& /*actionId*/, const QString& /*pluginName*/ ) { return false; } diff --git a/src/CASCatch/CASCatch_CatchSignals.cxx b/src/CASCatch/CASCatch_CatchSignals.cxx index 2a17bc670..794d95a7c 100644 --- a/src/CASCatch/CASCatch_CatchSignals.cxx +++ b/src/CASCatch/CASCatch_CatchSignals.cxx @@ -105,13 +105,16 @@ static void Handler(const int theSig) } -#ifdef SA_SIGINFO //================================================================================ /*! Private - * \brief handler for SIGSEGV signal */ //================================================================================ +#ifdef SA_SIGINFO static void SegvHandler(const int, siginfo_t*, const Standard_Address) +#else +static void SegvHandler(const int) +#endif { sigset_t set; sigemptyset(&set); @@ -120,7 +123,6 @@ static void SegvHandler(const int, siginfo_t*, const Standard_Address) CASCatch_Failure::Raise("SIGSEGV detected"); } -#endif //================================================================================ @@ -138,32 +140,32 @@ void CASCatch_CatchSignals::Activate() for(; i<=MAX_HANDLER_NUMBER; i++) mySigStates[i] = new struct sigaction(); //Initialize structures - int stat; + /*int stat;*/ act.sa_handler = (SIG_PFV) &Handler ; sigemptyset(&act.sa_mask) ; - stat = sigaction(SIGHUP,&act,(struct sigaction*)mySigStates[0]); // ...... hangup - stat = sigaction(SIGFPE,&act,(struct sigaction*) mySigStates[1]); // ...... floating point exception - stat = sigaction(SIGINT,&act,(struct sigaction*)mySigStates[2]); // ...... interrupt - stat = sigaction(SIGQUIT,&act,(struct sigaction*)mySigStates[3]); // ...... quit - stat = sigaction(SIGBUS,&act,(struct sigaction*)mySigStates[4]); // ...... bus error - stat = sigaction(SIGILL,&act,(struct sigaction*)mySigStates[5]); // ...... illegal instruction + /*stat = */sigaction(SIGHUP,&act,(struct sigaction*)mySigStates[0]); // ...... hangup + /*stat = */sigaction(SIGFPE,&act,(struct sigaction*) mySigStates[1]); // ...... floating point exception + /*stat = */sigaction(SIGINT,&act,(struct sigaction*)mySigStates[2]); // ...... interrupt + /*stat = */sigaction(SIGQUIT,&act,(struct sigaction*)mySigStates[3]); // ...... quit + /*stat = */sigaction(SIGBUS,&act,(struct sigaction*)mySigStates[4]); // ...... bus error + /*stat = */sigaction(SIGILL,&act,(struct sigaction*)mySigStates[5]); // ...... illegal instruction #ifdef SA_RESTART act.sa_flags = SA_RESTART ; #else act.sa_flags = 0 ; #endif +#ifdef SA_SIGINFO + act.sa_sigaction = (void(*)(int, siginfo_t *, void*)) &SegvHandler ; +#else act.sa_handler = (SIG_PFV) &SegvHandler ; - +# endif #ifdef SA_SIGINFO // OSF,SOLARIS,IRIX act.sa_flags = act.sa_flags | SA_SIGINFO ; -# ifdef SOLARIS - act.sa_sigaction = (void(*)(int, siginfo_t *, void*)) &SegvHandler ; -# endif #endif - stat = sigaction( SIGSEGV , &act , (struct sigaction*)mySigStates[6]); // ...... segmentation violation + /*stat = */sigaction( SIGSEGV , &act , (struct sigaction*)mySigStates[6]); // ...... segmentation violation myIsActivated = Standard_True; } @@ -179,15 +181,15 @@ void CASCatch_CatchSignals::Deactivate() if(!myIsActivated) return; struct sigaction oact; - int stat; - - stat = sigaction(SIGHUP,(struct sigaction*)mySigStates[0],&oact); // ...... hangup - stat = sigaction(SIGFPE,(struct sigaction*)mySigStates[1],&oact); // ...... floating point exception - stat = sigaction(SIGINT,(struct sigaction*)mySigStates[2],&oact); // ...... interrupt - stat = sigaction(SIGQUIT,(struct sigaction*)mySigStates[3],&oact); // ...... quit - stat = sigaction(SIGBUS,(struct sigaction*)mySigStates[4],&oact); // ...... bus error - stat = sigaction(SIGILL,(struct sigaction*)mySigStates[5],&oact); // ...... illegal instruction - stat = sigaction(SIGSEGV,(struct sigaction*)mySigStates[6],&oact); // ...... segmentation violation + /*int stat;*/ + + /*stat = */sigaction(SIGHUP,(struct sigaction*)mySigStates[0],&oact); // ...... hangup + /*stat = */sigaction(SIGFPE,(struct sigaction*)mySigStates[1],&oact); // ...... floating point exception + /*stat = */sigaction(SIGINT,(struct sigaction*)mySigStates[2],&oact); // ...... interrupt + /*stat = */sigaction(SIGQUIT,(struct sigaction*)mySigStates[3],&oact); // ...... quit + /*stat = */sigaction(SIGBUS,(struct sigaction*)mySigStates[4],&oact); // ...... bus error + /*stat = */sigaction(SIGILL,(struct sigaction*)mySigStates[5],&oact); // ...... illegal instruction + /*stat = */sigaction(SIGSEGV,(struct sigaction*)mySigStates[6],&oact); // ...... segmentation violation Standard_Integer i = 0; diff --git a/src/DDS/DDS_DicGroup.cxx b/src/DDS/DDS_DicGroup.cxx index 8936bd662..a3876888d 100644 --- a/src/DDS/DDS_DicGroup.cxx +++ b/src/DDS/DDS_DicGroup.cxx @@ -57,6 +57,7 @@ DDS_DicGroup::DDS_DicGroup( const TCollection_AsciiString& name ) \brief Copy constructor (put in private section to prevent object copying). */ DDS_DicGroup::DDS_DicGroup( const DDS_DicGroup& ) +: Standard_Transient() { } diff --git a/src/DDS/DDS_DicItem.cxx b/src/DDS/DDS_DicItem.cxx index a937f8c72..6d0aff38e 100644 --- a/src/DDS/DDS_DicItem.cxx +++ b/src/DDS/DDS_DicItem.cxx @@ -57,6 +57,7 @@ DDS_DicItem::DDS_DicItem() \brief Copy constructor (put in private section to prevent object copying). */ DDS_DicItem::DDS_DicItem( const DDS_DicItem& ) +: Standard_Transient() { } @@ -888,7 +889,7 @@ void DDS_DicItem::FillDataMap( TCollection_AsciiString theID, const LDOM_Element else if ( anUnitData.myUnits.ToCString()[0] ) // treat '%' as unit with scale 100 anUnitData.myScale = 0.01; } - catch( Standard_Failure ) { + catch( Standard_Failure& ) { anUnitData.myUnits.Clear(); } diff --git a/src/DDS/DDS_Dictionary.cxx b/src/DDS/DDS_Dictionary.cxx index 7ff1ee53c..4cf924964 100644 --- a/src/DDS/DDS_Dictionary.cxx +++ b/src/DDS/DDS_Dictionary.cxx @@ -267,6 +267,7 @@ DDS_Dictionary::DDS_Dictionary() \brief Copy constructor (put in private section to prevent object copying). */ DDS_Dictionary::DDS_Dictionary( const DDS_Dictionary& ) +: Standard_Transient() { } @@ -555,7 +556,7 @@ Standard_Real DDS_Dictionary::ToSI( const Standard_Real theValue, const Standard OCC_CATCH_SIGNALS; aRetValue = UnitsAPI::AnyToSI( theValue, theUnits ); } - catch( Standard_Failure ) { + catch( Standard_Failure& ) { } } else if ( theUnits && *theUnits ) @@ -580,7 +581,7 @@ Standard_Real DDS_Dictionary::FromSI( const Standard_Real theValue, const Standa OCC_CATCH_SIGNALS; aRetValue = UnitsAPI::AnyFromSI( theValue, theUnits ); } - catch( Standard_Failure ) { + catch( Standard_Failure& ) { } } else if ( theUnits && *theUnits ) diff --git a/src/GLViewer/GLViewer_BaseObjects.cxx b/src/GLViewer/GLViewer_BaseObjects.cxx index db2c3875a..c6e9bdb48 100644 --- a/src/GLViewer/GLViewer_BaseObjects.cxx +++ b/src/GLViewer/GLViewer_BaseObjects.cxx @@ -422,7 +422,7 @@ GLboolean GLViewer_MarkerSet::unhighlight() \param isCircle - true if sensitive area of detection is round \param isShift - true if selection exec with append option */ -GLboolean GLViewer_MarkerSet::select( GLfloat x, GLfloat y, GLfloat tol, GLViewer_Rect rect, GLboolean isFull, +GLboolean GLViewer_MarkerSet::select( GLfloat x, GLfloat y, GLfloat tol, GLViewer_Rect /*rect*/, GLboolean /*isFull*/, GLboolean isCircle, GLboolean isShift ) { if( !myIsVisible ) @@ -814,11 +814,11 @@ bool GLViewer_MarkerSet::initializeFromByteCopy( QByteArray theArray ) \param size - size of polyline \param toolTip - tool tip of polyline */ -GLViewer_Polyline::GLViewer_Polyline( int number, float size, const QString& toolTip ): +GLViewer_Polyline::GLViewer_Polyline( int number, float /*size*/, const QString& toolTip ): GLViewer_Object(), - myNumber( 0 ), myXCoord( 0 ), - myYCoord( 0 ) + myYCoord( 0 ), + myNumber( 0 ) { myHighFlag = GL_TRUE; @@ -1004,7 +1004,7 @@ GLViewer_Drawer* GLViewer_Polyline::createDrawer() \param isCircle - true if sensitive area of detection is round \return true if highlight status is changed */ -GLboolean GLViewer_Polyline::highlight( GLfloat x, GLfloat y, GLfloat tol, GLboolean isCircle ) +GLboolean GLViewer_Polyline::highlight( GLfloat x, GLfloat y, GLfloat /*tol*/, GLboolean /*isCircle*/ ) { if( !myIsVisible ) return false; @@ -1088,8 +1088,8 @@ GLboolean GLViewer_Polyline::unhighlight() \param isCircle - true if sensitive area of detection is round \param isShift - true if selection exec with append option */ -GLboolean GLViewer_Polyline::select( GLfloat x, GLfloat y, GLfloat tol, GLViewer_Rect rect, GLboolean isFull, - GLboolean isCircle, GLboolean isShift ) +GLboolean GLViewer_Polyline::select( GLfloat x, GLfloat y, GLfloat /*tol*/, GLViewer_Rect /*rect*/, GLboolean /*isFull*/, + GLboolean /*isCircle*/, GLboolean /*isShift*/ ) { if( !myIsVisible ) return false; @@ -1621,8 +1621,8 @@ GLboolean GLViewer_TextObject::unhighlight() \param isCircle - true if sensitive area of detection is round \param isShift - true if selection exec with append option */ -GLboolean GLViewer_TextObject::select( GLfloat theX, GLfloat theY, GLfloat theTol, GLViewer_Rect rect, - GLboolean isFull, GLboolean isCircle, GLboolean isShift ) +GLboolean GLViewer_TextObject::select( GLfloat theX, GLfloat theY, GLfloat theTol, GLViewer_Rect /*rect*/, + GLboolean /*isFull*/, GLboolean isCircle, GLboolean /*isShift*/ ) { if( !myIsVisible ) return false; diff --git a/src/GLViewer/GLViewer_Drawer.cxx b/src/GLViewer/GLViewer_Drawer.cxx index d46b9182a..d06b1571b 100644 --- a/src/GLViewer/GLViewer_Drawer.cxx +++ b/src/GLViewer/GLViewer_Drawer.cxx @@ -77,7 +77,7 @@ void GLViewer_TexFont::clearTextBases() Default constructor */ GLViewer_TexFont::GLViewer_TexFont() -: myMaxRowWidth( 0 ), myFontHeight( 0 ) +: myFontHeight( 0 ), myMaxRowWidth( 0 ) { myQFont = QApplication::font();//QFont::defaultFont(); mySeparator = 2; @@ -95,7 +95,7 @@ GLViewer_TexFont::GLViewer_TexFont() \param theMinMagFilter - min/mag filter, affects text sharpness */ GLViewer_TexFont::GLViewer_TexFont( QFont* theFont, int theSeparator, bool theIsResizeable, GLuint theMinMagFilter ) -: myMaxRowWidth( 0 ), myFontHeight( 0 ) +: myFontHeight( 0 ), myMaxRowWidth( 0 ) { myQFont = *theFont; mySeparator = theSeparator; @@ -161,7 +161,7 @@ bool GLViewer_TexFont::generateTexture() aFindFont.myIsItal = myQFont.italic(); aFindFont.myIsUndl = myQFont.underline(); aFindFont.myPointSize = myQFont.pointSize(); - aFindFont.myViewPortId = size_t(QGLContext::currentContext()); + aFindFont.myViewPortId = (long)QGLContext::currentContext(); //!::iterator it = GLViewer_TexFont::BitmapFontCache.begin(); for ( ; it != GLViewer_TexFont::BitmapFontCache.end(); ++it ) { - if ( it.key().myViewPortId == (int)ctx && it.value() > listBase ) + if ( it.key().myViewPortId == (LONG_PTR)ctx && it.value() > listBase ) listBase = it.value(); } listBase += 256; @@ -451,7 +451,7 @@ static GLuint displayListBase( QFont* theFont ) return aList; } - aFindFont.myViewPortId = size_t(aCont); + aFindFont.myViewPortId = (long)aCont; if ( GLViewer_TexFont::BitmapFontCache.contains( aFindFont ) ) aList = GLViewer_TexFont::BitmapFontCache[aFindFont]; @@ -461,7 +461,7 @@ static GLuint displayListBase( QFont* theFont ) QMap::iterator it = GLViewer_TexFont::BitmapFontCache.begin(); for ( ; it != GLViewer_TexFont::BitmapFontCache.end(); ++it ) { - if ( it.key().myViewPortId == size_t(aCont) && it.value() > listBase ) + if ( it.key().myViewPortId == (long)aCont && it.value() > listBase ) listBase = it.value(); } listBase += 256; diff --git a/src/GLViewer/GLViewer_Grid.cxx b/src/GLViewer/GLViewer_Grid.cxx index f8c8c4994..79538241e 100644 --- a/src/GLViewer/GLViewer_Grid.cxx +++ b/src/GLViewer/GLViewer_Grid.cxx @@ -56,11 +56,11 @@ GLViewer_Grid::GLViewer_Grid() : \param xPan and \param yPan - offsets along x and y direction \param xScale and \param yScal - scale factors along x and y direction */ -GLViewer_Grid::GLViewer_Grid( GLfloat width, GLfloat height, - GLfloat winW, GLfloat winH, - GLfloat xSize, GLfloat ySize, - GLfloat xPan, GLfloat yPan, - GLfloat xScale, GLfloat yScale ) : +GLViewer_Grid::GLViewer_Grid( GLfloat /*width*/, GLfloat /*height*/, + GLfloat /*winW*/, GLfloat /*winH*/, + GLfloat /*xSize*/, GLfloat /*ySize*/, + GLfloat /*xPan*/, GLfloat /*yPan*/, + GLfloat /*xScale*/, GLfloat /*yScale*/ ) : myGridList( 0 ), myGridHeight( (GLfloat)0.0 ), myGridWidth( (GLfloat)0.0 ), myWinW( (GLfloat)0.0 ), myWinH( (GLfloat)0.0 ), myXSize( (GLfloat)0.0 ), myYSize( (GLfloat)0.0 ), myXPan( (GLfloat)0.0 ), myYPan( (GLfloat)0.0 ), myXScale( (GLfloat)1.0 ), myYScale( (GLfloat)1.0 ), diff --git a/src/GLViewer/GLViewer_Group.cxx b/src/GLViewer/GLViewer_Group.cxx index 53e862876..00c738d70 100644 --- a/src/GLViewer/GLViewer_Group.cxx +++ b/src/GLViewer/GLViewer_Group.cxx @@ -56,7 +56,7 @@ bool GLViewer_Group::isEmpty() */ int GLViewer_Group::count() { - return myList.size(); + return (int)myList.size(); //!< TODO: conversion from size_t to int } /*! diff --git a/src/GLViewer/GLViewer_Object.cxx b/src/GLViewer/GLViewer_Object.cxx index bb2a4768c..5a0e543bc 100644 --- a/src/GLViewer/GLViewer_Object.cxx +++ b/src/GLViewer/GLViewer_Object.cxx @@ -196,7 +196,7 @@ QByteArray GLViewer_Object::getByteCopy() aCurPos += aGLText.size(); aPointer = (char*)&myOwner; - for( i = 0; i < sizeof( SUIT_DataOwner* ); i++, aPointer++ ) + for( i = 0; i < (int)sizeof( SUIT_DataOwner* ); i++, aPointer++ ) aResult[ aCurPos + i ] = *aPointer; return aResult; diff --git a/src/GLViewer/GLViewer_Selector2d.cxx b/src/GLViewer/GLViewer_Selector2d.cxx index e69441e5b..ca40d452d 100644 --- a/src/GLViewer/GLViewer_Selector2d.cxx +++ b/src/GLViewer/GLViewer_Selector2d.cxx @@ -170,7 +170,7 @@ void GLViewer_Selector2d::unselectAll() Checks selection state and emits 'selSelectionDone' or 'selSelectionCancel' Should be called by after non-interactive selection. */ -void GLViewer_Selector2d::checkSelection( int selBefore, bool append, int aStatus ) +void GLViewer_Selector2d::checkSelection( int selBefore, bool /*append*/, int aStatus ) { int selAfter = numSelected(); if ( selBefore > 0 && selAfter < 1 ) diff --git a/src/GLViewer/GLViewer_Text.cxx b/src/GLViewer/GLViewer_Text.cxx index e589e5a37..ff94e238c 100644 --- a/src/GLViewer/GLViewer_Text.cxx +++ b/src/GLViewer/GLViewer_Text.cxx @@ -70,7 +70,7 @@ int GLViewer_Text::getWidth() { int aResult = 0; QFontMetrics aFM( myQFont ); - for( uint i = 0; i < myText.length(); i++ ) + for( int i = 0; i < myText.length(); i++ ) aResult += aFM.width( myText.at(i) ) + mySeparator; return aResult; } diff --git a/src/GLViewer/GLViewer_ToolTip.cxx b/src/GLViewer/GLViewer_ToolTip.cxx index a16897493..895d3bfdc 100644 --- a/src/GLViewer/GLViewer_ToolTip.cxx +++ b/src/GLViewer/GLViewer_ToolTip.cxx @@ -20,11 +20,6 @@ // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // -// Author : OPEN CASCADE -// File: GLViewer_ToolTip.xx -// Created: March, 2005 -//#include "GLViewerAfx.h" -// #include "GLViewer_Context.h" #include "GLViewer_ToolTip.h" #include "GLViewer_Viewer2d.h" @@ -43,24 +38,19 @@ */ GLViewer_ObjectTip::GLViewer_ObjectTip( GLViewer_ViewPort2d* theParent ) :QObject(), - myText(), myPoint( -1, -1 ) { mypViewPort = theParent; - //mypLabel = NULL; mypLabel = new QLabel( "Test", NULL, Qt::WindowStaysOnTopHint | Qt::FramelessWindowHint | Qt::Tool | Qt::X11BypassWindowManagerHint ); mypLabel->setObjectName("ObjectTipText"); mypLabel->setMargin( 1 ); - //mypLabel->setAutoMask( false ); mypLabel->setFrameStyle( QFrame::Plain | QFrame::Box ); mypLabel->setLineWidth( 1 ); mypLabel->setAlignment( Qt::AlignAbsolute | Qt::AlignTop ); mypLabel->setIndent( 0 ); mypLabel->ensurePolished(); - //mypLabel->setPalette( QToolTip::palette() ); - mypTimer = new QTimer( this ); connect( mypTimer, SIGNAL( timeout() ), this, SLOT( showTip() ) ); @@ -71,15 +61,8 @@ GLViewer_ObjectTip::GLViewer_ObjectTip( GLViewer_ViewPort2d* theParent ) */ GLViewer_ObjectTip::~GLViewer_ObjectTip() { -// delete mypRect; if( mypLabel ) delete mypLabel; - - //if( mypPoint ) - // delete mypPoint; - - //if( mypTimer ) - // delete mypTimer; } @@ -87,29 +70,9 @@ GLViewer_ObjectTip::~GLViewer_ObjectTip() It is called when there is a possibility that a tool tip should be shown \param p - position of tooltip */ -bool GLViewer_ObjectTip::maybeTip( const QPoint &p ) +bool GLViewer_ObjectTip::maybeTip( const QPoint& /*p*/ ) { - - GLViewer_Context* aContext = ((GLViewer_Viewer2d*)mypViewPort->getViewFrame()->getViewer())->getGLContext(); - - /*if( !aContext->currentObjectIsChanged() ) - return false; - else - return true; - if( myPoint.x() == -1 && myPoint.y() == -1 || aContext->currentObjectIsChanged()) - { - myPoint = p; - } - else/if( abs(myPoint.y() - p.y()) < 16 ) - { - return; - } - else // > 16 - { - myPoint = p; - } -*/ GLViewer_Object* anObj = aContext->getCurrentObject(); if( anObj ) { @@ -118,20 +81,6 @@ bool GLViewer_ObjectTip::maybeTip( const QPoint &p ) } return false; - /*if( anObj ) - { - //GLViewer_Rect* aRect = anObj->getRect(); - //QRect aWinRect = mypViewPort->GLV2win( *aRect ); - tip( QRect( p.x(), p.y(), 1, 1 ), anObj->getName() ); - //QFontMetrics aFM( font() ); - //showTip( aWinRect, anObj->getName(), QRect( 0, 0, aFM.width( anObj->getName() + " " ), aFM.height()*1.5 ) ); - //tip( aWinRect, anObj->getName(), aWinRect( aFM.width( anObj->getName() + " " ), aFM.height()*1.5 ) ); - } -// else -// clear(); - - //tip( QRect( 0, 0, mypViewPort->getGLWidget()->width(),mypViewPort->getGLWidget()->height() ) , "test Tool tip" ); - */ } /*! @@ -142,34 +91,20 @@ bool GLViewer_ObjectTip::eventFilter( QObject* theObj, QEvent* e ) hideTipAndSleep(); switch( e->type() ) { - /*case QEvent::MouseButtonPress: - case QEvent::MouseButtonRelease: - case QEvent::MouseButtonDblClick: - case QEvent::KeyPress: - case QEvent::KeyRelease: - // input - turn off tool tip mode - hideTipAndSleep(); - break;*/ case QEvent::MouseMove: + { + QWidget* aWidget = (QWidget*) theObj; + if( aWidget == mypViewPort->getGLWidget() ) { - //hideTipAndSleep(); - /*if( mypTimer->isActive() ) - { - mypTimer->Stop(); - wakeUp(); - }*/ - QWidget* aWidget = (QWidget*) theObj; - if( aWidget == mypViewPort->getGLWidget() ) - { - wakeup(); - QMouseEvent* m = (QMouseEvent *)e; - //if( !mypPoint ) - // mypPoint = new QPoint(); - - myPoint.setX( m->x() ); - myPoint.setY( m->y() ); - } + wakeup(); + QMouseEvent* m = (QMouseEvent *)e; + + myPoint.setX( m->x() ); + myPoint.setY( m->y() ); } + } + default: + break; } return false; } @@ -179,15 +114,12 @@ bool GLViewer_ObjectTip::eventFilter( QObject* theObj, QEvent* e ) */ void GLViewer_ObjectTip::hideTipAndSleep() { - //if( mypPoint ) - // delete mypPoint; myPoint.setX(-1); myPoint.setY(-1); if( mypLabel ) { mypLabel->hide(); - //delete mypLabel; } mypTimer->stop(); } @@ -205,7 +137,6 @@ void GLViewer_ObjectTip::showTip() QPoint pos = mypViewPort->getGLWidget()->mapToGlobal( myPoint ); - //mypLabel->show(); int cur_height = 24; QCursor* aCursor = QApplication::overrideCursor(); if( aCursor ) diff --git a/src/GLViewer/GLViewer_Tools.cxx b/src/GLViewer/GLViewer_Tools.cxx index 6fe7c717f..ea7955d27 100644 --- a/src/GLViewer/GLViewer_Tools.cxx +++ b/src/GLViewer/GLViewer_Tools.cxx @@ -514,7 +514,7 @@ GLViewer_LineField::~GLViewer_LineField() /*! Adds line */ -void GLViewer_LineField::addLine( FieldDim theDim, GLViewer_LineList* ) +void GLViewer_LineField::addLine( FieldDim, GLViewer_LineList* ) { //not implemented } diff --git a/src/GLViewer/GLViewer_ViewPort2d.cxx b/src/GLViewer/GLViewer_ViewPort2d.cxx index 4a120be98..3819758dd 100644 --- a/src/GLViewer/GLViewer_ViewPort2d.cxx +++ b/src/GLViewer/GLViewer_ViewPort2d.cxx @@ -73,7 +73,7 @@ void rotate_point( float& theX, float& theY, float theAngle ) */ GLViewer_ViewPort2d::GLViewer_ViewPort2d( QWidget* parent, GLViewer_ViewFrame* theViewFrame ) : GLViewer_ViewPort( parent ), - myMargin( MARGIN ), myWidth( WIDTH ), myHeight( HEIGHT ), + myMargin( MARGIN ), myHeight( HEIGHT ), myWidth( WIDTH ), myXScale( 1.0 ), myYScale( 1.0 ), myXOldScale( 1.0 ), myYOldScale( 1.0 ), myXPan( 0.0 ), myYPan( 0.0 ), myIsMouseReleaseBlock( false ), @@ -824,7 +824,7 @@ void GLViewer_ViewPort2d::fitSelect() Transform view by view borders \param keepScale - if it is true, zoom does not change */ -void GLViewer_ViewPort2d::fitAll( bool keepScale, bool withZ ) +void GLViewer_ViewPort2d::fitAll( bool keepScale, bool /*withZ*/ ) { //cout << "GLViewer_ViewPort2d::fitAll" << endl; @@ -1140,7 +1140,7 @@ void GLViewer_ViewPort2d::drawCompass() glEndList(); - if ( aTextList != -1 ) + if ( (int)aTextList != -1 ) glCallList( aTextList ); } diff --git a/src/GLViewer/GLViewer_Viewer.cxx b/src/GLViewer/GLViewer_Viewer.cxx index 5d0ee8743..cc3d8ea13 100644 --- a/src/GLViewer/GLViewer_Viewer.cxx +++ b/src/GLViewer/GLViewer_Viewer.cxx @@ -48,12 +48,12 @@ static QEvent* l_mbPressEvent = 0; /*! Constructor */ -GLViewer_Viewer::GLViewer_Viewer( const QString& title ) +GLViewer_Viewer::GLViewer_Viewer( const QString& /*title*/ ) : SUIT_ViewModel(), mySelector( 0 ), +mySelMode( NoSelection ), mySketcher( 0 ), -myTransformer( 0 ), -mySelMode( NoSelection ) +myTransformer( 0 ) { } @@ -333,7 +333,7 @@ bool GLViewer_Viewer::eventFilter( QObject* o, QEvent* e ) /*! Called when smth is selected in this viewer. [ virtual protected slot ] */ -void GLViewer_Viewer::onSelectionDone( bool bAdded, SelectionChangeStatus status ) +void GLViewer_Viewer::onSelectionDone( bool /*bAdded*/, SelectionChangeStatus status ) { emit selectionChanged( status ); } @@ -433,9 +433,9 @@ void GLViewer_Viewer::handleMousePress( QMouseEvent* e ) if ( e->modifiers() & GLViewer_ViewTransformer::accelKey() ) { Qt::MouseButton bs = e->button(); - if ( bs == GLViewer_ViewTransformer::zoomButton() ) + if ( (int)bs == GLViewer_ViewTransformer::zoomButton() ) // todo Qt::MouseButton is unsigned int: comparison of int with uint activateTransform( Zoom ); - else if ( bs == GLViewer_ViewTransformer::panButton() ) + else if ( (int)bs == GLViewer_ViewTransformer::panButton() ) // todo Qt::MouseButton is unsigned int: comparison of int with uint activateTransform( Pan ); } else @@ -472,7 +472,7 @@ void GLViewer_Viewer::handleMouseMove( QMouseEvent* e ) } /* Try to activate default sketching */ - else if ( e->button() == GLViewer_ViewSketcher::sketchButton() ) + else if ( (int)e->button() == GLViewer_ViewSketcher::sketchButton() ) // todo Qt::MouseButton is unsigned int: comparison of int with uint { activateSketching( Rect ); if ( mySketcher ) @@ -541,8 +541,8 @@ GLViewer_ViewTransformer::GLViewer_ViewTransformer( GLViewer_Viewer* v, int type : QObject( 0 ), myViewer( v ), myType( type ), -myMajorBtn( Qt::NoButton ), myButtonState( 0 ), +myMajorBtn( Qt::NoButton ), myRectBand( 0 ) { if ( myType == GLViewer_Viewer::Pan || @@ -788,8 +788,8 @@ int GLViewer_ViewSketcher::sketchBtn = Qt::LeftButton; GLViewer_ViewSketcher::GLViewer_ViewSketcher( GLViewer_Viewer* viewer, int type ) : QObject( 0 ), myViewer( viewer ), -myData( 0 ), myType( type ), +myData( 0 ), myRectBand( 0 ) { if( !myViewer ) diff --git a/src/GLViewer/GLViewer_Viewer2d.cxx b/src/GLViewer/GLViewer_Viewer2d.cxx index 8cfad13b5..ffb290df7 100644 --- a/src/GLViewer/GLViewer_Viewer2d.cxx +++ b/src/GLViewer/GLViewer_Viewer2d.cxx @@ -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() ) ) { diff --git a/src/GLViewer/GLViewer_Widget.cxx b/src/GLViewer/GLViewer_Widget.cxx index ed455c711..9021ef00c 100644 --- a/src/GLViewer/GLViewer_Widget.cxx +++ b/src/GLViewer/GLViewer_Widget.cxx @@ -41,7 +41,7 @@ A constructor Parameters using for QOGLWidget as is */ -GLViewer_Widget::GLViewer_Widget( QWidget* parent, const char* name ): +GLViewer_Widget::GLViewer_Widget( QWidget* parent, const char* /*name*/ ): QGLWidget( parent, 0/*, WRepaintNoErase | WResizeNoErase*/ ) { myViewPort = ( GLViewer_ViewPort2d* )parent; @@ -401,7 +401,7 @@ void GLViewer_Widget::mouseReleaseEvent( QMouseEvent* e ) /*! Custom enter event handler */ -void GLViewer_Widget::enterEvent( QEvent* e ) +void GLViewer_Widget::enterEvent( QEvent* /*e*/ ) { updateGL(); } @@ -409,7 +409,7 @@ void GLViewer_Widget::enterEvent( QEvent* e ) /*! Custom leave event handler */ -void GLViewer_Widget::leaveEvent( QEvent* e ) +void GLViewer_Widget::leaveEvent( QEvent* /*e*/ ) { updateGL(); } @@ -579,7 +579,7 @@ typedef unsigned int WORD; memcpy( dest, source, aSize/8 ); else { - double r, g, b; WORD color; + double r=0, g=0, b=0; WORD color; for( int i=0; isetRect( theRect ); #endif @@ -170,7 +171,7 @@ void GraphicsView_Scene::contextMenuEvent( QGraphicsSceneContextMenuEvent* e ) // Function : dragEnterEvent // Purpose : //================================================================ -void GraphicsView_Scene::dragEnterEvent( QGraphicsSceneDragDropEvent* e ) +void GraphicsView_Scene::dragEnterEvent( QGraphicsSceneDragDropEvent* /*e*/ ) //!< TODO: unused variable { //QGraphicsScene::dragEnterEvent( e ); // don't uncomment } @@ -179,7 +180,7 @@ void GraphicsView_Scene::dragEnterEvent( QGraphicsSceneDragDropEvent* e ) // Function : dragLeaveEvent // Purpose : //================================================================ -void GraphicsView_Scene::dragLeaveEvent( QGraphicsSceneDragDropEvent* e ) +void GraphicsView_Scene::dragLeaveEvent( QGraphicsSceneDragDropEvent* /*e*/ ) //!< TODO: unused variable { //QGraphicsScene::dragLeaveEvent( e ); // don't uncomment } @@ -188,7 +189,7 @@ void GraphicsView_Scene::dragLeaveEvent( QGraphicsSceneDragDropEvent* e ) // Function : dragMoveEvent // Purpose : //================================================================ -void GraphicsView_Scene::dragMoveEvent( QGraphicsSceneDragDropEvent* e ) +void GraphicsView_Scene::dragMoveEvent( QGraphicsSceneDragDropEvent* /*e*/ ) //!< TODO: unused variable { //QGraphicsScene::dragMoveEvent( e ); // don't uncomment } @@ -197,7 +198,7 @@ void GraphicsView_Scene::dragMoveEvent( QGraphicsSceneDragDropEvent* e ) // Function : dropEvent // Purpose : //================================================================ -void GraphicsView_Scene::dropEvent( QGraphicsSceneDragDropEvent* e ) +void GraphicsView_Scene::dropEvent( QGraphicsSceneDragDropEvent* /*e*/ ) //!< TODO: unused variable { //QGraphicsScene::dropEvent( e ); // don't uncomment } diff --git a/src/GraphicsView/GraphicsView_Selector.cxx b/src/GraphicsView/GraphicsView_Selector.cxx index fa8c60a3e..fd57e5c4a 100644 --- a/src/GraphicsView/GraphicsView_Selector.cxx +++ b/src/GraphicsView/GraphicsView_Selector.cxx @@ -103,7 +103,7 @@ void GraphicsView_Selector::unselectAll() // Function : checkSelection // Purpose : //================================================================ -void GraphicsView_Selector::checkSelection( int selBefore, bool append, int theStatus ) +void GraphicsView_Selector::checkSelection( int selBefore, bool /*append*/, int theStatus ) { int selAfter = numSelected(); if ( selBefore > 0 && selAfter < 1 ) diff --git a/src/GraphicsView/GraphicsView_ViewPort.cxx b/src/GraphicsView/GraphicsView_ViewPort.cxx index 92ce3681e..42e06292c 100644 --- a/src/GraphicsView/GraphicsView_ViewPort.cxx +++ b/src/GraphicsView/GraphicsView_ViewPort.cxx @@ -285,7 +285,7 @@ void GraphicsView_ViewPort::addItem( QGraphicsItem* theItem ) //================================================================ bool GraphicsView_ViewPort::isItemAdded( QGraphicsItem* theItem ) { - if( GraphicsView_Object* anObject = dynamic_cast( theItem ) ) + if( dynamic_cast( theItem ) ) { for( GraphicsView_ObjectList::iterator anIter = myObjects.begin(); anIter != myObjects.end(); anIter++ ) if( theItem == *anIter ) @@ -1104,7 +1104,6 @@ void GraphicsView_ViewPort::highlight( double theX, double theY ) bool anIsHighlighted = false; bool anIsOnObject = false; - GraphicsView_Object* aPreviousHighlightedObject = myHighlightedObject; GraphicsView_Object* aHighlightedObject = 0; QCursor aCursor; @@ -1255,7 +1254,6 @@ int GraphicsView_ViewPort::select( const QRectF& theRect, bool theIsAppend ) { aStatus = GVSS_NoChanged; - bool updateAll = false; if( !theIsAppend ) { if( !mySelectedObjects.isEmpty() ) @@ -1605,8 +1603,8 @@ void GraphicsView_ViewPort::dragObjects( QGraphicsSceneMouseEvent* e ) else anObjectsToMove.append( anObject ); } - else if( ( hasInteractionFlag( DraggingByMiddleButton ) && ( e->buttons() & Qt::MidButton ) || - isDraggingSelectedByLeftButton() && ( e->buttons() & Qt::LeftButton ) ) && + else if( ( ( hasInteractionFlag( DraggingByMiddleButton ) && ( e->buttons() & Qt::MidButton ) ) || + ( isDraggingSelectedByLeftButton() && ( e->buttons() & Qt::LeftButton ) ) ) && nbSelected() ) { for( initSelected(); moreSelected(); nextSelected() ) @@ -1802,8 +1800,8 @@ void GraphicsView_ViewPort::onMouseEvent( QGraphicsSceneMouseEvent* e ) if( ( getHighlightedObject() && getHighlightedObject()->isMovable() && !( anAccel || e->button() != Qt::LeftButton ) ) || - ( ( hasInteractionFlag( DraggingByMiddleButton ) && e->button() == Qt::MidButton || - isDraggingSelectedByLeftButton() && e->button() == Qt::LeftButton ) && + ( ( ( hasInteractionFlag( DraggingByMiddleButton ) && e->button() == Qt::MidButton ) || + ( isDraggingSelectedByLeftButton() && e->button() == Qt::LeftButton ) ) && nbSelected() && !anAccel ) ) { myIsDragging = true; diff --git a/src/GraphicsView/GraphicsView_ViewTransformer.cxx b/src/GraphicsView/GraphicsView_ViewTransformer.cxx index 51bce5e07..e493321ea 100644 --- a/src/GraphicsView/GraphicsView_ViewTransformer.cxx +++ b/src/GraphicsView/GraphicsView_ViewTransformer.cxx @@ -41,8 +41,8 @@ GraphicsView_ViewTransformer::GraphicsView_ViewTransformer( GraphicsView_Viewer* : QObject( 0 ), myViewer( v ), myType( type ), - myMajorBtn( Qt::NoButton ), myButtonState( 0 ), + myMajorBtn( Qt::NoButton ), myRectBand( 0 ) { if( myType == GraphicsView_Viewer::Pan || diff --git a/src/GraphicsView/GraphicsView_Viewer.cxx b/src/GraphicsView/GraphicsView_Viewer.cxx index c57049b4f..52819f3c3 100644 --- a/src/GraphicsView/GraphicsView_Viewer.cxx +++ b/src/GraphicsView/GraphicsView_Viewer.cxx @@ -50,7 +50,7 @@ // Name : GraphicsView_Viewer // Purpose : Constructor //======================================================================= -GraphicsView_Viewer::GraphicsView_Viewer( const QString& title, QWidget* widget ) +GraphicsView_Viewer::GraphicsView_Viewer( const QString& /*title*/, QWidget* widget ) : SUIT_ViewModel(), mySelector( 0 ), myTransformer( 0 ), @@ -364,7 +364,7 @@ void GraphicsView_Viewer::handleKeyPress( QKeyEvent* e ) // Function : handleKeyRelease // Purpose : //================================================================ -void GraphicsView_Viewer::handleKeyRelease( QKeyEvent* e ) +void GraphicsView_Viewer::handleKeyRelease( QKeyEvent* /*e*/ ) //!< TODO: unused variable { } @@ -378,9 +378,9 @@ void GraphicsView_Viewer::handleMousePress( QGraphicsSceneMouseEvent* e ) if ( e->modifiers() & GraphicsView_ViewTransformer::accelKey() ) { Qt::MouseButton bs = e->button(); - if ( bs == GraphicsView_ViewTransformer::zoomButton() ) + if ( (int)bs == GraphicsView_ViewTransformer::zoomButton() ) // todo Qt::MouseButton is unsigned int: comparison of int with uint activateTransform( Zoom ); - else if ( bs == GraphicsView_ViewTransformer::panButton() ) + else if ( (int)bs == GraphicsView_ViewTransformer::panButton() ) // todo Qt::MouseButton is unsigned int: comparison of int with uint activateTransform( Pan ); } else // checking for other operations before selection in release event @@ -407,8 +407,8 @@ void GraphicsView_Viewer::handleMousePress( QGraphicsSceneMouseEvent* e ) else if( e->button() == Qt::LeftButton && !( aViewPort->currentBlock() & GraphicsView_ViewPort::BS_Selection ) && !aViewPort->getHighlightedObject() && - ( !aViewPort->isDraggingSelectedByLeftButton() || - aViewPort->isDraggingSelectedByLeftButton() && aViewPort->nbSelected() == 0 ) ) + ( ( !aViewPort->isDraggingSelectedByLeftButton() ) || + ( aViewPort->isDraggingSelectedByLeftButton() && aViewPort->nbSelected() == 0 ) ) ) { // Start rectangular selection if pulling was not started QPoint p = aViewPort->mapFromScene( e->scenePos() ); @@ -563,7 +563,7 @@ void GraphicsView_Viewer::handleWheel( QGraphicsSceneWheelEvent* e ) // Function : onSketchingFinished // Purpose : //================================================================ -void GraphicsView_Viewer::onSketchingFinished( QPainterPath thePath ) +void GraphicsView_Viewer::onSketchingFinished( QPainterPath /*thePath*/ ) { // testing ImageViewer //onTestCropOperatorPerform( thePath ); diff --git a/src/GuiHelpers/StandardApp_Module.cxx b/src/GuiHelpers/StandardApp_Module.cxx index 491a5b379..1f104aaef 100644 --- a/src/GuiHelpers/StandardApp_Module.cxx +++ b/src/GuiHelpers/StandardApp_Module.cxx @@ -138,9 +138,9 @@ int StandardApp_Module::createStandardAction(const QString& label, } // Creating the action - QAction * action= this->createAction( effIdentifier, label, actionIcon, - label, effToolTip, 0, getApp()->desktop(), - false, slotobject, slotmember); + this->createAction( effIdentifier, label, actionIcon, + label, effToolTip, 0, getApp()->desktop(), + false, slotobject, slotmember); return effIdentifier; } diff --git a/src/HelpBrowser/HelpBrowser.cxx b/src/HelpBrowser/HelpBrowser.cxx index 3a86c257a..120ce8a3f 100644 --- a/src/HelpBrowser/HelpBrowser.cxx +++ b/src/HelpBrowser/HelpBrowser.cxx @@ -162,7 +162,6 @@ int main( int argc, char **argv ) #if defined(WIN32) && defined(UNICODE) LPWSTR *szArglist = NULL; int nArgs; - int i; szArglist = CommandLineToArgvW(GetCommandLineW(), &nArgs); helpfile = QString::fromWCharArray(szArglist[nArgs-1]); // Free memory allocated for CommandLineToArgvW arguments. diff --git a/src/HelpBrowser/qtsingleapplication.h b/src/HelpBrowser/qtsingleapplication.h index cb2bfaf73..3a8493790 100644 --- a/src/HelpBrowser/qtsingleapplication.h +++ b/src/HelpBrowser/qtsingleapplication.h @@ -82,7 +82,7 @@ public: // Obsolete: void initialize(bool dummy = true) - { isRunning(); Q_UNUSED(dummy) } + { isRunning(); } public Q_SLOTS: bool sendMessage(const QString &message, int timeout = 5000); diff --git a/src/LightApp/LightApp_Application.cxx b/src/LightApp/LightApp_Application.cxx index 983648dcf..1aa01cf53 100644 --- a/src/LightApp/LightApp_Application.cxx +++ b/src/LightApp/LightApp_Application.cxx @@ -260,7 +260,7 @@ namespace int inputLen = input.length(); QDataStream anInputData( &input, QIODevice::ReadOnly ); while ( tmp < inputLen ) { - tmp = input.indexOf( QToolBarMarker, tmp + 1 ); + tmp = input.indexOf( (uchar)QToolBarMarker, tmp + 1 ); if ( tmp < 0 ) break; anInputData.device()->seek( tmp ); @@ -1854,7 +1854,7 @@ void LightApp_Application::onStudySaved( SUIT_Study* s ) } /*!Protected SLOT. On study closed.*/ -void LightApp_Application::onStudyClosed( SUIT_Study* s ) +void LightApp_Application::onStudyClosed( SUIT_Study* /*s*/ ) { /* disconnect( this, SIGNAL( viewManagerRemoved( SUIT_ViewManager* ) ), @@ -4937,7 +4937,7 @@ bool LightApp_Application::renameAllowed( const QString& /*entry*/) const { \param name new name of the object \brief Return \c true if rename operation finished successfully, \c false otherwise. */ -bool LightApp_Application::renameObject( const QString& entry, const QString& ) { +bool LightApp_Application::renameObject( const QString& /*entry*/, const QString& /*name*/ ) { return false; } @@ -5077,7 +5077,7 @@ QByteArray LightApp_Application::processState(QByteArray& input, return aRes; QDataStream anInputData(&input, QIODevice::ReadOnly); - int toolBarMarkerIndexDef; + int toolBarMarkerIndexDef = 0; if(hasDefaultState) { toolBarMarkerIndexDef = getToolbarMarkerIndex(defaultState, aNames); if(toolBarMarkerIndexDef < 0) diff --git a/src/LightApp/LightApp_DataModel.cxx b/src/LightApp/LightApp_DataModel.cxx index ba1cc711c..1d6be4f2a 100644 --- a/src/LightApp/LightApp_DataModel.cxx +++ b/src/LightApp/LightApp_DataModel.cxx @@ -55,7 +55,7 @@ LightApp_DataModel::~LightApp_DataModel() /*! Emit opened() */ -bool LightApp_DataModel::open( const QString&, CAM_Study* study, QStringList ) +bool LightApp_DataModel::open( const QString&, CAM_Study*, QStringList ) { emit opened(); //TODO: is it really needed? to be removed maybe... return true; diff --git a/src/LightApp/LightApp_DataObject.cxx b/src/LightApp/LightApp_DataObject.cxx index 9b3fa335d..4fd462b30 100644 --- a/src/LightApp/LightApp_DataObject.cxx +++ b/src/LightApp/LightApp_DataObject.cxx @@ -110,8 +110,8 @@ bool LightApp_DataObject::Key::isEqual( const SUIT_DataObjectKey* other ) const */ LightApp_DataObject::LightApp_DataObject( SUIT_DataObject* parent ) : CAM_DataObject( parent ), - myCompObject( 0 ), - myCompDataType( "" ) + myCompDataType( "" ), + myCompObject( 0 ) { } diff --git a/src/LightApp/LightApp_Driver.cxx b/src/LightApp/LightApp_Driver.cxx index ea9ba5952..13bc99a01 100644 --- a/src/LightApp/LightApp_Driver.cxx +++ b/src/LightApp/LightApp_Driver.cxx @@ -74,7 +74,7 @@ bool LightApp_Driver::SaveDatasInFile( const char* theFileName, bool isMultiFile for (it = myMap.begin(); it != myMap.end(); ++it) { aModuleName[i] = const_cast(it->first.c_str());//(it->first); aFileBufferSize += 4; //Add 4 bytes: a length of the module name - aFileBufferSize += strlen(aModuleName[i])+1; + aFileBufferSize += (int)strlen(aModuleName[i])+1; //!< TODO: conversion from size_t to int std::string aName(aModuleName[i]); PutFilesToStream(aName, aBuffer[i], aBufferSize[i], isMultiFile); aFileBufferSize += 8; //Add 8 bytes: a length of the buffer @@ -99,7 +99,7 @@ bool LightApp_Driver::SaveDatasInFile( const char* theFileName, bool isMultiFile int aBufferNameSize = 0; for (i = 0; i < n; i++) { - aBufferNameSize = strlen(aModuleName[i])+1; + aBufferNameSize = (int)strlen(aModuleName[i])+1; //!< TODO: conversion from size_t to int //Initialize 4 bytes of the buffer by 0 memset((aFileBuffer + aCurrentPos), 0, 4); //Copy the length of the module name to the buffer @@ -216,7 +216,7 @@ LightApp_Driver::ListOfFiles LightApp_Driver::GetListOfFiles( const char* theMod if (myMap.count(aName)) aListOfFiles = myMap[aName]; - return aListOfFiles; + return aListOfFiles; } /*! @@ -238,7 +238,7 @@ void LightApp_Driver::PutFilesToStream( const std::string& theModuleName, unsign // aFiles must contain temporary directory name in its first item // and names of files (relatively the temporary directory) in the others - int i, aLength = aFiles.size() - 1; + int i, aLength = (int)aFiles.size() - 1; //!< TODO: conversion size_t to int if(aLength <= 0) { theBufferSize = 0; theBuffer = new unsigned char[theBufferSize]; @@ -273,7 +273,7 @@ void LightApp_Driver::PutFilesToStream( const std::string& theModuleName, unsign aFileSize[i] = aFile.tellg(); aBufferSize += aFileSize[i]; //Add a space to store the file } - aFileNameSize[i] = strlen(aFName) + 1; + aFileNameSize[i] = (int)strlen(aFName) + 1; //!< TODO: conversion from size_t to int aBufferSize += aFileNameSize[i]; //Add a space to store the file name aBufferSize += (theNamesOnly)?4:12; //Add 4 bytes: a length of the file name, // 8 bytes: length of the file itself @@ -409,7 +409,7 @@ LightApp_Driver::ListOfFiles LightApp_Driver::PutStreamToFiles( const unsigned c */ void LightApp_Driver::RemoveFiles( const ListOfFiles& theFiles, const bool IsDirDeleted) { - int i, aLength = theFiles.size() - 1; + int i, aLength = (int)theFiles.size() - 1; //!< TODO: conversion size_t to int if(aLength <= 0) { return; } diff --git a/src/LightApp/LightApp_GVSelector.cxx b/src/LightApp/LightApp_GVSelector.cxx index 5cf89653d..61a18f96d 100644 --- a/src/LightApp/LightApp_GVSelector.cxx +++ b/src/LightApp/LightApp_GVSelector.cxx @@ -50,7 +50,7 @@ void LightApp_GVSelector::getSelection( SUIT_DataOwnerPtrList& theList ) const theList.append( new LightApp_DataOwner( aViewport->selectedObject()->getName() ) ); } -void LightApp_GVSelector::setSelection( const SUIT_DataOwnerPtrList& theList ) +void LightApp_GVSelector::setSelection( const SUIT_DataOwnerPtrList& /*theList*/ ) { } diff --git a/src/LightApp/LightApp_Module.cxx b/src/LightApp/LightApp_Module.cxx index da1d8a70c..ff19dc9c4 100644 --- a/src/LightApp/LightApp_Module.cxx +++ b/src/LightApp/LightApp_Module.cxx @@ -700,7 +700,7 @@ LightApp_Operation* LightApp_Module::operation( const int id ) const /*! virtual method called to manage the same operations */ -bool LightApp_Module::reusableOperation( const int id ) +bool LightApp_Module::reusableOperation( const int /*id*/ ) { return true; } diff --git a/src/LightApp/LightApp_OBSelector.cxx b/src/LightApp/LightApp_OBSelector.cxx index 6f94f1327..4a69a07a0 100644 --- a/src/LightApp/LightApp_OBSelector.cxx +++ b/src/LightApp/LightApp_OBSelector.cxx @@ -101,11 +101,13 @@ void LightApp_OBSelector::setModified() */ void LightApp_OBSelector::onSelectionChanged() { +#ifdef _DEBUG_ QTime t1 = QTime::currentTime(); +#endif mySelectedList.clear(); selectionChanged(); - QTime t2 = QTime::currentTime(); #ifdef _DEBUG_ + QTime t2 = QTime::currentTime(); qDebug( QString( "selection time = %1 msecs" ).arg( t1.msecsTo( t2 ) ).toLatin1().constData() ); #endif } diff --git a/src/LightApp/LightApp_Plot2dSelector.cxx b/src/LightApp/LightApp_Plot2dSelector.cxx index b80b701af..857985fe2 100644 --- a/src/LightApp/LightApp_Plot2dSelector.cxx +++ b/src/LightApp/LightApp_Plot2dSelector.cxx @@ -38,9 +38,10 @@ LightApp_Plot2dSelector::LightApp_Plot2dSelector( Plot2d_Viewer* v, SUIT_Selecti : SUIT_Selector( mgr, v ), myViewer(v) { - if ( v ) + if ( v ) { connect( v, SIGNAL( legendSelected( const QString& ) ), this, SLOT( onSelectionChanged( const QString& ) ) ); connect( v, SIGNAL( clearSelected() ), this, SLOT( onClearSelected( ) ) ); + } } /*! diff --git a/src/LightApp/LightApp_Study.cxx b/src/LightApp/LightApp_Study.cxx index c51f5bbdd..1a91cc437 100644 --- a/src/LightApp/LightApp_Study.cxx +++ b/src/LightApp/LightApp_Study.cxx @@ -167,7 +167,7 @@ bool LightApp_Study::saveDocumentAs( const QString& theFileName ) std::set aNewNames; std::set toRemove; - int i, n; + size_t i, n; for( i = 0, n = aNewList.size(); i < n; i++ ) aNewNames.insert( aNewList[ i ] ); for( i = 0, n = anOldList.size(); i < n; i++ ) @@ -319,7 +319,7 @@ bool LightApp_Study::isSaved() const /*! Creates SComponent for module, necessary for SalomeApp study */ -void LightApp_Study::addComponent(const CAM_DataModel* dm) +void LightApp_Study::addComponent(const CAM_DataModel* /*dm*/) { } @@ -349,7 +349,7 @@ void LightApp_Study::saveModuleData(QString theModuleName, int type, QStringList void LightApp_Study::openModuleData(QString theModuleName, int /*type*/, QStringList& theListOfFiles) { std::vector aListOfFiles = myDriver->GetListOfFiles(theModuleName.toLatin1().constData()); - int i, aLength = aListOfFiles.size() - 1; + int i, aLength = (int)aListOfFiles.size() - 1; //!< TODO: conversion size_t to int if (aLength < 0) return; diff --git a/src/LightApp/LightApp_SwitchOp.cxx b/src/LightApp/LightApp_SwitchOp.cxx index e22c1c627..8a8c68508 100644 --- a/src/LightApp/LightApp_SwitchOp.cxx +++ b/src/LightApp/LightApp_SwitchOp.cxx @@ -135,9 +135,8 @@ bool LightApp_SwitchOp::eventFilter( QObject* theObj, QEvent* theEv ) if ( !anOp->isActive() && anOp->isAutoResumed() && study() && !study()->blockingOperation( anOp ) ) study()->resume( anOp ); + break; } - break; - case QEvent::MouseButtonRelease: case QEvent::MouseButtonPress: case QEvent::MouseButtonDblClick: @@ -147,9 +146,10 @@ bool LightApp_SwitchOp::eventFilter( QObject* theObj, QEvent* theEv ) { if ( !anOp->isActive() ) return true; + break; } - break; - + default: + break; } } } diff --git a/src/LightApp/LightApp_VTKSelector.h b/src/LightApp/LightApp_VTKSelector.h index 9853e1f79..c5db9aaf0 100644 --- a/src/LightApp/LightApp_VTKSelector.h +++ b/src/LightApp/LightApp_VTKSelector.h @@ -80,7 +80,7 @@ class LIGHTAPP_EXPORT LightApp_SVTKDataOwner : public LightApp_DataOwner */ class LIGHTAPP_EXPORT LightApp_VTKSelector : public QObject, public SUIT_Selector { - Q_OBJECT; + Q_OBJECT public: virtual ~LightApp_VTKSelector() {}; diff --git a/src/OCCViewer/OCCViewer.h b/src/OCCViewer/OCCViewer.h index 173a7a1c8..f227a1fb3 100644 --- a/src/OCCViewer/OCCViewer.h +++ b/src/OCCViewer/OCCViewer.h @@ -45,6 +45,6 @@ namespace OCCViewer { OCCVIEWER_EXPORT Quantity_Color color( const QColor& ); OCCVIEWER_EXPORT QColor color( const Quantity_Color& ); -}; +} #endif //OCCVIEWER_H diff --git a/src/OCCViewer/OCCViewer_AISSelector.cxx b/src/OCCViewer/OCCViewer_AISSelector.cxx index 223dfb0b6..e814726b1 100644 --- a/src/OCCViewer/OCCViewer_AISSelector.cxx +++ b/src/OCCViewer/OCCViewer_AISSelector.cxx @@ -70,7 +70,7 @@ void OCCViewer_AISSelector::setHilightColor ( Quantity_NameOfColor color ) { myHilightColor = color; if ( !myAISContext.IsNull() ) { - const Handle(Graphic3d_HighlightStyle)& hStyle = myAISContext->HighlightStyle(); + const Handle(Prs3d_Drawer)& hStyle = myAISContext->HighlightStyle(); hStyle->SetColor( myHilightColor ); } } @@ -82,7 +82,7 @@ void OCCViewer_AISSelector::setSelectColor ( Quantity_NameOfColor color ) { mySelectColor = color; if ( !myAISContext.IsNull() ) { - const Handle(Graphic3d_HighlightStyle)& sStyle = myAISContext->SelectionStyle(); + const Handle(Prs3d_Drawer)& sStyle = myAISContext->SelectionStyle(); sStyle->SetColor( mySelectColor ); } } @@ -94,8 +94,8 @@ void OCCViewer_AISSelector::setAISContext ( const Handle (AIS_InteractiveContext { myAISContext = aisContext; if ( ! myAISContext.IsNull() ) { - const Handle(Graphic3d_HighlightStyle)& hStyle = myAISContext->HighlightStyle(); - const Handle(Graphic3d_HighlightStyle)& sStyle = myAISContext->SelectionStyle(); + const Handle(Prs3d_Drawer)& hStyle = myAISContext->HighlightStyle(); + const Handle(Prs3d_Drawer)& sStyle = myAISContext->SelectionStyle(); hStyle->SetColor( myHilightColor ); sStyle->SetColor( mySelectColor ); myAISContext->SetSubIntensityColor( Quantity_NOC_CYAN1 ); @@ -114,7 +114,7 @@ bool OCCViewer_AISSelector::checkSelection ( AIS_StatusOfPick status, if ( myAISContext.IsNull() ) return false; - myNumSelected = myAISContext->NbCurrents(); /* update after the last selection */ + myNumSelected = myAISContext->NbCurrents(); /* update after the last selection */ // todo: NbCurrents is deprecated if ( status == AIS_SOP_NothingSelected && !hadSelection ) { emit selSelectionCancel( addTo ); diff --git a/src/OCCViewer/OCCViewer_ClipPlane.cxx b/src/OCCViewer/OCCViewer_ClipPlane.cxx index 83a079aef..ffd572c2d 100644 --- a/src/OCCViewer/OCCViewer_ClipPlane.cxx +++ b/src/OCCViewer/OCCViewer_ClipPlane.cxx @@ -36,14 +36,14 @@ namespace result[1] = first[2]*second[0] - first[0]*second[2]; result[2] = first[0]*second[1] - first[1]*second[0]; } -}; +} OCCViewer_ClipPlane::OCCViewer_ClipPlane() -: X( 0.0 ), +: Mode( Absolute ), + IsOn( true ), + X( 0.0 ), Y( 0.0 ), - Z( 0.0 ), - Mode( Absolute ), - IsOn( true ) + Z( 0.0 ) { OrientationType = AbsoluteCustom; AbsoluteOrientation.Dx = 0.0; diff --git a/src/OCCViewer/OCCViewer_ClipPlaneInteractor.cxx b/src/OCCViewer/OCCViewer_ClipPlaneInteractor.cxx index 3b883d56b..8081b6b47 100644 --- a/src/OCCViewer/OCCViewer_ClipPlaneInteractor.cxx +++ b/src/OCCViewer/OCCViewer_ClipPlaneInteractor.cxx @@ -125,7 +125,7 @@ bool OCCViewer_ClipPlaneInteractor::isPerforming() const bool OCCViewer_ClipPlaneInteractor::isClickable( const Handle(AIS_Plane)& thePlane ) { bool isFound = Standard_False; - for ( int aPlaneIt = 0; aPlaneIt < myPlanes.size(); ++aPlaneIt ) + for ( int aPlaneIt = 0; aPlaneIt < (int)myPlanes.size(); ++aPlaneIt ) { if ( myPlanes[aPlaneIt] == thePlane ) { @@ -141,7 +141,7 @@ bool OCCViewer_ClipPlaneInteractor::isClickable( const Handle(AIS_Plane)& thePla Handle(AIS_InteractiveContext) anAISContext = myViewer->getAISContext(); - if ( anAISContext->IsSelected( Handle(AIS_InteractiveObject)::DownCast(thePlane) ) ) + if ( anAISContext->IsSelected( thePlane ) ) { return false; } @@ -156,7 +156,7 @@ bool OCCViewer_ClipPlaneInteractor::isClickable( const Handle(AIS_Plane)& thePla bool OCCViewer_ClipPlaneInteractor::isDraggable( const Handle(AIS_Plane)& thePlane ) { bool isFound = Standard_False; - for ( int aPlaneIt = 0; aPlaneIt < myPlanes.size(); ++aPlaneIt ) + for ( int aPlaneIt = 0; aPlaneIt < (int)myPlanes.size(); ++aPlaneIt ) { if ( myPlanes[aPlaneIt] == thePlane ) { @@ -172,7 +172,7 @@ bool OCCViewer_ClipPlaneInteractor::isDraggable( const Handle(AIS_Plane)& thePla Handle(AIS_InteractiveContext) anAISContext = myViewer->getAISContext(); - if ( !anAISContext->IsSelected( Handle(AIS_InteractiveObject)::DownCast(thePlane) ) ) + if ( !anAISContext->IsSelected( thePlane ) ) { return false; } @@ -323,10 +323,12 @@ bool OCCViewer_ClipPlaneInteractor::startDragging( const QPoint& thePickPos, myMouseDragPln = gp_Pln( aPickPoint, aMousePlnN ); + /* todo: aDistance2Center, aCenterOnMousePln not used Standard_Real aDistance2Center = myMouseDragPln.Distance( aPlaneCenter ); gp_Pnt aCenterOnMousePln = aMousePlnN * gp_Vec( aPickPoint, aPlaneCenter ) < 0.0 ? aPlaneCenter.Translated( aMousePlnN * aDistance2Center ) : aPlaneCenter.Translated( aMousePlnN * -aDistance2Center ); + */ myRotationAxis = gp_Ax1( myRotationCenter, aMousePlnN ); } @@ -336,10 +338,12 @@ bool OCCViewer_ClipPlaneInteractor::startDragging( const QPoint& thePickPos, myMouseDragPln = gp_Pln( aPickPoint, aMousePlnN ); + /* todo: aDistance2Center, aCenterOnMousePln not used Standard_Real aDistance2Center = myMouseDragPln.Distance( aPlaneCenter ); gp_Pnt aCenterOnMousePln = aMousePlnN * gp_Vec( aPickPoint, aPlaneCenter ) < 0.0 ? aPlaneCenter.Translated( aMousePlnN * aDistance2Center ) : aPlaneCenter.Translated( aMousePlnN * -aDistance2Center ); + */ myRotationAxis = gp_Ax1( myRotationCenter, aMousePlnN ); } @@ -348,6 +352,10 @@ bool OCCViewer_ClipPlaneInteractor::startDragging( const QPoint& thePickPos, return true; } + default: + { + break; + } } return false; @@ -450,6 +458,8 @@ void OCCViewer_ClipPlaneInteractor::performDragging( const QPoint& theDragPos, myViewer->getAISContext()->Update( thePlane , Standard_True ); } break; + default: + break; } } @@ -522,7 +532,7 @@ bool OCCViewer_ClipPlaneInteractor::mousePress( QMouseEvent* theEvent, // process mouse click on the object if ( myIsClickable ) { - myViewer->getAISContext()->SetSelected( Handle(AIS_InteractiveObject)::DownCast(aPlane) , Standard_True ); + myViewer->getAISContext()->SetSelected( aPlane, Standard_True ); emit planeClicked( aPlane ); } @@ -600,8 +610,8 @@ bool OCCViewer_ClipPlaneInteractor::mouseMove( QMouseEvent* theEvent, \param theEvent [in] the user event. \param theViewPort [in] the viewport. */ -bool OCCViewer_ClipPlaneInteractor::mouseRelease( QMouseEvent* theEvent, - OCCViewer_ViewPort3d* theViewPort ) +bool OCCViewer_ClipPlaneInteractor::mouseRelease( QMouseEvent* /*theEvent*/, + OCCViewer_ViewPort3d* /*theViewPort*/ ) { if ( !isPerforming() ) { @@ -625,8 +635,8 @@ bool OCCViewer_ClipPlaneInteractor::mouseRelease( QMouseEvent* theEvent, \param theEvent [in] the user event. \param theViewPort [in] the viewport. */ -bool OCCViewer_ClipPlaneInteractor::mouseDoubleClick( QMouseEvent* theEvent, - OCCViewer_ViewPort3d* theViewPort ) +bool OCCViewer_ClipPlaneInteractor::mouseDoubleClick( QMouseEvent* /*theEvent*/, + OCCViewer_ViewPort3d* /*theViewPort*/ ) { return isPerforming(); } diff --git a/src/OCCViewer/OCCViewer_ClippingDlg.cxx b/src/OCCViewer/OCCViewer_ClippingDlg.cxx index 4afd25da3..d15249450 100644 --- a/src/OCCViewer/OCCViewer_ClippingDlg.cxx +++ b/src/OCCViewer/OCCViewer_ClippingDlg.cxx @@ -791,7 +791,7 @@ void OCCViewer_ClippingDlg::setPlaneParam( OCCViewer_ClipPlane& thePlane ) void OCCViewer_ClippingDlg::synchronize() { ComboBoxPlanes->clear(); - int aNbPlanesAbsolute = myLocalPlanes.size(); + int aNbPlanesAbsolute = (int)myLocalPlanes.size(); QString aName; for(int i = 1; i<=aNbPlanesAbsolute; i++ ) { @@ -905,7 +905,7 @@ void OCCViewer_ClippingDlg::updatePreview() { gp_Pnt aBasePnt; gp_Dir aNormal; clipPlaneParams(aClipPlane, ic, aSize, aBasePnt, aNormal, myModel->trihedronSize()); - if(myPreviewPlaneVector.size() < clipPlanesCount()) { + if((int)myPreviewPlaneVector.size() < clipPlanesCount()) { //TODO: mismatch signed/unsigned myPreviewPlaneVector.resize(clipPlanesCount()); } myPreviewPlane = myPreviewPlaneVector[aCurPlaneIndex]; @@ -930,7 +930,7 @@ void OCCViewer_ClippingDlg::updatePreview() { ic->SetColor( myPreviewPlane, Quantity_Color( 255. / 255., 70. / 255., 0. / 255., Quantity_TOC_RGB ), false ); ic->Update( myPreviewPlane, Standard_False ); } else { - if(myPreviewPlaneVector.size() > aCurPlaneIndex ) { + if((int)myPreviewPlaneVector.size() > aCurPlaneIndex ) { myPreviewPlane = myPreviewPlaneVector[aCurPlaneIndex]; if(ic->IsDisplayed(myPreviewPlane)) { ic->Erase( myPreviewPlane, false ); @@ -939,7 +939,7 @@ void OCCViewer_ClippingDlg::updatePreview() { myPreviewPlaneVector[aCurPlaneIndex].Nullify(); } } - for(int i = 0; i < myPreviewPlaneVector.size(); i++) { + for(int i = 0; i < (int)myPreviewPlaneVector.size(); i++) {//TODO: mismatch signed/unsigned if( i == aCurPlaneIndex ) continue; if(!myPreviewPlaneVector[i].IsNull()) ic->SetColor( myPreviewPlaneVector[i], Quantity_Color( 85 / 255., 85 / 255., 255 / 255., Quantity_TOC_RGB ), false ); @@ -969,7 +969,7 @@ void OCCViewer_ClippingDlg::erasePreview() Handle(AIS_InteractiveContext) ic = myModel->getAISContext(); - for ( int i=0; i < myPreviewPlaneVector.size(); i++ ) { + for ( int i=0; i < (int)myPreviewPlaneVector.size(); i++ ) {//TODO: mismatch signed/unsigned Handle(AIS_Plane) myPreviewPlane = myPreviewPlaneVector[i]; if ( !myPreviewPlane.IsNull() && ic->IsDisplayed( myPreviewPlane ) ) { ic->Erase( myPreviewPlane, false ); @@ -1099,7 +1099,7 @@ void OCCViewer_ClippingDlg::ClickOnDelete() Handle(AIS_InteractiveContext) ic = myModel->getAISContext(); - if(aPlaneIndex+1 <= myPreviewPlaneVector.size()) { + if(aPlaneIndex+1 <= (int)myPreviewPlaneVector.size()) { Handle(AIS_Plane) myPreviewPlane = myPreviewPlaneVector[aPlaneIndex]; if ( !myPreviewPlane.IsNull() && ic->IsDisplayed( myPreviewPlane ) ) { ic->Erase( myPreviewPlane, false ); @@ -1227,7 +1227,7 @@ void OCCViewer_ClippingDlg::onSelectPlane ( int theIndex ) return; } - OCCViewer_ClipPlane& aClipPlane = getClipPlane( theIndex ); + //OCCViewer_ClipPlane& aClipPlane = getClipPlane( theIndex ); // unused myIsSelectPlane = true; updateControls(); @@ -1443,7 +1443,7 @@ void OCCViewer_ClippingDlg::onApply() */ void OCCViewer_ClippingDlg::onPlaneClicked( const Handle_AIS_Plane& thePlane ) { - for ( int aPlaneIt = 0; aPlaneIt < myPreviewPlaneVector.size(); aPlaneIt++ ) + for ( int aPlaneIt = 0; aPlaneIt < (int)myPreviewPlaneVector.size(); aPlaneIt++ ) { Handle(AIS_Plane)& aPlane = myPreviewPlaneVector.at( aPlaneIt ); if ( aPlane != thePlane ) @@ -1462,7 +1462,7 @@ void OCCViewer_ClippingDlg::onPlaneClicked( const Handle_AIS_Plane& thePlane ) */ void OCCViewer_ClippingDlg::onPlaneDragged( const Handle_AIS_Plane& thePlane ) { - for ( int aPlaneIt = 0; aPlaneIt < myPreviewPlaneVector.size(); aPlaneIt++ ) + for ( int aPlaneIt = 0; aPlaneIt < (int)myPreviewPlaneVector.size(); aPlaneIt++ ) { Handle(AIS_Plane)& aPlane = myPreviewPlaneVector.at( aPlaneIt ); if ( aPlane != thePlane ) diff --git a/src/OCCViewer/OCCViewer_CreateRestoreViewDlg.cxx b/src/OCCViewer/OCCViewer_CreateRestoreViewDlg.cxx index 144477d34..587777472 100644 --- a/src/OCCViewer/OCCViewer_CreateRestoreViewDlg.cxx +++ b/src/OCCViewer/OCCViewer_CreateRestoreViewDlg.cxx @@ -121,8 +121,6 @@ void OCCViewer_CreateRestoreViewDlg::changeImage( QListWidgetItem* curItem ) { if( curItem && ( curItem->flags() & Qt::ItemIsEditable ) ) { - int lowLevel = -1; - int highLevel = -1; int index = curItem->listWidget()->row( curItem ); Handle(V3d_View) aView3d = myCurViewPort->getView(); myCurrentItem = myParametersMap[ index ]; diff --git a/src/OCCViewer/OCCViewer_EnvTextureDlg.cxx b/src/OCCViewer/OCCViewer_EnvTextureDlg.cxx index 73342e85a..48af6c684 100644 --- a/src/OCCViewer/OCCViewer_EnvTextureDlg.cxx +++ b/src/OCCViewer/OCCViewer_EnvTextureDlg.cxx @@ -189,7 +189,6 @@ void OCCViewer_EnvTextureDlg::onTextureChanged() } else { myEnvTextureName->setText(""); - Graphic3d_NameOfTextureEnv aStandardTexture; QList aTextures; aTextures << Graphic3d_NOT_ENV_CLOUDS << Graphic3d_NOT_ENV_CV << Graphic3d_NOT_ENV_MEDIT << Graphic3d_NOT_ENV_PEARL << Graphic3d_NOT_ENV_SKY1 << Graphic3d_NOT_ENV_SKY2 diff --git a/src/OCCViewer/OCCViewer_LightSourceDlg.cxx b/src/OCCViewer/OCCViewer_LightSourceDlg.cxx index d51a5ca77..c32c38427 100644 --- a/src/OCCViewer/OCCViewer_LightSourceDlg.cxx +++ b/src/OCCViewer/OCCViewer_LightSourceDlg.cxx @@ -76,7 +76,6 @@ OCCViewer_LightSourceDlg::OCCViewer_LightSourceDlg( OCCViewer_ViewWindow* view, const double min = -RealLast(); const double max = RealLast(); - const int precision = 3; /********************** Directional light **********************/ /* Controls for directional light: @@ -303,7 +302,7 @@ void OCCViewer_LightSourceDlg::initParam( bool theIsDefault ) myModel->getViewer3d()->NextDefinedLights(); } - double aX, aY, aZ; + double aX=0., aY=0., aZ=0.; Quantity_Color aColor = aLight->Color(); if( myDirType->isChecked() ) { myDirColor->setColor( OCCViewer::color( aColor ) ); diff --git a/src/OCCViewer/OCCViewer_SetRotationPointDlg.cxx b/src/OCCViewer/OCCViewer_SetRotationPointDlg.cxx index c75b72a9e..ca25fb90b 100644 --- a/src/OCCViewer/OCCViewer_SetRotationPointDlg.cxx +++ b/src/OCCViewer/OCCViewer_SetRotationPointDlg.cxx @@ -44,7 +44,7 @@ \param modal - is this dialog modal \param fl - flags */ -OCCViewer_SetRotationPointDlg::OCCViewer_SetRotationPointDlg( OCCViewer_ViewWindow* view, const char* name, bool modal, Qt::WindowFlags fl ) +OCCViewer_SetRotationPointDlg::OCCViewer_SetRotationPointDlg( OCCViewer_ViewWindow* view, const char* /*name*/, bool modal, Qt::WindowFlags /*fl*/ ) : QDialog( view, Qt::WindowTitleHint | Qt::WindowSystemMenuHint ), myView( view ) { diff --git a/src/OCCViewer/OCCViewer_ToolTip.cxx b/src/OCCViewer/OCCViewer_ToolTip.cxx index 7fb2e76ae..e9efcd55f 100644 --- a/src/OCCViewer/OCCViewer_ToolTip.cxx +++ b/src/OCCViewer/OCCViewer_ToolTip.cxx @@ -74,7 +74,7 @@ void OCCViewer_ToolTip::setFont( const QFont& f ) \param txtRect - returned tooltip text rectangle \param rect - returned tooltip rectangle */ -void OCCViewer_ToolTip::onToolTip( QPoint p, QString& str, QFont& f, QRect& txtRect, QRect& rect ) +void OCCViewer_ToolTip::onToolTip( QPoint p, QString& str, QFont& /*f*/, QRect& txtRect, QRect& rect ) { OCCViewer_Viewer* v = dynamic_cast( myWnd->getViewManager()->getViewModel() ); Handle( AIS_InteractiveContext ) aCont = v->getAISContext(); diff --git a/src/OCCViewer/OCCViewer_Utilities.cxx b/src/OCCViewer/OCCViewer_Utilities.cxx index e19e08cd5..0d37c0567 100644 --- a/src/OCCViewer/OCCViewer_Utilities.cxx +++ b/src/OCCViewer/OCCViewer_Utilities.cxx @@ -119,6 +119,8 @@ OCCViewer_ViewWindow::Mode2dType OCCViewer_Utilities::setViewer2DMode case OCCViewer_ViewWindow::YZPlane: aView3d->SetProj (V3d_Xpos); break; + default: + break; } } diff --git a/src/OCCViewer/OCCViewer_VService.cxx b/src/OCCViewer/OCCViewer_VService.cxx index 4ede419bb..d07e32f61 100644 --- a/src/OCCViewer/OCCViewer_VService.cxx +++ b/src/OCCViewer/OCCViewer_VService.cxx @@ -57,27 +57,10 @@ Handle(Aspect_Window) OCCViewer_VService::CreateWindow( const Handle(V3d_View)& /*! Creates viewer 3d [ static ] */ -Handle(V3d_Viewer) OCCViewer_VService::CreateViewer( const Standard_ExtString name, - const Standard_CString displayName, - const Standard_CString domain, - const Standard_Real viewSize , - const V3d_TypeOfOrientation viewProjection, - const Standard_Boolean computedMode, - const Standard_Boolean defaultComputedMode ) +Handle(V3d_Viewer) OCCViewer_VService::CreateViewer() { static Handle(OpenGl_GraphicDriver) aGraphicDriver; if (aGraphicDriver.IsNull()) - { - Handle(Aspect_DisplayConnection) aDisplayConnection; -#if !defined WIN32 && !defined __APPLE__ - aDisplayConnection = new Aspect_DisplayConnection( displayName ); -#else - aDisplayConnection = new Aspect_DisplayConnection(); -#endif - aGraphicDriver = new OpenGl_GraphicDriver(aDisplayConnection); - } - - return new V3d_Viewer( aGraphicDriver, name, domain, viewSize, viewProjection, - Quantity_NOC_GRAY30, V3d_ZBUFFER, V3d_GOURAUD, - computedMode, defaultComputedMode ); + aGraphicDriver = new OpenGl_GraphicDriver(new Aspect_DisplayConnection()); + return new V3d_Viewer(aGraphicDriver); } diff --git a/src/OCCViewer/OCCViewer_VService.h b/src/OCCViewer/OCCViewer_VService.h index e1c966c58..b8fb91c04 100644 --- a/src/OCCViewer/OCCViewer_VService.h +++ b/src/OCCViewer/OCCViewer_VService.h @@ -37,16 +37,8 @@ class Standard_EXPORT OCCViewer_VService { public: - static Handle(Aspect_Window) CreateWindow( const Handle(V3d_View)&, WId ); - - static Handle(V3d_Viewer) CreateViewer( const Standard_ExtString, - const Standard_CString = "", - const Standard_CString = "", - const Quantity_Length = 1000.0, - const V3d_TypeOfOrientation = V3d_XposYnegZpos, - const Standard_Boolean = Standard_True, - const Standard_Boolean = Standard_True ); + static Handle(V3d_Viewer) CreateViewer(); }; #endif diff --git a/src/OCCViewer/OCCViewer_ViewFrame.cxx b/src/OCCViewer/OCCViewer_ViewFrame.cxx index e69020f42..f9ed085d9 100644 --- a/src/OCCViewer/OCCViewer_ViewFrame.cxx +++ b/src/OCCViewer/OCCViewer_ViewFrame.cxx @@ -37,7 +37,7 @@ #include OCCViewer_ViewFrame::OCCViewer_ViewFrame(SUIT_Desktop* theDesktop, OCCViewer_Viewer* theModel) - : OCCViewer_ViewWindow( theDesktop, theModel ), myPopupRequestedView(0), mySplitMode(-1) + : OCCViewer_ViewWindow( theDesktop, theModel ), mySplitMode(-1), myPopupRequestedView(0) { QFrame* centralFrame = new QFrame( this ); setCentralWidget( centralFrame ); @@ -193,7 +193,7 @@ void OCCViewer_ViewFrame::splitSubViews() if( mySplitMode == -1 ) return; - int aNbViews; + int aNbViews = 1; if ( mySplitMode >= 0 && mySplitMode < 2) aNbViews = 2; else if( mySplitMode >= 2 && mySplitMode < 8 ) @@ -202,7 +202,7 @@ void OCCViewer_ViewFrame::splitSubViews() aNbViews = 4; if( aNbViews != myViewsMode.count() ) - return; + return; int SubViews3Map[6][3][4] = { { {0,0,1,1}, {0,1,1,1}, {0,2,1,1} }, diff --git a/src/OCCViewer/OCCViewer_ViewFrame.h b/src/OCCViewer/OCCViewer_ViewFrame.h index d216935bf..f5684a1fd 100644 --- a/src/OCCViewer/OCCViewer_ViewFrame.h +++ b/src/OCCViewer/OCCViewer_ViewFrame.h @@ -145,15 +145,15 @@ public slots: virtual void activateRotation() {} virtual void activatePanning() {} virtual void activateGlobalPanning() {} - virtual void onSetRotationPoint( bool on ) {} + virtual void onSetRotationPoint( bool /*on*/ ) {} virtual void onAxialScale() {} virtual void onAmbientToogle() {} virtual void onMemorizeView() {} virtual void onRestoreView() {} - virtual void onSwitchInteractionStyle( bool on ) {} + virtual void onSwitchInteractionStyle( bool /*on*/ ) {} virtual void activateSetRotationGravity() {} - virtual void activateSetRotationSelected( double theX, double theY, double theZ ) {} + virtual void activateSetRotationSelected( double /*theX*/, double /*theY*/, double /*theZ*/ ) {} virtual void activateStartPointSelection( TopAbs_ShapeEnum ) {} virtual void updateGravityCoords() {} diff --git a/src/OCCViewer/OCCViewer_ViewModel.cxx b/src/OCCViewer/OCCViewer_ViewModel.cxx index 49adfd65b..be6a7dea8 100644 --- a/src/OCCViewer/OCCViewer_ViewModel.cxx +++ b/src/OCCViewer/OCCViewer_ViewModel.cxx @@ -122,15 +122,15 @@ void OCCViewer_Viewer::stereoData( QStringList& typeList, QIntList& idList) */ OCCViewer_Viewer::OCCViewer_Viewer( bool DisplayTrihedron) : SUIT_ViewModel(), - myBackgrounds(4, Qtx::BackgroundData( Qt::black )), myIsRelative(true), - myTopLayerId( 0 ), + myTopLayerId(0), myTrihedronSize(100), - myClippingDlg (NULL), + myBackgrounds(4, Qtx::BackgroundData(Qt::black)), + myClippingDlg(0), myFitter(0) { // init CasCade viewers - myV3dViewer = OCCViewer_VService::CreateViewer( TCollection_ExtendedString("Viewer3d").ToExtString() ); + myV3dViewer = OCCViewer_VService::CreateViewer(); //myV3dViewer->Init(); // to avoid creation of the useless perspective view (see OCCT issue 0024267) setDefaultLights(); @@ -161,9 +161,9 @@ OCCViewer_Viewer::OCCViewer_Viewer( bool DisplayTrihedron) Handle(Prs3d_Drawer) drawer = myTrihedron->Attributes(); if (drawer->HasOwnDatumAspect()) { Handle(Prs3d_DatumAspect) daspect = drawer->DatumAspect(); - daspect->FirstAxisAspect()->SetColor(Quantity_Color(1.0, 0.0, 0.0, Quantity_TOC_RGB)); - daspect->SecondAxisAspect()->SetColor(Quantity_Color(0.0, 1.0, 0.0, Quantity_TOC_RGB)); - daspect->ThirdAxisAspect()->SetColor(Quantity_Color(0.0, 0.0, 1.0, Quantity_TOC_RGB)); + daspect->LineAspect(Prs3d_DP_XAxis)->SetColor(Quantity_Color(1.0, 0.0, 0.0, Quantity_TOC_RGB)); + daspect->LineAspect(Prs3d_DP_YAxis)->SetColor(Quantity_Color(0.0, 1.0, 0.0, Quantity_TOC_RGB)); + daspect->LineAspect(Prs3d_DP_ZAxis)->SetColor(Quantity_Color(0.0, 0.0, 1.0, Quantity_TOC_RGB)); } } @@ -322,7 +322,7 @@ void OCCViewer_Viewer::setViewManager(SUIT_ViewManager* theViewManager) /*! SLOT: called on mouse button press, stores current mouse position as start point for transformations */ -void OCCViewer_Viewer::onMousePress(SUIT_ViewWindow* theWindow, QMouseEvent* theEvent) +void OCCViewer_Viewer::onMousePress(SUIT_ViewWindow* /*theWindow*/, QMouseEvent* theEvent) { myStartPnt.setX(theEvent->x()); myStartPnt.setY(theEvent->y()); } @@ -373,7 +373,7 @@ void OCCViewer_Viewer::onMouseRelease(SUIT_ViewWindow* theWindow, QMouseEvent* t if (myStartPnt == myEndPnt) { if (!aHasShift) { - myAISContext->ClearCurrents( false ); + myAISContext->ClearCurrents( false ); // todo: ClearCurrents is deprecated emit deselection(); } if ( !isPreselectionEnabled() ) { @@ -432,7 +432,7 @@ void OCCViewer_Viewer::onKeyPress(SUIT_ViewWindow* theWindow, QKeyEvent* theEven switch ( theEvent->key() ) { case Qt::Key_S: if (!aHasShift) { - myAISContext->ClearCurrents( false ); + myAISContext->ClearCurrents( false ); // todo: ClearCurrents is deprecated emit deselection(); } @@ -1187,7 +1187,7 @@ bool OCCViewer_Viewer::unHighlightAll( bool updateviewer, bool unselect ) \param onlyInViewer - search object only in viewer (so object must be displayed) */ bool OCCViewer_Viewer::isInViewer( const Handle(AIS_InteractiveObject)& obj, - bool onlyInViewer ) + bool /*onlyInViewer*/ ) { AIS_ListOfInteractive List; myAISContext->DisplayedObjects(List); @@ -1314,7 +1314,6 @@ void OCCViewer_Viewer::setTrihedronShown( const bool on ) 0 /*wireframe*/, -1 /* selection mode */, Standard_True /* update viewer*/, - Standard_False /* allow decomposition */, AIS_DS_Displayed /* display status */); myAISContext->Deactivate( myTrihedron ); } @@ -1451,7 +1450,7 @@ bool OCCViewer_Viewer::computeTrihedronSize( double& theNewSize, double& theSize float aSizeInPercents = SUIT_Session::session()->resourceMgr()->doubleValue("3DViewer","trihedron_size", 100.); - static float EPS = 5.0E-3; + static float EPS = 5.0E-3f; theSize = getTrihedron()->Size(); theNewSize = aMaxSide*aSizeInPercents / 100.0; @@ -1570,7 +1569,7 @@ void OCCViewer_Viewer::setClipPlanes(ClipPlanesList theList) Handle(AIS_InteractiveObject) anObj = anIter.Value(); Handle(ViewerData_AISShape) aShape = Handle(ViewerData_AISShape)::DownCast (anObj); if (!aShape.IsNull() && aShape->IsClippable()) { - aShape->SetClipPlanes(myInternalClipPlanes); + aShape->SetClipPlanes(new Graphic3d_SequenceOfHClipPlane(myInternalClipPlanes)); // todo: store clipping planes in a handle? } } } @@ -1589,7 +1588,7 @@ void OCCViewer_Viewer::applyExistingClipPlanesToObject (const Handle(AIS_Interac Handle(ViewerData_AISShape) aShape = Handle(ViewerData_AISShape)::DownCast (theObject); if (!aShape.IsNull() && aShape->IsClippable()) { - aShape->SetClipPlanes (myInternalClipPlanes); + aShape->SetClipPlanes (new Graphic3d_SequenceOfHClipPlane(myInternalClipPlanes)); // todo: store clipping planes in a handle? } } diff --git a/src/OCCViewer/OCCViewer_ViewPort3d.cxx b/src/OCCViewer/OCCViewer_ViewPort3d.cxx index c9f5905fa..e1b865986 100644 --- a/src/OCCViewer/OCCViewer_ViewPort3d.cxx +++ b/src/OCCViewer/OCCViewer_ViewPort3d.cxx @@ -64,8 +64,8 @@ static Standard_Boolean zRotation = Standard_False; */ OCCViewer_ViewPort3d::OCCViewer_ViewPort3d( QWidget* parent, const Handle( V3d_Viewer)& viewer, V3d_TypeOfView type ) : OCCViewer_ViewPort( parent ), - myScale( 1.0 ), myBusy( true ), + myScale( 1.0 ), myIsAdvancedZoomingEnabled( false ) { // VSR: 01/07/2010 commented to avoid SIGSEGV at SALOME exit @@ -470,7 +470,7 @@ void OCCViewer_ViewPort3d::startRotation( int x, int y, theSelectedPoint.X(),theSelectedPoint.Y(), theSelectedPoint.Z(), Standard_True ); - Quantity_Ratio zRotationThreshold; + Standard_Real zRotationThreshold; zRotation = Standard_False; zRotationThreshold = 0.45; if( zRotationThreshold > 0. ) { @@ -580,7 +580,7 @@ void OCCViewer_ViewPort3d::repaintViewAfterMove( ) /*! Fits all objects in view. [ virtual protected ] */ -void OCCViewer_ViewPort3d::fitAll( bool keepScale, bool withZ, bool upd ) +void OCCViewer_ViewPort3d::fitAll( bool keepScale, bool /*withZ*/, bool upd ) { if ( activeView().IsNull() ) return; diff --git a/src/OCCViewer/OCCViewer_ViewSketcher.cxx b/src/OCCViewer/OCCViewer_ViewSketcher.cxx index 6e2cbc007..4a60b76cc 100644 --- a/src/OCCViewer/OCCViewer_ViewSketcher.cxx +++ b/src/OCCViewer/OCCViewer_ViewSketcher.cxx @@ -256,7 +256,7 @@ void OCCViewer_RectSketcher::onMouse( QMouseEvent* e ) else avp->setCursor( Qt::ForbiddenCursor ); - if ( e->type() == QEvent::MouseButtonRelease && e->button() == sketchButton() ) + if ( e->type() == QEvent::MouseButtonRelease && (int)e->button() == sketchButton() ) // todo Qt::MouseButton is unsigned int: comparison of int with uint { myResult = Accept; QApplication::postEvent( avp, new QMouseEvent( e->type(), e->pos(), @@ -554,7 +554,7 @@ bool OCCViewer_PolygonSketcher::isValid( const QPolygon* aPoints, const QPoint& return true; bool res = true; - for ( uint i = 0; i < aPoints->count() - 1 && res; i++ ) + for ( int i = 0; i < aPoints->count() - 1 && res; i++ ) { const QPoint& aStart = aPoints->point( i ); const QPoint& anEnd = aPoints->point( i + 1 ); diff --git a/src/OCCViewer/OCCViewer_ViewSketcher.h b/src/OCCViewer/OCCViewer_ViewSketcher.h index d533fe322..4d6e44d41 100644 --- a/src/OCCViewer/OCCViewer_ViewSketcher.h +++ b/src/OCCViewer/OCCViewer_ViewSketcher.h @@ -70,7 +70,7 @@ public: virtual bool isDefault() const; virtual bool eventFilter( QObject*, QEvent* ); - virtual void setSketcherMode(int theMode) {} + virtual void setSketcherMode(int) {} virtual int sketcherMode() const { return 0; } private slots: diff --git a/src/OCCViewer/OCCViewer_ViewWindow.cxx b/src/OCCViewer/OCCViewer_ViewWindow.cxx index 104a964be..0dc30dbc6 100644 --- a/src/OCCViewer/OCCViewer_ViewWindow.cxx +++ b/src/OCCViewer/OCCViewer_ViewWindow.cxx @@ -319,6 +319,8 @@ void OCCViewer_ViewWindow::initLayout() case YZPlane: onFrontView(); break; + default: + break; } // Graduated axes dialog @@ -716,11 +718,10 @@ bool OCCViewer_ViewWindow::computeGravityCenter( double& theX, double& theY, dou if ( aStructure->IsEmpty() || !aStructure->IsVisible() || aStructure->CStructure()->IsForHighlight ) continue; - Bnd_Box aBox1 = aStructure->MinMaxValues(); const Graphic3d_BndBox3d& aBox = aStructure->CStructure()->BoundingBox(); if (!aBox.IsValid()) continue; - aXmin = /*aBox.IsVoid() ? RealFirst() :*/ aBox.CornerMin().x(); + aXmin = /*aBox.IsVoid() ? RealFirst() : */aBox.CornerMin().x(); aYmin = /*aBox.IsVoid() ? RealFirst() : */aBox.CornerMin().y(); aZmin = /*aBox.IsVoid() ? RealFirst() : */aBox.CornerMin().z(); aXmax = /*aBox.IsVoid() ? RealLast() : */aBox.CornerMax().x(); @@ -984,7 +985,7 @@ void OCCViewer_ViewWindow::vpMouseMoveEvent( QMouseEvent* theEvent ) int aButton = theEvent->buttons(); int anInteractionStyle = interactionStyle(); if ( ( anInteractionStyle == SUIT_ViewModel::STANDARD && - aButton == Qt::LeftButton && ( aState == Qt::NoModifier || Qt::ShiftModifier ) ) || + aButton == Qt::LeftButton && ( aState == Qt::NoModifier || aState == Qt::ShiftModifier ) ) || ( anInteractionStyle == SUIT_ViewModel::KEY_FREE && aButton == Qt::LeftButton && ( aState == Qt::ControlModifier || aState == ( Qt::ControlModifier|Qt::ShiftModifier ) ) ) ) { myDrawRect = myEnableDrawMode; @@ -1111,6 +1112,8 @@ void OCCViewer_ViewWindow::vpMouseReleaseEvent(QMouseEvent* theEvent) resetState(); } break; + default: + break; } // NOTE: viewer 3D detects a rectangle of selection using this event @@ -2398,9 +2401,9 @@ QImage OCCViewer_ViewWindow::dumpView() #endif // USE_OLD_IMPLEMENTATION } -bool OCCViewer_ViewWindow::dumpViewToFormat( const QImage& img, +bool OCCViewer_ViewWindow::dumpViewToFormat( const QImage& /*img*/, const QString& fileName, - const QString& format ) + const QString& /*format*/ ) { bool res = false; QApplication::setOverrideCursor( Qt::WaitCursor ); @@ -2618,7 +2621,7 @@ QString OCCViewer_ViewWindow::getVisualParameters() data << QString( "size=%1" ) .arg( params.size, 0, 'f', 2 ); ClipPlanesList aPlanes = myModel->getClipPlanes(); - for ( int i=0; i < aPlanes.size(); i++ ) + for ( int i=0; i < (int)aPlanes.size(); i++ ) { OCCViewer_ClipPlane& aPlane = aPlanes[i]; QString ClippingPlane = QString( "ClippingPlane%1=").arg( i+1 ); @@ -2739,6 +2742,8 @@ QString OCCViewer_ViewWindow::getVisualParameters() Handle(V3d_DirectionalLight)::DownCast( aLight )->Direction( aX, aY, aZ ); else if ( aLight->Type() == V3d_POSITIONAL ) Handle(V3d_PositionalLight)::DownCast( aLight )->Position( aX, aY, aZ ); + else + continue; // not supported type of light source LightSource += QString( "lightX~%1;" ).arg( aX ); LightSource += QString( "lightY~%1;" ).arg( aY ); LightSource += QString( "lightZ~%1;" ).arg( aZ ); @@ -2914,10 +2919,10 @@ void OCCViewer_ViewWindow::setVisualParameters( const QString& parameters ) myModel->getViewer3d()->NextDefinedLights(); } } - double aX, aY, aZ; - double cR, cG, cB; - V3d_TypeOfLight aType; - bool isHeadlight; + double aX = 0., aY = 0., aZ = 0.; + double cR = 0., cG = 0., cB = 0.; + V3d_TypeOfLight aType = (V3d_TypeOfLight)-1; // not specified + bool isHeadlight = false; QStringList lsData = paramValue.split( ';' ); foreach( QString lsParam, lsData ) { @@ -3622,7 +3627,7 @@ void OCCViewer_ViewWindow::synchronize( SUIT_ViewWindow* theView ) aDestView->SetImmediateUpdate( Standard_True ); aDestView->Redraw(); } - catch (Standard_Failure) { + catch (Standard_Failure&) { } blockSignals( blocked ); @@ -3763,7 +3768,7 @@ void OCCViewer_ViewWindow::projAndPanToGravity(V3d_TypeOfOrientation CamOri) if( USE_XY ) { const double EPS = 1E-6; - int xp = myViewPort->width()/2, yp = myViewPort->height()/2, xp1, yp1; + int xp = myViewPort->width()/2, yp = myViewPort->height()/2; aView3d->Convert( xp, yp, X, Y, Z ); gp_Dir d = aView3d->Camera()->Direction(); diff --git a/src/PVServerService/ServiceLoader/PVServer_ServiceLoader.cxx b/src/PVServerService/ServiceLoader/PVServer_ServiceLoader.cxx index b8a3933f6..65f841bb8 100644 --- a/src/PVServerService/ServiceLoader/PVServer_ServiceLoader.cxx +++ b/src/PVServerService/ServiceLoader/PVServer_ServiceLoader.cxx @@ -26,7 +26,7 @@ #include #include CORBA_CLIENT_HEADER(SALOME_ContainerManager) -PVServer_ServiceLoader::PVServer_ServiceLoader() throw(PVServer_ServiceLoader_Exception): +PVServer_ServiceLoader::PVServer_ServiceLoader(): myLcc( 0 ) { try diff --git a/src/PVServerService/ServiceLoader/PVServer_ServiceLoader.h b/src/PVServerService/ServiceLoader/PVServer_ServiceLoader.h index 430233824..877318572 100644 --- a/src/PVServerService/ServiceLoader/PVServer_ServiceLoader.h +++ b/src/PVServerService/ServiceLoader/PVServer_ServiceLoader.h @@ -33,8 +33,8 @@ class PVSERVERSERVICELOADER_EXPORT PVServer_ServiceLoader_Exception: public std: { public: PVServer_ServiceLoader_Exception(const std::string & what):_what(what) {} - ~PVServer_ServiceLoader_Exception() throw () {} - virtual const char* what() const throw() { return _what.c_str(); } + ~PVServer_ServiceLoader_Exception() noexcept {} + virtual const char* what() const noexcept { return _what.c_str(); } private: std::string _what; }; @@ -42,7 +42,7 @@ private: class PVSERVERSERVICELOADER_EXPORT PVServer_ServiceLoader { public: - PVServer_ServiceLoader() throw(PVServer_ServiceLoader_Exception); + PVServer_ServiceLoader() ; virtual ~PVServer_ServiceLoader(); //! Get the IOR of the CORBA service handling the PVServer diff --git a/src/PVViewer/PVViewer_Behaviors.cxx b/src/PVViewer/PVViewer_Behaviors.cxx index 80f4dfabf..b2302b1f1 100644 --- a/src/PVViewer/PVViewer_Behaviors.cxx +++ b/src/PVViewer/PVViewer_Behaviors.cxx @@ -60,7 +60,7 @@ PVViewer_Behaviors::PVViewer_Behaviors(QMainWindow * parent) * This method should be updated at each new version of ParaView with what is found in * Qt/ApplicationComponents/pqParaViewBehaviors.cxx */ -void PVViewer_Behaviors::instanciateMinimalBehaviors(QMainWindow * desk) +void PVViewer_Behaviors::instanciateMinimalBehaviors(QMainWindow * /*desk*/) { if (BehaviorLoadingLevel < 1) { diff --git a/src/PVViewer/PVViewer_Core.cxx b/src/PVViewer/PVViewer_Core.cxx index 2f34196e6..06730898a 100644 --- a/src/PVViewer/PVViewer_Core.cxx +++ b/src/PVViewer/PVViewer_Core.cxx @@ -60,7 +60,7 @@ pqPVApplicationCore * PVViewer_Core::GetPVApplication() \param fullSetup whether to instanciate all behaviors or just the minimal ones. \return \c true if ParaView has been initialized successfully, otherwise false */ -bool PVViewer_Core::ParaviewInitApp(QMainWindow * aDesktop) +bool PVViewer_Core::ParaviewInitApp(QMainWindow * /*aDesktop*/) { if ( ! MyCoreApp) { // Obtain command-line arguments diff --git a/src/PVViewer/PVViewer_OutputWindow.cxx b/src/PVViewer/PVViewer_OutputWindow.cxx index 878187082..43dac1272 100644 --- a/src/PVViewer/PVViewer_OutputWindow.cxx +++ b/src/PVViewer/PVViewer_OutputWindow.cxx @@ -21,7 +21,7 @@ #include -vtkStandardNewMacro(PVViewer_OutputWindow); +vtkStandardNewMacro(PVViewer_OutputWindow) PVViewer_OutputWindow::PVViewer_OutputWindow() { @@ -31,27 +31,27 @@ PVViewer_OutputWindow::~PVViewer_OutputWindow() { } -const unsigned int PVViewer_OutputWindow::getTextCount() +unsigned int PVViewer_OutputWindow::getTextCount() const { return count(MESSAGE_TYPE_TEXT); } -const unsigned int PVViewer_OutputWindow::getErrorCount() +unsigned int PVViewer_OutputWindow::getErrorCount() const { return count(MESSAGE_TYPE_ERROR); } -const unsigned int PVViewer_OutputWindow::getWarningCount() +unsigned int PVViewer_OutputWindow::getWarningCount() const { return count(MESSAGE_TYPE_WARNING); } -const unsigned int PVViewer_OutputWindow::getGenericWarningCount() +unsigned int PVViewer_OutputWindow::getGenericWarningCount() const { return count(MESSAGE_TYPE_GENERIC_WARNING); } -const unsigned int PVViewer_OutputWindow::getDebugCount() +unsigned int PVViewer_OutputWindow::getDebugCount() const { return count(MESSAGE_TYPE_DEBUG); } @@ -79,7 +79,7 @@ void PVViewer_OutputWindow::DisplayText(const char* text) } } -int PVViewer_OutputWindow::count(const MessageTypes& type) +int PVViewer_OutputWindow::count(const MessageTypes& type) const { return myCounter.value(type, 0); } diff --git a/src/PVViewer/PVViewer_OutputWindow.h b/src/PVViewer/PVViewer_OutputWindow.h index 2e1acd096..79df51291 100644 --- a/src/PVViewer/PVViewer_OutputWindow.h +++ b/src/PVViewer/PVViewer_OutputWindow.h @@ -38,18 +38,18 @@ class PVVIEWER_EXPORT PVViewer_OutputWindow : public vtkOutputWindow { public: static PVViewer_OutputWindow* New(); - vtkTypeMacro(PVViewer_OutputWindow, vtkOutputWindow); + vtkTypeMacro(PVViewer_OutputWindow, vtkOutputWindow) //! Returns the number of text messages received - const unsigned int getTextCount(); + unsigned int getTextCount() const; //! Returns the number of error messages received - const unsigned int getErrorCount(); + unsigned int getErrorCount() const; //! Returns the number of warning messages received - const unsigned int getWarningCount(); + unsigned int getWarningCount() const; //! Returns the number of generic warning messages received - const unsigned int getGenericWarningCount(); + unsigned int getGenericWarningCount() const; //! Returns the number of debug messages received - const unsigned int getDebugCount(); + unsigned int getDebugCount() const; private: PVViewer_OutputWindow(); @@ -60,7 +60,7 @@ private: QMap myCounter; void DisplayText(const char*); - int count(const MessageTypes&); + int count(const MessageTypes&) const; }; #endif // PVVIEWER_OUTPUTWINDOW_H diff --git a/src/Plot2d/Plot2d.cxx b/src/Plot2d/Plot2d.cxx index 2b79a0772..91fc80150 100644 --- a/src/Plot2d/Plot2d.cxx +++ b/src/Plot2d/Plot2d.cxx @@ -47,7 +47,7 @@ Plot2d_Point::Plot2d_Point() Constructor */ Plot2d_Point::Plot2d_Point( double theX, double theY, const QString& theText ) - : x( theX ), y( theY ), text( theText ), deviationPtr(0) + : x( theX ), y( theY ), deviationPtr(0), text( theText ) { } diff --git a/src/Plot2d/Plot2d_AnalyticalCurve.cxx b/src/Plot2d/Plot2d_AnalyticalCurve.cxx index 893af1668..ca9e79192 100644 --- a/src/Plot2d/Plot2d_AnalyticalCurve.cxx +++ b/src/Plot2d/Plot2d_AnalyticalCurve.cxx @@ -44,9 +44,9 @@ Plot2d_AnalyticalCurve::Plot2d_AnalyticalCurve() : myMarkerSize( 0 ), myLine( Plot2d::Solid ), myLineWidth( 0 ), + myNbIntervals(100), myRangeBegin(0.0), myRangeEnd(100.0), - myNbIntervals(100), myExpression(""), myAction(Plot2d_AnalyticalCurve::ActAddInView), myState(Plot2d_AnalyticalCurve::StateNeedUpdate), diff --git a/src/Plot2d/Plot2d_AnalyticalParser.cxx b/src/Plot2d/Plot2d_AnalyticalParser.cxx index 80d788313..474177fe7 100644 --- a/src/Plot2d/Plot2d_AnalyticalParser.cxx +++ b/src/Plot2d/Plot2d_AnalyticalParser.cxx @@ -58,13 +58,13 @@ namespace { static PyMethodDef PyStdOut_methods[] = { {"write", (PyCFunction)PyStdOut_write, METH_VARARGS, PyDoc_STR("write(string) -> None")}, - {NULL, NULL} /* sentinel */ + {0, 0, 0, 0} /* sentinel */ }; static PyMemberDef PyStdOut_memberlist[] = { {(char*)"softspace", T_INT, offsetof(PyStdOut, softspace), 0, (char*)"flag indicating that a space needs to be printed; used by print"}, - {NULL} /* Sentinel */ + {0, 0, 0, 0, 0} /* sentinel */ }; static PyTypeObject PyStdOut_Type = { diff --git a/src/Plot2d/Plot2d_NormalizeAlgorithm.cxx b/src/Plot2d/Plot2d_NormalizeAlgorithm.cxx index 55096fa9e..cb0f71416 100644 --- a/src/Plot2d/Plot2d_NormalizeAlgorithm.cxx +++ b/src/Plot2d/Plot2d_NormalizeAlgorithm.cxx @@ -108,7 +108,7 @@ void Plot2d_NormalizeAlgorithm::execute() { double pMin, pMax, kKoef, bKoef, yMin, yMax; switch( getNormalizationMode() ) { - case NormalizeToMin: + case NormalizeToMin: pMin = _pMin; for (int i = 0; i < yMaxLst.size(); ++i) { yMin = yMinLst.at(i); @@ -144,6 +144,8 @@ void Plot2d_NormalizeAlgorithm::execute() { aKkoefs<setItemMode( defaultItemMode() ); diff --git a/src/Plot2d/Plot2d_ViewFrame.cxx b/src/Plot2d/Plot2d_ViewFrame.cxx index ff52f41d5..667222242 100644 --- a/src/Plot2d/Plot2d_ViewFrame.cxx +++ b/src/Plot2d/Plot2d_ViewFrame.cxx @@ -767,12 +767,12 @@ QVector< QVector > Plot2d_ViewFrame::displayPlot2dCurveList( con icur2 = icur1 + groupSize -1; // For all curves in one group - double XgroupMin, XgroupMax; - double YgroupMin, YgroupMax; + double XgroupMin = 0., XgroupMax = 0.; + double YgroupMin = 0., YgroupMax = 0.; // For one curve - double XcurveMin, XcurveMax; - double YcurveMin, YcurveMax; + double XcurveMin = 0., XcurveMax = 0.; + double YcurveMin = 0., YcurveMax = 0.; double *Xval; double *Yval; int nbPoints; @@ -977,7 +977,7 @@ Plot2d_Curve* Plot2d_ViewFrame::createPlot2dCurve( QString & title, int lineWidth, QColor & lineColor, QwtSymbol::Style markerKind, - Plot2d_QwtPlotPicker* picker, + Plot2d_QwtPlotPicker* /*picker*/, bool toDraw, bool displayLegend) { @@ -1944,8 +1944,8 @@ AnalyticalCurveList Plot2d_ViewFrame::getAnalyticalCurves() const Plot2d_AnalyticalCurve* Plot2d_ViewFrame::getAnalyticalCurve(QwtPlotItem * theItem) { AnalyticalCurveList::iterator it = myAnalyticalCurves.begin(); for( ; it != myAnalyticalCurves.end(); it++) { - if((*it)->plotItem() == theItem); - return (*it); + if((*it)->plotItem() == theItem) + return (*it); } return 0; } @@ -2850,7 +2850,7 @@ bool Plot2d_ViewFrame::hasPlotObject( Plot2d_Object* object ) const /*! Sets curve type */ -void Plot2d_ViewFrame::setCurveType( QwtPlotCurve* curve, int curveType ) +void Plot2d_ViewFrame::setCurveType( QwtPlotCurve* curve, int /*curveType*/ ) { if ( !curve ) return; @@ -3176,7 +3176,7 @@ QwtPlotMarker* Plot2d_Plot2d::createMarkerAndTooltip( QwtSymbol* symbol, QwtPlotGrid* Plot2d_Plot2d::grid() const { return myGrid; -}; +} QwtPlotZoomer* Plot2d_Plot2d::zoomer() const { @@ -3273,7 +3273,7 @@ void Plot2d_Plot2d::displayXTicksAndLabels( QList allTicks; double devXmin, devXmax; // X interval of a system - double gapXmin, gapXmax; // X interval between two systems + double gapXmin = 0., gapXmax = 0.; // X interval between two systems double devLabPos; // Label's position of a system double segmentPos; // Position of the vertical segment between current system and the next @@ -3838,7 +3838,7 @@ QString Plot2d_ViewFrame::getXmlVisualParameters() { aWriter.writeAttribute("Name",c->getName()); aWriter.writeAttribute("IsActive", QString("").sprintf("%d", c->isActive())); aWriter.writeAttribute("Expression", c->getExpression()); - aWriter.writeAttribute("NbIntervals", QString("").sprintf("%d", c->getNbIntervals())); + aWriter.writeAttribute("NbIntervals", QString("").sprintf("%ld", c->getNbIntervals())); aWriter.writeAttribute("isAuto", QString("").sprintf("%d",isAuto)); if(!isAuto) { aWriter.writeAttribute("Marker", QString("").sprintf("%d",(int)c->getMarker())); @@ -3872,7 +3872,7 @@ QString Plot2d_ViewFrame::getXmlVisualParameters() { */ bool Plot2d_ViewFrame::setXmlVisualParameters(const QString& parameters) { QXmlStreamReader aReader(parameters); - double xmin, xmax, ymin, ymax, y2min, y2max; + double xmin = 0., xmax = 0., ymin = 0., ymax = 0., y2min = 0., y2max = 0.; bool leftMin,leftMax,rightMin,rightMax; leftMin = leftMax = rightMin = rightMax = false; while(!aReader.atEnd()) { diff --git a/src/Plot2d/Plot2d_ViewModel.cxx b/src/Plot2d/Plot2d_ViewModel.cxx index 04a8abfc9..795acbc26 100644 --- a/src/Plot2d/Plot2d_ViewModel.cxx +++ b/src/Plot2d/Plot2d_ViewModel.cxx @@ -110,8 +110,8 @@ void Plot2d_Viewer::update() { SUIT_ViewManager* aMgr = getViewManager(); QVector aViews = aMgr->getViews(); - unsigned int aSize = aViews.size(); - for (uint i = 0; i < aSize; i++) { + int aSize = aViews.size(); + for (int i = 0; i < aSize; i++) { Plot2d_ViewWindow* aView = (Plot2d_ViewWindow*)aViews[i]; if (myPrs && aView) aView->getViewFrame()->Display(myPrs); @@ -127,8 +127,8 @@ void Plot2d_Viewer::clearPrs() QVector aViews; if ( aMgr ) aViews = aMgr->getViews(); - unsigned int aSize = aViews.size(); - for (uint i = 0; i < aSize; i++) { + int aSize = aViews.size(); + for (int i = 0; i < aSize; i++) { Plot2d_ViewWindow* aView = (Plot2d_ViewWindow*)aViews[i]; if (myPrs && aView) aView->getViewFrame()->Erase(myPrs); @@ -220,7 +220,7 @@ void Plot2d_Viewer::onCloneView( Plot2d_ViewFrame* clonedVF, Plot2d_ViewFrame* n /* SLOT: called when clicked item in the legend from Plot2d_ViewManager */ -void Plot2d_Viewer::onClicked(const QVariant& itemInfo, int index) +void Plot2d_Viewer::onClicked(const QVariant& /*itemInfo*/, int /*index*/) { } diff --git a/src/Prs/SALOME_Prs.h b/src/Prs/SALOME_Prs.h index 1161e08c0..daf05845e 100644 --- a/src/Prs/SALOME_Prs.h +++ b/src/Prs/SALOME_Prs.h @@ -307,7 +307,7 @@ public: //! \retval Return false. virtual bool isVisible( const Handle(SALOME_InteractiveObject)& ){ return false; } virtual void Repaint() {} //!< Null body here. - virtual void GetVisible( SALOME_ListIO& theList ) {} + virtual void GetVisible( SALOME_ListIO& /*theList*/ ) {} }; /*! diff --git a/src/QDS/QDS_ComboBox.cxx b/src/QDS/QDS_ComboBox.cxx index 33ef748bb..296b4b113 100644 --- a/src/QDS/QDS_ComboBox.cxx +++ b/src/QDS/QDS_ComboBox.cxx @@ -260,7 +260,7 @@ void QDS_ComboBox::setState( const bool on, const QList& ids, const bool ap bool changed = false; QMap aMap; - for ( uint i = 0; i < ids.count(); i++ ) + for ( int i = 0; i < ids.count(); i++ ) aMap.insert( ids.at( i ), 0 ); for ( IdStateMap::Iterator it = myState.begin(); it != myState.end(); ++it ) diff --git a/src/QDS/QDS_Datum.cxx b/src/QDS/QDS_Datum.cxx index b69d720ce..a1e7db6bd 100644 --- a/src/QDS/QDS_Datum.cxx +++ b/src/QDS/QDS_Datum.cxx @@ -200,10 +200,10 @@ void QDS_Datum::Wrapper::setGeometry( int x, int y, int w, int h ) QDS_Datum::QDS_Datum( const QString& id, QWidget* parent, const int flags, const QString& comp ) : QObject( parent ), myId( id ), + myFlags( flags ), myLabel( 0 ), myUnits( 0 ), myControl( 0 ), - myFlags( flags ), myInitialised( false ), myTr( false ) { @@ -1422,7 +1422,7 @@ void QDS_Datum::initialize() \param unitSystem new active units system */ -void QDS_Datum::unitSystemChanged( const QString& unitSystem ) +void QDS_Datum::unitSystemChanged( const QString& /*unitSystem*/ ) { QString labText = label(); QString unitText = unitsToText( units() ); @@ -1883,7 +1883,7 @@ QString QDS_Datum::removeAccel( const QString& src ) { QString trg = src; - for ( uint i = 0; i < trg.length(); ) + for ( int i = 0; i < trg.length(); ) { if ( trg.mid( i, 2 ) == QString( "&&" ) ) i += 2; diff --git a/src/QDS/QDS_RadioBox.cxx b/src/QDS/QDS_RadioBox.cxx index beaae1168..aed149d34 100644 --- a/src/QDS/QDS_RadioBox.cxx +++ b/src/QDS/QDS_RadioBox.cxx @@ -161,7 +161,7 @@ void QDS_RadioBox::setState( const bool on, const QList& ids, const bool ap bool changed = false; QMap aMap; - for ( uint i = 0; i < ids.count(); i++ ) + for ( int i = 0; i < ids.count(); i++ ) aMap.insert( ids.at( i ), 0 ); for ( IdStateMap::Iterator it = myState.begin(); it != myState.end(); ++it ) diff --git a/src/QDS/QDS_Validator.cxx b/src/QDS/QDS_Validator.cxx index 5feff0003..c65746262 100644 --- a/src/QDS/QDS_Validator.cxx +++ b/src/QDS/QDS_Validator.cxx @@ -198,9 +198,9 @@ QDS_StringValidator::QDS_StringValidator( QObject* p ) \param p parent object */ QDS_StringValidator::QDS_StringValidator( const QString& f, QObject* p ) -: QValidator( p ), - myFlags( f ), - myLen( -1 ) +: QValidator( p ), + myLen( -1 ), + myFlags( f ) { } @@ -213,10 +213,10 @@ QDS_StringValidator::QDS_StringValidator( const QString& f, QObject* p ) \param p parent object */ QDS_StringValidator::QDS_StringValidator( const QString& ft, const QString& fg, QObject* p ) -: QValidator( p ), - myLen( -1 ), - myFilter( ft ), - myFlags( fg ) +: QValidator( p ), + myLen( -1 ), + myFlags( fg ), + myFilter( ft ) { } diff --git a/src/Qtx/Qtx.cxx b/src/Qtx/Qtx.cxx index 6a3d61c33..cbefba7db 100644 --- a/src/Qtx/Qtx.cxx +++ b/src/Qtx/Qtx.cxx @@ -589,7 +589,7 @@ bool Qtx::dos2unix( const QString& absName ) char inbuf[512], outbuf[512]; /* convert buffer */ - int nbread = ::fread( inbuf, 1, sizeof( inbuf ), src ); + int nbread = (int)::fread( inbuf, 1, sizeof( inbuf ), src ); //!< TODO: conversion from 'size_t' to 'int' for ( int incnt = 0; incnt < nbread; incnt++ ) { if ( waitingLF ) @@ -610,7 +610,7 @@ bool Qtx::dos2unix( const QString& absName ) waitingLF = ( inbuf[nbread - 1] == CR ); /* write converted buffer to temp file */ - int nbwri = ::fwrite( outbuf, 1, outcnt, tgt ); + int nbwri = (int)::fwrite( outbuf, 1, outcnt, tgt ); //!< TODO: conversion from 'size_t' to 'int' if ( nbwri != outcnt ) { ::fclose( src ); @@ -2143,7 +2143,7 @@ QString Qtx::qtDir( const QString& context ) QStringList vars = { "QT5_ROOT_DIR", "QT_ROOT_DIR", "QTDIR" }; QString qtPath; - for (uint i = 0; i < vars.length() && qtPath.isEmpty(); i++ ) { + for (int i = 0; i < vars.length() && qtPath.isEmpty(); i++ ) { qtPath = getenv(vars[i]); } if ( !qtPath.isEmpty() && !context.isEmpty() ) diff --git a/src/Qtx/Qtx.h b/src/Qtx/Qtx.h index 3bc6d305c..ace8592ec 100644 --- a/src/Qtx/Qtx.h +++ b/src/Qtx/Qtx.h @@ -121,6 +121,7 @@ public: //! Header view flags typedef enum { + ShowNone = 0x000, //!< Show nothing ShowText = 0x001, //!< Show only text in the header ShowIcon = 0x010, //!< Show only icon in the header ShowAll = ShowText | ShowIcon //!< Show icon and text in the header diff --git a/src/Qtx/QtxBiColorTool.cxx b/src/Qtx/QtxBiColorTool.cxx index 7517685ca..616a80f97 100644 --- a/src/Qtx/QtxBiColorTool.cxx +++ b/src/Qtx/QtxBiColorTool.cxx @@ -61,7 +61,7 @@ public: } return mySizeHint; } - void paintEvent( QPaintEvent* e ) + void paintEvent( QPaintEvent* /*e*/ ) { QStylePainter sp(this); QStyleOptionButton option; diff --git a/src/Qtx/QtxColorScale.cxx b/src/Qtx/QtxColorScale.cxx index 6ef8d823f..1110126d4 100644 --- a/src/Qtx/QtxColorScale.cxx +++ b/src/Qtx/QtxColorScale.cxx @@ -706,7 +706,7 @@ void QtxColorScale::hide() \brief Paint widget \param e paint event */ -void QtxColorScale::paintEvent( QPaintEvent* e ) +void QtxColorScale::paintEvent( QPaintEvent* /*e*/ ) { QPainter p( this ); drawFrame( &p ); @@ -784,7 +784,7 @@ void QtxColorScale::drawScale( QPainter* p, const QColor& bg, const bool transp, QString aTitle = title(); - int titleWidth = 0; + //int titleWidth = 0; // unused int titleHeight = 0; if ( qGray( bg.rgb() ) < 128 ) @@ -800,7 +800,7 @@ void QtxColorScale::drawScale( QPainter* p, const QColor& bg, const bool transp, { srt->setTextWidth( W - 10 ); titleHeight = (int)srt->size().height() + spacer; - titleWidth = (int)srt->size().width(); + //titleWidth = (int)srt->size().width(); // unused p->save(); p->translate( X + 5, Y ); srt->drawContents( p ); diff --git a/src/Qtx/QtxDialog.cxx b/src/Qtx/QtxDialog.cxx index 59da60e61..8c5683681 100644 --- a/src/Qtx/QtxDialog.cxx +++ b/src/Qtx/QtxDialog.cxx @@ -443,14 +443,14 @@ QSize QtxDialog::Border::minimumSizeHint() const QtxDialog::QtxDialog( QWidget* parent, bool modal, bool allowResize, const int f, Qt::WindowFlags wf ) : QDialog( parent, (Qt::WindowFlags)( wf | Qt::WindowTitleHint | Qt::WindowSystemMenuHint | Qt::WindowCloseButtonHint | Qt::Dialog | #ifdef WIN32 - ( allowResize ? 0 : Qt::FramelessWindowHint ) | + ( allowResize ? (Qt::WindowType)0 : Qt::FramelessWindowHint ) | #endif ( ( allowResize #ifdef WIN32 // in qwidget_win.cpp flag WStyle_ContextHelp will be unset in WStyle_MinMax in switched ON && !( wf & Qt::WindowContextHelpButtonHint ) #endif - ) ? Qt::WindowMaximizeButtonHint : 0 ) ) ), + ) ? Qt::WindowMaximizeButtonHint : (Qt::WindowType)0 ) ) ), myInited( false ), mySender( 0 ), myAlignment( 0 ), diff --git a/src/Qtx/QtxDoubleSpinBox.cxx b/src/Qtx/QtxDoubleSpinBox.cxx index 7c8102ad8..8030686e4 100644 --- a/src/Qtx/QtxDoubleSpinBox.cxx +++ b/src/Qtx/QtxDoubleSpinBox.cxx @@ -306,7 +306,7 @@ QValidator::State QtxDoubleSpinBox::validate( QString& str, int& pos ) const { QString pref = this->prefix(); QString suff = this->suffix(); - uint overhead = pref.length() + suff.length(); + int overhead = pref.length() + suff.length(); QValidator::State state = QValidator::Invalid; QDoubleValidator v (NULL); diff --git a/src/Qtx/QtxEvalExpr.cxx b/src/Qtx/QtxEvalExpr.cxx index 6c2b69bb0..38f41b3f9 100644 --- a/src/Qtx/QtxEvalExpr.cxx +++ b/src/Qtx/QtxEvalExpr.cxx @@ -1912,7 +1912,7 @@ int QtxEvalSetMath::priority( const QString& op, bool isBin ) const \param v2 second argument (not valid for unary postfix operations) \return error code (QtxEvalExpr::Error) */ -QtxEvalExpr::Error QtxEvalSetMath::calculate( const QString& op, QVariant& v1, QVariant& v2 ) const +QtxEvalExpr::Error QtxEvalSetMath::calculate( const QString& op, QVariant& /*v1*/, QVariant& v2 ) const { QtxEvalExpr::Error err = QtxEvalExpr::OK; double val = v2.toDouble(); diff --git a/src/Qtx/QtxListAction.cxx b/src/Qtx/QtxListAction.cxx index c3b1891dc..c15a0c9dc 100644 --- a/src/Qtx/QtxListAction.cxx +++ b/src/Qtx/QtxListAction.cxx @@ -455,7 +455,7 @@ bool QtxListAction::ListFrame::eventFilter( QObject* o, QEvent* e ) { bool res = true; - switch( e->type() ) + switch( (int)e->type() ) { case QEvent::MouseMove: { diff --git a/src/Qtx/QtxMainWindow.cxx b/src/Qtx/QtxMainWindow.cxx index fcfe0fe1e..a2bf89fa4 100644 --- a/src/Qtx/QtxMainWindow.cxx +++ b/src/Qtx/QtxMainWindow.cxx @@ -69,7 +69,7 @@ QtxMainWindow::Filter::Filter( QWidget* wid, QtxMainWindow* mw, QObject* parent myWidget( wid ) { QApplication::instance()->installEventFilter( this ); -}; +} /*! \brief Destructor. @@ -142,7 +142,7 @@ QtxMainWindow::Resizer::Resizer( const QPoint& p, const Qt::Orientation o, QtxMa setPosition( p ); myRubber->hide(); -}; +} /*! \brief Destructor. @@ -239,11 +239,11 @@ QtxMainWindow::QtxMainWindow( QWidget* parent, Qt::WindowFlags f ) : QMainWindow( parent, f ), myMenuBar( 0 ), myStatusBar( 0 ), + myFullScreenAllowed(true), + myMinimizeAllowed(true), myOpaque( true ), myResizer( 0 ), - myMouseMove( 0 ), - myFullScreenAllowed(true), - myMinimizeAllowed(true) + myMouseMove( 0 ) { //rnv: Enables tooltips for inactive windows. //rnv: For details see http://bugtracker.opencascade.com/show_bug.cgi?id=20893 diff --git a/src/Qtx/QtxNotify.cxx b/src/Qtx/QtxNotify.cxx index 6727e3269..a8ef6770d 100644 --- a/src/Qtx/QtxNotify.cxx +++ b/src/Qtx/QtxNotify.cxx @@ -81,11 +81,10 @@ private: private: int myId; - QString myText; QString myTitle; + QString myText; QTimer* myTimer; QtxNotify* myNotifyMgr; - bool myIsClosePressed; }; diff --git a/src/Qtx/QtxPagePrefMgr.cxx b/src/Qtx/QtxPagePrefMgr.cxx index d11413755..7f7e51936 100644 --- a/src/Qtx/QtxPagePrefMgr.cxx +++ b/src/Qtx/QtxPagePrefMgr.cxx @@ -4475,7 +4475,7 @@ void QtxPagePrefShortcutBtnsItem::retrieve() \param param resource file parameter associated with the preference item */ QtxPagePrefShortcutTreeItem::QtxPagePrefShortcutTreeItem( const QString& title, QtxPreferenceItem* parent, const QString& sect, - const QString& param ): QtxPageNamedPrefItem( title, parent, sect, "" ) + const QString& /*param*/ ): QtxPageNamedPrefItem( title, parent, sect, "" ) { mySection = sect; diff --git a/src/Qtx/QtxPathListEdit.cxx b/src/Qtx/QtxPathListEdit.cxx index 31ce3002b..3b1ea4b57 100644 --- a/src/Qtx/QtxPathListEdit.cxx +++ b/src/Qtx/QtxPathListEdit.cxx @@ -207,8 +207,8 @@ QtxPathListEdit::Delegate::~Delegate() \param option style option \param index data model index */ -QWidget* QtxPathListEdit::Delegate::createEditor( QWidget* parent, const QStyleOptionViewItem& option, - const QModelIndex& index ) const +QWidget* QtxPathListEdit::Delegate::createEditor( QWidget* parent, const QStyleOptionViewItem& /*option*/, + const QModelIndex& /*index*/ ) const { return myPathEdit->createEditor( parent ); } @@ -220,7 +220,7 @@ QWidget* QtxPathListEdit::Delegate::createEditor( QWidget* parent, const QStyleO \param model data model \param index data model index */ -void QtxPathListEdit::Delegate::setModelData( QWidget* editor, QAbstractItemModel* model, +void QtxPathListEdit::Delegate::setModelData( QWidget* editor, QAbstractItemModel* /*model*/, const QModelIndex& index ) const { myPathEdit->setModelData( editor, index ); @@ -270,7 +270,7 @@ void QtxPathListEdit::Delegate::paint( QPainter* painter, const QStyleOptionView \param rect selection rectangle */ void QtxPathListEdit::Delegate::drawFocus( QPainter* painter, const QStyleOptionViewItem& option, - const QRect& rect ) const + const QRect& /*rect*/ ) const { QItemDelegate::drawFocus( painter, option, option.rect ); } @@ -307,8 +307,8 @@ void QtxPathListEdit::Delegate::drawFocus( QPainter* painter, const QStyleOption */ QtxPathListEdit::QtxPathListEdit( const Qtx::PathType type, QWidget* parent ) : QFrame( parent ), - myCompleter( 0 ), myType( type ), + myCompleter( 0 ), myDuplicate( false ) { initialize(); @@ -324,8 +324,8 @@ QtxPathListEdit::QtxPathListEdit( const Qtx::PathType type, QWidget* parent ) */ QtxPathListEdit::QtxPathListEdit( QWidget* parent ) : QFrame( parent ), - myCompleter( 0 ), myType( Qtx::PT_OpenFile ), + myCompleter( 0 ), myDuplicate( false ) { initialize(); @@ -782,6 +782,8 @@ bool QtxPathListEdit::checkExistance( const QString& str, const bool msg ) if ( !ok && msg ) QMessageBox::warning( this, tr( "Error" ), tr( "Location \"%1\" doesn't point to directory" ).arg( str ) ); break; + default: + break; } } diff --git a/src/Qtx/QtxRubberBand.cxx b/src/Qtx/QtxRubberBand.cxx index 3c92e0dbe..818e98c7b 100644 --- a/src/Qtx/QtxRubberBand.cxx +++ b/src/Qtx/QtxRubberBand.cxx @@ -76,7 +76,7 @@ bool QtxAbstractRubberBand::isClosed() return myIsClosed; } -void QtxAbstractRubberBand::paintEvent( QPaintEvent* theEvent ) +void QtxAbstractRubberBand::paintEvent( QPaintEvent* /*theEvent*/ ) { if ( !myPoints.empty() ) { @@ -92,57 +92,10 @@ void QtxAbstractRubberBand::paintEvent( QPaintEvent* theEvent ) // ### workaround for borked XRENDER tiledPixmap = QPixmap::fromImage(tiledPixmap.toImage()); - - QPainter aPainter( this ); aPainter.setRenderHint( QPainter::Antialiasing ); - QRect r = myPoints.boundingRect(); - //aPainter.setClipRegion( r.normalized().adjusted( -1, -1, 2, 2 ) ); aPainter.drawTiledPixmap( 0, 0, width(), height(), tiledPixmap); - aPainter.end(); - - /* - - - -#ifdef WIN32 - QPixmap anImage( size() ); -#else - QImage anImage( size(), QImage::Format_ARGB32_Premultiplied ); -#endif - - anImage.fill( Qt::transparent ); - QPainter aImgPainter( &anImage ); - aImgPainter.setRenderHint( QPainter::Antialiasing ); - aImgPainter.setCompositionMode(QPainter::CompositionMode_Source); - - QPen aPen( Qt::black ); - aPen.setWidth( 2 ); - aImgPainter.setPen( aPen ); - - aImgPainter.drawPolyline( myPoints ); - if ( myIsClosed && myPoints.last() != myPoints.first() ) - aImgPainter.drawLine( myPoints.last(), myPoints.first() ); - - //aImgPainter.setPen(Qt::NoPen); - //aImgPainter.setBrush(QBrush( Qt::white, Qt::Dense4Pattern)); - //aImgPainter.setCompositionMode(QPainter::CompositionMode_SourceAtop); - //aImgPainter.drawRect(0, 0, width(), height()); - aImgPainter.end(); - - QPainter aPainter( this ); - aPainter.drawPolyline( myPoints ); - if ( myIsClosed && myPoints.last() != myPoints.first() ) - aPainter.drawLine( myPoints.last(), myPoints.first() ); - -#ifdef WIN32 - aPainter.drawPixmap( 0, 0, anImage ); -#else - aPainter.drawImage( 0, 0, anImage ); - #endif - aPainter.end();*/ - } } @@ -404,4 +357,4 @@ int QtxCircleRubberBand::radius() const return -1; QPoint aDist = myPoints[1] - myPoints[0]; return (int)std::sqrt(std::pow(aDist.x(), 2) + std::pow(aDist.y(), 2)); -} \ No newline at end of file +} diff --git a/src/Qtx/QtxShortcutEdit.cxx b/src/Qtx/QtxShortcutEdit.cxx index 415cf9484..798caf254 100644 --- a/src/Qtx/QtxShortcutEdit.cxx +++ b/src/Qtx/QtxShortcutEdit.cxx @@ -242,7 +242,7 @@ QtxShortcutTree::~QtxShortcutTree(){} \param event event \return \c true if further event processing should be stopped */ -bool QtxShortcutTree::eventFilter(QObject* obj, QEvent* event) +bool QtxShortcutTree::eventFilter(QObject* /*obj*/, QEvent* event) { if ( currentItem() && currentItem()->isSelected() ) { @@ -273,7 +273,7 @@ bool QtxShortcutTree::eventFilter(QObject* obj, QEvent* event) \param cur the current item \param prev the previous current item */ -void QtxShortcutTree::onCurrentItemChanged( QTreeWidgetItem* cur, QTreeWidgetItem* prev ) +void QtxShortcutTree::onCurrentItemChanged( QTreeWidgetItem* /*cur*/, QTreeWidgetItem* prev ) { if ( prev && prev->text( 1 ).endsWith( "+" ) ) prev->setText( 1, myPrevBindings[ prev->parent()->text( 0 ) ][ prev->text( 0 ) ] ); diff --git a/src/Qtx/QtxSplash.cxx b/src/Qtx/QtxSplash.cxx index f57ce87a6..59ef968e8 100644 --- a/src/Qtx/QtxSplash.cxx +++ b/src/Qtx/QtxSplash.cxx @@ -200,9 +200,9 @@ QtxSplash::QtxSplash( const QPixmap& pixmap ) myMargin( 5 ), myOpacity( 1.0 ), myError( 0 ), - myShowPercent( true ), myShowProgress( true ), - myShowMessage( true ) + myShowMessage( true ), + myShowPercent( true ) { setAttribute( Qt::WA_DeleteOnClose, true ); setPixmap( pixmap ); diff --git a/src/Qtx/QtxToolBar.cxx b/src/Qtx/QtxToolBar.cxx index be4398d74..44808c584 100644 --- a/src/Qtx/QtxToolBar.cxx +++ b/src/Qtx/QtxToolBar.cxx @@ -213,7 +213,7 @@ void QtxToolBar::Watcher::hideContainer() */ void QtxToolBar::Watcher::customEvent( QEvent* e ) { - switch ( e->type() ) + switch ( (int)e->type() ) { case Install: installFilters(); diff --git a/src/Qtx/QtxToolButton.cxx b/src/Qtx/QtxToolButton.cxx index b0b3aab88..4f2c6da41 100644 --- a/src/Qtx/QtxToolButton.cxx +++ b/src/Qtx/QtxToolButton.cxx @@ -378,6 +378,7 @@ void QtxToolButton::keyPressEvent( QKeyEvent* e ) showMenu(); return; } + // fall through! case Qt::Key_PageDown: move = ( e->modifiers() & Qt::ControlModifier ) ? MoveLast : MoveDown; break; diff --git a/src/Qtx/QtxTranslator.cxx b/src/Qtx/QtxTranslator.cxx index 7bf0b6640..4766a7f75 100644 --- a/src/Qtx/QtxTranslator.cxx +++ b/src/Qtx/QtxTranslator.cxx @@ -32,7 +32,7 @@ does not allow to process messages with global context. For the current moment global context should be specified in translation - (*.ts/*.qm) files as "@default" string. For example: + (*.ts) files as "@default" string. For example: \verbatim diff --git a/src/Qtx/QtxWorkstack.cxx b/src/Qtx/QtxWorkstack.cxx index 18b10df00..584f0aa85 100644 --- a/src/Qtx/QtxWorkstack.cxx +++ b/src/Qtx/QtxWorkstack.cxx @@ -959,7 +959,7 @@ void QtxWorkstackArea::customEvent( QEvent* e ) { WidgetEvent* we = (WidgetEvent*)e; - switch ( we->type() ) + switch ( (int)we->type() ) { case ActivateWidget: myBar->updateActiveState(); @@ -1080,7 +1080,7 @@ void QtxWorkstackArea::onChildDestroyed( QObject* obj ) \brief Called when child widget container is shown. \param c child widget container being shown */ -void QtxWorkstackArea::onChildShown( QtxWorkstackChild* c ) +void QtxWorkstackArea::onChildShown( QtxWorkstackChild* /*c*/ ) { updateState(); } @@ -1089,7 +1089,7 @@ void QtxWorkstackArea::onChildShown( QtxWorkstackChild* c ) \brief Called when child widget container is hidden. \param c child widget container being hidden */ -void QtxWorkstackArea::onChildHidden( QtxWorkstackChild* c ) +void QtxWorkstackArea::onChildHidden( QtxWorkstackChild* /*c*/ ) { updateState(); } @@ -1469,7 +1469,7 @@ bool QtxWorkstackChild::eventFilter( QObject* o, QEvent* e ) \brief Called when child widget is destroyed. \param obj child widget being destroyed */ -void QtxWorkstackChild::onDestroyed( QObject* obj ) +void QtxWorkstackChild::onDestroyed( QObject* /*obj*/ ) { deleteLater(); } @@ -2287,8 +2287,6 @@ static int positionSimple (QIntList& szList, const int nb, const int splitter_si int new_this = szList[item_ind]; int new_next = 0; - bool isToCheck = false; - if (need_pos < splitter_pos) { // Set size of all previous workareas to zero <-- if (item_ind == nb - 1) { @@ -2320,7 +2318,6 @@ static int positionSimple (QIntList& szList, const int nb, const int splitter_si new_this = splitter_size - new_item_rel_pos; } // jfa to do: in this case fixed size of next widgets could prevent right resizing - isToCheck = true; } if (item_ind == nb - 1) { new_this = splitter_size - new_item_rel_pos; diff --git a/src/Qtx/QtxWorkstackAction.cxx b/src/Qtx/QtxWorkstackAction.cxx index c0611c145..655525fb3 100644 --- a/src/Qtx/QtxWorkstackAction.cxx +++ b/src/Qtx/QtxWorkstackAction.cxx @@ -297,7 +297,7 @@ void QtxWorkstackAction::setStatusTip( const int id, const QString& txt ) \brief Process action activated by the user. \param type action ID */ -void QtxWorkstackAction::perform( const int type ) +void QtxWorkstackAction::perform( const int /*type*/ ) { /* switch ( type ) @@ -853,7 +853,7 @@ void QtxSplitDlg::onComboBoxChanged( int theItem ) } for( int i = 0; i < 4; i++ ) { if( myComboBox[i] != aSender ) { - ViewMode aNewMode; + ViewMode aNewMode = XYZ; if( myMapComboBoxMode[myComboBox[i]] == (ViewMode)(theItem) ) { for( int j = 0; j < 4; j++ ) if( !aModeEnabledMap[(ViewMode)j] ) diff --git a/src/QxScene/QxScene_ViewModel.cxx b/src/QxScene/QxScene_ViewModel.cxx index f4ce54336..2429c4610 100644 --- a/src/QxScene/QxScene_ViewModel.cxx +++ b/src/QxScene/QxScene_ViewModel.cxx @@ -84,7 +84,7 @@ SUIT_ViewWindow* QxScene_Viewer::createView(SUIT_Desktop* theDesktop) /*! Builds popup for QxScene viewer */ -void QxScene_Viewer::contextMenuPopup(QMenu* thePopup) +void QxScene_Viewer::contextMenuPopup(QMenu* /*thePopup*/) { DEBTRACE("QxScene_Viewer::contextMenuPopup"); } diff --git a/src/QxScene/QxScene_ViewWindow.cxx b/src/QxScene/QxScene_ViewWindow.cxx index 0cba0ab81..8802adb34 100644 --- a/src/QxScene/QxScene_ViewWindow.cxx +++ b/src/QxScene/QxScene_ViewWindow.cxx @@ -235,7 +235,7 @@ void QxScene_ViewWindow::onViewFitAll() /*! Set background of the viewport */ -void QxScene_ViewWindow::setBackgroundColor( const QColor& color ) +void QxScene_ViewWindow::setBackgroundColor( const QColor& /*color*/ ) { DEBTRACE("QxScene_ViewWindow::setBackgroundColor"); } @@ -253,7 +253,7 @@ QColor QxScene_ViewWindow::backgroundColor() const /*! Custom resize event handler */ -void QxScene_ViewWindow::resizeEvent( QResizeEvent* theEvent ) +void QxScene_ViewWindow::resizeEvent( QResizeEvent* /*theEvent*/ ) { DEBTRACE("QxScene_ViewWindow::resizeEvent"); } diff --git a/src/QxScene/QxScene_ViewWindow.h b/src/QxScene/QxScene_ViewWindow.h index 05fbd7495..9fe5322be 100644 --- a/src/QxScene/QxScene_ViewWindow.h +++ b/src/QxScene/QxScene_ViewWindow.h @@ -82,7 +82,7 @@ class QXSCENE_EXPORT QxScene_ViewWindow : public SUIT_ViewWindow { void onViewReset(); protected: - void resizeEvent( QResizeEvent* theEvent ); + void resizeEvent( QResizeEvent* ); QGraphicsScene* _scene; QGraphicsView* _sceneView; diff --git a/src/SALOME_PY/SalomePy.cxx b/src/SALOME_PY/SalomePy.cxx index a06880e47..3bf9cf31f 100644 --- a/src/SALOME_PY/SalomePy.cxx +++ b/src/SALOME_PY/SalomePy.cxx @@ -230,7 +230,7 @@ public: } }; -extern "C" SALOMEPY_EXPORT PyObject* libSalomePy_getRenderer( PyObject* self, PyObject* args ) +extern "C" SALOMEPY_EXPORT PyObject* libSalomePy_getRenderer( PyObject* /*self*/, PyObject* args ) { PyObject* aResult = Py_None; int toCreate = 0; @@ -285,7 +285,7 @@ public: } }; -extern "C" SALOMEPY_EXPORT PyObject* libSalomePy_getRenderWindow( PyObject* self, PyObject* args ) +extern "C" SALOMEPY_EXPORT PyObject* libSalomePy_getRenderWindow( PyObject* /*self*/, PyObject* args ) { PyObject* aResult = Py_None; int toCreate = 0; @@ -340,7 +340,7 @@ public: } }; -extern "C" SALOMEPY_EXPORT PyObject* libSalomePy_getRenderWindowInteractor( PyObject* self, PyObject* args ) +extern "C" SALOMEPY_EXPORT PyObject* libSalomePy_getRenderWindowInteractor( PyObject* /*self*/, PyObject* args ) { PyObject* aResult = Py_None; int toCreate = 0; @@ -362,7 +362,7 @@ extern "C" SALOMEPY_EXPORT PyObject* libSalomePy_getRenderWindowInteractor( PyOb \return nothing (Py_None) */ -extern "C" SALOMEPY_EXPORT PyObject* libSalomePy_showTrihedron( PyObject* self, PyObject* args ) +extern "C" SALOMEPY_EXPORT PyObject* libSalomePy_showTrihedron( PyObject* /*self*/, PyObject* args ) { class TEvent: public SALOME_Event { @@ -373,7 +373,7 @@ extern "C" SALOMEPY_EXPORT PyObject* libSalomePy_showTrihedron( PyObject* self, virtual void Execute() { if( SVTK_ViewWindow* aVTKViewWindow = GetVTKViewWindow( __Find ) ) { - if ( aVTKViewWindow->isTrihedronDisplayed() != myShow ) + if ( aVTKViewWindow->isTrihedronDisplayed() != (bool)myShow ) aVTKViewWindow->onViewTrihedron(myShow); } } @@ -397,7 +397,7 @@ extern "C" SALOMEPY_EXPORT PyObject* libSalomePy_showTrihedron( PyObject* self, \return nothing (Py_None) */ -extern "C" SALOMEPY_EXPORT PyObject* libSalomePy_fitAll( PyObject* self, PyObject* args ) +extern "C" SALOMEPY_EXPORT PyObject* libSalomePy_fitAll( PyObject* /*self*/, PyObject* /*args*/ ) { class TEvent: public SALOME_Event { @@ -425,7 +425,7 @@ extern "C" SALOMEPY_EXPORT PyObject* libSalomePy_fitAll( PyObject* self, PyObjec \return nothing (Py_None) */ -extern "C" SALOMEPY_EXPORT PyObject* libSalomePy_setView( PyObject* self, PyObject* args ) +extern "C" SALOMEPY_EXPORT PyObject* libSalomePy_setView( PyObject* /*self*/, PyObject* args ) { class TEvent: public SALOME_Event { @@ -476,7 +476,7 @@ extern "C" SALOMEPY_EXPORT PyObject* libSalomePy_setView( PyObject* self, PyObje \return nothing (Py_None) */ -extern "C" SALOMEPY_EXPORT PyObject* libSalomePy_resetView( PyObject* self, PyObject* args ) +extern "C" SALOMEPY_EXPORT PyObject* libSalomePy_resetView( PyObject* /*self*/, PyObject* /*args*/ ) { class TEvent: public SALOME_Event { @@ -496,14 +496,14 @@ extern "C" SALOMEPY_EXPORT PyObject* libSalomePy_resetView( PyObject* self, PyOb static PyMethodDef libSalomePy_methods[] = { - { "getRenderer", libSalomePy_getRenderer, METH_VARARGS }, - { "getRenderWindow", libSalomePy_getRenderWindow, METH_VARARGS }, - { "getRenderWindowInteractor", libSalomePy_getRenderWindowInteractor, METH_VARARGS }, - { "showTrihedron", libSalomePy_showTrihedron, METH_VARARGS }, - { "fitAll", libSalomePy_fitAll, METH_NOARGS }, - { "setView", libSalomePy_setView, METH_VARARGS }, - { "resetView", libSalomePy_resetView, METH_NOARGS }, - { NULL, NULL } + { "getRenderer", libSalomePy_getRenderer, METH_VARARGS, PyDoc_STR("Get renderer from current vtk view") }, + { "getRenderWindow", libSalomePy_getRenderWindow, METH_VARARGS, PyDoc_STR("Get render window from current vtk view") }, + { "getRenderWindowInteractor", libSalomePy_getRenderWindowInteractor, METH_VARARGS, PyDoc_STR("Get interactor from current vtk view") }, + { "showTrihedron", libSalomePy_showTrihedron, METH_VARARGS, PyDoc_STR("Show/hide trihedron in current vtk view") }, + { "fitAll", libSalomePy_fitAll, METH_NOARGS, PyDoc_STR("Fit current vtk view to show all contents") }, + { "setView", libSalomePy_setView, METH_VARARGS, PyDoc_STR("Set side view for the current VTK viewer") }, + { "resetView", libSalomePy_resetView, METH_NOARGS, PyDoc_STR("Reset camera for current vtk view") }, + { 0, 0, 0, 0 } }; struct module_state { diff --git a/src/SALOME_PYQT/SALOME_PYQT_GUI/SALOME_PYQT_Module.h b/src/SALOME_PYQT/SALOME_PYQT_GUI/SALOME_PYQT_Module.h index 510e7e773..afe484507 100644 --- a/src/SALOME_PYQT/SALOME_PYQT_GUI/SALOME_PYQT_Module.h +++ b/src/SALOME_PYQT/SALOME_PYQT_GUI/SALOME_PYQT_Module.h @@ -34,7 +34,7 @@ class PyModuleHelper; class SALOME_PYQT_EXPORT SALOME_PYQT_Module: public SalomeApp_Module { - Q_OBJECT; + Q_OBJECT public: SALOME_PYQT_Module(); diff --git a/src/SALOME_PYQT/SALOME_PYQT_GUILight/SALOME_PYQT_BorrowedDataObjectLight.cxx b/src/SALOME_PYQT/SALOME_PYQT_GUILight/SALOME_PYQT_BorrowedDataObjectLight.cxx index 9ccf98f0d..407550a45 100644 --- a/src/SALOME_PYQT/SALOME_PYQT_GUILight/SALOME_PYQT_BorrowedDataObjectLight.cxx +++ b/src/SALOME_PYQT/SALOME_PYQT_GUILight/SALOME_PYQT_BorrowedDataObjectLight.cxx @@ -112,7 +112,7 @@ QPixmap SALOME_PYQT_BorrowedDataObjectLight::icon(const int index) const // function : SALOME_PYQT_BorrowedDataObjectLight::toolTip() // purpose : return toolTip of object //================================================================================= -QString SALOME_PYQT_BorrowedDataObjectLight::toolTip(const int index) const +QString SALOME_PYQT_BorrowedDataObjectLight::toolTip(const int /*index*/) const { return myToolTip; } diff --git a/src/SALOME_PYQT/SALOME_PYQT_GUILight/SALOME_PYQT_DataModelLight.cxx b/src/SALOME_PYQT/SALOME_PYQT_GUILight/SALOME_PYQT_DataModelLight.cxx index aeaf7dbf4..47b6057e3 100644 --- a/src/SALOME_PYQT/SALOME_PYQT_GUILight/SALOME_PYQT_DataModelLight.cxx +++ b/src/SALOME_PYQT/SALOME_PYQT_GUILight/SALOME_PYQT_DataModelLight.cxx @@ -108,7 +108,7 @@ bool SALOME_PYQT_DataModelLight::save( QStringList& theListOfFiles) // function : saveAs() // purpose : SaveAs data model operation //================================================================================= -bool SALOME_PYQT_DataModelLight::saveAs ( const QString& theURL, CAM_Study* theStudy, QStringList& theListOfFiles) +bool SALOME_PYQT_DataModelLight::saveAs ( const QString& theURL, CAM_Study* /*theStudy*/, QStringList& theListOfFiles) { myStudyURL = theURL; return save(theListOfFiles); @@ -116,7 +116,7 @@ bool SALOME_PYQT_DataModelLight::saveAs ( const QString& theURL, CAM_Study* theS -bool SALOME_PYQT_DataModelLight::create( CAM_Study* study ) +bool SALOME_PYQT_DataModelLight::create( CAM_Study* /*study*/ ) { return true; } @@ -183,7 +183,7 @@ bool SALOME_PYQT_DataModelLight::close() } -void SALOME_PYQT_DataModelLight::update ( LightApp_DataObject* theObj, LightApp_Study* theStudy ) +void SALOME_PYQT_DataModelLight::update ( LightApp_DataObject* /*theObj*/, LightApp_Study* /*theStudy*/ ) { // Nothing to do here: we always keep the data tree in the up-to-date state // The only goal of this method is to hide default behavior from LightApp_DataModel diff --git a/src/SALOME_PYQT/SALOME_PYQT_GUILight/SALOME_PYQT_DataObjectLight.cxx b/src/SALOME_PYQT/SALOME_PYQT_GUILight/SALOME_PYQT_DataObjectLight.cxx index 0902b20a5..17ae4ac56 100644 --- a/src/SALOME_PYQT/SALOME_PYQT_GUILight/SALOME_PYQT_DataObjectLight.cxx +++ b/src/SALOME_PYQT/SALOME_PYQT_GUILight/SALOME_PYQT_DataObjectLight.cxx @@ -113,7 +113,7 @@ QPixmap SALOME_PYQT_DataObjectLight::icon(const int index) const // function : SALOME_PYQT_DataObjectLight::toolTip() // purpose : return toolTip of object //================================================================================= -QString SALOME_PYQT_DataObjectLight::toolTip(const int index) const +QString SALOME_PYQT_DataObjectLight::toolTip(const int /*index*/) const { return myToolTip; } diff --git a/src/SALOME_PYQT/SALOME_PYQT_GUILight/SALOME_PYQT_ModuleLight.cxx b/src/SALOME_PYQT/SALOME_PYQT_GUILight/SALOME_PYQT_ModuleLight.cxx index 0789456ee..73437e61c 100644 --- a/src/SALOME_PYQT/SALOME_PYQT_GUILight/SALOME_PYQT_ModuleLight.cxx +++ b/src/SALOME_PYQT/SALOME_PYQT_GUILight/SALOME_PYQT_ModuleLight.cxx @@ -637,7 +637,7 @@ void SALOME_PYQT_ModuleLight::getSelected( DataObjectList& ) const \brief Used to notify a Python light module of a modification of selection in study (propagation of a remote selection) \param list of study entries */ -void SALOME_PYQT_ModuleLight::setSelected( const QStringList& entries, const bool isUnused) +void SALOME_PYQT_ModuleLight::setSelected( const QStringList& entries, const bool /*isUnused*/) { MESSAGE("setSelected"); return myHelper->selectionUpdated(entries); diff --git a/src/SALOME_PYQT/SALOME_PYQT_GUILight/SALOME_PYQT_ModuleLight.h b/src/SALOME_PYQT/SALOME_PYQT_GUILight/SALOME_PYQT_ModuleLight.h index afd351518..ca447cec8 100644 --- a/src/SALOME_PYQT/SALOME_PYQT_GUILight/SALOME_PYQT_ModuleLight.h +++ b/src/SALOME_PYQT/SALOME_PYQT_GUILight/SALOME_PYQT_ModuleLight.h @@ -39,7 +39,7 @@ class SALOME_PYQT_DataObjectLight; class SALOME_PYQT_LIGHT_EXPORT SALOME_PYQT_ModuleLight: public LightApp_Module { - Q_OBJECT; + Q_OBJECT public: SALOME_PYQT_ModuleLight(); diff --git a/src/SALOME_PYQT/SALOME_PYQT_GUILight/SALOME_PYQT_PyModule.cxx b/src/SALOME_PYQT/SALOME_PYQT_GUILight/SALOME_PYQT_PyModule.cxx index e305afbe0..e0c141ed9 100644 --- a/src/SALOME_PYQT/SALOME_PYQT_GUILight/SALOME_PYQT_PyModule.cxx +++ b/src/SALOME_PYQT/SALOME_PYQT_GUILight/SALOME_PYQT_PyModule.cxx @@ -178,6 +178,7 @@ public: } void message( const QString& msg ) { + (void)msg; // unused in debug mode if ( theDEBUG ) MESSAGE( qPrintable( myName ) << " : " << qPrintable( msg ) ); } @@ -388,7 +389,7 @@ QIcon PyModuleHelper::XmlHandler::loadIcon( const QString& fileName ) */ void PyModuleHelper::XmlHandler::createMenu( QDomNode& parentNode, const int parentMenuId, - QMenu* parentPopup ) + QMenu* /*parentPopup*/ ) { if ( !module() || parentNode.isNull() ) return; @@ -2086,7 +2087,7 @@ void PyModuleHelper::internalCustomize( SUIT_Study* study ) \param study parent study */ -void PyModuleHelper::internalDeactivate( SUIT_Study* study ) +void PyModuleHelper::internalDeactivate( SUIT_Study* /*study*/ ) { FuncMsg fmsg( "--- PyModuleHelper::internalDeactivate()" ); @@ -2857,8 +2858,8 @@ void PyModuleHelper::onObjectBrowserClicked(SUIT_DataObject* theObj, int theColu } private: PyModuleHelper* myHelper; - int myColumn; QString myEntry; + int myColumn; }; // Posting the request only if dispatcher is not busy! diff --git a/src/SALOME_PYQT/SalomePyQt/SalomePyQt.cxx b/src/SALOME_PYQT/SalomePyQt/SalomePyQt.cxx index 04b9bece8..e243c2d4a 100644 --- a/src/SALOME_PYQT/SalomePyQt/SalomePyQt.cxx +++ b/src/SALOME_PYQT/SalomePyQt/SalomePyQt.cxx @@ -1678,7 +1678,7 @@ public: bool mySubst; TResult myDefault; TGetStrSettingEvent( const QString& section, const QString& name, const QString& def, const bool subst ) - : mySection( section ), myName( name ), myDefault( def ), mySubst( subst ) {} + : mySection( section ), myName( name ), mySubst( subst ), myDefault( def ) {} virtual void Execute() { if ( SUIT_Session::session() ) { @@ -2117,13 +2117,13 @@ public: CrTool( const QString& tBar, const QString& nBar ) : myCase( 0 ), myTbTitle( tBar ), myTbName( nBar) {} CrTool( const int id, const int tBar, const int idx ) - : myCase( 1 ), myId( id ), myTbId( tBar ), myIndex( idx ) {} + : myCase( 1 ), myTbId( tBar ), myId( id ), myIndex( idx ) {} CrTool( const int id, const QString& tBar, const int idx ) - : myCase( 2 ), myId( id ), myTbTitle( tBar ), myIndex( idx ) {} + : myCase( 2 ), myTbTitle( tBar ), myId( id ), myIndex( idx ) {} CrTool( QAction* action, const int tbId, const int id, const int idx ) - : myCase( 3 ), myAction( action ), myTbId( tbId ), myId( id ), myIndex( idx ) {} + : myCase( 3 ), myTbId( tbId ), myAction( action ), myId( id ), myIndex( idx ) {} CrTool( QAction* action, const QString& tBar, const int id, const int idx ) - : myCase( 4 ), myAction( action ), myTbTitle( tBar ), myId( id ), myIndex( idx ) {} + : myCase( 4 ), myTbTitle( tBar ), myAction( action ), myId( id ), myIndex( idx ) {} int execute() const { @@ -2133,26 +2133,33 @@ public: return getActiveModule()->createTool( myTbTitle, myTbName ); else if ( getApplication() ) return getApplication()->createTool( myTbTitle, myTbName ); + break; case 1: if ( getActiveModule() ) return getActiveModule()->createTool( myId, myTbId, myIndex ); else if ( getApplication() ) return getApplication()->createTool( myId, myTbId, myIndex ); + break; case 2: if ( getActiveModule() ) return getActiveModule()->createTool( myId, myTbTitle, myIndex ); else if ( getApplication() ) return getApplication()->createTool( myId, myTbTitle, myIndex ); + break; case 3: if ( getActiveModule() ) return getActiveModule()->createTool( myAction, myTbId, myId, myIndex ); else if ( getApplication() ) return getApplication()->createTool( myAction, myTbId, myId, myIndex ); + break; case 4: if ( getActiveModule() ) return getActiveModule()->createTool( myAction, myTbTitle, myId, myIndex ); else if ( getApplication() ) return getApplication()->createTool( myAction, myTbTitle, myId, myIndex ); + break; + default: + break; } return -1; } @@ -2269,17 +2276,17 @@ class CrMenu { public: CrMenu( const QString& subMenu, const int menu, const int id, const int group, const int idx ) - : myCase( 0 ), mySubMenuName( subMenu ), myMenuId( menu ), myId( id ), myGroup( group ), myIndex( idx ) {} + : myCase( 0 ), myMenuId( menu ), mySubMenuName( subMenu ), myGroup( group ), myId( id ), myIndex( idx ) {} CrMenu( const QString& subMenu, const QString& menu, const int id, const int group, const int idx ) - : myCase( 1 ), mySubMenuName( subMenu ), myMenuName( menu ), myId( id ), myGroup( group ), myIndex( idx ) {} + : myCase( 1 ), myMenuName( menu ), mySubMenuName( subMenu ), myGroup( group ), myId( id ), myIndex( idx ) {} CrMenu( const int id, const int menu, const int group, const int idx ) - : myCase( 2 ), myId( id ), myMenuId( menu ), myGroup( group ), myIndex( idx ) {} + : myCase( 2 ), myMenuId( menu ), myGroup( group ), myId( id ), myIndex( idx ) {} CrMenu( const int id, const QString& menu, const int group, const int idx ) - : myCase( 3 ), myId( id ), myMenuName( menu ), myGroup( group ), myIndex( idx ) {} + : myCase( 3 ), myMenuName( menu ), myGroup( group ), myId( id ), myIndex( idx ) {} CrMenu( QAction* action, const int menu, const int id, const int group, const int idx ) - : myCase( 4 ), myAction( action ), myMenuId( menu ), myId( id ), myGroup( group ), myIndex( idx ) {} + : myCase( 4 ), myMenuId( menu ), myGroup( group ), myAction( action ), myId( id ), myIndex( idx ) {} CrMenu( QAction* action, const QString& menu, const int id, const int group, const int idx ) - : myCase( 5 ), myAction( action ), myMenuName( menu ), myId( id ), myGroup( group ), myIndex( idx ) {} + : myCase( 5 ), myMenuName( menu ), myGroup( group ), myAction( action ), myId( id ), myIndex( idx ) {} int execute() const { @@ -2289,31 +2296,39 @@ public: return getActiveModule()->createMenu( mySubMenuName, myMenuId, myId, myGroup, myIndex ); else if ( getApplication() ) return getApplication()->createMenu( mySubMenuName, myMenuId, myId, myGroup, myIndex ); + break; case 1: if ( getActiveModule() ) return getActiveModule()->createMenu( mySubMenuName, myMenuName, myId, myGroup, myIndex ); else if ( getApplication() ) return getApplication()->createMenu( mySubMenuName, myMenuName, myId, myGroup, myIndex ); + break; case 2: if ( getActiveModule() ) return getActiveModule()->createMenu( myId, myMenuId, myGroup, myIndex ); else if ( getApplication() ) return getApplication()->createMenu( myId, myMenuId, myGroup, myIndex ); + break; case 3: if ( getActiveModule() ) return getActiveModule()->createMenu( myId, myMenuName, myGroup, myIndex ); else if ( getApplication() ) return getApplication()->createMenu( myId, myMenuName, myGroup, myIndex ); + break; case 4: if ( getActiveModule() ) return getActiveModule()->createMenu( myAction, myMenuId, myId, myGroup, myIndex ); else if ( getApplication() ) return getApplication()->createMenu( myAction, myMenuId, myId, myGroup, myIndex ); + break; case 5: if ( getActiveModule() ) return getActiveModule()->createMenu( myAction, myMenuName, myId, myGroup, myIndex ); else if ( getApplication() ) return getApplication()->createMenu( myAction, myMenuName, myId, myGroup, myIndex ); + break; + default: + break; } return -1; } @@ -3977,10 +3992,10 @@ public: const QString& icon, const QString& tooltip, const QString& parent ) - : myName( name ), + : myParent( parent ), + myName( name ), myIcon( icon ), - myToolTip( tooltip ), - myParent( parent ) {} + myToolTip( tooltip ) {} virtual void Execute() { SALOME_PYQT_ModuleLight* module = dynamic_cast( getActiveModule() ); diff --git a/src/SOCC/SOCC_ViewModel.cxx b/src/SOCC/SOCC_ViewModel.cxx index 943a1583c..7d7b9b6a5 100644 --- a/src/SOCC/SOCC_ViewModel.cxx +++ b/src/SOCC/SOCC_ViewModel.cxx @@ -103,7 +103,7 @@ bool SOCC_Viewer::highlight( const Handle(SALOME_InteractiveObject)& obj, \param onlyInViewer - search object only in viewer (so object must be displayed) */ bool SOCC_Viewer::isInViewer( const Handle(SALOME_InteractiveObject)& obj, - bool onlyInViewer ) + bool /*onlyInViewer*/ ) { AIS_ListOfInteractive List; getAISContext()->DisplayedObjects(List); @@ -363,7 +363,7 @@ void SOCC_Viewer::Display( const SALOME_OCCPrs* prs ) \param prs - presentation \param forced - removes object from context */ -void SOCC_Viewer::Erase( const SALOME_OCCPrs* prs, const bool forced ) +void SOCC_Viewer::Erase( const SALOME_OCCPrs* prs, const bool /*forced*/ ) { // try do downcast object const SOCC_Prs* anOCCPrs = dynamic_cast( prs ); @@ -511,13 +511,13 @@ void SOCC_Viewer::LocalSelection( const SALOME_OCCPrs* thePrs, const std::list::const_iterator it; if ( anAIS->IsKind( STANDARD_TYPE( AIS_Shape ) ) ) { - ic->Load( anAIS, -1, false ); + ic->Load( anAIS, -1 ); for( it = sel_modes.begin(); it != sel_modes.end(); ++it ) ic->Activate( anAIS, AIS_Shape::SelectionMode( (TopAbs_ShapeEnum)*it ) ); } else if ( anAIS->DynamicType() != STANDARD_TYPE(AIS_Trihedron) ) { - ic->Load( anAIS, -1, false ); + ic->Load( anAIS, -1 ); for( it = sel_modes.begin(); it != sel_modes.end(); ++it ) ic->Activate( anAIS, *it ); } diff --git a/src/SOCC/SOCC_ViewWindow.cxx b/src/SOCC/SOCC_ViewWindow.cxx index ae5648a6e..91dcd0d1c 100644 --- a/src/SOCC/SOCC_ViewWindow.cxx +++ b/src/SOCC/SOCC_ViewWindow.cxx @@ -53,7 +53,7 @@ SOCC_ViewWindow ::action( const int theAction ) { const int inc = 10; - int cx, cy; + int cx = 0, cy = 0; if ( theAction == SUIT_Accel::ZoomIn || theAction == SUIT_Accel::ZoomOut || theAction == SUIT_Accel::RotateLeft || theAction == SUIT_Accel::RotateRight || theAction == SUIT_Accel::RotateUp || theAction == SUIT_Accel::RotateDown ) { diff --git a/src/SOCC/SOCC_ViewWindow.h b/src/SOCC/SOCC_ViewWindow.h index 64b68cd26..2282709eb 100644 --- a/src/SOCC/SOCC_ViewWindow.h +++ b/src/SOCC/SOCC_ViewWindow.h @@ -32,7 +32,7 @@ class SOCC_EXPORT SOCC_ViewWindow : public OCCViewer_ViewWindow { - Q_OBJECT; + Q_OBJECT public: SOCC_ViewWindow( SUIT_Desktop*, OCCViewer_Viewer* ); diff --git a/src/SPlot2d/SPlot2d_ViewModel.cxx b/src/SPlot2d/SPlot2d_ViewModel.cxx index 7154f4cd3..665e34d6b 100644 --- a/src/SPlot2d/SPlot2d_ViewModel.cxx +++ b/src/SPlot2d/SPlot2d_ViewModel.cxx @@ -102,7 +102,7 @@ void SPlot2d_Viewer::renameAll( const Handle(SALOME_InteractiveObject)& IObj, co { const QVector& wnds = vm->getViews(); - for ( uint i = 0; i < wnds.size(); i++ ) + for ( int i = 0; i < wnds.size(); i++ ) { Plot2d_ViewWindow* pwnd = dynamic_cast( wnds.at( i ) ); rename( IObj, name, pwnd->getViewFrame() ); @@ -375,7 +375,7 @@ SUIT_ViewWindow* SPlot2d_Viewer::createView( SUIT_Desktop* theDesktop ) SLOT: called when action "Legend Clicked" is activated. override "onLegendClicked" method from Plot2d_ViewModel. */ -void SPlot2d_Viewer::onClicked( const QVariant& itemInfo, int index ) +void SPlot2d_Viewer::onClicked( const QVariant& itemInfo, int /*index*/ ) { Plot2d_ViewFrame* aViewFrame = getActiveViewFrame(); if(aViewFrame == NULL) return; diff --git a/src/SPlot2d/SPlot2d_ViewModel.h b/src/SPlot2d/SPlot2d_ViewModel.h index 569451e9c..0d9d15167 100644 --- a/src/SPlot2d/SPlot2d_ViewModel.h +++ b/src/SPlot2d/SPlot2d_ViewModel.h @@ -52,7 +52,7 @@ public: virtual QString getType() const { return Type(); } /* interactive object management */ - void highlight( const Handle(SALOME_InteractiveObject)& IObject, bool highlight, bool update = true ) {} + void highlight( const Handle(SALOME_InteractiveObject)& /*IObject*/, bool /*highlight*/, bool /*update*/ = true ) {} void unHighlightAll() {} void rename( const Handle(SALOME_InteractiveObject)&, const QString&, Plot2d_ViewFrame* = 0 ); void renameAll( const Handle(SALOME_InteractiveObject)&, const QString& ); diff --git a/src/SPlot2d/SPlot2d_ViewWindow.h b/src/SPlot2d/SPlot2d_ViewWindow.h index 24ebf10cd..b0e241a5c 100644 --- a/src/SPlot2d/SPlot2d_ViewWindow.h +++ b/src/SPlot2d/SPlot2d_ViewWindow.h @@ -32,7 +32,7 @@ class SPLOT2D_EXPORT SPlot2d_ViewWindow : public Plot2d_ViewWindow { - Q_OBJECT; + Q_OBJECT public: SPlot2d_ViewWindow( SUIT_Desktop*, Plot2d_Viewer* ); diff --git a/src/STD/STD_Application.cxx b/src/STD/STD_Application.cxx index 8aa52f100..4a391e348 100644 --- a/src/STD/STD_Application.cxx +++ b/src/STD/STD_Application.cxx @@ -472,7 +472,7 @@ bool STD_Application::isPossibleToClose( bool& closePermanently ) return true; } -int STD_Application::closeChoice( const QString& docName ) +int STD_Application::closeChoice( const QString& /*docName*/ ) { int answer = SUIT_MessageBox::question( desktop(), tr( "CLOSE_STUDY" ), tr( "CLOSE_QUESTION" ), SUIT_MessageBox::Save | SUIT_MessageBox::Discard | SUIT_MessageBox::Cancel, @@ -487,7 +487,7 @@ int STD_Application::closeChoice( const QString& docName ) return res; } -bool STD_Application::closeAction( const int choice, bool& closePermanently ) +bool STD_Application::closeAction( const int choice, bool& /*closePermanently*/ ) { bool res = true; switch( choice ) diff --git a/src/SUIT/SUIT_DataBrowser.cxx b/src/SUIT/SUIT_DataBrowser.cxx index d79c13c75..98d642b2e 100644 --- a/src/SUIT/SUIT_DataBrowser.cxx +++ b/src/SUIT/SUIT_DataBrowser.cxx @@ -143,7 +143,7 @@ void SUIT_DataBrowser::setUpdateModified( const bool on ) \param obj starting object for updating \param autoOpen if \c true automatically open branches */ -void SUIT_DataBrowser::updateTree( SUIT_DataObject* obj, const bool autoOpen ) +void SUIT_DataBrowser::updateTree( SUIT_DataObject* obj, const bool /*autoOpen*/ ) { SUIT_ProxyModel* m = qobject_cast( model() ); if ( m ) { @@ -470,7 +470,7 @@ void SUIT_DataBrowser::onDblClicked( const QModelIndex& index ) \brief Called when item specified by index is expanded. \internal */ -void SUIT_DataBrowser::onExpanded( const QModelIndex& index ) +void SUIT_DataBrowser::onExpanded( const QModelIndex& /*index*/ ) { if (myResizeOnExpandItem) { adjustFirstColumnWidth(); diff --git a/src/SUIT/SUIT_TreeModel.cxx b/src/SUIT/SUIT_TreeModel.cxx index 4af8769d5..d5a4cd142 100644 --- a/src/SUIT/SUIT_TreeModel.cxx +++ b/src/SUIT/SUIT_TreeModel.cxx @@ -658,7 +658,7 @@ void SUIT_TreeModel::setHeaderFlags( const QString& name, const Qtx::HeaderViewF */ Qtx::HeaderViewFlags SUIT_TreeModel::headerFlags( const QString& name ) const { - Qtx::HeaderViewFlags flags; + Qtx::HeaderViewFlags flags = Qtx::ShowNone; for ( int i = 0, n = myColumns.size(); i < n; i++ ) { if ( myColumns[i].myName == name ) { flags = myColumns[i].myHeaderFlags; @@ -1728,7 +1728,7 @@ QMimeData* SUIT_TreeModel::mimeData( const QModelIndexList& indexes ) const } bool SUIT_TreeModel::dropMimeData( const QMimeData* data, Qt::DropAction action, - int row, int column, const QModelIndex& parent ) + int row, int /*column*/, const QModelIndex& parent ) { if ( action == Qt::IgnoreAction ) // do nothing with data diff --git a/src/SUIT/SUIT_ViewManager.cxx b/src/SUIT/SUIT_ViewManager.cxx index 66102af7e..a355f3702 100644 --- a/src/SUIT/SUIT_ViewManager.cxx +++ b/src/SUIT/SUIT_ViewManager.cxx @@ -213,8 +213,8 @@ QVector SUIT_ViewManager::getViews() const */ bool SUIT_ViewManager::insertView(SUIT_ViewWindow* theView) { - unsigned int aSize = myViews.size(); - unsigned int aNbItems = myViews.count() + 1; + int aSize = myViews.size(); + int aNbItems = myViews.count() + 1; if ( aNbItems > aSize ) { myViews.resize( aNbItems ); @@ -251,7 +251,7 @@ bool SUIT_ViewManager::insertView(SUIT_ViewWindow* theView) connect(theView, SIGNAL(contextMenuRequested( QContextMenuEvent * )), this, SLOT (onContextMenuRequested( QContextMenuEvent * ))); - for ( uint i = 0; i < aSize; i++ ) + for ( int i = 0; i < aSize; i++ ) { if ( myViews[i] == 0 ) { @@ -345,8 +345,8 @@ void SUIT_ViewManager::onMousePressed(SUIT_ViewWindow* theView, QMouseEvent* the void SUIT_ViewManager::onWindowActivated(SUIT_ViewWindow* view) { if (view) { - unsigned int aSize = myViews.size(); - for (uint i = 0; i < aSize; i++) { + int aSize = myViews.size(); + for (int i = 0; i < aSize; i++) { if (myViews[i] && myViews[i] == view) { myActiveView = view; emit activated( this ); diff --git a/src/SUIT/SUIT_ViewWindow.cxx b/src/SUIT/SUIT_ViewWindow.cxx index 22c20b4c1..f429d5de2 100644 --- a/src/SUIT/SUIT_ViewWindow.cxx +++ b/src/SUIT/SUIT_ViewWindow.cxx @@ -334,7 +334,7 @@ bool SUIT_ViewWindow::dropDownButtons() const */ int SUIT_ViewWindow::getId() const { - return int(long(this)); + return int(reinterpret_cast(this)); // todo: unsafe - converting pointer to int can give non-unique result } /*! @@ -454,7 +454,7 @@ void SUIT_ViewWindow::updateSyncViews() /*! "Synchronize View" action slot. */ -void SUIT_ViewWindow::onSynchronizeView( bool checked ) +void SUIT_ViewWindow::onSynchronizeView( bool /*checked*/ ) { QAction* a = qobject_cast( sender() ); if ( a ) { diff --git a/src/SUITApp/SUITApp.cxx b/src/SUITApp/SUITApp.cxx index cba1a49ca..18aa58723 100644 --- a/src/SUITApp/SUITApp.cxx +++ b/src/SUITApp/SUITApp.cxx @@ -102,7 +102,7 @@ namespace } protected: - QString userFileName( const QString& appName, const bool forLoad ) const + QString userFileName( const QString& /*appName*/, const bool forLoad ) const { if ( version().isEmpty() ) return ""; return SUIT_ResourceMgr::userFileName( myCustomAppName, forLoad ); diff --git a/src/SUITApp/SUITApp_init_python.cxx b/src/SUITApp/SUITApp_init_python.cxx index 4c3036f0e..a3e828212 100644 --- a/src/SUITApp/SUITApp_init_python.cxx +++ b/src/SUITApp/SUITApp_init_python.cxx @@ -67,7 +67,7 @@ void SUIT_PYTHON::init_python(int argc, char **argv) script += "import sys\n"; script += "sys.excepthook = _custom_except_hook\n"; script += "del _custom_except_hook, sys\n"; - int res = PyRun_SimpleString(qUtf8Printable(script)); + PyRun_SimpleString(qUtf8Printable(script)); // VSR (22/09/2016): end of workaround PyEval_InitThreads(); // Create (and acquire) the interpreter lock - can be called many times // Py_InitThreads acquires the GIL diff --git a/src/SVTK/SALOME_Actor.cxx b/src/SVTK/SALOME_Actor.cxx index cd2cb3510..503cf1e91 100644 --- a/src/SVTK/SALOME_Actor.cxx +++ b/src/SVTK/SALOME_Actor.cxx @@ -166,20 +166,20 @@ namespace SVTK } -vtkStandardNewMacro(SALOME_Actor); +vtkStandardNewMacro(SALOME_Actor) /*! Constructor */ SALOME_Actor ::SALOME_Actor(): - myRenderer(NULL), myInteractor(NULL), + myRenderer(NULL), mySelectionMode(ActorSelection), myPreHighlightActor(SVTK_Actor::New()), myHighlightActor(SVTK_Actor::New()), - myOutline(vtkOutlineSource::New()), myOutlineActor(VTKViewer_Actor::New()), + myOutline(vtkOutlineSource::New()), myIsDisplayNameActor(false), myNameActor(VTKViewer_FramedTextActor::New()) { @@ -712,7 +712,7 @@ SALOME_Actor TColStd_MapOfInteger anIndexes; if(aMapIter != aVectorIdsMap.end()){ const SVTK_AreaPicker::TVectorIds& aVectorIds = aMapIter->second; - vtkIdType anEnd = aVectorIds.size(); + vtkIdType anEnd = (int)aVectorIds.size(); //!< TODO: conversion from size_t to int for(vtkIdType anId = 0; anId < anEnd; anId++ ) { int aPointId = aVectorIds[anId]; if( aPointId >= 0 && mySelector->IsValid( this, aPointId, true ) ) { @@ -745,7 +745,7 @@ SALOME_Actor aRenderer->SetWorldPoint( aBounds[ i ], aBounds[ j ], aBounds[ k ], 1.0 ); aRenderer->WorldToDisplay(); aRenderer->GetDisplayPoint( aPnt ); - bool anIsPointInSelection; + bool anIsPointInSelection = false; if( theSelectionEvent->myIsRectangle ) anIsPointInSelection = aPnt[0] > x1 && aPnt[0] < x2 && aPnt[1] > y1 && aPnt[1] < y2; else if( theSelectionEvent->myIsPolygon ) @@ -788,7 +788,7 @@ SALOME_Actor TColStd_MapOfInteger anIndexes; if(aMapIter != aVectorIdsMap.end()){ const SVTK_AreaPicker::TVectorIds& aVectorIds = aMapIter->second; - vtkIdType anEnd = aVectorIds.size(); + vtkIdType anEnd = (int)aVectorIds.size(); //!< TODO: conversion from size_t to int for(vtkIdType anId = 0; anId < anEnd; anId++ ) { int aCellId = aVectorIds[anId]; if ( !mySelector->IsValid( this, aCellId ) ) @@ -826,7 +826,7 @@ SALOME_Actor SVTK_IndexedMapOfIds anIndexes; if(aMapIter != aVectorIdsMap.end()){ const SVTK_AreaPicker::TVectorIds& aVectorIds = aMapIter->second; - vtkIdType anEnd = aVectorIds.size(); + vtkIdType anEnd = (int)aVectorIds.size(); //!< TODO: conversion from size_t to int for(vtkIdType anId = 0; anId < anEnd; anId++ ) { int aCellId = aVectorIds[anId]; if ( !mySelector->IsValid( this, aCellId ) ) diff --git a/src/SVTK/SALOME_Actor.h b/src/SVTK/SALOME_Actor.h index 91f2026e2..b5ed155ed 100644 --- a/src/SVTK/SALOME_Actor.h +++ b/src/SVTK/SALOME_Actor.h @@ -74,7 +74,7 @@ class SVTK_EXPORT SALOME_Actor : public VTKViewer_Actor public: static SALOME_Actor* New(); - vtkTypeMacro(SALOME_Actor,VTKViewer_Actor); + vtkTypeMacro(SALOME_Actor,VTKViewer_Actor) //---------------------------------------------------------------------------- //! To check, if the #SALOME_Actor has a reference to #SALOME_InteractiveObject diff --git a/src/SVTK/SVTK_Actor.cxx b/src/SVTK/SVTK_Actor.cxx index 6253b2e4a..a534ea44a 100644 --- a/src/SVTK/SVTK_Actor.cxx +++ b/src/SVTK/SVTK_Actor.cxx @@ -44,7 +44,7 @@ #include "utilities.h" -vtkStandardNewMacro(SVTK_Actor); +vtkStandardNewMacro(SVTK_Actor) /*! Constructor diff --git a/src/SVTK/SVTK_Actor.h b/src/SVTK/SVTK_Actor.h index 8c66d3a45..a42db7998 100644 --- a/src/SVTK/SVTK_Actor.h +++ b/src/SVTK/SVTK_Actor.h @@ -48,7 +48,7 @@ class SVTK_EXPORT SVTK_Actor : public SVTK_DeviceActor public: static SVTK_Actor* New(); - vtkTypeMacro(SVTK_Actor,SVTK_DeviceActor); + vtkTypeMacro(SVTK_Actor,SVTK_DeviceActor) //! Initialiaze the instance completely virtual void diff --git a/src/SVTK/SVTK_AreaPicker.cxx b/src/SVTK/SVTK_AreaPicker.cxx index 4212a0957..46e62b61e 100644 --- a/src/SVTK/SVTK_AreaPicker.cxx +++ b/src/SVTK/SVTK_AreaPicker.cxx @@ -87,6 +87,7 @@ namespace } //---------------------------------------------------------------------------- + /* Unused void CalculatePickPosition( vtkRenderer *theRenderer, double theSelectionX, double theSelectionY, double theSelectionZ, double thePickPosition[3] ) { @@ -101,10 +102,10 @@ namespace } } } + */ } vtkStandardNewMacro( SVTK_AreaPicker ) -; SVTK_AreaPicker::SVTK_AreaPicker() { @@ -264,7 +265,7 @@ void SVTK_AreaPicker::SelectVisiblePoints( QVector< QPoint >& thePoints, double aDX[3]; theRenderer->GetDisplayPoint( aDX ); - bool isInSelection; + bool isInSelection = false; if ( theMode == RectangleMode ) isInSelection = aDX[0] >= mySelection[0] && aDX[0] <= mySelection[2] && aDX[1] >= mySelection[1] && aDX[1] <= mySelection[3]; @@ -372,7 +373,7 @@ void SVTK_AreaPicker::SelectVisibleCells( QVector< QPoint >& thePoints, double aDX[3]; theRenderer->GetDisplayPoint( aDX ); - bool isInSelection; + bool isInSelection = false; if ( theMode == RectangleMode ) isInSelection = aDX[0] >= mySelection[0] && aDX[0] <= mySelection[2] && aDX[1] >= mySelection[1] && aDX[1] <= mySelection[3]; diff --git a/src/SVTK/SVTK_AreaPicker.h b/src/SVTK/SVTK_AreaPicker.h index 972438fd6..fbe50d391 100644 --- a/src/SVTK/SVTK_AreaPicker.h +++ b/src/SVTK/SVTK_AreaPicker.h @@ -60,7 +60,7 @@ class SVTK_EXPORT SVTK_AreaPicker : public vtkAbstractPropPicker static SVTK_AreaPicker *New(); - vtkTypeMacro(SVTK_AreaPicker,vtkAbstractPropPicker); + vtkTypeMacro(SVTK_AreaPicker,vtkAbstractPropPicker) /*! Specify tolerance for performing pick operation. Tolerance is specified diff --git a/src/SVTK/SVTK_CubeAxesActor2D.cxx b/src/SVTK/SVTK_CubeAxesActor2D.cxx index 743dc557e..0740ab57a 100644 --- a/src/SVTK/SVTK_CubeAxesActor2D.cxx +++ b/src/SVTK/SVTK_CubeAxesActor2D.cxx @@ -43,7 +43,7 @@ #include #include -vtkStandardNewMacro(SVTK_CubeAxesActor2D); +vtkStandardNewMacro(SVTK_CubeAxesActor2D) // Instantiate this object. SVTK_CubeAxesActor2D::SVTK_CubeAxesActor2D() diff --git a/src/SVTK/SVTK_CubeAxesActor2D.h b/src/SVTK/SVTK_CubeAxesActor2D.h index 0944606f0..3d322b047 100644 --- a/src/SVTK/SVTK_CubeAxesActor2D.h +++ b/src/SVTK/SVTK_CubeAxesActor2D.h @@ -53,7 +53,7 @@ class SVTK_EXPORT SVTK_CubeAxesActor2D : public vtkCubeAxesActor2D #endif { public: - vtkTypeMacro(SVTK_CubeAxesActor2D,vtkCubeAxesActor2D); + vtkTypeMacro(SVTK_CubeAxesActor2D,vtkCubeAxesActor2D) // Description: // Instantiate object with bold, italic, and shadow enabled; font family diff --git a/src/SVTK/SVTK_DeviceActor.cxx b/src/SVTK/SVTK_DeviceActor.cxx index a0c576e21..b7f4f42c8 100644 --- a/src/SVTK/SVTK_DeviceActor.cxx +++ b/src/SVTK/SVTK_DeviceActor.cxx @@ -43,7 +43,7 @@ #include -vtkStandardNewMacro(SVTK_DeviceActor); +vtkStandardNewMacro(SVTK_DeviceActor) /*! Constructor @@ -97,7 +97,7 @@ SVTK_DeviceActor myFeatureEdges->Delete(); - for(int i = 0, iEnd = myPassFilter.size(); i < iEnd; i++) + for(size_t i = 0, iEnd = myPassFilter.size(); i < iEnd; i++) myPassFilter[i]->Delete(); } @@ -205,7 +205,7 @@ SVTK_DeviceActor if(myIsFeatureEdgesEnabled) mTime = std::max(mTime,myFeatureEdges->GetMTime()); - for(int i = 0, iEnd = myPassFilter.size(); i < iEnd; i++) + for(size_t i = 0, iEnd = myPassFilter.size(); i < iEnd; i++) std::max(mTime,myPassFilter[i]->GetMTime()); return mTime; diff --git a/src/SVTK/SVTK_DeviceActor.h b/src/SVTK/SVTK_DeviceActor.h index 89e5264c6..82c31e1c5 100644 --- a/src/SVTK/SVTK_DeviceActor.h +++ b/src/SVTK/SVTK_DeviceActor.h @@ -56,7 +56,7 @@ class vtkAlgorithmOutput; class SVTK_EXPORT SVTK_DeviceActor: public vtkLODActor { public: - vtkTypeMacro(SVTK_DeviceActor,vtkLODActor); + vtkTypeMacro(SVTK_DeviceActor,vtkLODActor) static SVTK_DeviceActor* diff --git a/src/SVTK/SVTK_GenericRenderWindowInteractor.cxx b/src/SVTK/SVTK_GenericRenderWindowInteractor.cxx index a8abf22d1..90debf24a 100644 --- a/src/SVTK/SVTK_GenericRenderWindowInteractor.cxx +++ b/src/SVTK/SVTK_GenericRenderWindowInteractor.cxx @@ -32,7 +32,7 @@ #include -vtkStandardNewMacro(QVTK_GenericRenderWindowInteractor); +vtkStandardNewMacro(QVTK_GenericRenderWindowInteractor) /*! Constructor @@ -104,7 +104,7 @@ QVTK_GenericRenderWindowInteractor } -vtkStandardNewMacro(SVTK_GenericRenderWindowInteractor); +vtkStandardNewMacro(SVTK_GenericRenderWindowInteractor) /*! Constructor diff --git a/src/SVTK/SVTK_GenericRenderWindowInteractor.h b/src/SVTK/SVTK_GenericRenderWindowInteractor.h index 8e47def06..aaecd3ece 100644 --- a/src/SVTK/SVTK_GenericRenderWindowInteractor.h +++ b/src/SVTK/SVTK_GenericRenderWindowInteractor.h @@ -58,11 +58,11 @@ class SVTK_EXPORT QVTK_GenericRenderWindowInteractor: public QObject, public vtkGenericRenderWindowInteractor { - Q_OBJECT; + Q_OBJECT public: static QVTK_GenericRenderWindowInteractor* New(); - vtkTypeMacro(QVTK_GenericRenderWindowInteractor,vtkGenericRenderWindowInteractor); + vtkTypeMacro(QVTK_GenericRenderWindowInteractor,vtkGenericRenderWindowInteractor) //! Starts the QTimer instance on defined microseconds virtual @@ -98,7 +98,7 @@ class SVTK_EXPORT SVTK_GenericRenderWindowInteractor: public QVTK_GenericRenderW { public: static SVTK_GenericRenderWindowInteractor* New(); - vtkTypeMacro(SVTK_GenericRenderWindowInteractor,QVTK_GenericRenderWindowInteractor); + vtkTypeMacro(SVTK_GenericRenderWindowInteractor,QVTK_GenericRenderWindowInteractor) //! To get access to SVTK_Selector SVTK_Selector* diff --git a/src/SVTK/SVTK_Hash.h b/src/SVTK/SVTK_Hash.h index 7f5b1d1fa..afd6227ef 100644 --- a/src/SVTK/SVTK_Hash.h +++ b/src/SVTK/SVTK_Hash.h @@ -38,7 +38,7 @@ class SVTK_Hasher { public: static Standard_Integer HashCode(const std::vector ids, const Standard_Integer upper) { - Standard_Integer seed = ids.size(); + Standard_Integer seed = (Standard_Integer)ids.size(); //!< TODO: conversion from size_t to int for( Standard_Integer i = 0; i < (Standard_Integer) ids.size(); i++ ) { Standard_Integer v = ids[i]; seed ^= v + 0x9e3779b9 + ( seed << 6 ) + ( seed >> 2 ); diff --git a/src/SVTK/SVTK_ImageWriterMgr.cxx b/src/SVTK/SVTK_ImageWriterMgr.cxx index 9c255d52d..21058129d 100644 --- a/src/SVTK/SVTK_ImageWriterMgr.cxx +++ b/src/SVTK/SVTK_ImageWriterMgr.cxx @@ -88,7 +88,7 @@ SVTK_ImageWriterMgr //"- total = "<total()<< "; available = "<available()<SetClientData(this); myCommand->SetCallback(SVTK_Recorder::ProcessEvents); @@ -433,13 +433,14 @@ SVTK_Recorder aStream<<"COPY /Y "< NUL"; #endif - if(anIndex + 1 < aFinishIndex) + if(anIndex + 1 < aFinishIndex) { #ifndef WIN32 aStream<<" \\"; aStream<CreateTimer(VTKI_TIMER_FIRST); } @@ -208,7 +208,7 @@ QVTK_RenderWindowInteractor */ void QVTK_RenderWindowInteractor -::resizeEvent( QResizeEvent* theEvent ) +::resizeEvent( QResizeEvent* /*theEvent*/ ) { int* aSize = getRenderWindow()->GetSize(); int aWidth = aSize[0]; @@ -243,7 +243,7 @@ QVTK_RenderWindowInteractor */ void QVTK_RenderWindowInteractor -::contextMenuEvent( QContextMenuEvent* event ) +::contextMenuEvent( QContextMenuEvent* /*event*/ ) {} /*! @@ -321,7 +321,7 @@ QVTK_RenderWindowInteractor */ void QVTK_RenderWindowInteractor -::mouseDoubleClickEvent( QMouseEvent* event ) +::mouseDoubleClickEvent( QMouseEvent* /*event*/ ) {} @@ -378,7 +378,7 @@ QVTK_RenderWindowInteractor */ void QVTK_RenderWindowInteractor -::enterEvent( QEvent* event ) +::enterEvent( QEvent* /*event*/ ) { if(FOCUS_UNDER_MOUSE){ activateWindow(); diff --git a/src/SVTK/SVTK_RenderWindowInteractor.h b/src/SVTK/SVTK_RenderWindowInteractor.h index a77b0637c..3ebb0eb40 100644 --- a/src/SVTK/SVTK_RenderWindowInteractor.h +++ b/src/SVTK/SVTK_RenderWindowInteractor.h @@ -63,7 +63,7 @@ class SVTK_Renderer; */ class SVTK_EXPORT QVTK_RenderWindowInteractor: public QWidget { - Q_OBJECT; + Q_OBJECT public: QVTK_RenderWindowInteractor(QWidget* theParent, @@ -139,7 +139,7 @@ class SVTK_EXPORT QVTK_RenderWindowInteractor: public QWidget */ class SVTK_EXPORT SVTK_RenderWindowInteractor: public QVTK_RenderWindowInteractor { - Q_OBJECT; + Q_OBJECT public: SVTK_RenderWindowInteractor(QWidget* theParent, diff --git a/src/SVTK/SVTK_Renderer.cxx b/src/SVTK/SVTK_Renderer.cxx index 4ecfc2c93..aad5d922b 100644 --- a/src/SVTK/SVTK_Renderer.cxx +++ b/src/SVTK/SVTK_Renderer.cxx @@ -55,24 +55,24 @@ #undef max -vtkStandardNewMacro(SVTK_Renderer); +vtkStandardNewMacro(SVTK_Renderer) /*! Constructor */ SVTK_Renderer ::SVTK_Renderer(): - myDevice(VTKViewer_OpenGLRenderer::New()), - myInteractor(NULL), myPriority(0.0), myEventCallbackCommand(vtkCallbackCommand::New()), + myDevice(VTKViewer_OpenGLRenderer::New()), + myInteractor(NULL), + myTransform(VTKViewer_Transform::New()), myPointPicker(vtkPointPicker::New()), myCellPicker(vtkCellPicker::New()), myPointAreaPicker(SVTK_AreaPicker::New()), myCellAreaPicker(SVTK_AreaPicker::New()), myPreHighlightProperty(vtkProperty::New()), myHighlightProperty(vtkProperty::New()), - myTransform(VTKViewer_Transform::New()), myCubeAxes(SVTK_CubeAxesActor2D::New()), myTrihedron(SVTK_Trihedron::New()), myTrihedronSize(105), diff --git a/src/SVTK/SVTK_Renderer.h b/src/SVTK/SVTK_Renderer.h index 358bd649c..62249484d 100644 --- a/src/SVTK/SVTK_Renderer.h +++ b/src/SVTK/SVTK_Renderer.h @@ -65,7 +65,7 @@ class SVTK_Selector; class SVTK_EXPORT SVTK_Renderer : public vtkObject { public: - vtkTypeMacro(SVTK_Renderer,vtkObject); + vtkTypeMacro(SVTK_Renderer,vtkObject) static SVTK_Renderer* New(); //---------------------------------------------------------------------------- diff --git a/src/SVTK/SVTK_Selector.cxx b/src/SVTK/SVTK_Selector.cxx index 58b8e7d9a..dae45cfeb 100644 --- a/src/SVTK/SVTK_Selector.cxx +++ b/src/SVTK/SVTK_Selector.cxx @@ -252,7 +252,7 @@ int SVTK_SelectorDef ::IObjectCount() const { - return myIObjects.size(); + return (int)myIObjects.size(); //!< TODO: conversion from size_t to int } /*! diff --git a/src/SVTK/SVTK_Selector.h b/src/SVTK/SVTK_Selector.h index 93b0e7dfd..a61e90f73 100644 --- a/src/SVTK/SVTK_Selector.h +++ b/src/SVTK/SVTK_Selector.h @@ -59,7 +59,7 @@ class SVTK_EXPORT SVTK_Selector: public vtkObject public: static SVTK_Selector* New(); - vtkTypeMacro(SVTK_Selector,vtkObject); + vtkTypeMacro(SVTK_Selector,vtkObject) //! To change current Selection_Mode (as outside effect, it invokes selectionChange signal) virtual diff --git a/src/SVTK/SVTK_SetRotationPointDlg.cxx b/src/SVTK/SVTK_SetRotationPointDlg.cxx index fdc5e3362..a0b98d81c 100644 --- a/src/SVTK/SVTK_SetRotationPointDlg.cxx +++ b/src/SVTK/SVTK_SetRotationPointDlg.cxx @@ -57,9 +57,9 @@ SVTK_SetRotationPointDlg theParent, theName), myMainWindow(theParent), + myRWInteractor(theParent->GetInteractor()), myPriority(0.0), - myEventCallbackCommand(vtkCallbackCommand::New()), - myRWInteractor(theParent->GetInteractor()) + myEventCallbackCommand(vtkCallbackCommand::New()) { setWindowTitle(tr("DLG_TITLE")); setSizeGripEnabled(true); diff --git a/src/SVTK/SVTK_SetRotationPointDlg.h b/src/SVTK/SVTK_SetRotationPointDlg.h index 9416481c1..65a37ea70 100644 --- a/src/SVTK/SVTK_SetRotationPointDlg.h +++ b/src/SVTK/SVTK_SetRotationPointDlg.h @@ -54,7 +54,7 @@ class vtkObject; class SVTK_EXPORT SVTK_SetRotationPointDlg : public ViewerTools_DialogBase { - Q_OBJECT; + Q_OBJECT public: SVTK_SetRotationPointDlg(QtxAction* theAction, diff --git a/src/SVTK/SVTK_SpaceMouse.cxx b/src/SVTK/SVTK_SpaceMouse.cxx index af8d14bb4..54b7069f9 100644 --- a/src/SVTK/SVTK_SpaceMouse.cxx +++ b/src/SVTK/SVTK_SpaceMouse.cxx @@ -109,7 +109,7 @@ int SVTK_SpaceMouseXCB::initialize( xcb_connection_t *connection, xcb_window_t w int SVTK_SpaceMouseXCB::setWindow( xcb_connection_t *connection, xcb_window_t window ) { xcb_client_message_event_t xcbEvent; - xcb_window_t root_window; + xcb_window_t root_window = 0; // todo: initial value (if screen is null, see below) xcb_screen_t* screen; xcb_generic_error_t* error; xcb_void_cookie_t cookie; diff --git a/src/SVTK/SVTK_Trihedron.cxx b/src/SVTK/SVTK_Trihedron.cxx index 3a9ee482a..b42382c6c 100644 --- a/src/SVTK/SVTK_Trihedron.cxx +++ b/src/SVTK/SVTK_Trihedron.cxx @@ -29,7 +29,7 @@ #include #include -vtkStandardNewMacro(SVTK_Trihedron); +vtkStandardNewMacro(SVTK_Trihedron) /*! Constructor diff --git a/src/SVTK/SVTK_Trihedron.h b/src/SVTK/SVTK_Trihedron.h index 321e00d89..24ac59c36 100644 --- a/src/SVTK/SVTK_Trihedron.h +++ b/src/SVTK/SVTK_Trihedron.h @@ -35,7 +35,7 @@ protected: void operator = (const SVTK_Trihedron&); // Not implemented public: - vtkTypeMacro(SVTK_Trihedron,VTKViewer_Trihedron); + vtkTypeMacro(SVTK_Trihedron,VTKViewer_Trihedron) static SVTK_Trihedron *New(); virtual int GetVisibleActorCount(vtkRenderer* theRenderer); diff --git a/src/SVTK/SVTK_UpdateRateDlg.cxx b/src/SVTK/SVTK_UpdateRateDlg.cxx index ca457cffe..6dd3ba73e 100644 --- a/src/SVTK/SVTK_UpdateRateDlg.cxx +++ b/src/SVTK/SVTK_UpdateRateDlg.cxx @@ -168,10 +168,10 @@ SVTK_UpdateRateDlg ViewerTools_DialogBase(theAction, theParent, theName), - myPriority(0.0), - myEventCallbackCommand(vtkCallbackCommand::New()), myRWInteractor(theParent->GetInteractor()), - myAction(theAction) + myAction(theAction), + myPriority(0.0), + myEventCallbackCommand(vtkCallbackCommand::New()) { vtkRenderWindowInteractor* aRWI = myRWInteractor->GetDevice(); bool anIsEnabledUpdateRate = false; diff --git a/src/SVTK/SVTK_UpdateRateDlg.h b/src/SVTK/SVTK_UpdateRateDlg.h index 961d5a627..a9c09a6b7 100644 --- a/src/SVTK/SVTK_UpdateRateDlg.h +++ b/src/SVTK/SVTK_UpdateRateDlg.h @@ -46,7 +46,7 @@ class vtkObject; class SVTK_UpdateRateDlg : public ViewerTools_DialogBase { - Q_OBJECT; + Q_OBJECT public: SVTK_UpdateRateDlg(QtxAction* theAction, diff --git a/src/SVTK/SVTK_View.cxx b/src/SVTK/SVTK_View.cxx index 6e597e043..c844bfc6a 100644 --- a/src/SVTK/SVTK_View.cxx +++ b/src/SVTK/SVTK_View.cxx @@ -201,7 +201,7 @@ void SVTK_View ::highlight( const Handle(SALOME_InteractiveObject)& theIO, bool theIsHighlight, - bool theIsUpdate ) + bool /*theIsUpdate*/ ) { using namespace SVTK; VTK::ActorCollectionCopy aCopy(getRenderer()->GetActors()); diff --git a/src/SVTK/SVTK_View.h b/src/SVTK/SVTK_View.h index 16dd58a9b..6dc0c8010 100644 --- a/src/SVTK/SVTK_View.h +++ b/src/SVTK/SVTK_View.h @@ -60,7 +60,7 @@ class QColor; */ class SVTK_EXPORT SVTK_SignalHandler : public QObject { - Q_OBJECT; + Q_OBJECT public: SVTK_SignalHandler(SVTK_ViewWindow* theMainWindow); @@ -117,7 +117,7 @@ public: */ class SVTK_EXPORT SVTK_View : public SVTK_SignalHandler { - Q_OBJECT; + Q_OBJECT public: SVTK_View(SVTK_ViewWindow* theMainWindow); diff --git a/src/SVTK/SVTK_ViewModel.cxx b/src/SVTK/SVTK_ViewModel.cxx index 0e062d85c..a91655bde 100644 --- a/src/SVTK/SVTK_ViewModel.cxx +++ b/src/SVTK/SVTK_ViewModel.cxx @@ -219,7 +219,7 @@ void SVTK_Viewer::setTrihedronSize( const double theSize, const bool theRelative if (SUIT_ViewManager* aViewManager = getViewManager()) { QVector aViews = aViewManager->getViews(); - for ( uint i = 0; i < aViews.count(); i++ ) + for ( int i = 0; i < aViews.count(); i++ ) { if ( TViewWindow* aView = dynamic_cast(aViews.at( i )) ) aView->SetTrihedronSize( theSize, theRelative ); @@ -245,7 +245,7 @@ void SVTK_Viewer::setStaticTrihedronVisible( const bool theIsVisible ) if (SUIT_ViewManager* aViewManager = getViewManager()) { QVector aViews = aViewManager->getViews(); - for ( uint i = 0; i < aViews.count(); i++ ) + for ( int i = 0; i < aViews.count(); i++ ) { if ( TViewWindow* aView = dynamic_cast(aViews.at( i )) ) aView->SetStaticTrihedronVisible( theIsVisible ); @@ -273,7 +273,7 @@ void SVTK_Viewer::setProjectionMode( const int theMode ) myProjMode = theMode; if (SUIT_ViewManager* aViewManager = getViewManager()) { QVector aViews = aViewManager->getViews(); - for ( uint i = 0; i < aViews.count(); i++ ) + for ( int i = 0; i < aViews.count(); i++ ) { if ( TViewWindow* aView = dynamic_cast(aViews.at( i )) ) aView->SetProjectionMode( theMode ); @@ -301,7 +301,7 @@ void SVTK_Viewer::setStereoType( const int theType ) if (SUIT_ViewManager* aViewManager = getViewManager()) { QVector aViews = aViewManager->getViews(); - for ( uint i = 0; i < aViews.count(); i++ ) + for ( int i = 0; i < aViews.count(); i++ ) { if ( TViewWindow* aView = dynamic_cast(aViews.at( i )) ) aView->SetStereoType( theType ); @@ -329,7 +329,7 @@ void SVTK_Viewer::setAnaglyphFilter( const int theFilter ) if (SUIT_ViewManager* aViewManager = getViewManager()) { QVector aViews = aViewManager->getViews(); - for ( uint i = 0; i < aViews.count(); i++ ) + for ( int i = 0; i < aViews.count(); i++ ) { if ( TViewWindow* aView = dynamic_cast(aViews.at( i )) ) aView->SetAnaglyphFilter( theFilter ); @@ -357,7 +357,7 @@ void SVTK_Viewer::setQuadBufferSupport( const bool theEnable ) if (SUIT_ViewManager* aViewManager = getViewManager()) { QVector aViews = aViewManager->getViews(); - for ( uint i = 0; i < aViews.count(); i++ ) + for ( int i = 0; i < aViews.count(); i++ ) { if ( TViewWindow* aView = dynamic_cast(aViews.at( i )) ) aView->SetQuadBufferSupport( theEnable ); @@ -383,7 +383,7 @@ void SVTK_Viewer::setInteractionStyle( const int theStyle ) if (SUIT_ViewManager* aViewManager = getViewManager()) { QVector aViews = aViewManager->getViews(); - for ( uint i = 0; i < aViews.count(); i++ ) + for ( int i = 0; i < aViews.count(); i++ ) { if ( TViewWindow* aView = dynamic_cast(aViews.at( i )) ) aView->SetInteractionStyle( theStyle ); @@ -409,7 +409,7 @@ void SVTK_Viewer::setZoomingStyle( const int theStyle ) if (SUIT_ViewManager* aViewManager = getViewManager()) { QVector aViews = aViewManager->getViews(); - for ( uint i = 0; i < aViews.count(); i++ ) + for ( int i = 0; i < aViews.count(); i++ ) { if ( TViewWindow* aView = dynamic_cast(aViews.at( i )) ) aView->SetZoomingStyle( theStyle ); @@ -435,7 +435,7 @@ void SVTK_Viewer::setPreSelectionMode( Preselection_Mode theMode ) if (SUIT_ViewManager* aViewManager = getViewManager()) { QVector aViews = aViewManager->getViews(); - for ( uint i = 0; i < aViews.count(); i++ ) + for ( int i = 0; i < aViews.count(); i++ ) { if ( TViewWindow* aView = dynamic_cast(aViews.at( i )) ) aView->SetPreSelectionMode( theMode ); @@ -471,7 +471,7 @@ void SVTK_Viewer::setIncrementalSpeed( const int theValue, const int theMode ) if (SUIT_ViewManager* aViewManager = getViewManager()) { QVector aViews = aViewManager->getViews(); - for ( uint i = 0; i < aViews.count(); i++ ) + for ( int i = 0; i < aViews.count(); i++ ) { if ( TViewWindow* aView = dynamic_cast(aViews.at( i )) ) aView->SetIncrementalSpeed( theValue, theMode ); @@ -502,7 +502,7 @@ void SVTK_Viewer::setSpacemouseButtons( const int theBtn1, const int theBtn2, co if (SUIT_ViewManager* aViewManager = getViewManager()) { QVector aViews = aViewManager->getViews(); - for ( uint i = 0; i < aViews.count(); i++ ) + for ( int i = 0; i < aViews.count(); i++ ) { if ( TViewWindow* aView = dynamic_cast(aViews.at( i )) ) aView->SetSpacemouseButtons( theBtn1, theBtn2, theBtn3 ); @@ -557,19 +557,19 @@ void SVTK_Viewer::contextMenuPopup( QMenu* thePopup ) /*! SLOT: called on mouse button press, empty implementation */ -void SVTK_Viewer::onMousePress(SUIT_ViewWindow* vw, QMouseEvent* event) +void SVTK_Viewer::onMousePress(SUIT_ViewWindow* /*vw*/, QMouseEvent* /*event*/) {} /*! SLOT: called on mouse move, empty implementation */ -void SVTK_Viewer::onMouseMove(SUIT_ViewWindow* vw, QMouseEvent* event) +void SVTK_Viewer::onMouseMove(SUIT_ViewWindow* /*vw*/, QMouseEvent* /*event*/) {} /*! SLOT: called on mouse button release, empty implementation */ -void SVTK_Viewer::onMouseRelease(SUIT_ViewWindow* vw, QMouseEvent* event) +void SVTK_Viewer::onMouseRelease(SUIT_ViewWindow* /*vw*/, QMouseEvent* /*event*/) {} /*! @@ -583,7 +583,7 @@ void SVTK_Viewer::enableSelection(bool isEnabled) if (SUIT_ViewManager* aViewManager = getViewManager()) { QVector aViews = aViewManager->getViews(); - for ( uint i = 0; i < aViews.count(); i++ ) + for ( int i = 0; i < aViews.count(); i++ ) { if ( TViewWindow* aView = dynamic_cast(aViews.at( i )) ) aView->SetSelectionEnabled( isEnabled ); diff --git a/src/SVTK/SVTK_ViewModel.h b/src/SVTK/SVTK_ViewModel.h index c47219786..bc7b2c9fc 100644 --- a/src/SVTK/SVTK_ViewModel.h +++ b/src/SVTK/SVTK_ViewModel.h @@ -44,7 +44,7 @@ class VTKViewer_Actor; //! Extends two interfaces #SVTK_ViewModelBase and #SALOME_View class SVTK_EXPORT SVTK_Viewer : public SVTK_ViewModelBase, public SALOME_View { - Q_OBJECT; + Q_OBJECT public: /*! supported gradient types */ diff --git a/src/SVTK/SVTK_ViewModelBase.h b/src/SVTK/SVTK_ViewModelBase.h index 4a82304cd..a1735e4fa 100644 --- a/src/SVTK/SVTK_ViewModelBase.h +++ b/src/SVTK/SVTK_ViewModelBase.h @@ -32,7 +32,7 @@ //! To define minimal interface for #SVTK_ViewWindow initialization class SVTK_EXPORT SVTK_ViewModelBase: public SUIT_ViewModel { - Q_OBJECT; + Q_OBJECT public slots: //! To invoke Qt #selectionChanged signal diff --git a/src/SVTK/SVTK_ViewParameterDlg.cxx b/src/SVTK/SVTK_ViewParameterDlg.cxx index b27def000..73ff26cfa 100644 --- a/src/SVTK/SVTK_ViewParameterDlg.cxx +++ b/src/SVTK/SVTK_ViewParameterDlg.cxx @@ -54,9 +54,9 @@ SVTK_ViewParameterDlg::SVTK_ViewParameterDlg(QtxAction* theAction, const char* theName): ViewerTools_DialogBase(theAction, theParent, theName), myMainWindow(theParent), + myRWInteractor(theParent->GetInteractor()), myPriority(0.0), - myEventCallbackCommand(vtkCallbackCommand::New()), - myRWInteractor(theParent->GetInteractor()) + myEventCallbackCommand(vtkCallbackCommand::New()) { setWindowTitle(tr("DLG_TITLE")); setSizeGripEnabled(true); @@ -494,7 +494,7 @@ void SVTK_ViewParameterDlg::setEnabled(QFrame* theWidget, const bool theState) } -void SVTK_ViewParameterDlg::onProjectionModeChanged(int mode) +void SVTK_ViewParameterDlg::onProjectionModeChanged(int /*mode*/) { int aBtn = myProjectionMode->checkedId(); @@ -516,7 +516,7 @@ void SVTK_ViewParameterDlg::onProjectionModeChanged(int mode) } } -void SVTK_ViewParameterDlg::onPositionModeChanged(int mode) +void SVTK_ViewParameterDlg::onPositionModeChanged(int /*mode*/) { setEnabled(myCameraCoords, myCameraPositionMode->checkedId() == 0); } diff --git a/src/SVTK/SVTK_ViewParameterDlg.h b/src/SVTK/SVTK_ViewParameterDlg.h index 29d10ac08..54d47c0a7 100644 --- a/src/SVTK/SVTK_ViewParameterDlg.h +++ b/src/SVTK/SVTK_ViewParameterDlg.h @@ -47,7 +47,7 @@ class vtkObject; class SVTK_EXPORT SVTK_ViewParameterDlg : public ViewerTools_DialogBase { - Q_OBJECT; + Q_OBJECT public: SVTK_ViewParameterDlg(QtxAction* theAction, diff --git a/src/SVTK/SVTK_ViewWindow.cxx b/src/SVTK/SVTK_ViewWindow.cxx index 2c6aaecce..2181cbefd 100644 --- a/src/SVTK/SVTK_ViewWindow.cxx +++ b/src/SVTK/SVTK_ViewWindow.cxx @@ -138,9 +138,9 @@ namespace SVTK SVTK_ViewWindow::SVTK_ViewWindow(SUIT_Desktop* theDesktop): SUIT_ViewWindow(theDesktop), myView(NULL), - myDumpImage(QImage()), myKeyFreeInteractorStyle(SVTK_KeyFreeInteractorStyle::New()), - myEventCallbackCommand(vtkCallbackCommand::New()) + myEventCallbackCommand(vtkCallbackCommand::New()), + myDumpImage(QImage()) { setWindowFlags( windowFlags() & ~Qt::Window ); // specific of vtkSmartPointer @@ -1233,7 +1233,7 @@ void SVTK_ViewWindow::SetTrihedronSize(const double theSize, const bool theRelat /*! If parameter theIsForcedUpdate is true, recalculate parameters for * trihedron and cube axes, even if trihedron and cube axes is invisible. */ -void SVTK_ViewWindow::AdjustTrihedrons(const bool theIsForcedUpdate) +void SVTK_ViewWindow::AdjustTrihedrons(const bool /*theIsForcedUpdate*/) { GetRenderer()->AdjustActors(); Repaint(); @@ -1890,7 +1890,7 @@ void SVTK_ViewWindow::setVisualParameters( const QString& parameters ) void SVTK_ViewWindow::doSetVisualParameters( const QString& parameters, bool baseParamsOnly ) { - double pos[3], focalPnt[3], viewUp[3], parScale, scale[3]; + double pos[3], focalPnt[3], viewUp[3], parScale = 1.0, scale[3]; QXmlStreamReader aReader(parameters); SVTK_CubeAxesActor2D* gradAxesActor = GetCubeAxes(); @@ -2733,9 +2733,9 @@ void SVTK_ViewWindow::emitTransformed() { Processes events */ void SVTK_ViewWindow::ProcessEvents(vtkObject* vtkNotUsed(theObject), - unsigned long theEvent, + unsigned long /*theEvent*/, void* theClientData, - void* theCallData) + void* /*theCallData*/) { SVTK_ViewWindow* self = reinterpret_cast(theClientData); if(self) diff --git a/src/SVTK/SVTK_ViewWindow.h b/src/SVTK/SVTK_ViewWindow.h index 0ab5d7920..5ca8ee9f7 100644 --- a/src/SVTK/SVTK_ViewWindow.h +++ b/src/SVTK/SVTK_ViewWindow.h @@ -84,7 +84,7 @@ namespace SVTK //! Define a container for SALOME VTK view window class SVTK_EXPORT SVTK_ViewWindow : public SUIT_ViewWindow { - Q_OBJECT; + Q_OBJECT public: //! To construct #SVTK_ViewWindow instance diff --git a/src/SVTK/salomevtkPVAxesActor.cxx b/src/SVTK/salomevtkPVAxesActor.cxx index 6f11e2bb0..fcc799286 100644 --- a/src/SVTK/salomevtkPVAxesActor.cxx +++ b/src/SVTK/salomevtkPVAxesActor.cxx @@ -59,10 +59,10 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. namespace salomevtk { -vtkStandardNewMacro(vtkPVAxesActor); +vtkStandardNewMacro(vtkPVAxesActor) -vtkCxxSetObjectMacro( vtkPVAxesActor, UserDefinedTip, vtkPolyData ); -vtkCxxSetObjectMacro( vtkPVAxesActor, UserDefinedShaft, vtkPolyData ); +vtkCxxSetObjectMacro( vtkPVAxesActor, UserDefinedTip, vtkPolyData ) +vtkCxxSetObjectMacro( vtkPVAxesActor, UserDefinedShaft, vtkPolyData ) //----------------------------------------------------------------------------- vtkPVAxesActor::vtkPVAxesActor() diff --git a/src/SVTK/salomevtkPVAxesActor.h b/src/SVTK/salomevtkPVAxesActor.h index 9cfd4a8d0..97c92ad08 100644 --- a/src/SVTK/salomevtkPVAxesActor.h +++ b/src/SVTK/salomevtkPVAxesActor.h @@ -69,7 +69,7 @@ class SVTK_EXPORT vtkPVAxesActor : public vtkProp3D { public: static vtkPVAxesActor *New(); - vtkTypeMacro(vtkPVAxesActor,vtkProp3D); + vtkTypeMacro(vtkPVAxesActor,vtkProp3D) void PrintSelf(ostream& os, vtkIndent indent); diff --git a/src/SVTK/salomevtkPVAxesWidget.cxx b/src/SVTK/salomevtkPVAxesWidget.cxx index c73d4730b..985a637b9 100644 --- a/src/SVTK/salomevtkPVAxesWidget.cxx +++ b/src/SVTK/salomevtkPVAxesWidget.cxx @@ -54,10 +54,10 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. namespace salomevtk { -vtkStandardNewMacro(vtkPVAxesWidget); +vtkStandardNewMacro(vtkPVAxesWidget) -vtkCxxSetObjectMacro(vtkPVAxesWidget, AxesActor, vtkPVAxesActor); -vtkCxxSetObjectMacro(vtkPVAxesWidget, ParentRenderer, vtkRenderer); +vtkCxxSetObjectMacro(vtkPVAxesWidget, AxesActor, vtkPVAxesActor) +vtkCxxSetObjectMacro(vtkPVAxesWidget, ParentRenderer, vtkRenderer) //---------------------------------------------------------------------------- class vtkPVAxesWidgetObserver : public vtkCommand diff --git a/src/SVTK/salomevtkPVAxesWidget.h b/src/SVTK/salomevtkPVAxesWidget.h index bb68fa5d9..412110ff6 100644 --- a/src/SVTK/salomevtkPVAxesWidget.h +++ b/src/SVTK/salomevtkPVAxesWidget.h @@ -60,7 +60,7 @@ class SVTK_EXPORT vtkPVAxesWidget : public vtkInteractorObserver { public: static vtkPVAxesWidget* New(); - vtkTypeMacro(vtkPVAxesWidget, vtkInteractorObserver); + vtkTypeMacro(vtkPVAxesWidget, vtkInteractorObserver) void PrintSelf(ostream& os, vtkIndent indent); // Description: diff --git a/src/SalomeApp/SalomeApp_Application.cxx b/src/SalomeApp/SalomeApp_Application.cxx index 7204f3f74..b5a6c6a54 100644 --- a/src/SalomeApp/SalomeApp_Application.cxx +++ b/src/SalomeApp/SalomeApp_Application.cxx @@ -1190,7 +1190,7 @@ void SalomeApp_Application::updateDesktopTitle() { desktop()->setWindowTitle( aTitle ); } -int SalomeApp_Application::closeChoice( const QString& docName ) +int SalomeApp_Application::closeChoice( const QString& /*docName*/ ) { QStringList buttons; QMap choices; @@ -1233,6 +1233,7 @@ bool SalomeApp_Application::closeAction( const int choice, bool& closePermanentl onSaveDoc(); else if ( !onSaveAsDoc() ) res = false; + // fall through! case CloseDisconnect: closeActiveDoc( false ); closePermanently = false; @@ -1281,9 +1282,8 @@ bool SalomeApp_Application::openAction( const int aChoice, const QString& aName switch ( choice ) { case OpenRefresh: - { - choice = OpenNew; - } + choice = OpenNew; + // fall through! default: res = LightApp_Application::openAction( choice, aName ); break; @@ -1898,7 +1898,7 @@ bool SalomeApp_Application::renameAllowed( const QString& entry) const \param name new name of the object \brief Return \c true if rename operation finished successfully, \c false otherwise. */ -bool SalomeApp_Application::renameObject( const QString& entry, const QString& name ) +bool SalomeApp_Application::renameObject( const QString& /*entry*/, const QString& name ) { SalomeApp_Study* aStudy = dynamic_cast( activeStudy() ); diff --git a/src/SalomeApp/SalomeApp_DataModel.cxx b/src/SalomeApp/SalomeApp_DataModel.cxx index 593a7e558..e9b0f05e5 100644 --- a/src/SalomeApp/SalomeApp_DataModel.cxx +++ b/src/SalomeApp/SalomeApp_DataModel.cxx @@ -236,7 +236,7 @@ suitPtr SalomeApp_DataModelSync::parent( const suitPtr& p ) const Updates SUIT object \param p - SUIT object */ -void SalomeApp_DataModelSync::updateItem( const kerPtr& obj, const suitPtr& ) const +void SalomeApp_DataModelSync::updateItem( const kerPtr&, const suitPtr& ) const { } diff --git a/src/SalomeApp/SalomeApp_DataObject.cxx b/src/SalomeApp/SalomeApp_DataObject.cxx index bd480a8ca..b606e3a21 100644 --- a/src/SalomeApp/SalomeApp_DataObject.cxx +++ b/src/SalomeApp/SalomeApp_DataObject.cxx @@ -150,14 +150,10 @@ QString SalomeApp_DataObject::text( const int id ) const switch ( id ) { case ValueId: -#ifndef WIN32 - if ( componentObject() != this ) -#else if ( componentObject() != (SUIT_DataObject*)this ) -#endif txt = value( object() ); - if ( txt.isEmpty() ) - txt = value( referencedObject() ); + if ( txt.isEmpty() ) + txt = value( referencedObject() ); break; case IORId: txt = ior( referencedObject() ); diff --git a/src/SalomeApp/SalomeApp_Engine_i.cxx b/src/SalomeApp/SalomeApp_Engine_i.cxx index 68fd9dc59..4f5a82f00 100644 --- a/src/SalomeApp/SalomeApp_Engine_i.cxx +++ b/src/SalomeApp/SalomeApp_Engine_i.cxx @@ -64,7 +64,7 @@ SalomeApp_Engine_i::~SalomeApp_Engine_i() } SALOMEDS::TMPFile* SalomeApp_Engine_i::Save (SALOMEDS::SComponent_ptr theComponent, - const char* theURL, + const char* /*theURL*/, bool isMultiFile) { SALOMEDS::TMPFile_var aStreamFile = new SALOMEDS::TMPFile; @@ -136,7 +136,7 @@ SALOMEDS::TMPFile* SalomeApp_Engine_i::Save (SALOMEDS::SComponent_ptr theCompone // listOfFiles must contain temporary directory name in its first item // and names of files (relatively the temporary directory) in the others ListOfFiles listOfFiles = GetListOfFiles( 0 ); // 0 means persistence file - const int n = listOfFiles.size() - 1; + const int n = (int)listOfFiles.size() - 1; //!< TODO: conversion from size_t to int if (n > 0) { // there are some files, containing persistent data of the component std::string aTmpDir = listOfFiles[0]; @@ -187,7 +187,7 @@ CORBA::Boolean SalomeApp_Engine_i::Load (SALOMEDS::SComponent_ptr theComponent, SALOMEDS_Tool::PutStreamToFiles(theFile, aTmpDir.c_str(), isMultiFile); // Store list of file names to be used by the component loading procedure - const int n = aSeq.size() + 1; + const int n = (int)aSeq.size() + 1; //!< TODO: conversion from size_t to int ListOfFiles listOfFiles (n); listOfFiles[0] = aTmpDir; for (int i = 1; i < n; i++) @@ -212,9 +212,9 @@ void SalomeApp_Engine_i::SetListOfFiles (int type, const ListOfFiles& theListOfF /*! * DumpPython implementation for light modules */ -Engines::TMPFile* SalomeApp_Engine_i::DumpPython(CORBA::Boolean isPublished, - CORBA::Boolean isMultiFile, - CORBA::Boolean& isValidScript) +Engines::TMPFile* SalomeApp_Engine_i::DumpPython(CORBA::Boolean /*isPublished*/, + CORBA::Boolean /*isMultiFile*/, + CORBA::Boolean& isValidScript) { MESSAGE("SalomeApp_Engine_i::DumpPython(): myComponentName = "<< qPrintable( myComponentName ) << ", this = " << this); diff --git a/src/SalomeApp/SalomeApp_Engine_i.h b/src/SalomeApp/SalomeApp_Engine_i.h index fa1c1fef0..2b4137a52 100644 --- a/src/SalomeApp/SalomeApp_Engine_i.h +++ b/src/SalomeApp/SalomeApp_Engine_i.h @@ -85,7 +85,7 @@ public: char* IORToLocalPersistentID( SALOMEDS::SObject_ptr, const char*, CORBA::Boolean, CORBA::Boolean ) {return 0;} char* LocalPersistentIDToIOR( SALOMEDS::SObject_ptr, const char*, CORBA::Boolean, CORBA::Boolean ) {return 0;} bool CanPublishInStudy( CORBA::Object_ptr ) {return 0;} - SALOMEDS::SObject_ptr PublishInStudy( SALOMEDS::SObject_ptr, CORBA::Object_ptr, const char* ) throw (SALOME::SALOME_Exception) {return 0;} + SALOMEDS::SObject_ptr PublishInStudy( SALOMEDS::SObject_ptr, CORBA::Object_ptr, const char* ) {return 0;} CORBA::Boolean CanCopy( SALOMEDS::SObject_ptr ) {return 0;} SALOMEDS::TMPFile* CopyFrom( SALOMEDS::SObject_ptr, CORBA::Long& ) {return 0;} CORBA::Boolean CanPaste( const char*, CORBA::Long ) {return 0;} diff --git a/src/SalomeApp/SalomeApp_ListView.cxx b/src/SalomeApp/SalomeApp_ListView.cxx index e55787d0c..62bc4aa40 100644 --- a/src/SalomeApp/SalomeApp_ListView.cxx +++ b/src/SalomeApp/SalomeApp_ListView.cxx @@ -980,7 +980,7 @@ void SalomeApp_ComboBox::insertItem(const QString& theValue, */ void SalomeApp_ComboBox::insertList(const QStringList& theList) { - for (unsigned i = 0; i < theList.count(); i++) + for (int i = 0; i < theList.count(); i++) insertItem(theList[i]); } @@ -1243,7 +1243,7 @@ void SalomeApp_EntityEdit::insertList(const TColStd_ListOfInteger& theList, TColStd_ListIteratorOfListOfInteger aIter(theList); for (unsigned i = 0; aIter.More(); aIter.Next(), i++) { - if (theCurrent == i) { + if (theCurrent == (int)i) { //!< TODO: mismatch signed/unsigned setText(QString::number(aIter.Value())); break; } @@ -1274,7 +1274,7 @@ void SalomeApp_EntityEdit::insertList(const TColStd_ListOfReal& theList, TColStd_ListIteratorOfListOfReal aIter(theList); for (unsigned i = 0; aIter.More(); aIter.Next(), i++) { - if (theCurrent == i) { + if (theCurrent == (int)i) { //!< TODO: mismatch signed/unsigned setText(QString::number(aIter.Value())); break; } diff --git a/src/SalomeApp/SalomeApp_Module.cxx b/src/SalomeApp/SalomeApp_Module.cxx index 5d662a004..e6fe76ca7 100644 --- a/src/SalomeApp/SalomeApp_Module.cxx +++ b/src/SalomeApp/SalomeApp_Module.cxx @@ -135,7 +135,7 @@ void SalomeApp_Module::extractContainers( const SALOME_ListIO& source, SALOME_Li * This method is called just before the study document is saved, so the module has a possibility * to store visual parameters in AttributeParameter attribut */ -void SalomeApp_Module::storeVisualParameters(int savePoint) +void SalomeApp_Module::storeVisualParameters(int /*savePoint*/) { } @@ -145,6 +145,6 @@ void SalomeApp_Module::storeVisualParameters(int savePoint) * This method is called after the study document is opened, so the module has a possibility to restore * visual parameters */ -void SalomeApp_Module::restoreVisualParameters(int savePoint) +void SalomeApp_Module::restoreVisualParameters(int /*savePoint*/) { } diff --git a/src/SalomeApp/SalomeApp_NoteBook.cxx b/src/SalomeApp/SalomeApp_NoteBook.cxx index 3e9f640c6..a3d7c0bea 100644 --- a/src/SalomeApp/SalomeApp_NoteBook.cxx +++ b/src/SalomeApp/SalomeApp_NoteBook.cxx @@ -71,8 +71,8 @@ //============================================================================ NoteBook_TableRow::NoteBook_TableRow(int index, NoteBook_Table* parentTable, QWidget* parent): QWidget(parent), - myParentTable(parentTable), myIndex(index), + myParentTable(parentTable), myRowHeader(new QTableWidgetItem()), myVariableName(new QTableWidgetItem()), myVariableValue(new QTableWidgetItem()) @@ -274,7 +274,7 @@ bool NoteBook_TableRow::IsIntegerValue(const QString theValue, int* theResult) * The whole notebook is verified on apply */ //============================================================================ -bool NoteBook_TableRow::IsValidStringValue(const QString theValue) +bool NoteBook_TableRow::IsValidStringValue(const QString /*theValue*/) { int aNumRows = myParentTable->myRows.count(); if( aNumRows == 0 ) @@ -404,7 +404,7 @@ void NoteBook_Table::Init() //Add all variables into the table std::vector aVariables = SalomeApp_Application::getStudy()->GetVariableNames(); - for(int iVar = 0; iVar < aVariables.size(); iVar++ ) { + for(int iVar = 0; iVar < (int)aVariables.size(); iVar++ ) { AddRow(QString(aVariables[iVar].c_str()), Variable2String(aVariables[iVar])); } @@ -816,7 +816,7 @@ void SalomeApp_NoteBook::Init(){ * Purpose : [slot] */ //============================================================================ -void SalomeApp_NoteBook::onVarUpdate(QString theVarName) +void SalomeApp_NoteBook::onVarUpdate(QString /*theVarName*/) { myTable->Init(); } diff --git a/src/SalomeApp/SalomeApp_NoteBook.h b/src/SalomeApp/SalomeApp_NoteBook.h index afcd55751..6658ae025 100644 --- a/src/SalomeApp/SalomeApp_NoteBook.h +++ b/src/SalomeApp/SalomeApp_NoteBook.h @@ -113,7 +113,7 @@ class SALOMEAPP_EXPORT NoteBook_Table : public QTableWidget bool IsUniqueName(const NoteBook_TableRow* theRow) const; QList GetRows() const; - const bool IsModified() const { return myIsModified; } + bool IsModified() const { return myIsModified; } const QList& GetRemovedRows() const { return myRemovedRows; } const VariableMap& GetVariableMap() const { return myVariableMap; } const VariableMap& GetVariableMapRef() const { return myVariableMapRef; } diff --git a/src/SalomeApp/SalomeApp_Study.cxx b/src/SalomeApp/SalomeApp_Study.cxx index 39bf6bf03..c68065232 100644 --- a/src/SalomeApp/SalomeApp_Study.cxx +++ b/src/SalomeApp/SalomeApp_Study.cxx @@ -211,7 +211,7 @@ public: return; } - int last2Pnt_pos = theID.rfind( ":" ); + int last2Pnt_pos = (int)theID.rfind( ":" ); //!< TODO: conversion from size_t to int std::string parent_id = theID.substr( 0, last2Pnt_pos ); int tag = atoi( theID.substr( last2Pnt_pos+1 ).c_str() ); @@ -365,7 +365,7 @@ private: // parse the children o = o->firstChild(); } - else if ( o->nextBrother() > 0 ) { + else if ( o->nextBrother() ) { o = o->nextBrother(); } else { @@ -724,7 +724,7 @@ bool SalomeApp_Study::dump( const QString& theFileName, bool isMultiFile, bool toSaveGUI ) { - int savePoint; + int savePoint = 0; _PTR(AttributeParameter) ap; _PTR(IParameters) ip = ClientFactory::getIParameters(ap); @@ -842,7 +842,7 @@ void SalomeApp_Study::openModuleData( QString theModuleName, int type, QStringLi { std::vector aListOfFiles = GetListOfFiles( theModuleName.toStdString().c_str(), type ); - int i, aLength = aListOfFiles.size() - 1; + int i, aLength = (int)aListOfFiles.size() - 1; //!< TODO: conversion from size_t to int if ( aLength < 0 ) return; @@ -857,7 +857,7 @@ void SalomeApp_Study::openModuleData( QString theModuleName, int type, QStringLi Re-implemented from LightApp_Study, actually does not save anything but simply cleans up light modules' data */ -bool SalomeApp_Study::saveStudyData( const QString& theFileName, int type ) +bool SalomeApp_Study::saveStudyData( const QString& /*theFileName*/, int type ) { ModelList list; dataModels( list ); QListIterator it( list ); @@ -1108,7 +1108,7 @@ void SalomeApp_Study::RemoveTemporaryFiles ( const char* theModuleName, bool isM if (aListOfFiles.size() > 0) { std::string aTmpDir = aListOfFiles[0]; - const int n = aListOfFiles.size() - 1; + const int n = (int)aListOfFiles.size() - 1; //!< TODO: conversion from size_t to int std::vector aSeq; aSeq.reserve(n); for (int i = 0; i < n; i++) @@ -1157,7 +1157,7 @@ void SalomeApp_Study::deleteReferencesTo( _PTR( SObject ) obj ) { _PTR(StudyBuilder) sb = studyDS()->NewBuilder(); std::vector<_PTR(SObject)> aRefs = studyDS()->FindDependances( obj ); - for( int i=0, n=aRefs.size(); iGetFatherComponent()->ComponentDataType()==obj->GetFatherComponent()->ComponentDataType() ) diff --git a/src/SalomeApp/SalomeApp_StudyPropertiesDlg.cxx b/src/SalomeApp/SalomeApp_StudyPropertiesDlg.cxx index a83658d8a..b355724e5 100644 --- a/src/SalomeApp/SalomeApp_StudyPropertiesDlg.cxx +++ b/src/SalomeApp/SalomeApp_StudyPropertiesDlg.cxx @@ -226,7 +226,7 @@ void SalomeApp_StudyPropertiesDlg::initData() std::vector aMins, aHours, aDays, aMonths, aYears; propAttr->GetModificationsList(aUsers, aMins, aHours, aDays, aMonths, aYears, false); int aCnt = aUsers.size(); - for ( int i = 0; i < aCnt; i++ ) { + for ( int i = 0; i < (int)aCnt; i++ ) { QString date; date.sprintf("%2.2d/%2.2d/%2d %2.2d:%2.2d", aDays [i], @@ -243,7 +243,7 @@ void SalomeApp_StudyPropertiesDlg::initData() //Component versions std::vector aComponents = propAttr->GetStoredComponents(); - for ( int i = 0; i < aComponents.size(); i++ ) { + for ( int i = 0; i < (int)aComponents.size(); i++ ) { std::vector aMins, aHours, aDays, aMonths, aYears; std::vector aVersions = propAttr->GetComponentVersions(aComponents[i]); QStringList aData; diff --git a/src/SalomeApp/SalomeApp_VisualState.cxx b/src/SalomeApp/SalomeApp_VisualState.cxx index c4ef112e9..1bd77cf94 100644 --- a/src/SalomeApp/SalomeApp_VisualState.cxx +++ b/src/SalomeApp/SalomeApp_VisualState.cxx @@ -275,7 +275,7 @@ void SalomeApp_VisualState::restoreState(int savePoint) // restore modules' visual parameters std::vector v = ip->getValues( "AP_MODULES_LIST" ); - for ( int i = 0; i < v.size(); i++ ) + for ( int i = 0; i < (int)v.size(); i++ ) { myApp->activateModule( v[i].c_str() ); if ( SalomeApp_Module* module = dynamic_cast( myApp->activeModule() ) ) diff --git a/src/Session/SALOME_Session_Server.cxx b/src/Session/SALOME_Session_Server.cxx index 7ab837c81..0bf8344fd 100644 --- a/src/Session/SALOME_Session_Server.cxx +++ b/src/Session/SALOME_Session_Server.cxx @@ -108,8 +108,9 @@ namespace { public: MsgHandler() {} - void qtMessage( QtMsgType type, const QMessageLogContext& context, const QString& message ) + void qtMessage( QtMsgType type, const QMessageLogContext& /*context*/, const QString& message ) { + (void)message; // unused in debug mode switch ( type ) { case QtDebugMsg: @@ -181,7 +182,7 @@ namespace } protected: - QString userFileName( const QString& appName, const bool forLoad ) const + QString userFileName( const QString& /*appName*/, const bool forLoad ) const { if ( version().isEmpty() ) return ""; return SUIT_ResourceMgr::userFileName( myCustomAppName, forLoad ); diff --git a/src/Session/Session_ServerThread.cxx b/src/Session/Session_ServerThread.cxx index 5304bfaa7..0d042a042 100644 --- a/src/Session/Session_ServerThread.cxx +++ b/src/Session/Session_ServerThread.cxx @@ -206,8 +206,7 @@ void Session_ServerThread::ActivateModuleCatalog(int argc, } } -void Session_ServerThread::ActivateSALOMEDS(int argc, - char ** argv) +void Session_ServerThread::ActivateSALOMEDS(int /*argc*/, char** /*argv*/) { try { MESSAGE("SALOMEDS thread started"); @@ -293,8 +292,7 @@ void Session_ServerThread::ActivateRegistry(int argc, } } -void Session_ServerThread::ActivateContainerManager(int argc, - char ** argv) +void Session_ServerThread::ActivateContainerManager(int /*argc*/, char** /*argv*/) { try { PortableServer::POA_var root_poa=PortableServer::POA::_the_root_poa(); @@ -318,8 +316,7 @@ void Session_ServerThread::ActivateContainerManager(int argc, } } -void Session_ServerThread::ActivateContainer(int argc, - char ** argv) +void Session_ServerThread::ActivateContainer(int argc, char** argv) { try { MESSAGE("Container thread started"); @@ -372,7 +369,7 @@ void Session_ServerThread::ActivateContainer(int argc, containerName = argv[1]; } - _container = new Engines_Container_i(_orb, _root_poa, containerName , argc , argv , true , false); + _container = new Engines_Container_i(_orb, _root_poa, containerName, argc, argv, true, false); } catch(CORBA::SystemException&) { INFOS("Caught CORBA::SystemException."); @@ -391,8 +388,7 @@ void Session_ServerThread::ActivateContainer(int argc, } } -void Session_ServerThread::ActivateSession(int argc, - char ** argv) +void Session_ServerThread::ActivateSession(int /*argc*/, char** /*argv*/) { MESSAGE("Session_ServerThread::ActivateSession() not implemented!"); } diff --git a/src/Session/Session_Session_i.cxx b/src/Session/Session_Session_i.cxx index f7eb45ed6..2cb7cacf6 100644 --- a/src/Session/Session_Session_i.cxx +++ b/src/Session/Session_Session_i.cxx @@ -349,16 +349,16 @@ void SALOME_Session_i::deleteContainersinNS() // destroy of all containers and modules _NS->Change_Directory("/Containers"); std::vector machines = _NS->list_subdirs(); - for(int i=0;iChange_Directory(machines[i].c_str()); std::vector toto = _NS->list_directory(); - for(int j=0;jDestroy_Name(toto[j].c_str()); std::vector containers = _NS->list_subdirs(); - for(int j=0;jChange_Directory(containers[j].c_str()); std::vector modules = _NS->list_directory(); - for(int k=0;kDestroy_Name(modules[k].c_str()); _NS->Change_Directory("/Containers"); _NS->Change_Directory(machines[i].c_str()); diff --git a/src/Style/Style_Salome.cxx b/src/Style/Style_Salome.cxx index d5f9c2f4d..cb2e4930b 100644 --- a/src/Style/Style_Salome.cxx +++ b/src/Style/Style_Salome.cxx @@ -72,93 +72,93 @@ #define DELTA_SLIDER 3 static const char* const hole_xpm[] = { -"3 3 3 1", -". c None", -"a c #999999", -"b c #FFFFFF", -"aa.", -"aab", -".bb" + "3 3 3 1", + ". c None", + "a c #999999", + "b c #FFFFFF", + "aa.", + "aab", + ".bb" }; static const char* const cross_xpm[] = { -"12 12 4 1", -". c None", -"a c #000000", -"b c #FFFFFF", -"c c #666666", -"............", -"............", -"............", -".aaaa..aaaa.", -"..abbaabba..", -"...abbbba...", -"....abba....", -"...abbbba...", -"..abbaabba..", -".aaaa..aaaa.", -"............", -"............" + "12 12 4 1", + ". c None", + "a c #000000", + "b c #FFFFFF", + "c c #666666", + "............", + "............", + "............", + ".aaaa..aaaa.", + "..abbaabba..", + "...abbbba...", + "....abba....", + "...abbbba...", + "..abbaabba..", + ".aaaa..aaaa.", + "............", + "............" }; static const char* const maximize_xpm[] = { -"12 12 4 1", -". c None", -"a c #000000", -"b c #FFFFFF", -"c c #666666", -"............", -".aaaaaaaaaa.", -".acccccccca.", -".acccccccca.", -".abbbbbbbba.", -".abbbbbbbba.", -".abbbbbbbba.", -".abbbbbbbba.", -".abbbbbbbba.", -".abbbbbbbba.", -".aaaaaaaaaa.", -"............" + "12 12 4 1", + ". c None", + "a c #000000", + "b c #FFFFFF", + "c c #666666", + "............", + ".aaaaaaaaaa.", + ".acccccccca.", + ".acccccccca.", + ".abbbbbbbba.", + ".abbbbbbbba.", + ".abbbbbbbba.", + ".abbbbbbbba.", + ".abbbbbbbba.", + ".abbbbbbbba.", + ".aaaaaaaaaa.", + "............" }; static const char* const normal_xpm[] = { -"12 12 4 1", -". c None", -"a c #000000", -"b c #FFFFFF", -"c c #666666", -"............", -"...aaaaaaaa.", -"...acccccca.", -"...abbbbbba.", -"...aaaaaaba.", -".aaaaaaaaba.", -".accccccaba.", -".abbbbbbaaa.", -".abbbbbba...", -".abbbbbba...", -".aaaaaaaa...", -"............" + "12 12 4 1", + ". c None", + "a c #000000", + "b c #FFFFFF", + "c c #666666", + "............", + "...aaaaaaaa.", + "...acccccca.", + "...abbbbbba.", + "...aaaaaaba.", + ".aaaaaaaaba.", + ".accccccaba.", + ".abbbbbbaaa.", + ".abbbbbba...", + ".abbbbbba...", + ".aaaaaaaa...", + "............" }; static const char* const minimize_xpm[] = { -"12 12 4 1", -". c None", -"a c #000000", -"b c #FFFFFF", -"c c #666666", -"............", -"............", -"............", -"............", -"............", -"............", -"............", -"............", -"aaaaaaaaaaaa", -"abbbbbbbbbba", -"aaaaaaaaaaaa", -"............" + "12 12 4 1", + ". c None", + "a c #000000", + "b c #FFFFFF", + "c c #666666", + "............", + "............", + "............", + "............", + "............", + "............", + "............", + "............", + "aaaaaaaaaaaa", + "abbbbbbbbbba", + "aaaaaaaaaaaa", + "............" }; /////////////////////////////////////////////////////////// @@ -322,7 +322,7 @@ Style_Model* Style_Salome::model() void Style_Salome::polish ( QApplication* app ) { BaseStyle::polish( app ); - + if ( checkDebugLevel(1) ) { return; } @@ -356,7 +356,7 @@ void Style_Salome::polish ( QWidget* w ) qobject_cast(w) || qobject_cast(w) ) w->setAttribute( Qt::WA_Hover ); } - BaseStyle::polish( w ); + BaseStyle::polish( w ); } /*! @@ -405,7 +405,7 @@ void Style_Salome::drawComplexControl( ComplexControl cc, const QStyleOptionComp const QPalette& pal = w->palette(); switch( cc ) { - case CC_SpinBox: + case CC_SpinBox: { if (const QStyleOptionSpinBox *spin = qstyleoption_cast(opt)) { bool hover = hasHover() && (opt->state & State_Enabled) && (opt->state & State_MouseOver); QRect optr = opt->rect, arUp = subControlRect( cc, spin, SC_SpinBoxUp, w ); @@ -480,9 +480,10 @@ void Style_Salome::drawComplexControl( ComplexControl cc, const QStyleOptionComp copy.rect = aBtnRect; drawPrimitive(pe, ©, p, w); } - break; - } - case CC_ComboBox: { + } + break; + } + case CC_ComboBox: { if (const QStyleOptionComboBox *cmb = qstyleoption_cast(opt)) { bool hover = hasHover() && (opt->state & State_Enabled) && (opt->state & State_MouseOver); QRect optr = opt->rect, @@ -533,84 +534,86 @@ void Style_Salome::drawComplexControl( ComplexControl cc, const QStyleOptionComp else p->setPen(cmb->palette.text().color()); } - break; } + break; } case CC_Slider: { - if (const QStyleOptionSlider *slider = qstyleoption_cast(opt)) { - QRect groove = subControlRect(CC_Slider, slider, SC_SliderGroove, w); - QRect handle = subControlRect(CC_Slider, slider, SC_SliderHandle, w); - - if( hasHover() && (slider->state & State_Enabled) && - (slider->state & State_MouseOver) ) { - QRect moderated = w->rect(); - drawHoverRect(p, moderated, opt->palette.color( QPalette::Window ), - model()->widgetRounding( Style_Model::ButtonRadius ), Style_Tools::All, false); - } - - if ((slider->subControls & SC_SliderGroove) && groove.isValid()) { - QStyleOptionSlider tmpSlider = *slider; - tmpSlider.subControls = SC_SliderGroove; - BaseStyle::drawComplexControl(cc, &tmpSlider, p, w); - } - if (slider->subControls & SC_SliderTickmarks) { - QStyleOptionSlider tmpSlider = *slider; - tmpSlider.subControls = SC_SliderTickmarks; - QCommonStyle::drawComplexControl(cc, &tmpSlider, p, w); + if (const QStyleOptionSlider *slider = qstyleoption_cast(opt)) { + QRect groove = subControlRect(CC_Slider, slider, SC_SliderGroove, w); + QRect handle = subControlRect(CC_Slider, slider, SC_SliderHandle, w); + + if( hasHover() && (slider->state & State_Enabled) && + (slider->state & State_MouseOver) ) { + QRect moderated = w->rect(); + drawHoverRect(p, moderated, opt->palette.color( QPalette::Window ), + model()->widgetRounding( Style_Model::ButtonRadius ), Style_Tools::All, false); + } + + if ((slider->subControls & SC_SliderGroove) && groove.isValid()) { + QStyleOptionSlider tmpSlider = *slider; + tmpSlider.subControls = SC_SliderGroove; + BaseStyle::drawComplexControl(cc, &tmpSlider, p, w); + } + if (slider->subControls & SC_SliderTickmarks) { + QStyleOptionSlider tmpSlider = *slider; + tmpSlider.subControls = SC_SliderTickmarks; + QCommonStyle::drawComplexControl(cc, &tmpSlider, p, w); + } + if (slider->subControls & SC_SliderHandle) { + if (slider->state & State_HasFocus) { + QStyleOptionFocusRect fropt; + fropt.QStyleOption::operator=(*slider); + fropt.rect = subElementRect(SE_SliderFocusRect, slider, w); + drawPrimitive(PE_FrameFocusRect, &fropt, p, w); + } + int x = handle.x(), y = handle.y(), wi = handle.width(), he = handle.height(); + bool horiz = slider->orientation == Qt::Horizontal; + bool tickAbove = slider->tickPosition == QSlider::TicksAbove; + bool tickBelow = slider->tickPosition == QSlider::TicksBelow; + QColor aBtnCol = model()->color( Style_Model::Slider ); // Style_Model::slider_clr + QColor aBrdTopCol = model()->color( Style_Model::BorderTop ); // Style_Model::border_top_clr + QColor aBrdBotCol = model()->color( Style_Model::BorderBottom ); // Style_Model::border_bot_clr + // rect was changed on +/-DELTA_SLIDER value for correct painting Antialised border of slider + int aDelta = DELTA_SLIDER-1; + QRect slRect = QRect(x+aDelta, y+aDelta, wi-aDelta, he-aDelta); + int aXAdd = (int)(slRect.width()/6), aYAdd = (int)(slRect.height()/6); + Style_Tools::SliderType type = Style_Tools::SlNone; + if ((tickAbove && tickBelow) || (!tickAbove && !tickBelow)) + type = Style_Tools::SlNone; + else { + if (horiz) { + if (tickAbove) { + type = Style_Tools::SlUp; + slRect.setTop( slRect.top()-aYAdd ); + } + else { + type = Style_Tools::SlDown; + slRect.setBottom( slRect.bottom()+aYAdd ); + } } - if (slider->subControls & SC_SliderHandle) { - if (slider->state & State_HasFocus) { - QStyleOptionFocusRect fropt; - fropt.QStyleOption::operator=(*slider); - fropt.rect = subElementRect(SE_SliderFocusRect, slider, w); - drawPrimitive(PE_FrameFocusRect, &fropt, p, w); + else { + if (tickAbove) { + type = Style_Tools::SlLeft; + slRect.setLeft( slRect.left()-aXAdd ); } - int x = handle.x(), y = handle.y(), wi = handle.width(), he = handle.height(); - bool horiz = slider->orientation == Qt::Horizontal; - bool tickAbove = slider->tickPosition == QSlider::TicksAbove; - bool tickBelow = slider->tickPosition == QSlider::TicksBelow; - QColor aBtnCol = model()->color( Style_Model::Slider ); // Style_Model::slider_clr - QColor aBrdTopCol = model()->color( Style_Model::BorderTop ); // Style_Model::border_top_clr - QColor aBrdBotCol = model()->color( Style_Model::BorderBottom ); // Style_Model::border_bot_clr - // rect was changed on +/-DELTA_SLIDER value for correct painting Antialised border of slider - int aDelta = DELTA_SLIDER-1; - QRect slRect = QRect(x+aDelta, y+aDelta, wi-aDelta, he-aDelta); - int aXAdd = (int)(slRect.width()/6), aYAdd = (int)(slRect.height()/6); - Style_Tools::SliderType type = Style_Tools::SlNone; - if ((tickAbove && tickBelow) || (!tickAbove && !tickBelow)) - type = Style_Tools::SlNone; else { - if (horiz) - if (tickAbove) { - type = Style_Tools::SlUp; - slRect.setTop( slRect.top()-aYAdd ); - } - else { - type = Style_Tools::SlDown; - slRect.setBottom( slRect.bottom()+aYAdd ); - } - else - if (tickAbove) { - type = Style_Tools::SlLeft; - slRect.setLeft( slRect.left()-aXAdd ); - } - else { - type = Style_Tools::SlRight; - slRect.setRight( slRect.right()+aXAdd ); - } + type = Style_Tools::SlRight; + slRect.setRight( slRect.right()+aXAdd ); } - Style_Tools::drawSlider( p, slRect, model()->widgetRounding( Style_Model::SliderRadius ), type, - aBtnCol.light( BUT_PERCENT_COL ), - aBtnCol.dark( BUT_PERCENT_COL ), aBrdTopCol, aBrdBotCol ); - QRect aHRect = handle; - int aXRect = (int)(aHRect.width()/5), - aYRect = (int)(aHRect.height()/5); - aHRect = QRect( aHRect.x()+aXRect, aHRect.y()+aYRect, - aHRect.width()-2*aXRect, aHRect.height()-2*aYRect ); - drawHandle( p, aHRect, horiz ); } - break; + } + Style_Tools::drawSlider( p, slRect, model()->widgetRounding( Style_Model::SliderRadius ), type, + aBtnCol.light( BUT_PERCENT_COL ), + aBtnCol.dark( BUT_PERCENT_COL ), aBrdTopCol, aBrdBotCol ); + QRect aHRect = handle; + int aXRect = (int)(aHRect.width()/5), + aYRect = (int)(aHRect.height()/5); + aHRect = QRect( aHRect.x()+aXRect, aHRect.y()+aYRect, + aHRect.width()-2*aXRect, aHRect.height()-2*aYRect ); + drawHandle( p, aHRect, horiz ); } + } + break; } case CC_ToolButton: { if (const QStyleOptionToolButton *toolbutton @@ -699,15 +702,14 @@ void Style_Salome::drawComplexControl( ComplexControl cc, const QStyleOptionComp int fw = pixelMetric( PM_DefaultFrameWidth, opt, w ); label.rect = button.adjusted( fw, fw, -fw, -fw ); drawControl( CE_ToolButtonLabel, &label, p, w ); - - break; } + break; } case CC_TitleBar: { BaseStyle::drawComplexControl( cc, opt, p, w ); break; } - case CC_GroupBox: + case CC_GroupBox: { if (const QStyleOptionGroupBox *groupBox = qstyleoption_cast(opt)) { // Draw frame @@ -751,14 +753,17 @@ void Style_Salome::drawComplexControl( ComplexControl cc, const QStyleOptionComp box.rect = checkBoxRect; drawPrimitive(PE_IndicatorCheckBox, &box, p, w); } - break; } + break; + } case CC_Dial: { BaseStyle::drawComplexControl( cc, opt, p, w ); break; } - default: + default: { BaseStyle::drawComplexControl( cc, opt, p, w ); + break; + } } } @@ -778,7 +783,7 @@ void Style_Salome::drawControl( ControlElement ce, const QStyleOption* opt, } switch ( ce ) { - case CE_PushButton: + case CE_PushButton: { if (const QStyleOptionButton *btn = qstyleoption_cast(opt)) { drawControl(CE_PushButtonBevel, btn, p, w); QStyleOptionButton subopt = *btn; @@ -789,9 +794,10 @@ void Style_Salome::drawControl( ControlElement ce, const QStyleOption* opt, Style_Tools::drawFocus( p, aRect, model()->widgetRounding( Style_Model::ButtonRadius ), Style_Tools::All, model()->color( Style_Model::BorderBottom ) ); } - break; } - case CE_PushButtonBevel: + break; + } + case CE_PushButtonBevel: { if ( const QStyleOptionButton *btn = qstyleoption_cast(opt) ) { double aRad = model()->widgetRounding( Style_Model::ButtonRadius ); bool aStateOn = opt->state & ( State_Sunken | State_On ); @@ -815,92 +821,94 @@ void Style_Salome::drawControl( ControlElement ce, const QStyleOption* opt, else Style_Tools::shadowRect( p, r, aRad, -1, SHADOW, Style_Tools::All, top, bottom, aBrdTopCol, aBrdBotCol, antialized, true, aStateOn ); - if (btn->features & QStyleOptionButton::HasMenu) { - int mbi = pixelMetric(PM_MenuButtonIndicator, btn, w); - QStyleOptionButton newBtn = *btn; - newBtn.rect = QRect(r.right() - mbi-2, r.height()/2 - mbi/2, mbi, mbi); - drawPrimitive(PE_IndicatorArrowDown, &newBtn, p, w); - } - break; + if (btn->features & QStyleOptionButton::HasMenu) { + int mbi = pixelMetric(PM_MenuButtonIndicator, btn, w); + QStyleOptionButton newBtn = *btn; + newBtn.rect = QRect(r.right() - mbi-2, r.height()/2 - mbi/2, mbi, mbi); + drawPrimitive(PE_IndicatorArrowDown, &newBtn, p, w); + } } - case CE_DockWidgetTitle: - if (const QStyleOptionDockWidget *dwOpt = qstyleoption_cast(opt)) { - bool floating = false; - int menuOffset = 0; //used to center text when floated - QColor inactiveCaptionTextColor = opt->palette.color( QPalette::HighlightedText ); - const QDockWidget *dockWidget = qobject_cast(w); - //Titlebar gradient - if (dockWidget) { - if ( dockWidget->isFloating() && dwOpt->movable) { - floating = true; - QColor top = opt->palette.color( QPalette::Highlight ).light(); - QColor bottom = opt->palette.color( QPalette::Highlight ); - menuOffset = 2; - QBrush fillBrush(bottom); - if (top != bottom) { - QPoint p1(dwOpt->rect.x(), dwOpt->rect.y()); - QPoint p2(dwOpt->rect.x(), dwOpt->rect.bottom() ); - QLinearGradient lg(p1, p2); - lg.setColorAt(0, top); - lg.setColorAt(1, bottom); - fillBrush = lg; - } - p->fillRect(dwOpt->rect.adjusted(0, 0, 0, -3), fillBrush); - } - else { - QRect r = dwOpt->rect.adjusted(0, 0, -1, -1); - QColor bottom = opt->palette.color( QPalette::Window ), - top = bottom.dark( BUT_PERCENT_COL ); - QRect aRect = dwOpt->rect; - QLinearGradient gr( aRect.x(), aRect.y(), aRect.x(), aRect.y()+aRect.height() ); - gr.setColorAt( 0.0, top ); - gr.setColorAt( 0.4, bottom ); - gr.setColorAt( 0.6, bottom ); - gr.setColorAt( 1.0, top ); - p->fillRect( r, gr ); - - QColor aBrdTopCol = model()->color( Style_Model::TabBorderTop ); // Style_Model::border_tab_top_clr - QColor aBrdBotCol = model()->color( Style_Model::TabBorderBottom ); // Style_Model::border_tab_bot_clr - p->setPen( aBrdTopCol ); - p->drawLine( r.x(), r.bottom(), r.x(), r.y() ); - p->drawLine( r.x(), r.y(), r.right(), r.y() ); - p->setPen( aBrdBotCol ); - p->drawLine( r.x(), r.bottom(), r.right(), r.bottom() ); - p->drawLine( r.right(), r.bottom(), r.right(), r.y() ); + break; + } + case CE_DockWidgetTitle: { + if (const QStyleOptionDockWidget *dwOpt = qstyleoption_cast(opt)) { + bool floating = false; + int menuOffset = 0; //used to center text when floated + QColor inactiveCaptionTextColor = opt->palette.color( QPalette::HighlightedText ); + const QDockWidget *dockWidget = qobject_cast(w); + //Titlebar gradient + if (dockWidget) { + if ( dockWidget->isFloating() && dwOpt->movable) { + floating = true; + QColor top = opt->palette.color( QPalette::Highlight ).light(); + QColor bottom = opt->palette.color( QPalette::Highlight ); + menuOffset = 2; + QBrush fillBrush(bottom); + if (top != bottom) { + QPoint p1(dwOpt->rect.x(), dwOpt->rect.y()); + QPoint p2(dwOpt->rect.x(), dwOpt->rect.bottom() ); + QLinearGradient lg(p1, p2); + lg.setColorAt(0, top); + lg.setColorAt(1, bottom); + fillBrush = lg; } + p->fillRect(dwOpt->rect.adjusted(0, 0, 0, -3), fillBrush); } - p->setPen(dwOpt->palette.color(QPalette::Light)); - - QString aTitle = dwOpt->title; - if (!aTitle.isEmpty()) { - int aMargin = pixelMetric(QStyle::PM_DockWidgetTitleMargin, dwOpt, w); - const int indent = p->fontMetrics().descent(); - QRect r = dwOpt->rect.adjusted(indent + 1, - menuOffset, -indent - 1, -1); - QPixmap aPxm = standardPixmap( SP_DockWidgetCloseButton, opt, w); - int aWidth = r.width() - aPxm.width()-2/*button margins*/; - aPxm = standardPixmap( SP_TitleBarNormalButton, opt, w); - aWidth = aWidth - aPxm.width()-2/*button margins*/; - r = QRect( r.x(), r.y(), aWidth-aMargin-2/*buttons separator*/-2/*margin from text*/, r.height() ); - - QFont oldFont = p->font(); - QFont font = oldFont; - if (floating) { - font.setBold(true); - p->setFont(font); - } - aTitle = titleText( aTitle, r.width(), r.height(), font ); - - QPalette palette = dwOpt->palette; - palette.setColor(QPalette::Window, inactiveCaptionTextColor); - bool active = dwOpt->state & State_Active; - //const int indent = p->fontMetrics().descent(); - drawItemText(p, r, Qt::AlignLeft | Qt::AlignVCenter, palette, - dwOpt->state & State_Enabled, aTitle, - floating ? (active ? QPalette::BrightText : QPalette::Window) : QPalette::WindowText); - p->setFont(oldFont); + else { + QRect r = dwOpt->rect.adjusted(0, 0, -1, -1); + QColor bottom = opt->palette.color( QPalette::Window ), + top = bottom.dark( BUT_PERCENT_COL ); + QRect aRect = dwOpt->rect; + QLinearGradient gr( aRect.x(), aRect.y(), aRect.x(), aRect.y()+aRect.height() ); + gr.setColorAt( 0.0, top ); + gr.setColorAt( 0.4, bottom ); + gr.setColorAt( 0.6, bottom ); + gr.setColorAt( 1.0, top ); + p->fillRect( r, gr ); + + QColor aBrdTopCol = model()->color( Style_Model::TabBorderTop ); // Style_Model::border_tab_top_clr + QColor aBrdBotCol = model()->color( Style_Model::TabBorderBottom ); // Style_Model::border_tab_bot_clr + p->setPen( aBrdTopCol ); + p->drawLine( r.x(), r.bottom(), r.x(), r.y() ); + p->drawLine( r.x(), r.y(), r.right(), r.y() ); + p->setPen( aBrdBotCol ); + p->drawLine( r.x(), r.bottom(), r.right(), r.bottom() ); + p->drawLine( r.right(), r.bottom(), r.right(), r.y() ); } - break; } + p->setPen(dwOpt->palette.color(QPalette::Light)); + + QString aTitle = dwOpt->title; + if (!aTitle.isEmpty()) { + int aMargin = pixelMetric(QStyle::PM_DockWidgetTitleMargin, dwOpt, w); + const int indent = p->fontMetrics().descent(); + QRect r = dwOpt->rect.adjusted(indent + 1, - menuOffset, -indent - 1, -1); + QPixmap aPxm = standardPixmap( SP_DockWidgetCloseButton, opt, w); + int aWidth = r.width() - aPxm.width()-2/*button margins*/; + aPxm = standardPixmap( SP_TitleBarNormalButton, opt, w); + aWidth = aWidth - aPxm.width()-2/*button margins*/; + r = QRect( r.x(), r.y(), aWidth-aMargin-2/*buttons separator*/-2/*margin from text*/, r.height() ); + + QFont oldFont = p->font(); + QFont font = oldFont; + if (floating) { + font.setBold(true); + p->setFont(font); + } + aTitle = titleText( aTitle, r.width(), r.height(), font ); + + QPalette palette = dwOpt->palette; + palette.setColor(QPalette::Window, inactiveCaptionTextColor); + bool active = dwOpt->state & State_Active; + //const int indent = p->fontMetrics().descent(); + drawItemText(p, r, Qt::AlignLeft | Qt::AlignVCenter, palette, + dwOpt->state & State_Enabled, aTitle, + floating ? (active ? QPalette::BrightText : QPalette::Window) : QPalette::WindowText); + p->setFont(oldFont); + } + } + break; + } case CE_Splitter: { BaseStyle::drawControl( ce, opt, p, w ); QRect r = opt->rect; @@ -913,7 +921,7 @@ void Style_Salome::drawControl( ControlElement ce, const QStyleOption* opt, drawHandle( p, r, horiz, true ); break; } - case CE_TabBarTabShape: + case CE_TabBarTabShape: { if (const QStyleOptionTab *tab = qstyleoption_cast(opt)) { if (tab->shape == QTabBar::RoundedNorth || tab->shape == QTabBar::RoundedEast || tab->shape == QTabBar::RoundedSouth || tab->shape == QTabBar::RoundedWest) { @@ -939,11 +947,14 @@ void Style_Salome::drawControl( ControlElement ce, const QStyleOption* opt, DELTA_H_TAB, aColor, aDarkColor, aBrdTopCol, aBrdBotCol, isSelected, isLast, isHover ); p->restore(); - } else - QCommonStyle::drawControl( ce, opt, p, w ); - break; + } + else { + QCommonStyle::drawControl( ce, opt, p, w ); + } } - case CE_TabBarTabLabel: + break; + } + case CE_TabBarTabLabel: { if (const QStyleOptionTab *tab = qstyleoption_cast(opt)) { if ( tab->position == QStyleOptionTab::End || tab->position == QStyleOptionTab::OnlyOneTab ) { @@ -961,11 +972,13 @@ void Style_Salome::drawControl( ControlElement ce, const QStyleOption* opt, copyTab->rect = oldRect; BaseStyle::drawControl( ce, copyTab, p, w ); } - else + else { BaseStyle::drawControl( ce, opt, p, w ); - break; + } } - case CE_MenuBarItem: + break; + } + case CE_MenuBarItem: { if (const QStyleOptionMenuItem *mbi = qstyleoption_cast(opt)) { if ( w ) drawBackground( p, w->rect(), opt->palette.color( QPalette::Window ), true, true, true ); @@ -1001,11 +1014,13 @@ void Style_Salome::drawControl( ControlElement ce, const QStyleOption* opt, } } QCommonStyle::drawControl(ce, &newMbi, p, w); - break; } - case CE_MenuBarEmptyArea: + break; + } + case CE_MenuBarEmptyArea: { drawBackground( p, opt->rect, opt->palette.color( QPalette::Window ), true, true, true ); break; + } case CE_ProgressBarGroove: { QColor aBgColor = opt->palette.color( QPalette::Window ), top = aBgColor.light( BUT_PERCENT_ON ), @@ -1016,8 +1031,8 @@ void Style_Salome::drawControl( ControlElement ce, const QStyleOption* opt, SHADOW, Style_Tools::All, top, bottom, aBrdTopCol, aBrdBotCol, model()->antialiasing(), true ); break; - } - case CE_ProgressBarLabel: + } + case CE_ProgressBarLabel: { if (const QStyleOptionProgressBar *bar = qstyleoption_cast(opt)) { // implementation from qplastiquestyle // The busy indicator doesn't draw a label @@ -1032,7 +1047,7 @@ void Style_Salome::drawControl( ControlElement ce, const QStyleOption* opt, bool inverted = false; bool bottomToTop = false; // Get extra style options if version 2 - if (const QStyleOptionProgressBarV2 *bar2 = qstyleoption_cast(opt)) { + if (const QStyleOptionProgressBar *bar2 = qstyleoption_cast(opt)) { vertical = (bar2->orientation == Qt::Vertical); inverted = bar2->invertedAppearance; bottomToTop = bar2->bottomToTop; @@ -1081,13 +1096,14 @@ void Style_Salome::drawControl( ControlElement ce, const QStyleOption* opt, p->restore(); } break; - case CE_ProgressBarContents: + } + case CE_ProgressBarContents: { if (const QStyleOptionProgressBar *pb = qstyleoption_cast(opt)) { QRect rect = pb->rect; bool vertical = false; bool inverted = false; // Get extra style options if version 2 - const QStyleOptionProgressBarV2 *pb2 = qstyleoption_cast(opt); + const QStyleOptionProgressBar *pb2 = qstyleoption_cast(opt); if (pb2) { vertical = (pb2->orientation == Qt::Vertical); inverted = pb2->invertedAppearance; @@ -1147,7 +1163,7 @@ void Style_Salome::drawControl( ControlElement ce, const QStyleOption* opt, int x = 0; int x0 = reverse ? rect.right() - ((unit_width > 1) ? unit_width : fw) : rect.x() + fw; - QStyleOptionProgressBarV2 pbBits = *pb; + QStyleOptionProgressBar pbBits = *pb; pbBits.rect = rect; pbBits.palette = pal2; int myY = pbBits.rect.y(); @@ -1206,7 +1222,8 @@ void Style_Salome::drawControl( ControlElement ce, const QStyleOption* opt, } } break; - case CE_MenuItem: + } + case CE_MenuItem: { if (const QStyleOptionMenuItem *menuitem = qstyleoption_cast(opt)) { const int windowsItemFrame = 2; // definitions from qwindowstyle.cpp file const int windowsItemHMargin = 3; @@ -1327,38 +1344,40 @@ void Style_Salome::drawControl( ControlElement ce, const QStyleOption* opt, QFont font = menuitem->font; if (menuitem->menuItemType == QStyleOptionMenuItem::DefaultItem) font.setBold(true); - p->setFont(font); - if (dis && !act) { - p->setPen(menuitem->palette.light().color()); - p->drawText(vTextRect.adjusted(1,1,1,1), text_flags, s.left(t)); - p->setPen(discol); - } - p->drawText(vTextRect, text_flags, s.left(t)); - p->restore(); - } - if (menuitem->menuItemType == QStyleOptionMenuItem::SubMenu) {// draw sub menu arrow - int dim = (h - 2 * windowsItemFrame) / 2; - PrimitiveElement arrow; - arrow = (opt->direction == Qt::RightToLeft) ? PE_IndicatorArrowLeft : - PE_IndicatorArrowRight; - xpos = x + width - windowsArrowHMargin - windowsItemFrame - dim; - QRect vSubMenuRect = visualRect(opt->direction, menuitem->rect, - QRect(xpos, y + h / 2 - dim / 2, dim, dim)); - QStyleOptionMenuItem newMI = *menuitem; - newMI.rect = vSubMenuRect; - newMI.state = dis ? State_None : State_Enabled; - if (act) - newMI.palette.setColor(QPalette::ButtonText, - newMI.palette.highlightedText().color()); - drawPrimitive(arrow, &newMI, p, w); + p->setFont(font); + if (dis && !act) { + p->setPen(menuitem->palette.light().color()); + p->drawText(vTextRect.adjusted(1,1,1,1), text_flags, s.left(t)); + p->setPen(discol); } + p->drawText(vTextRect, text_flags, s.left(t)); + p->restore(); } + if (menuitem->menuItemType == QStyleOptionMenuItem::SubMenu) {// draw sub menu arrow + int dim = (h - 2 * windowsItemFrame) / 2; + PrimitiveElement arrow; + arrow = (opt->direction == Qt::RightToLeft) ? PE_IndicatorArrowLeft : + PE_IndicatorArrowRight; + xpos = x + width - windowsArrowHMargin - windowsItemFrame - dim; + QRect vSubMenuRect = visualRect(opt->direction, menuitem->rect, + QRect(xpos, y + h / 2 - dim / 2, dim, dim)); + QStyleOptionMenuItem newMI = *menuitem; + newMI.rect = vSubMenuRect; + newMI.state = dis ? State_None : State_Enabled; + if (act) + newMI.palette.setColor(QPalette::ButtonText, + newMI.palette.highlightedText().color()); + drawPrimitive(arrow, &newMI, p, w); + } + } break; - /* - case CE_ToolBoxTab: + } + /* + case CE_ToolBoxTab: { QCommonStyle::drawControl( ce, opt, p, w ); break; - */ + } + */ case CE_HeaderSection: { bool aStateOn = opt->state & State_On; QColor aColor = model()->color( Style_Model::Header ); // Style_Model::header_clr @@ -1370,7 +1389,7 @@ void Style_Salome::drawControl( ControlElement ce, const QStyleOption* opt, aBrdBotCol, model()->antialiasing(), true, aStateOn ); break; } - case CE_ComboBoxLabel: + case CE_ComboBoxLabel: { if (const QStyleOptionComboBox *cb = qstyleoption_cast(opt)) { QRect editRect = subControlRect(CC_ComboBox, cb, SC_ComboBoxEditField, w); p->save(); @@ -1407,16 +1426,17 @@ void Style_Salome::drawControl( ControlElement ce, const QStyleOption* opt, p->restore(); } break; + } case CE_ScrollBarSubLine: case CE_ScrollBarAddLine: { - bool aStateOn = opt->state & ( State_Sunken | State_On ); - QColor aBtnCol = opt->palette.color( QPalette::Button ); - QColor top = aBtnCol.light( BUT_PERCENT_COL ), - bottom = aBtnCol.dark( BUT_PERCENT_COL ); - QColor aBrdTopCol = model()->color( Style_Model::BorderTop ); // Style_Model::border_top_clr - QColor aBrdBotCol = model()->color( Style_Model::BorderBottom ); // Style_Model::border_bot_clr - Style_Tools::shadowRect( p, opt->rect, 0, -1, 0, Style_Tools::All, top, bottom, aBrdTopCol, - aBrdBotCol, false, true, aStateOn, true ); + bool aStateOn = opt->state & ( State_Sunken | State_On ); + QColor aBtnCol = opt->palette.color( QPalette::Button ); + QColor top = aBtnCol.light( BUT_PERCENT_COL ), + bottom = aBtnCol.dark( BUT_PERCENT_COL ); + QColor aBrdTopCol = model()->color( Style_Model::BorderTop ); // Style_Model::border_top_clr + QColor aBrdBotCol = model()->color( Style_Model::BorderBottom ); // Style_Model::border_bot_clr + Style_Tools::shadowRect( p, opt->rect, 0, -1, 0, Style_Tools::All, top, bottom, aBrdTopCol, + aBrdBotCol, false, true, aStateOn, true ); PrimitiveElement arrow; if (opt->state & State_Horizontal) { if (ce == CE_ScrollBarAddLine) @@ -1432,7 +1452,7 @@ void Style_Salome::drawControl( ControlElement ce, const QStyleOption* opt, drawPrimitive(arrow, opt, p, w); break; } - case CE_ScrollBarSlider: + case CE_ScrollBarSlider: { if (const QStyleOptionSlider *scrollbar = qstyleoption_cast(opt)) { p->save(); p->setRenderHint( QPainter::Antialiasing, true ); @@ -1442,7 +1462,7 @@ void Style_Salome::drawControl( ControlElement ce, const QStyleOption* opt, if ( hasHover() && enabled && (opt->state & State_MouseOver) ) drawHoverRect(p, opt->rect, opt->palette.color( QPalette::Window ), aRad, Style_Tools::All, false); else { - QColor aColor = model()->color( Style_Model::Slider ); // Style_Model::slider_clr + QColor aColor = model()->color( Style_Model::Slider ); // Style_Model::slider_clr if ( !enabled ) aColor = opt->palette.button().color(); QColor top = aColor.light( BUT_PERCENT_ON ), @@ -1462,37 +1482,39 @@ void Style_Salome::drawControl( ControlElement ce, const QStyleOption* opt, p->fillPath( path, gr ); p->strokePath( path, aBrdTopCol ); + } + p->setRenderHint( QPainter::Antialiasing, false ); + // draw handle + QRect aRect = opt->rect; + int aWidth = aRect.width(), aHeight = aRect.height(); + if ( aWidth > aHeight + aRad ) + aRect = QRect( aRect.x() + (int)((aWidth-aHeight)/2), + aRect.y(), aHeight, aHeight ); + else if ( aHeight > aWidth + aRad ) + aRect = QRect( aRect.x(), aRect.y() + (int)((aHeight-aWidth)/2), + aWidth, aWidth ); + else { + int aRad2 = (int)(aRad/3); + aRect = QRect( aRect.x()+aRad2, aRect.y()+aRad2, aRect.width()-2*aRad2, aRect.height()-2*aRad2 ); + } + drawHandle( p, aRect, horiz, true ); + + p->restore(); } + break; + } + case CE_ToolBar: { + QRect r = w->rect(); + bool horiz = opt->state & State_Horizontal; + drawBackground( p, r, opt->palette.color( QPalette::Window ), true, true, horiz ); p->setRenderHint( QPainter::Antialiasing, false ); - // draw handle - QRect aRect = opt->rect; - int aWidth = aRect.width(), aHeight = aRect.height(); - if ( aWidth > aHeight + aRad ) - aRect = QRect( aRect.x() + (int)((aWidth-aHeight)/2), - aRect.y(), aHeight, aHeight ); - else if ( aHeight > aWidth + aRad ) - aRect = QRect( aRect.x(), aRect.y() + (int)((aHeight-aWidth)/2), - aWidth, aWidth ); - else { - int aRad2 = (int)(aRad/3); - aRect = QRect( aRect.x()+aRad2, aRect.y()+aRad2, aRect.width()-2*aRad2, aRect.height()-2*aRad2 ); - } - drawHandle( p, aRect, horiz, true ); - - p->restore(); + drawBorder( p, r, horiz ); + break; + } + default: { + BaseStyle::drawControl( ce, opt, p, w ); break; } - case CE_ToolBar: { - QRect r = w->rect(); - bool horiz = opt->state & State_Horizontal; - drawBackground( p, r, opt->palette.color( QPalette::Window ), true, true, horiz ); - p->setRenderHint( QPainter::Antialiasing, false ); - drawBorder( p, r, horiz ); - break; - } - default: - BaseStyle::drawControl( ce, opt, p, w ); - break; } } @@ -1514,7 +1536,7 @@ void Style_Salome::drawPrimitive( PrimitiveElement pe, const QStyleOption* opt, const QPalette& pal = opt->palette; bool doRestore = false; switch ( pe ) { - case PE_FrameMenu: + case PE_FrameMenu: { if (qstyleoption_cast(opt)) { QColor aBtnCol = opt->palette.color( QPalette::Window ), top = aBtnCol.light( BUT_PERCENT_ON ), @@ -1523,8 +1545,9 @@ void Style_Salome::drawPrimitive( PrimitiveElement pe, const QStyleOption* opt, QColor aBrdBotCol = model()->color( Style_Model::BorderBottom ); // Style_Model::border_bot_clr Style_Tools::shadowRect( p, opt->rect, 0, 0., SHADOW, Style_Tools::All, top, bottom, aBrdTopCol, aBrdBotCol, false, false, false, false ); - break; } + break; + } case PE_PanelButtonTool : { if ( w && ( opt->state & State_Enabled ) && ( ( qobject_cast( w->parentWidget() ) ) || @@ -1546,10 +1569,11 @@ void Style_Salome::drawPrimitive( PrimitiveElement pe, const QStyleOption* opt, } break; } - else + else { BaseStyle::drawPrimitive( pe, opt, p, w ); + } + break; } - break; case PE_FrameFocusRect: { if (w && qobject_cast((QWidget*)w)) { QTabBar* tabBar = qobject_cast((QWidget*)w); @@ -1636,9 +1660,8 @@ void Style_Salome::drawPrimitive( PrimitiveElement pe, const QStyleOption* opt, p->setPen(opt->palette.dark().color()); else p->setPen(opt->palette.text().color()); - } // Fall through! - case PE_IndicatorViewItemCheck: - { + } // Fall through! + case PE_IndicatorViewItemCheck: { if (!doRestore) { p->save(); doRestore = true; @@ -1692,7 +1715,7 @@ void Style_Salome::drawPrimitive( PrimitiveElement pe, const QStyleOption* opt, QPoint(10, 2), QPoint(10, 3), QPoint(11, 4), QPoint(11, 7), QPoint(10, 8), QPoint(10, 9), QPoint(9, 10), QPoint(8, 10), QPoint(7, 11), QPoint(4, 11), QPoint(3, 10), QPoint(2, 10) }; - // make sure the indicator is square + // make sure the indicator is square QRect ir = opt->rect; if (opt->rect.width() < opt->rect.height()) { ir.setTop(opt->rect.top() + (opt->rect.height() - opt->rect.width()) / 2); @@ -1752,10 +1775,11 @@ void Style_Salome::drawPrimitive( PrimitiveElement pe, const QStyleOption* opt, p->restore(); break; } - case PE_FrameDockWidget: + case PE_FrameDockWidget: { if ( qstyleoption_cast(opt)) QCommonStyle::drawPrimitive( pe, opt, p, w ); break; + } case PE_FrameLineEdit: case PE_PanelLineEdit: { if ( w ) { @@ -1810,8 +1834,8 @@ void Style_Salome::drawPrimitive( PrimitiveElement pe, const QStyleOption* opt, model()->color( Style_Model::FieldLight ), opt->palette.color( QPalette::Dark ), aBrdTopCol, aBrdBotCol, false, false, false, false ); - break; } + break; } case PE_IndicatorToolBarHandle: { p->save(); @@ -1836,7 +1860,7 @@ void Style_Salome::drawPrimitive( PrimitiveElement pe, const QStyleOption* opt, drawBackground( p, w->rect(), opt->palette.color( QPalette::Window ), false ); break; } - case PE_FrameTabBarBase: + case PE_FrameTabBarBase: { // for a tabbar that isn't part of a tab widget(dockWidgets for example). if (const QStyleOptionTabBarBase *tbb = qstyleoption_cast(opt)) { @@ -1864,44 +1888,45 @@ void Style_Salome::drawPrimitive( PrimitiveElement pe, const QStyleOption* opt, QStyleOptionTabBarBase* copyOpt = (QStyleOptionTabBarBase*)tbb; copyOpt->selectedTabRect = aSelRect; QCommonStyle::drawPrimitive( pe, copyOpt, p, w ); - break; } + break; + } case PE_IndicatorBranch: { - // This is _way_ too similar to the common style. - static const int decoration_size = 9; - int mid_h = opt->rect.x() + opt->rect.width() / 2; - int mid_v = opt->rect.y() + opt->rect.height() / 2; - int bef_h = mid_h; - int bef_v = mid_v; - int aft_h = mid_h; - int aft_v = mid_v; - if (opt->state & State_Children) { - int delta = decoration_size / 2; - bef_h -= delta; - bef_v -= delta; - aft_h += delta; - aft_v += delta; - p->drawLine(bef_h + 2, bef_v + 4, bef_h + 6, bef_v + 4); - if (!(opt->state & State_Open)) - p->drawLine(bef_h + 4, bef_v + 2, bef_h + 4, bef_v + 6); - QPen oldPen = p->pen(); - p->setPen(opt->palette.dark().color()); - p->drawRect(bef_h, bef_v, decoration_size - 1, decoration_size - 1); - p->setPen(oldPen); - } - QBrush brush(opt->palette.dark().color(), Qt::Dense4Pattern); - if (opt->state & State_Item) { - if (opt->direction == Qt::RightToLeft) - p->fillRect(opt->rect.left(), mid_v, bef_h - opt->rect.left(), 1, brush); - else - p->fillRect(aft_h, mid_v, opt->rect.right() - aft_h + 1, 1, brush); - } - if (opt->state & State_Sibling) - p->fillRect(mid_h, aft_v, 1, opt->rect.bottom() - aft_v + 1, brush); - if (opt->state & (State_Open | State_Children | State_Item | State_Sibling)) - p->fillRect(mid_h, opt->rect.y(), 1, bef_v - opt->rect.y(), brush); - break; + // This is _way_ too similar to the common style. + static const int decoration_size = 9; + int mid_h = opt->rect.x() + opt->rect.width() / 2; + int mid_v = opt->rect.y() + opt->rect.height() / 2; + int bef_h = mid_h; + int bef_v = mid_v; + int aft_h = mid_h; + int aft_v = mid_v; + if (opt->state & State_Children) { + int delta = decoration_size / 2; + bef_h -= delta; + bef_v -= delta; + aft_h += delta; + aft_v += delta; + p->drawLine(bef_h + 2, bef_v + 4, bef_h + 6, bef_v + 4); + if (!(opt->state & State_Open)) + p->drawLine(bef_h + 4, bef_v + 2, bef_h + 4, bef_v + 6); + QPen oldPen = p->pen(); + p->setPen(opt->palette.dark().color()); + p->drawRect(bef_h, bef_v, decoration_size - 1, decoration_size - 1); + p->setPen(oldPen); + } + QBrush brush(opt->palette.dark().color(), Qt::Dense4Pattern); + if (opt->state & State_Item) { + if (opt->direction == Qt::RightToLeft) + p->fillRect(opt->rect.left(), mid_v, bef_h - opt->rect.left(), 1, brush); + else + p->fillRect(aft_h, mid_v, opt->rect.right() - aft_h + 1, 1, brush); } + if (opt->state & State_Sibling) + p->fillRect(mid_h, aft_v, 1, opt->rect.bottom() - aft_v + 1, brush); + if (opt->state & (State_Open | State_Children | State_Item | State_Sibling)) + p->fillRect(mid_h, opt->rect.y(), 1, bef_v - opt->rect.y(), brush); + break; + } case PE_IndicatorDockWidgetResizeHandle: { QRect r = opt->rect; drawBorder( p, r, opt->state & State_Horizontal ); @@ -1987,18 +2012,18 @@ int Style_Salome::pixelMetric( PixelMetric metric, const QStyleOption* opt, } case PM_DockWidgetFrameWidth: aRes = 1; - break; + break; case PM_DockWidgetSeparatorExtent: aRes = 8; - break; + break; case PM_DockWidgetTitleMargin: aRes = 2; - break; + break; case PM_SplitterWidth: aRes = 6; - break; + break; default: - break; + break; } return aRes; } @@ -2020,7 +2045,7 @@ QSize Style_Salome::sizeFromContents( ContentsType ct, const QStyleOption* opt, } QSize sz = BaseStyle::sizeFromContents( ct, opt, contentsSize, w ); switch (ct) { - case CT_TabBarTab: + case CT_TabBarTab: { if (const QStyleOptionTab *tab = qstyleoption_cast(opt)) { if ( tab->position == QStyleOptionTab::End || tab->position == QStyleOptionTab::OnlyOneTab ) { @@ -2033,31 +2058,33 @@ QSize Style_Salome::sizeFromContents( ContentsType ct, const QStyleOption* opt, sz.setHeight( sz.height() + aDelta ); } } - break; } break; - case CT_Slider: { - int aValue = model()->sliderSize(); - sz.setWidth( sz.width() + aValue ); - sz.setHeight( sz.height() + aValue ); - break; + } + case CT_Slider: { + int aValue = model()->sliderSize(); + sz.setWidth( sz.width() + aValue ); + sz.setHeight( sz.height() + aValue ); + break; + } + case CT_ComboBox: { + if (const QStyleOptionComboBox *cmb = qstyleoption_cast(opt)) { + QRect res = QRect( 0, 0, sz.width(), sz.height() ); + int aHalfRect = (int)Style_Tools::getMaxRect( res, + (int)model()->widgetRounding( Style_Model::EditRadius )/2 ); // left value + + QRect old_arrow = BaseStyle::subControlRect( CC_ComboBox, cmb, + SC_ComboBoxArrow, w ); + int aDelta = res.height() - old_arrow.width(); // right value + if ( cmb->editable ) + aDelta += aHalfRect; // for right of line edit internal + sz.setWidth( res.width() + aDelta + aHalfRect ); } - case CT_ComboBox: - if (const QStyleOptionComboBox *cmb = qstyleoption_cast(opt)) { - QRect res = QRect( 0, 0, sz.width(), sz.height() ); - int aHalfRect = (int)Style_Tools::getMaxRect( res, - (int)model()->widgetRounding( Style_Model::EditRadius )/2 ); // left value - - QRect old_arrow = BaseStyle::subControlRect( CC_ComboBox, cmb, - SC_ComboBoxArrow, w ); - int aDelta = res.height() - old_arrow.width(); // right value - if ( cmb->editable ) - aDelta += aHalfRect; // for right of line edit internal - sz.setWidth( res.width() + aDelta + aHalfRect ); - } - break; - default: break; + } + default: { + break; + } } return sz; } @@ -2204,11 +2231,14 @@ QRect Style_Salome::subControlRect( ComplexControl cc, const QStyleOptionComplex res.setWidth( h ); break; } + default: { + break; + } } } break; } - case CC_ScrollBar: + case CC_ScrollBar: { if (const QStyleOptionSlider *scrollbar = qstyleoption_cast(opt)) { QRect slider_r = BaseStyle::subControlRect( cc, opt, SC_ScrollBarSlider, wid ); int aRect = Style_Tools::getMaxRect( slider_r, (int)model()->widgetRounding( Style_Model::ButtonRadius ) ); @@ -2228,8 +2258,9 @@ QRect Style_Salome::subControlRect( ComplexControl cc, const QStyleOptionComplex default: break; } - break; } + break; + } case CC_Slider: { if (const QStyleOptionSlider *slider = qstyleoption_cast(opt)) { switch ( sc ) { @@ -2244,8 +2275,15 @@ QRect Style_Salome::subControlRect( ComplexControl cc, const QStyleOptionComplex } break; } + default: { + break; + } } } + break; + } + default: { + break; } } return res; @@ -2289,6 +2327,8 @@ QRect Style_Salome::subElementRect( SubElement se, const QStyleOption* opt, case SE_ProgressBarContents: case SE_ProgressBarGroove: return opt->rect; + default: + break; } if( qobject_cast(wid) || qobject_cast(wid) ) { diff --git a/src/Style/Style_Tools.cxx b/src/Style/Style_Tools.cxx index 242a7815e..ffc63afc4 100644 --- a/src/Style/Style_Tools.cxx +++ b/src/Style/Style_Tools.cxx @@ -354,8 +354,9 @@ void Style_Tools::drawArrow( QStyle::PrimitiveElement type, QPainter* p, const Q p->translate( xc, yc ); bool correct = false; switch( type ) { - case QStyle::PE_IndicatorArrowDown: + case QStyle::PE_IndicatorArrowDown: { correct = true; + } // fall through! case QStyle::PE_IndicatorArrowUp: { int widthArr2 = (int)(deltaX/3.); if ( correct ) @@ -374,8 +375,9 @@ void Style_Tools::drawArrow( QStyle::PrimitiveElement type, QPainter* p, const Q x11 = -deltaX; y11 = -deltaY; x12 = deltaX; y12 = deltaY; break; } - case QStyle::PE_IndicatorArrowLeft: // to change + case QStyle::PE_IndicatorArrowLeft: { correct = true; + } // fall through! case QStyle::PE_IndicatorArrowRight: { int widthArr2 = (int)(deltaX/3.); if ( correct ) @@ -392,8 +394,9 @@ void Style_Tools::drawArrow( QStyle::PrimitiveElement type, QPainter* p, const Q x11 = deltaX; y11 = deltaY; x12 = -deltaX; y12 = -deltaY; break; } - case QStyle::PE_IndicatorSpinDown: + case QStyle::PE_IndicatorSpinDown: { correct = true; + } // fall through! case QStyle::PE_IndicatorSpinUp: { aDelta = (int)(deltaY/2); if ( correct ) { @@ -447,8 +450,9 @@ void Style_Tools::drawSign( QStyle::PrimitiveElement type, QPainter* p, const QR p->translate( xc, yc ); bool correct = false; switch( type ) { - case QStyle::PE_IndicatorSpinMinus: + case QStyle::PE_IndicatorSpinMinus: { correct = true; + } // fall through! case QStyle::PE_IndicatorSpinPlus: { aDelta = (int)(deltaY/2); if ( correct ) { @@ -694,7 +698,7 @@ void Style_Tools::drawFocus( QPainter* p, const QPainterPath& path, const QColor */ void Style_Tools::drawSlider( QPainter* p, const QRect& r, const double rad, SliderType type, const QColor& light, const QColor& dark, - const QColor& border_top, const QColor& border_bot ) + const QColor& /*border_top*/, const QColor& border_bot ) { p->save(); QPainterPath path, bottomPath; diff --git a/src/TOOLSGUI/ToolsGUI.cxx b/src/TOOLSGUI/ToolsGUI.cxx index 1be827f46..c0cb8f472 100644 --- a/src/TOOLSGUI/ToolsGUI.cxx +++ b/src/TOOLSGUI/ToolsGUI.cxx @@ -42,11 +42,12 @@ bool ToolsGUI::GetVisibility( _PTR(SObject) theObj, void* theId ) { + // todo: this function seems to be not used _PTR(GenericAttribute) anAttr; if ( theObj && theObj->FindAttribute( anAttr, "AttributeGraphic" ) ) { _PTR(AttributeGraphic) aGraphic (anAttr); - return aGraphic->GetVisibility( (unsigned long)theId ); + return aGraphic->GetVisibility( int(reinterpret_cast(theId)) ); // todo: unsafe - converting pointer to int can give non-unique result } return false; @@ -62,6 +63,7 @@ bool ToolsGUI::SetVisibility( const char* theEntry, const bool theValue, void* theId ) { + // todo: this function seems to be not used _PTR(Study) aStudy = ClientFactory::Study(KERNEL::getStudyServant()); _PTR(SObject) anObj ( aStudy->FindObjectID( theEntry ) ); @@ -71,13 +73,13 @@ bool ToolsGUI::SetVisibility( const char* theEntry, if ( anObj->FindAttribute( aGAttr, "AttributeGraphic" ) ) { _PTR(AttributeGraphic) anAttr ( aGAttr ); - anAttr->SetVisibility( (unsigned long)theId, theValue ); + anAttr->SetVisibility( int(reinterpret_cast(theId)), theValue ); // todo: unsafe - converting pointer to int can give non-unique result } else if ( theValue ) { _PTR(StudyBuilder) aBuilder (aStudy->NewBuilder()); _PTR(AttributeGraphic) anAttr (aBuilder->FindOrCreateAttribute(anObj, "AttributeGraphic")); - anAttr->SetVisibility( (unsigned long)theId, theValue ); + anAttr->SetVisibility( int(reinterpret_cast(theId)), theValue ); // todo: unsafe - converting pointer to int can give non-unique result } return true; } diff --git a/src/TOOLSGUI/ToolsGUI_RegWidget.cxx b/src/TOOLSGUI/ToolsGUI_RegWidget.cxx index bb7c0a448..886d7f194 100644 --- a/src/TOOLSGUI/ToolsGUI_RegWidget.cxx +++ b/src/TOOLSGUI/ToolsGUI_RegWidget.cxx @@ -140,7 +140,7 @@ static Registry::Components_ptr GetRegistry( CORBA::ORB_ptr orb ) if ( CORBA::is_nil( object ) ) throw CommException( "Unable to find the Registry service" ); aRegistry = Registry::Components::_narrow( object ); } - catch( const CORBA::Exception& ex ) + catch( const CORBA::Exception& /*ex*/ ) //!< TODO: unused variable { MESSAGE( "Error: can't access Registry server" ); } @@ -279,7 +279,7 @@ ToolsGUI_RegWidget::ToolsGUI_RegWidget( CORBA::ORB_ptr orb, QWidget* parent ) ToolsGUI_RegWidget::~ToolsGUI_RegWidget() { myRegWidgetPtr = 0; -}; +} /*! \brief Get description text, containing information about the service. @@ -351,7 +351,7 @@ void ToolsGUI_RegWidget::refresh() // update current services list myViews[Clients]->clear(); - for ( int i = 0; i < myData[Clients]->length(); i++ ) { + for ( int i = 0; i < (int)myData[Clients]->length(); i++ ) { //!< TODO: mismatch signed/unsigned const Registry::Infos& c_info = (*myData[Clients])[i]; time_t aStarted = time_t( c_info.tc_start ); time_t aLastPing = time_t( c_info.tc_hello ); @@ -367,7 +367,7 @@ void ToolsGUI_RegWidget::refresh() // update history myViews[History]->clear(); - for ( int i = 0; i < myData[History]->length(); i++ ) { + for ( int i = 0; i < (int)myData[History]->length(); i++ ) { //!< TODO: mismatch signed/unsigned const Registry::Infos& c_info = (*myData[History])[i]; time_t aStarted = time_t( c_info.tc_start ); time_t aFinished = time_t( c_info.tc_end ); diff --git a/src/TreeData/DataProcessor.hxx b/src/TreeData/DataProcessor.hxx index 08d4394af..d86c18535 100644 --- a/src/TreeData/DataProcessor.hxx +++ b/src/TreeData/DataProcessor.hxx @@ -52,10 +52,10 @@ public: protected: - virtual void preprocess(QStringList itemNameIdList) { + virtual void preprocess(QStringList /*itemNameIdList*/) { // Implement something to be executed at the begining of the process function }; - virtual void postprocess(QStringList itemNameIdList) { + virtual void postprocess(QStringList /*itemNameIdList*/) { // Implement something to be executed at the end of the process function }; // Implement what must be done with each DataObject during the process function diff --git a/src/TreeData/DockWidgets.cxx b/src/TreeData/DockWidgets.cxx index a34ec6c04..845f27068 100644 --- a/src/TreeData/DockWidgets.cxx +++ b/src/TreeData/DockWidgets.cxx @@ -116,7 +116,7 @@ void DockWidgets::setDataView(QTreeView * dataView) { _dwDataPanel->setWidget(_tvDataView); } -void DockWidgets::setPropertiesView(QTreeView * propertiesView) { +void DockWidgets::setPropertiesView(QTreeView * /*propertiesView*/) { // Not implemented yet } diff --git a/src/TreeData/Test/tester.cxx b/src/TreeData/Test/tester.cxx index 67182851b..5d8b942e7 100644 --- a/src/TreeData/Test/tester.cxx +++ b/src/TreeData/Test/tester.cxx @@ -72,7 +72,7 @@ void TEST_DataModel() { // // ================================================================= // -int main(int argc, char * argv[ ]) +int main() { TEST_DataObject(); //TEST_DataModel(); diff --git a/src/TreeData/TreeGuiManager.cxx b/src/TreeData/TreeGuiManager.cxx index 72c1314b4..a9c0c69a6 100644 --- a/src/TreeData/TreeGuiManager.cxx +++ b/src/TreeData/TreeGuiManager.cxx @@ -143,7 +143,7 @@ DataModel * TreeGuiManager::getDataModel() { */ void TreeGuiManager::processItemList(QStringList itemNameIdList, - int actionId) + int /*actionId*/) { // WARN: THIS IS A DEFAULT IMPLEMENTATION GIVEN FOR DEMONSTRATION // OF WHAT TO DO WITH THE PARAMETERS diff --git a/src/TreeData/TreeView.cxx b/src/TreeData/TreeView.cxx index 2d7c6583c..c59ef9531 100644 --- a/src/TreeData/TreeView.cxx +++ b/src/TreeData/TreeView.cxx @@ -41,8 +41,8 @@ TreeView::TreeView(QWidget * parent) _lastActionId = 0; // Default actions for tests - int displayActionId = addAction(QObject::tr("Afficher")); - int editActionId = addAction(QObject::tr("Editer")); + /*int displayActionId = */addAction(QObject::tr("Afficher")); + /*int editActionId = */addAction(QObject::tr("Editer")); } TreeView::~TreeView() { diff --git a/src/VTKViewer/VTKViewer_Actor.cxx b/src/VTKViewer/VTKViewer_Actor.cxx index 309fc8101..49e98cbac 100644 --- a/src/VTKViewer/VTKViewer_Actor.cxx +++ b/src/VTKViewer/VTKViewer_Actor.cxx @@ -54,7 +54,7 @@ int VTKViewer_POINT_SIZE = 5; int VTKViewer_LINE_WIDTH = 3; -vtkStandardNewMacro(VTKViewer_Actor); +vtkStandardNewMacro(VTKViewer_Actor) /*! Constructor @@ -93,7 +93,7 @@ VTKViewer_Actor myTransformFilter->Delete(); - for(int i = 0, iEnd = myPassFilter.size(); i < iEnd; i++) + for(size_t i = 0, iEnd = myPassFilter.size(); i < iEnd; i++) if(myPassFilter[i]) myPassFilter[i]->Delete(); @@ -637,7 +637,7 @@ VTKViewer_Actor */ void VTKViewer_Actor -::SetMaterial(std::vector theProps) +::SetMaterial(std::vector /*theProps*/) { } @@ -770,4 +770,4 @@ vtkDataSet* VTKViewer_Actor::GetHighlightedDataSet() { -vtkCxxSetObjectMacro(VTKViewer_Actor,PreviewProperty,vtkProperty); +vtkCxxSetObjectMacro(VTKViewer_Actor,PreviewProperty,vtkProperty) diff --git a/src/VTKViewer/VTKViewer_Actor.h b/src/VTKViewer/VTKViewer_Actor.h index fe6d2f0c1..805eaca23 100644 --- a/src/VTKViewer/VTKViewer_Actor.h +++ b/src/VTKViewer/VTKViewer_Actor.h @@ -76,7 +76,7 @@ class VTKVIEWER_EXPORT VTKViewer_Actor : public vtkLODActor public: static VTKViewer_Actor* New(); - vtkTypeMacro(VTKViewer_Actor,vtkLODActor); + vtkTypeMacro(VTKViewer_Actor,vtkLODActor) //---------------------------------------------------------------------------- //! Get its name @@ -319,7 +319,7 @@ class VTKVIEWER_EXPORT VTKViewer_Actor : public vtkLODActor //! Is notified on enabling/disabling selection virtual void - EnableSelection( bool enable ) {} + EnableSelection( bool /*enable*/ ) {} //! Ask, if the descendant of the VTKViewer_Actor will implement its own highlight or not virtual diff --git a/src/VTKViewer/VTKViewer_AppendFilter.cxx b/src/VTKViewer/VTKViewer_AppendFilter.cxx index 4011302e1..02f9195cd 100644 --- a/src/VTKViewer/VTKViewer_AppendFilter.cxx +++ b/src/VTKViewer/VTKViewer_AppendFilter.cxx @@ -44,7 +44,7 @@ #endif #endif -vtkStandardNewMacro(VTKViewer_AppendFilter); +vtkStandardNewMacro(VTKViewer_AppendFilter) VTKViewer_AppendFilter ::VTKViewer_AppendFilter() @@ -149,7 +149,7 @@ namespace { theInputID = theInputDataSetID = -1; - vtkIdType aNbInputs = theRanges.size(); + vtkIdType aNbInputs = (int)theRanges.size(); //!< TODO: conversion from size_t to int if(theInputDataSetID < 0 || theInputDataSetID >= aNbInputs) return -1; @@ -201,7 +201,7 @@ namespace return; vtkIdType aStartId = 0; - vtkIdType aNbInputs = theRanges.size(); + vtkIdType aNbInputs = (int)theRanges.size(); //!< TODO: conversion from size_t to int for(vtkIdType aDataSetId = 0; aDataSetId < aNbInputs; ++aDataSetId){ vtkIdType aRange = theRanges[aDataSetId]; if(aRange > theOutputID){ diff --git a/src/VTKViewer/VTKViewer_AppendFilter.h b/src/VTKViewer/VTKViewer_AppendFilter.h index 25eb9e81d..449f25d31 100644 --- a/src/VTKViewer/VTKViewer_AppendFilter.h +++ b/src/VTKViewer/VTKViewer_AppendFilter.h @@ -49,7 +49,7 @@ public: /*! \fn vtkTypeMacro(VTKViewer_AppendFilter, vtkAppendFilter) * \brief VTK type revision macros. */ - vtkTypeMacro(VTKViewer_AppendFilter, vtkAppendFilter); + vtkTypeMacro(VTKViewer_AppendFilter, vtkAppendFilter) void SetDoMappingFlag(const bool theFlag); diff --git a/src/VTKViewer/VTKViewer_ArcBuilder.cxx b/src/VTKViewer/VTKViewer_ArcBuilder.cxx index 0f84d9056..ef848bda1 100644 --- a/src/VTKViewer/VTKViewer_ArcBuilder.cxx +++ b/src/VTKViewer/VTKViewer_ArcBuilder.cxx @@ -227,8 +227,8 @@ VTKViewer_ArcBuilder::VTKViewer_ArcBuilder(const Pnt& thePnt1, const Pnt& thePnt2, const Pnt& thePnt3, double theAngle): - myStatus(Arc_Error), - myAngle(theAngle) + myAngle(theAngle), + myStatus(Arc_Error) { Vec V1(thePnt2.GetXYZ().X()-thePnt1.GetXYZ().X(), thePnt2.GetXYZ().Y()-thePnt1.GetXYZ().Y(), @@ -357,7 +357,7 @@ VTKViewer_ArcBuilder::~VTKViewer_ArcBuilder() */ vtkUnstructuredGrid* VTKViewer_ArcBuilder::BuildGrid(const PntList& theList) const { - int aListsize = theList.size(); + int aListsize = (int)theList.size(); //!< TODO: conversion from size_t to int vtkUnstructuredGrid* aGrid = NULL; if(aListsize != 0) { @@ -560,22 +560,22 @@ const std::vector& VTKViewer_ArcBuilder::GetScalarValues() } VTKViewer_ArcBuilder::IncOrder VTKViewer_ArcBuilder::GetArcAngle( const double& P1, const double& P2, const double& P3,double* Ang){ - IncOrder aResult; + IncOrder aResult = MINUS; if(P1 < P2 && P2 < P3){ *Ang = P3 - P1; - aResult = VTKViewer_ArcBuilder::PLUS; + aResult = PLUS; } else if((P1 < P3 && P3 < P2) || (P2 < P1 && P1 < P3)){ *Ang = 2*vtkMath::Pi() - P3 + P1; - aResult = VTKViewer_ArcBuilder::MINUS; + aResult = MINUS; } else if((P2 < P3 && P3 < P1) || (P3 < P1 && P1 < P2)){ *Ang = 2*vtkMath::Pi() - P1 + P3; - aResult = VTKViewer_ArcBuilder::PLUS; + aResult = PLUS; } else if(P3 < P2 && P2 < P1){ *Ang = P1 - P3; - aResult = VTKViewer_ArcBuilder::MINUS; + aResult = MINUS; } return aResult; } @@ -597,7 +597,6 @@ vtkIdType Build1DArc(vtkIdType cellId, vtkUnstructuredGrid* input, double myMaxArcAngle){ vtkIdType aResult = -1; - vtkIdType *aNewPoints; vtkDataArray* inputScalars = input->GetPointData()->GetScalars(); vtkDataArray* outputScalars = output->GetPointData()->GetScalars(); diff --git a/src/VTKViewer/VTKViewer_CellCenters.cxx b/src/VTKViewer/VTKViewer_CellCenters.cxx index b497d52ed..f6058d000 100644 --- a/src/VTKViewer/VTKViewer_CellCenters.cxx +++ b/src/VTKViewer/VTKViewer_CellCenters.cxx @@ -33,7 +33,7 @@ #include #include -vtkStandardNewMacro(VTKViewer_CellCenters); +vtkStandardNewMacro(VTKViewer_CellCenters) /*! * Class : VTKViewer_CellCenters diff --git a/src/VTKViewer/VTKViewer_CellCenters.h b/src/VTKViewer/VTKViewer_CellCenters.h index 05d0e010a..b0b0ec848 100644 --- a/src/VTKViewer/VTKViewer_CellCenters.h +++ b/src/VTKViewer/VTKViewer_CellCenters.h @@ -39,7 +39,7 @@ class VTKVIEWER_EXPORT VTKViewer_CellCenters : public vtkCellCenters { public: - vtkTypeMacro(VTKViewer_CellCenters,vtkCellCenters); + vtkTypeMacro(VTKViewer_CellCenters,vtkCellCenters) static VTKViewer_CellCenters *New(); diff --git a/src/VTKViewer/VTKViewer_CellLocationsArray.cxx b/src/VTKViewer/VTKViewer_CellLocationsArray.cxx index 315c60e67..c95060832 100644 --- a/src/VTKViewer/VTKViewer_CellLocationsArray.cxx +++ b/src/VTKViewer/VTKViewer_CellLocationsArray.cxx @@ -28,4 +28,4 @@ #include -vtkStandardNewMacro(VTKViewer_CellLocationsArray); +vtkStandardNewMacro(VTKViewer_CellLocationsArray) diff --git a/src/VTKViewer/VTKViewer_CellLocationsArray.h b/src/VTKViewer/VTKViewer_CellLocationsArray.h index d7869ed18..e3db50ac3 100644 --- a/src/VTKViewer/VTKViewer_CellLocationsArray.h +++ b/src/VTKViewer/VTKViewer_CellLocationsArray.h @@ -39,7 +39,7 @@ struct VTKVIEWER_EXPORT VTKViewer_CellLocationsArray : TCellLocationsArray { static VTKViewer_CellLocationsArray* New(); - vtkTypeMacro(VTKViewer_CellLocationsArray,TCellLocationsArray); + vtkTypeMacro(VTKViewer_CellLocationsArray,TCellLocationsArray) }; #undef TCellLocationsArray diff --git a/src/VTKViewer/VTKViewer_ConvexTool.cxx b/src/VTKViewer/VTKViewer_ConvexTool.cxx index e8cd08c57..ef39a661d 100644 --- a/src/VTKViewer/VTKViewer_ConvexTool.cxx +++ b/src/VTKViewer/VTKViewer_ConvexTool.cxx @@ -405,7 +405,7 @@ VTKViewer_Triangulator if(DEBUG_TRIA_EXECUTE) cout << "; Added = FALSE" << endl; } } - int aNbPoints = aPointIds.size(); + int aNbPoints = (int)aPointIds.size(); //!< TODO: conversion from size_t to int aCenter[0] /= aNbPoints; aCenter[1] /= aNbPoints; aCenter[2] /= aNbPoints; @@ -523,7 +523,7 @@ VTKViewer_Triangulator } if(!aSortedPointIds.empty()){ - int aNumFacePts = aSortedPointIds.size(); + int aNumFacePts = (int)aSortedPointIds.size(); //!< TODO: conversion from size_t to int ::TConnectivities aConnectivities(aNumFacePts); TSortedPointIds::const_iterator anIter = aSortedPointIds.begin(); TSortedPointIds::const_iterator anEndIter = aSortedPointIds.end(); @@ -544,7 +544,7 @@ VTKViewer_Triangulator // To check, whether the polygons give a convex polyhedron or not if(theIsCheckConvex){ - int aNbPolygons = aPolygons.size(); + int aNbPolygons = (int)aPolygons.size(); //!< TODO: conversion from size_t to int for (int aPolygonId = 0; aPolygonId < aNbPolygons; aPolygonId++) { ::TPolygon& aPolygon = aPolygons[aPolygonId]; double* aNormal = aPolygon.myNormal; @@ -569,7 +569,7 @@ VTKViewer_Triangulator // To pass resulting set of the polygons to the output { - int aNbPolygons = aPolygons.size(); + int aNbPolygons = (int)aPolygons.size(); //!< TODO: conversion from size_t to int for (int aPolygonId = 0; aPolygonId < aNbPolygons; aPolygonId++) { ::TPolygon& aPolygon = aPolygons[aPolygonId]; if(DEBUG_TRIA_EXECUTE) cout << "PoilygonId="<InsertNextCell(VTK_POLYGON,aNbPoints,&aConnectivities[0]); if(theStoreMapping) VTKViewer_GeometryFilter::InsertId( theCellId, VTK_POLYGON, theVTK2ObjIds, theDimension2VTK2ObjIds ); diff --git a/src/VTKViewer/VTKViewer_DataSetMapper.cxx b/src/VTKViewer/VTKViewer_DataSetMapper.cxx index 45878797e..e5862952d 100644 --- a/src/VTKViewer/VTKViewer_DataSetMapper.cxx +++ b/src/VTKViewer/VTKViewer_DataSetMapper.cxx @@ -23,7 +23,7 @@ #include #include -vtkStandardNewMacro(VTKViewer_DataSetMapper); +vtkStandardNewMacro(VTKViewer_DataSetMapper) //---------------------------------------------------------------------------- VTKViewer_DataSetMapper::VTKViewer_DataSetMapper() diff --git a/src/VTKViewer/VTKViewer_DataSetMapper.h b/src/VTKViewer/VTKViewer_DataSetMapper.h index 316aeadaf..8515d5f3c 100644 --- a/src/VTKViewer/VTKViewer_DataSetMapper.h +++ b/src/VTKViewer/VTKViewer_DataSetMapper.h @@ -29,7 +29,7 @@ class VTKVIEWER_EXPORT VTKViewer_DataSetMapper : public vtkDataSetMapper { public: static VTKViewer_DataSetMapper *New(); - vtkTypeMacro(VTKViewer_DataSetMapper,vtkDataSetMapper); + vtkTypeMacro(VTKViewer_DataSetMapper,vtkDataSetMapper) //! Set point marker enabled void SetMarkerEnabled( bool ); diff --git a/src/VTKViewer/VTKViewer_ExtractUnstructuredGrid.cxx b/src/VTKViewer/VTKViewer_ExtractUnstructuredGrid.cxx index 5cd12e23f..0b392acaa 100644 --- a/src/VTKViewer/VTKViewer_ExtractUnstructuredGrid.cxx +++ b/src/VTKViewer/VTKViewer_ExtractUnstructuredGrid.cxx @@ -47,7 +47,7 @@ #define VTK_XVERSION (VTK_MAJOR_VERSION*10000+VTK_MINOR_VERSION*100+VTK_BUILD_VERSION) -vtkStandardNewMacro(VTKViewer_ExtractUnstructuredGrid); +vtkStandardNewMacro(VTKViewer_ExtractUnstructuredGrid) VTKViewer_ExtractUnstructuredGrid::VTKViewer_ExtractUnstructuredGrid(): @@ -287,9 +287,9 @@ inline int InsertCell(vtkUnstructuredGrid *theInput, vtkIdTypeArray*& theFaces, vtkIdTypeArray*& theFaceLocations, vtkIdType theCellId, - vtkIdList *theIdList, + vtkIdList* /*theIdList*/, bool theStoreMapping, - vtkIdType theOutId, + vtkIdType /*theOutId*/, VTKViewer_ExtractUnstructuredGrid::TVectorId& theOut2InId/*, VTKViewer_ExtractUnstructuredGrid::TMapId& theIn2OutId*/) { @@ -346,7 +346,7 @@ inline void InsertPointCell(vtkCellArray *theConnectivity, vtkIdType theCellId, vtkIdList *theIdList, bool theStoreMapping, - vtkIdType theOutId, + vtkIdType /*theOutId*/, VTKViewer_ExtractUnstructuredGrid::TVectorId& theOut2InId/*, VTKViewer_ExtractUnstructuredGrid::TMapId& theIn2OutId*/) { diff --git a/src/VTKViewer/VTKViewer_ExtractUnstructuredGrid.h b/src/VTKViewer/VTKViewer_ExtractUnstructuredGrid.h index c64e28d70..64ff52fa0 100644 --- a/src/VTKViewer/VTKViewer_ExtractUnstructuredGrid.h +++ b/src/VTKViewer/VTKViewer_ExtractUnstructuredGrid.h @@ -45,7 +45,7 @@ class VTKVIEWER_EXPORT VTKViewer_ExtractUnstructuredGrid : public vtkUnstructure { public: //! VTK type macros. - vtkTypeMacro( VTKViewer_ExtractUnstructuredGrid, vtkUnstructuredGridAlgorithm ); + vtkTypeMacro( VTKViewer_ExtractUnstructuredGrid, vtkUnstructuredGridAlgorithm ) //! \brief Construct with all types of clipping turned off. static VTKViewer_ExtractUnstructuredGrid *New(); diff --git a/src/VTKViewer/VTKViewer_Filter.h b/src/VTKViewer/VTKViewer_Filter.h index c7aa3ba36..4dd15b106 100644 --- a/src/VTKViewer/VTKViewer_Filter.h +++ b/src/VTKViewer/VTKViewer_Filter.h @@ -35,7 +35,7 @@ class VTKViewer_Actor; -DEFINE_STANDARD_HANDLE(VTKViewer_Filter, Standard_Transient); +DEFINE_STANDARD_HANDLE(VTKViewer_Filter, Standard_Transient) /* Class : VTKViewer_Filter diff --git a/src/VTKViewer/VTKViewer_FramedTextActor.cxx b/src/VTKViewer/VTKViewer_FramedTextActor.cxx index d810958ce..4b4ac0d63 100644 --- a/src/VTKViewer/VTKViewer_FramedTextActor.cxx +++ b/src/VTKViewer/VTKViewer_FramedTextActor.cxx @@ -63,7 +63,7 @@ namespace } //================================================================== -vtkStandardNewMacro(VTKViewer_FramedTextActor); +vtkStandardNewMacro(VTKViewer_FramedTextActor) //================================================================== // function : VTKViewer_FramedTextActor diff --git a/src/VTKViewer/VTKViewer_FramedTextActor.h b/src/VTKViewer/VTKViewer_FramedTextActor.h index 1999c5c77..0035441a0 100644 --- a/src/VTKViewer/VTKViewer_FramedTextActor.h +++ b/src/VTKViewer/VTKViewer_FramedTextActor.h @@ -41,7 +41,7 @@ public: enum LayoutType { Vertical = 0, Horizontal }; public: - vtkTypeMacro(VTKViewer_FramedTextActor,vtkActor2D); + vtkTypeMacro(VTKViewer_FramedTextActor,vtkActor2D) static VTKViewer_FramedTextActor *New(); virtual int RenderOpaqueGeometry(vtkViewport*); diff --git a/src/VTKViewer/VTKViewer_GeometryFilter.cxx b/src/VTKViewer/VTKViewer_GeometryFilter.cxx index c273927ac..a4ce3be23 100644 --- a/src/VTKViewer/VTKViewer_GeometryFilter.cxx +++ b/src/VTKViewer/VTKViewer_GeometryFilter.cxx @@ -92,7 +92,7 @@ #endif /////////////////////////////////////////////////////////////////////////////////////////////// -vtkStandardNewMacro(VTKViewer_GeometryFilter); +vtkStandardNewMacro(VTKViewer_GeometryFilter) VTKViewer_GeometryFilter ::VTKViewer_GeometryFilter(): @@ -180,7 +180,7 @@ int VTKViewer_GeometryFilter ::UnstructuredGridExecute(vtkDataSet *dataSetInput, vtkPolyData *output, - vtkInformation *outInfo) + vtkInformation */*outInfo*/) { vtkUnstructuredGrid *input= (vtkUnstructuredGrid *)dataSetInput; vtkCellArray *Connectivity = input->GetCells(); @@ -1229,7 +1229,7 @@ void VTKViewer_GeometryFilter ::InsertId( const vtkIdType theCellId, const vtkIdType theCellType, - TVectorId& theVTK2ObjIds, + TVectorId& /*theVTK2ObjIds*/, TMapOfVectorId& theDimension2VTK2ObjIds ) { //theVTK2ObjIds.push_back( theCellId ); diff --git a/src/VTKViewer/VTKViewer_GeometryFilter.h b/src/VTKViewer/VTKViewer_GeometryFilter.h index 7f60f5fab..9a641896f 100644 --- a/src/VTKViewer/VTKViewer_GeometryFilter.h +++ b/src/VTKViewer/VTKViewer_GeometryFilter.h @@ -48,7 +48,7 @@ public: /*! \fn vtkTypeMacro(VTKViewer_GeometryFilter, vtkGeometryFilter) * \brief VTK type revision macros. */ - vtkTypeMacro(VTKViewer_GeometryFilter, vtkGeometryFilter); + vtkTypeMacro(VTKViewer_GeometryFilter, vtkGeometryFilter) /*! \fn void SetInside(int theShowInside) * \brief Sets \a myShowInside flag. \a myShowInside is changed, call this->Modified(). * \param theShowInside - used for changing value of \a myShowInside variable. @@ -112,7 +112,7 @@ public: static void InsertId( const vtkIdType theCellId, const vtkIdType theCellType, - TVectorId& theVTK2ObjIds, + TVectorId& /*theVTK2ObjIds*/, TMapOfVectorId& theDimension2VTK2ObjIds ); protected: diff --git a/src/VTKViewer/VTKViewer_InteractorStyle.cxx b/src/VTKViewer/VTKViewer_InteractorStyle.cxx index cd67ed70c..0a74de2ef 100644 --- a/src/VTKViewer/VTKViewer_InteractorStyle.cxx +++ b/src/VTKViewer/VTKViewer_InteractorStyle.cxx @@ -74,7 +74,7 @@ static int GetEdgeId(vtkPicker *thePicker, SALOME_Actor *theActor, int theObjId) } */ -vtkStandardNewMacro(VTKViewer_InteractorStyle); +vtkStandardNewMacro(VTKViewer_InteractorStyle) /*!Constructor.*/ @@ -1197,7 +1197,7 @@ void VTKViewer_InteractorStyle::onOperation(QPoint mousePos) { if (!myCursorState) setCursor(VTK_INTERACTOR_STYLE_CAMERA_SELECT); - } + } // fall through! case VTK_INTERACTOR_STYLE_CAMERA_FIT: { myOtherPoint = mousePos; @@ -1221,7 +1221,7 @@ void VTKViewer_InteractorStyle::OnSelectionModeChanged() /*! called when user moves mouse inside viewer window and there is no active viewer operation \n * (!put necessary processing here!) */ -void VTKViewer_InteractorStyle::onCursorMove(QPoint mousePos) { +void VTKViewer_InteractorStyle::onCursorMove(QPoint /*mousePos*/) { // processing highlighting // SUIT_Study* anActiveStudy = SUIT_Application::getDesktop()->getActiveStudy(); // SALOME_Selection* Sel = SALOME_Selection::Selection( anActiveStudy->getSelection() ); diff --git a/src/VTKViewer/VTKViewer_InteractorStyle.h b/src/VTKViewer/VTKViewer_InteractorStyle.h index 5ecd8f23b..8a2fe13f7 100644 --- a/src/VTKViewer/VTKViewer_InteractorStyle.h +++ b/src/VTKViewer/VTKViewer_InteractorStyle.h @@ -72,7 +72,7 @@ class VTKVIEWER_EXPORT VTKViewer_InteractorStyle : public QObject, public vtkInt { public: static VTKViewer_InteractorStyle *New(); - vtkTypeMacro(VTKViewer_InteractorStyle, vtkInteractorStyle); + vtkTypeMacro(VTKViewer_InteractorStyle, vtkInteractorStyle) virtual void SetInteractor(vtkRenderWindowInteractor *theInteractor); void setViewWnd(VTKViewer_ViewWindow* theViewWnd); @@ -113,7 +113,7 @@ class VTKVIEWER_EXPORT VTKViewer_InteractorStyle : public QObject, public vtkInt protected: VTKViewer_InteractorStyle(); ~VTKViewer_InteractorStyle(); - VTKViewer_InteractorStyle(const VTKViewer_InteractorStyle&) {}; + VTKViewer_InteractorStyle(const VTKViewer_InteractorStyle&): QObject(), vtkInteractorStyle() {}; void operator=(const VTKViewer_InteractorStyle&) {}; void RotateXY(int dx, int dy); @@ -152,7 +152,7 @@ class VTKVIEWER_EXPORT VTKViewer_InteractorStyle : public QObject, public vtkInt void startRotate(); void startFitArea(); void startSpin(); - void SetTDxStyle(vtkTDxInteractorStyle *tdxStyle) {} + void SetTDxStyle(vtkTDxInteractorStyle* /*tdxStyle*/) {} bool needsRedrawing(); protected: @@ -161,7 +161,7 @@ class VTKVIEWER_EXPORT VTKViewer_InteractorStyle : public QObject, public vtkInt virtual void onStartOperation(); virtual void onFinishOperation(); virtual void onOperation(QPoint mousePos); - virtual void onCursorMove(QPoint mousePos); + virtual void onCursorMove(QPoint /*mousePos*/); virtual void setCursor(const int operation); void drawRect(); diff --git a/src/VTKViewer/VTKViewer_MarkerUtils.cxx b/src/VTKViewer/VTKViewer_MarkerUtils.cxx index f23783936..fe0f6e6ea 100644 --- a/src/VTKViewer/VTKViewer_MarkerUtils.cxx +++ b/src/VTKViewer/VTKViewer_MarkerUtils.cxx @@ -72,7 +72,7 @@ namespace VTK aHeight++; } - if( theMarkerTexture.size() != aWidth * aHeight ) + if( (int)theMarkerTexture.size() != aWidth * aHeight ) return false; theMarkerTexture.push_front( aWidth ); diff --git a/src/VTKViewer/VTKViewer_OpenGLHelper.cxx b/src/VTKViewer/VTKViewer_OpenGLHelper.cxx index b40aeb7ba..696daedae 100644 --- a/src/VTKViewer/VTKViewer_OpenGLHelper.cxx +++ b/src/VTKViewer/VTKViewer_OpenGLHelper.cxx @@ -238,7 +238,7 @@ namespace GUI_OPENGL if( count > 0 ) { content = ( char* )malloc( sizeof( char ) * ( count + 1 ) ); - count = fread( content, sizeof( char ), count, file ); + count = (int)fread( content, sizeof( char ), count, file ); //!< TODO: conversion from size_t to int content[ count ] = '\0'; } fclose( file ); diff --git a/src/VTKViewer/VTKViewer_OpenGLRenderer.cxx b/src/VTKViewer/VTKViewer_OpenGLRenderer.cxx index 59706c968..03314e672 100644 --- a/src/VTKViewer/VTKViewer_OpenGLRenderer.cxx +++ b/src/VTKViewer/VTKViewer_OpenGLRenderer.cxx @@ -47,7 +47,7 @@ #include -vtkStandardNewMacro(VTKViewer_OpenGLRenderer); +vtkStandardNewMacro(VTKViewer_OpenGLRenderer) VTKViewer_OpenGLRenderer::VTKViewer_OpenGLRenderer() { diff --git a/src/VTKViewer/VTKViewer_OpenGLRenderer.h b/src/VTKViewer/VTKViewer_OpenGLRenderer.h index c78d8e8f8..ed5e8e9fe 100644 --- a/src/VTKViewer/VTKViewer_OpenGLRenderer.h +++ b/src/VTKViewer/VTKViewer_OpenGLRenderer.h @@ -43,7 +43,7 @@ public: public: static VTKViewer_OpenGLRenderer *New(); - vtkTypeMacro(VTKViewer_OpenGLRenderer,vtkOpenGLRenderer); + vtkTypeMacro(VTKViewer_OpenGLRenderer,vtkOpenGLRenderer) virtual void SetGradientType( const int ); diff --git a/src/VTKViewer/VTKViewer_PolyDataMapper.cxx b/src/VTKViewer/VTKViewer_PolyDataMapper.cxx index f4adef411..f5f772323 100644 --- a/src/VTKViewer/VTKViewer_PolyDataMapper.cxx +++ b/src/VTKViewer/VTKViewer_PolyDataMapper.cxx @@ -77,7 +77,7 @@ void * glXGetProcAddressARB (const GLubyte *name) #endif #ifndef VTK_IMPLEMENT_MESA_CXX -vtkStandardNewMacro(VTKViewer_PolyDataMapper); +vtkStandardNewMacro(VTKViewer_PolyDataMapper) #endif // some definitions for what the polydata has in it @@ -103,13 +103,13 @@ typedef GLfloat TBall; -void MessageCallback( GLenum source, +void MessageCallback( GLenum /*source*/, GLenum type, - GLuint id, + GLuint /*id*/, GLenum severity, - GLsizei length, + GLsizei /*length*/, const GLcharARB* message, - const void* userParam ) + const void* /*userParam*/ ) { fprintf( stderr, "GL CALLBACK: %s type = 0x%x, severity = 0x%x, message = %s\n", ( type == GL_DEBUG_TYPE_ERROR ? "** GL ERROR **" : "" ), @@ -667,7 +667,7 @@ namespace VTK virtual void - get( TVertex& theVertex, vtkIdType thePointId, vtkIdType theCellId ) + get( TVertex& theVertex, vtkIdType /*thePointId*/, vtkIdType /*theCellId*/ ) { theVertex.r = myColor[0]; theVertex.g = myColor[1]; @@ -715,7 +715,7 @@ namespace VTK virtual vtkIdType - GetTupleId( vtkIdType thePointId, vtkIdType theCellId ) + GetTupleId( vtkIdType thePointId, vtkIdType /*theCellId*/ ) { return thePointId; } @@ -731,7 +731,7 @@ namespace VTK virtual vtkIdType - GetTupleId( vtkIdType thePointId, vtkIdType theCellId ) + GetTupleId( vtkIdType /*thePointId*/, vtkIdType theCellId ) { return theCellId; } @@ -829,7 +829,6 @@ int VTKViewer_PolyDataMapper::Draw( vtkRenderer* ren, vtkActor* act ) #else //----------------------------------------------------------------------------- void VTKViewer_PolyDataMapper::RenderPieceDraw( vtkRenderer* ren, vtkActor* act ) { - int noAbort = 1; if( (!this->MarkerEnabled || this->MarkerType == VTK::MT_NONE || !this->ImageData.GetPointer()) && !this->BallEnabled) { MAPPER_SUPERCLASS::RenderPieceDraw( ren, act ); return; diff --git a/src/VTKViewer/VTKViewer_PolyDataMapper.h b/src/VTKViewer/VTKViewer_PolyDataMapper.h index c8661cdbe..76272dbd4 100644 --- a/src/VTKViewer/VTKViewer_PolyDataMapper.h +++ b/src/VTKViewer/VTKViewer_PolyDataMapper.h @@ -66,7 +66,7 @@ public: public: static VTKViewer_PolyDataMapper* New(); - vtkTypeMacro( VTKViewer_PolyDataMapper, MAPPER_SUPERCLASS ); + vtkTypeMacro( VTKViewer_PolyDataMapper, MAPPER_SUPERCLASS ) //! Set point marker enabled void SetMarkerEnabled( bool ); diff --git a/src/VTKViewer/VTKViewer_RenderWindow.cxx b/src/VTKViewer/VTKViewer_RenderWindow.cxx index 5ee5ac0f3..5b6e57102 100644 --- a/src/VTKViewer/VTKViewer_RenderWindow.cxx +++ b/src/VTKViewer/VTKViewer_RenderWindow.cxx @@ -62,13 +62,13 @@ VTKViewer_RenderWindow::~VTKViewer_RenderWindow() } /*!Call Render method for render window field.*/ -void VTKViewer_RenderWindow::paintEvent(QPaintEvent* theEvent) +void VTKViewer_RenderWindow::paintEvent(QPaintEvent* /*theEvent*/) { myRW->Render(); } /*!Resize render window.*/ -void VTKViewer_RenderWindow::resizeEvent(QResizeEvent* theEvent) +void VTKViewer_RenderWindow::resizeEvent(QResizeEvent* /*theEvent*/) { int aWidth = myRW->GetSize()[0], aHeight = myRW->GetSize()[1]; if(vtkRenderWindowInteractor* aRWI = myRW->GetInteractor()) diff --git a/src/VTKViewer/VTKViewer_RenderWindowInteractor.cxx b/src/VTKViewer/VTKViewer_RenderWindowInteractor.cxx index 3743b3142..59933dcb5 100644 --- a/src/VTKViewer/VTKViewer_RenderWindowInteractor.cxx +++ b/src/VTKViewer/VTKViewer_RenderWindowInteractor.cxx @@ -462,14 +462,14 @@ void VTKViewer_RenderWindowInteractor::RightButtonReleased(const QMouseEvent *ev /*!Reaction on button pressed. *\warning Do nothing. */ -void VTKViewer_RenderWindowInteractor::ButtonPressed(const QMouseEvent *event) { +void VTKViewer_RenderWindowInteractor::ButtonPressed(const QMouseEvent* /*event*/) { return ; } /*!Reaction on button released.. *\warning Do nothing. */ -void VTKViewer_RenderWindowInteractor::ButtonReleased(const QMouseEvent *event) { +void VTKViewer_RenderWindowInteractor::ButtonReleased(const QMouseEvent* /*event*/) { return ; } @@ -577,7 +577,7 @@ void VTKViewer_RenderWindowInteractor::DisplayAll() } /*!Do nothing*/ -void VTKViewer_RenderWindowInteractor::Erase( VTKViewer_Actor* SActor, bool update) +void VTKViewer_RenderWindowInteractor::Erase( VTKViewer_Actor* /*SActor*/, bool /*update*/) { } @@ -632,7 +632,7 @@ void VTKViewer_RenderWindowInteractor::Display( VTKViewer_Actor* theActor, bool /*! default key press event (empty implementation) */ -void VTKViewer_RenderWindowInteractor::KeyPressed(QKeyEvent *event) +void VTKViewer_RenderWindowInteractor::KeyPressed(QKeyEvent* /*event*/) { /// NOT_IMPLEMENTED } diff --git a/src/VTKViewer/VTKViewer_RenderWindowInteractor.h b/src/VTKViewer/VTKViewer_RenderWindowInteractor.h index 63e9985dd..ca321e38c 100644 --- a/src/VTKViewer/VTKViewer_RenderWindowInteractor.h +++ b/src/VTKViewer/VTKViewer_RenderWindowInteractor.h @@ -61,7 +61,7 @@ class VTKVIEWER_EXPORT VTKViewer_RenderWindowInteractor : public QObject, public public: static VTKViewer_RenderWindowInteractor *New(); - vtkTypeMacro(VTKViewer_RenderWindowInteractor,vtkRenderWindowInteractor); + vtkTypeMacro(VTKViewer_RenderWindowInteractor,vtkRenderWindowInteractor) void PrintSelf(ostream& os, vtkIndent indent); @@ -163,16 +163,16 @@ public: void setViewWindow( VTKViewer_ViewWindow* theViewWnd ); - void setCellData(const int& theIndex, - VTKViewer_Actor* theMapActor, - VTKViewer_Actor* theActor) {} - void setEdgeData(const int& theCellIndex, - VTKViewer_Actor* theMapActor, - const int& theEdgeIndex, - VTKViewer_Actor* theActor ) {} //NB - void setPointData(const int& theIndex, - VTKViewer_Actor* theMapActor, - VTKViewer_Actor* theActor) {} + void setCellData(const int& /*theIndex*/, + VTKViewer_Actor* /*theMapActor*/, + VTKViewer_Actor* /*theActor*/) {} + void setEdgeData(const int& /*theCellIndex*/, + VTKViewer_Actor* /*theMapActor*/, + const int& /*theEdgeIndex*/, + VTKViewer_Actor* /*theActor*/ ) {} //NB + void setPointData(const int& /*theIndex*/, + VTKViewer_Actor* /*theMapActor*/, + VTKViewer_Actor* /*theActor*/) {} typedef void (*TUpdateActor)(const TColStd_IndexedMapOfInteger& theMapIndex, VTKViewer_Actor* theMapActor, diff --git a/src/VTKViewer/VTKViewer_ShrinkFilter.cxx b/src/VTKViewer/VTKViewer_ShrinkFilter.cxx index f53a2ac1b..9d7d8d6a3 100644 --- a/src/VTKViewer/VTKViewer_ShrinkFilter.cxx +++ b/src/VTKViewer/VTKViewer_ShrinkFilter.cxx @@ -35,7 +35,7 @@ #include #include -vtkStandardNewMacro(VTKViewer_ShrinkFilter); +vtkStandardNewMacro(VTKViewer_ShrinkFilter) /*!Constructor. Sets store mapping to zero.*/ VTKViewer_ShrinkFilter::VTKViewer_ShrinkFilter(): diff --git a/src/VTKViewer/VTKViewer_ShrinkFilter.h b/src/VTKViewer/VTKViewer_ShrinkFilter.h index 90c47ff0a..b19c19a84 100644 --- a/src/VTKViewer/VTKViewer_ShrinkFilter.h +++ b/src/VTKViewer/VTKViewer_ShrinkFilter.h @@ -41,7 +41,7 @@ class VTKVIEWER_EXPORT VTKViewer_ShrinkFilter : public vtkShrinkFilter public: /*!Create new instance of VTKViewer_ShrinkFilter.*/ static VTKViewer_ShrinkFilter *New(); - vtkTypeMacro(VTKViewer_ShrinkFilter, vtkShrinkFilter); + vtkTypeMacro(VTKViewer_ShrinkFilter, vtkShrinkFilter) void SetStoreMapping(int theStoreMapping); /*!Gets store mapping flag.*/ diff --git a/src/VTKViewer/VTKViewer_Texture.cxx b/src/VTKViewer/VTKViewer_Texture.cxx index 8893414ea..8ac63b541 100644 --- a/src/VTKViewer/VTKViewer_Texture.cxx +++ b/src/VTKViewer/VTKViewer_Texture.cxx @@ -41,7 +41,7 @@ #include "vtkOpenGL.h" #include -vtkStandardNewMacro(VTKViewer_Texture); +vtkStandardNewMacro(VTKViewer_Texture) // ---------------------------------------------------------------------------- diff --git a/src/VTKViewer/VTKViewer_Texture.h b/src/VTKViewer/VTKViewer_Texture.h index 6dae20e22..231eaf93f 100644 --- a/src/VTKViewer/VTKViewer_Texture.h +++ b/src/VTKViewer/VTKViewer_Texture.h @@ -39,7 +39,7 @@ public: public: static VTKViewer_Texture *New(); - vtkTypeMacro(VTKViewer_Texture,vtkOpenGLTexture); + vtkTypeMacro(VTKViewer_Texture,vtkOpenGLTexture) virtual void Load(vtkRenderer *ren); diff --git a/src/VTKViewer/VTKViewer_Transform.cxx b/src/VTKViewer/VTKViewer_Transform.cxx index dd8026bb8..1077e5818 100644 --- a/src/VTKViewer/VTKViewer_Transform.cxx +++ b/src/VTKViewer/VTKViewer_Transform.cxx @@ -33,7 +33,7 @@ static double EPS = 10e-4; -vtkStandardNewMacro(VTKViewer_Transform); +vtkStandardNewMacro(VTKViewer_Transform) /*!Sets matrix scale.*/ void VTKViewer_Transform::SetMatrixScale(double theScaleX, double theScaleY, double theScaleZ){ diff --git a/src/VTKViewer/VTKViewer_Transform.h b/src/VTKViewer/VTKViewer_Transform.h index 798114598..3f354ca61 100644 --- a/src/VTKViewer/VTKViewer_Transform.h +++ b/src/VTKViewer/VTKViewer_Transform.h @@ -35,7 +35,7 @@ class VTKVIEWER_EXPORT VTKViewer_Transform : public vtkTransform public: /*!Create new instance of VTKViewer_Transform.*/ static VTKViewer_Transform *New(); - vtkTypeMacro( VTKViewer_Transform, vtkTransform ); + vtkTypeMacro( VTKViewer_Transform, vtkTransform ) int IsIdentity(); //merge with V2_2_0_VISU_improvements:void SetScale( float theScaleX, float theScaleY, float theScaleZ ); @@ -46,7 +46,7 @@ protected: /*!Constructor.*/ VTKViewer_Transform() {/*!Do nothing*/} /*!Copy contructor.*/ - VTKViewer_Transform(const VTKViewer_Transform&) {/*!Do nothing*/} + VTKViewer_Transform(const VTKViewer_Transform&): vtkTransform() {/*!Do nothing*/} /*!Destructor.*/ ~VTKViewer_Transform() {/*!Do nothing*/} diff --git a/src/VTKViewer/VTKViewer_TransformFilter.cxx b/src/VTKViewer/VTKViewer_TransformFilter.cxx index 11b71d08a..88ac87a22 100644 --- a/src/VTKViewer/VTKViewer_TransformFilter.cxx +++ b/src/VTKViewer/VTKViewer_TransformFilter.cxx @@ -36,7 +36,7 @@ #include #include -vtkStandardNewMacro(VTKViewer_TransformFilter); +vtkStandardNewMacro(VTKViewer_TransformFilter) /*!Execution method. Calculate output.*/ int VTKViewer_TransformFilter::RequestData( diff --git a/src/VTKViewer/VTKViewer_TransformFilter.h b/src/VTKViewer/VTKViewer_TransformFilter.h index 916b4b138..7a4b72ab4 100644 --- a/src/VTKViewer/VTKViewer_TransformFilter.h +++ b/src/VTKViewer/VTKViewer_TransformFilter.h @@ -35,7 +35,7 @@ class VTKVIEWER_EXPORT VTKViewer_TransformFilter : public vtkTransformFilter public: /*!Create new instance of VTKViewer_TransformFilter.*/ static VTKViewer_TransformFilter *New(); - vtkTypeMacro(VTKViewer_TransformFilter,vtkTransformFilter); + vtkTypeMacro(VTKViewer_TransformFilter,vtkTransformFilter) protected: /*!Constructor.*/ @@ -43,7 +43,7 @@ protected: /*!Destructor.*/ ~VTKViewer_TransformFilter() {/*!Do nothing*/} /*!Copy constructor.*/ - VTKViewer_TransformFilter(const VTKViewer_TransformFilter&) {/*!Do nothing*/} + VTKViewer_TransformFilter(const VTKViewer_TransformFilter&): vtkTransformFilter() {/*!Do nothing*/} /*!Operator = */ void operator=(const VTKViewer_TransformFilter&) {/*!Do nothing*/} diff --git a/src/VTKViewer/VTKViewer_Trihedron.cxx b/src/VTKViewer/VTKViewer_Trihedron.cxx index a9691cb79..a4c94a60b 100644 --- a/src/VTKViewer/VTKViewer_Trihedron.cxx +++ b/src/VTKViewer/VTKViewer_Trihedron.cxx @@ -47,7 +47,7 @@ // QT includes #include -vtkStandardNewMacro(VTKViewer_UnScaledActor); +vtkStandardNewMacro(VTKViewer_UnScaledActor) /*!Constructor*/ VTKViewer_UnScaledActor::VTKViewer_UnScaledActor() @@ -105,14 +105,14 @@ void VTKViewer_UnScaledActor::Render(vtkRenderer *theRenderer) vtkFollower::Render(theRenderer); } -vtkStandardNewMacro(VTKViewer_LineActor); +vtkStandardNewMacro(VTKViewer_LineActor) #ifdef IPAL21440 vtkCxxSetObjectMacro(VTKViewer_LineActor,LabelActor,vtkTextActor); #else -vtkCxxSetObjectMacro(VTKViewer_LineActor,LabelActor,VTKViewer_UnScaledActor); +vtkCxxSetObjectMacro(VTKViewer_LineActor,LabelActor,VTKViewer_UnScaledActor) #endif -vtkCxxSetObjectMacro(VTKViewer_LineActor,ArrowActor,vtkFollower); +vtkCxxSetObjectMacro(VTKViewer_LineActor,ArrowActor,vtkFollower) /*!Adds Label and Arrow actors to \a theRenderer.*/ void VTKViewer_LineActor::Render(vtkRenderer *theRenderer) @@ -354,11 +354,11 @@ protected: VTKViewer_XAxis(); VTKViewer_XAxis(const VTKViewer_XAxis&); public: - vtkTypeMacro(VTKViewer_XAxis,VTKViewer_Axis); + vtkTypeMacro(VTKViewer_XAxis,VTKViewer_Axis) static VTKViewer_XAxis *New(); }; -vtkStandardNewMacro(VTKViewer_XAxis); +vtkStandardNewMacro(VTKViewer_XAxis) /*!Initialize X Axis*/ VTKViewer_XAxis::VTKViewer_XAxis(){ @@ -380,11 +380,11 @@ protected: VTKViewer_YAxis(); VTKViewer_YAxis(const VTKViewer_YAxis&); public: - vtkTypeMacro(VTKViewer_YAxis,VTKViewer_Axis); + vtkTypeMacro(VTKViewer_YAxis,VTKViewer_Axis) static VTKViewer_YAxis *New(); }; -vtkStandardNewMacro(VTKViewer_YAxis); +vtkStandardNewMacro(VTKViewer_YAxis) /*!Initialize Y Axis*/ VTKViewer_YAxis::VTKViewer_YAxis() @@ -408,11 +408,11 @@ protected: VTKViewer_ZAxis(); VTKViewer_ZAxis(const VTKViewer_ZAxis&); public: - vtkTypeMacro(VTKViewer_ZAxis,VTKViewer_Axis); + vtkTypeMacro(VTKViewer_ZAxis,VTKViewer_Axis) static VTKViewer_ZAxis *New(); }; -vtkStandardNewMacro(VTKViewer_ZAxis); +vtkStandardNewMacro(VTKViewer_ZAxis) /*!Initialize Z Axis*/ VTKViewer_ZAxis::VTKViewer_ZAxis() @@ -427,7 +427,7 @@ VTKViewer_ZAxis::VTKViewer_ZAxis() SetColor(0.0,0.0,1.0); } -vtkStandardNewMacro(VTKViewer_Trihedron); +vtkStandardNewMacro(VTKViewer_Trihedron) /*! Constructor diff --git a/src/VTKViewer/VTKViewer_Trihedron.h b/src/VTKViewer/VTKViewer_Trihedron.h index e2fe380d6..98718ac8c 100644 --- a/src/VTKViewer/VTKViewer_Trihedron.h +++ b/src/VTKViewer/VTKViewer_Trihedron.h @@ -65,7 +65,7 @@ class VTKVIEWER_EXPORT VTKViewer_UnScaledActor: public vtkFollower public: - vtkTypeMacro(VTKViewer_UnScaledActor,vtkFollower); + vtkTypeMacro(VTKViewer_UnScaledActor,vtkFollower) /*!Create new instance of VTKViewer_UnScaledActor.*/ static VTKViewer_UnScaledActor *New(); @@ -91,7 +91,7 @@ class VTKVIEWER_EXPORT VTKViewer_LineActor: public vtkFollower public: /*!vtk type macros.*/ - vtkTypeMacro(VTKViewer_LineActor,vtkFollower); + vtkTypeMacro(VTKViewer_LineActor,vtkFollower) /*!Create new instance of VTKViewer_LineActor.*/ static VTKViewer_LineActor *New(); @@ -155,7 +155,7 @@ protected: public: /*!vtk type macros.*/ - vtkTypeMacro(VTKViewer_Trihedron,vtkObject); + vtkTypeMacro(VTKViewer_Trihedron,vtkObject) /*!Create new instance of VTKViewer_Trihedron.*/ static VTKViewer_Trihedron *New(); @@ -232,7 +232,7 @@ protected: public: /*!vtk type macros.*/ - vtkTypeMacro(VTKViewer_Axis,vtkObject); + vtkTypeMacro(VTKViewer_Axis,vtkObject) /*! Add to \a theRenderer actors: myLineActor,myLabelActor,myArrowActor */ diff --git a/src/ViewerTools/ViewerTools_DialogBase.h b/src/ViewerTools/ViewerTools_DialogBase.h index b1070d9e9..89d97c4c1 100644 --- a/src/ViewerTools/ViewerTools_DialogBase.h +++ b/src/ViewerTools/ViewerTools_DialogBase.h @@ -31,7 +31,7 @@ class QtxAction; class VIEWERTOOLS_EXPORT ViewerTools_DialogBase : public QDialog { - Q_OBJECT; + Q_OBJECT public: ViewerTools_DialogBase(QtxAction* theAction, diff --git a/src/ViewerTools/ViewerTools_FontWidgetBase.cxx b/src/ViewerTools/ViewerTools_FontWidgetBase.cxx index 598171467..bf99b1156 100644 --- a/src/ViewerTools/ViewerTools_FontWidgetBase.cxx +++ b/src/ViewerTools/ViewerTools_FontWidgetBase.cxx @@ -102,7 +102,7 @@ void ViewerTools_FontWidgetBase::onColor() } void ViewerTools_FontWidgetBase::SetData( const QColor& theColor, - const int theFamily, + const int /*theFamily*/, const bool theBold, const bool theItalic, const bool theShadow ) @@ -115,7 +115,7 @@ void ViewerTools_FontWidgetBase::SetData( const QColor& theColor, } void ViewerTools_FontWidgetBase::GetData( QColor& theColor, - int& theFamily, + int& /*theFamily*/, bool& theBold, bool& theItalic, bool& theShadow ) const diff --git a/tools/CurvePlot/src/cpp/CurvePlot.cxx b/tools/CurvePlot/src/cpp/CurvePlot.cxx index dfea9083f..b63a69e35 100644 --- a/tools/CurvePlot/src/cpp/CurvePlot.cxx +++ b/tools/CurvePlot/src/cpp/CurvePlot.cxx @@ -47,7 +47,7 @@ namespace throw CURVEPLOT::Exception(msg); } } -}; +} namespace CURVEPLOT { diff --git a/tools/CurvePlot/src/cpp/test/test_curveplot.cxx b/tools/CurvePlot/src/cpp/test/test_curveplot.cxx index b527cbb76..bb7254cca 100644 --- a/tools/CurvePlot/src/cpp/test/test_curveplot.cxx +++ b/tools/CurvePlot/src/cpp/test/test_curveplot.cxx @@ -67,7 +67,7 @@ void TestCurvePlot::onClicked() // std::string s = xx.toStdString(); // std::cout << "test xx: " << s << std::endl; std::cout << "setting X label " << CurvePlot::SetXLabel("tôtô") << std::endl; - PlotID crv_id = CurvePlot::AddCurve(xx, yy, ps_id, "the cérve", "th x", "the y-s", false); + /*PlotID crv_id = */CurvePlot::AddCurve(xx, yy, ps_id, "the cérve", "th x", "the y-s", false); std::cout << "setting X label " << CurvePlot::SetXLabel("tôtô") << std::endl; } diff --git a/tools/PyConsole/src/PyConsole_Editor.h b/tools/PyConsole/src/PyConsole_Editor.h index 51df36c33..0e96b0a77 100644 --- a/tools/PyConsole/src/PyConsole_Editor.h +++ b/tools/PyConsole/src/PyConsole_Editor.h @@ -38,7 +38,7 @@ class QEventLoop; class PYCONSOLE_EXPORT PyConsole_Editor : public QTextEdit { - Q_OBJECT; + Q_OBJECT public: PyConsole_Editor( QWidget* = 0 ); diff --git a/tools/PyEditor/src/PyEditor_Widget.cxx b/tools/PyEditor/src/PyEditor_Widget.cxx index e09ea96b1..11dec0679 100644 --- a/tools/PyEditor/src/PyEditor_Widget.cxx +++ b/tools/PyEditor/src/PyEditor_Widget.cxx @@ -35,7 +35,7 @@ \brief Constructor. \param parent Parent widget. */ -PyEditor_Widget::PyEditor_Widget( QWidget* parent ) +PyEditor_Widget::PyEditor_Widget( QWidget* parent ) : QWidget( parent ) { // Create editor. myEditor = new PyEditor_Editor( this ); diff --git a/tools/PyInterp/src/PyInterp_Interp.cxx b/tools/PyInterp/src/PyInterp_Interp.cxx index 38369cc38..38f522310 100644 --- a/tools/PyInterp/src/PyInterp_Interp.cxx +++ b/tools/PyInterp/src/PyInterp_Interp.cxx @@ -401,7 +401,7 @@ std::string __join(const std::vector& v, int begin=0, int end=-1) { if (end == -1) - end = v.size(); + end = (int)v.size(); //!< TODO: conversion from size_t to int std::stringstream ss; for (int i = begin; i < end; ++i) { if (i != begin)