From 519c4bfcdf3ffddb81be2a90bd24079891a66f0b Mon Sep 17 00:00:00 2001 From: vsr Date: Wed, 30 Sep 2020 18:35:29 +0300 Subject: [PATCH] fight warnings: additional corrections --- CMakeLists.txt | 2 +- src/CAF/CAF_Study.cxx | 16 +- src/CAM/CAM_Module.cxx | 9 +- src/CASCatch/CASCatch_CatchSignals.cxx | 48 +- src/DDS/DDS_DicGroup.cxx | 1 + src/DDS/DDS_DicItem.cxx | 3 +- src/DDS/DDS_Dictionary.cxx | 5 +- src/GLViewer/GLViewer_BaseObjects.cxx | 9 +- src/GLViewer/GLViewer_Drawer.cxx | 10 +- src/GLViewer/GLViewer_Group.cxx | 2 +- src/GLViewer/GLViewer_Object.cxx | 2 +- src/GLViewer/GLViewer_Selector2d.cxx | 3 +- src/GLViewer/GLViewer_Text.cxx | 2 +- src/GLViewer/GLViewer_ToolTip.cxx | 93 +- src/GLViewer/GLViewer_Tools.cxx | 3 +- src/GLViewer/GLViewer_ViewPort2d.cxx | 7 +- src/GLViewer/GLViewer_Viewer.cxx | 20 +- src/GLViewer/GLViewer_Viewer2d.cxx | 36 +- src/GLViewer/GLViewer_Widget.cxx | 5 +- src/GraphicsView/GraphicsView_Object.cxx | 7 +- src/GraphicsView/GraphicsView_Scene.cxx | 1 + src/GraphicsView/GraphicsView_ViewPort.cxx | 12 +- .../GraphicsView_ViewTransformer.cxx | 2 +- src/GraphicsView/GraphicsView_Viewer.cxx | 13 +- src/GuiHelpers/StandardApp_Module.cxx | 6 +- src/HelpBrowser/qtsingleapplication.h | 2 +- src/LightApp/LightApp_Application.cxx | 8 +- src/LightApp/LightApp_DataModel.cxx | 2 +- src/LightApp/LightApp_DataObject.cxx | 4 +- src/LightApp/LightApp_Driver.cxx | 2 +- src/LightApp/LightApp_GVSelector.cxx | 2 +- src/LightApp/LightApp_Module.cxx | 2 +- src/LightApp/LightApp_OBSelector.cxx | 4 +- src/LightApp/LightApp_Plot2dSelector.cxx | 3 +- src/LightApp/LightApp_Study.cxx | 2 +- src/LightApp/LightApp_SwitchOp.cxx | 8 +- src/LightApp/LightApp_VTKSelector.h | 2 +- src/OCCViewer/OCCViewer_AISSelector.cxx | 10 +- src/OCCViewer/OCCViewer_ClipPlane.cxx | 10 +- .../OCCViewer_ClipPlaneInteractor.cxx | 28 +- src/OCCViewer/OCCViewer_ClippingDlg.cxx | 12 +- .../OCCViewer_CreateRestoreViewDlg.cxx | 2 - src/OCCViewer/OCCViewer_EnvTextureDlg.cxx | 1 - src/OCCViewer/OCCViewer_LightSourceDlg.cxx | 3 +- .../OCCViewer_SetRotationPointDlg.cxx | 2 +- src/OCCViewer/OCCViewer_ToolTip.cxx | 2 +- src/OCCViewer/OCCViewer_Utilities.cxx | 2 + src/OCCViewer/OCCViewer_VService.cxx | 23 +- src/OCCViewer/OCCViewer_VService.h | 10 +- src/OCCViewer/OCCViewer_ViewFrame.cxx | 6 +- src/OCCViewer/OCCViewer_ViewModel.cxx | 29 +- src/OCCViewer/OCCViewer_ViewPort3d.cxx | 6 +- src/OCCViewer/OCCViewer_ViewSketcher.cxx | 4 +- src/OCCViewer/OCCViewer_ViewSketcher.h | 2 +- src/OCCViewer/OCCViewer_ViewWindow.cxx | 29 +- .../ServiceLoader/PVServer_ServiceLoader.h | 2 +- src/PVViewer/PVViewer_Behaviors.cxx | 3 +- src/PVViewer/PVViewer_Core.cxx | 3 +- src/PVViewer/PVViewer_OutputWindow.cxx | 14 +- src/PVViewer/PVViewer_OutputWindow.h | 14 +- src/Plot2d/Plot2d.cxx | 2 +- src/Plot2d/Plot2d_AnalyticalCurve.cxx | 2 +- src/Plot2d/Plot2d_AnalyticalParser.cxx | 4 +- src/Plot2d/Plot2d_NormalizeAlgorithm.cxx | 4 +- src/Plot2d/Plot2d_Object.cxx | 4 +- src/Plot2d/Plot2d_PlotItems.cxx | 13 +- src/Plot2d/Plot2d_ViewFrame.cxx | 20 +- src/Plot2d/Plot2d_ViewModel.cxx | 10 +- src/Prs/SALOME_Prs.h | 2 +- src/QDS/QDS_ComboBox.cxx | 2 +- src/QDS/QDS_Datum.cxx | 7 +- src/QDS/QDS_RadioBox.cxx | 2 +- src/QDS/QDS_Validator.cxx | 14 +- src/Qtx/Qtx.cxx | 2 +- src/Qtx/Qtx.h | 1 + src/Qtx/QtxColorScale.cxx | 4 +- src/Qtx/QtxDialog.cxx | 4 +- src/Qtx/QtxDoubleSpinBox.cxx | 4 +- src/Qtx/QtxEvalExpr.cxx | 2 +- src/Qtx/QtxListAction.cxx | 2 +- src/Qtx/QtxMainWindow.cxx | 6 +- src/Qtx/QtxNotify.cxx | 3 +- src/Qtx/QtxPathListEdit.cxx | 6 +- src/Qtx/QtxRubberBand.cxx | 51 +- src/Qtx/QtxSplash.cxx | 4 +- src/Qtx/QtxToolBar.cxx | 2 +- src/Qtx/QtxToolButton.cxx | 1 + src/Qtx/QtxTranslator.cxx | 2 +- src/Qtx/QtxWorkstack.cxx | 5 +- src/Qtx/QtxWorkstackAction.cxx | 2 +- src/QxScene/QxScene_ViewModel.cxx | 3 +- src/QxScene/QxScene_ViewWindow.h | 2 +- src/SALOME_PY/SalomePy.cxx | 30 +- .../SALOME_PYQT_GUI/SALOME_PYQT_Module.h | 2 +- .../SALOME_PYQT_BorrowedDataObjectLight.cxx | 3 +- .../SALOME_PYQT_DataModelLight.cxx | 9 +- .../SALOME_PYQT_DataObjectLight.cxx | 3 +- .../SALOME_PYQT_ModuleLight.cxx | 3 +- .../SALOME_PYQT_ModuleLight.h | 2 +- .../SALOME_PYQT_PyModule.cxx | 8 +- src/SALOME_PYQT/SalomePyQt/SalomePyQt.cxx | 43 +- src/SOCC/SOCC_ViewModel.cxx | 10 +- src/SOCC/SOCC_ViewWindow.cxx | 2 +- src/SOCC/SOCC_ViewWindow.h | 2 +- src/SPlot2d/SPlot2d_ViewModel.cxx | 4 +- src/SPlot2d/SPlot2d_ViewModel.h | 2 +- src/SPlot2d/SPlot2d_ViewWindow.h | 2 +- src/SUIT/SUIT_DataBrowser.cxx | 2 - src/SUIT/SUIT_TreeModel.cxx | 3 +- src/SUIT/SUIT_ViewManager.cxx | 10 +- src/SUIT/SUIT_ViewWindow.cxx | 3 +- src/SUITApp/SUITApp.cxx | 2 +- src/SUITApp/SUITApp_init_python.cxx | 2 +- src/SVTK/SALOME_Actor.cxx | 8 +- src/SVTK/SALOME_Actor.h | 2 +- src/SVTK/SVTK_Actor.cxx | 2 +- src/SVTK/SVTK_Actor.h | 2 +- src/SVTK/SVTK_AreaPicker.cxx | 7 +- src/SVTK/SVTK_AreaPicker.h | 2 +- src/SVTK/SVTK_CubeAxesActor2D.cxx | 2 +- src/SVTK/SVTK_CubeAxesActor2D.h | 2 +- src/SVTK/SVTK_DeviceActor.cxx | 2 +- src/SVTK/SVTK_DeviceActor.h | 2 +- .../SVTK_GenericRenderWindowInteractor.cxx | 4 +- src/SVTK/SVTK_GenericRenderWindowInteractor.h | 6 +- src/SVTK/SVTK_Hash.h | 2 +- src/SVTK/SVTK_InteractorStyle.cxx | 26 +- src/SVTK/SVTK_InteractorStyle.h | 8 +- src/SVTK/SVTK_KeyFreeInteractorStyle.cxx | 2 +- src/SVTK/SVTK_KeyFreeInteractorStyle.h | 2 +- src/SVTK/SVTK_NonIsometricDlg.h | 2 +- src/SVTK/SVTK_Recorder.cxx | 25 +- src/SVTK/SVTK_Recorder.h | 2 +- src/SVTK/SVTK_RenderWindowInteractor.cxx | 10 +- src/SVTK/SVTK_RenderWindowInteractor.h | 4 +- src/SVTK/SVTK_Renderer.cxx | 8 +- src/SVTK/SVTK_Renderer.h | 2 +- src/SVTK/SVTK_Selector.h | 2 +- src/SVTK/SVTK_SetRotationPointDlg.cxx | 4 +- src/SVTK/SVTK_SetRotationPointDlg.h | 2 +- src/SVTK/SVTK_SpaceMouse.cxx | 2 +- src/SVTK/SVTK_Trihedron.cxx | 2 +- src/SVTK/SVTK_Trihedron.h | 2 +- src/SVTK/SVTK_UpdateRateDlg.cxx | 6 +- src/SVTK/SVTK_UpdateRateDlg.h | 2 +- src/SVTK/SVTK_View.cxx | 2 +- src/SVTK/SVTK_View.h | 4 +- src/SVTK/SVTK_ViewModel.cxx | 30 +- src/SVTK/SVTK_ViewModel.h | 2 +- src/SVTK/SVTK_ViewModelBase.h | 2 +- src/SVTK/SVTK_ViewParameterDlg.cxx | 8 +- src/SVTK/SVTK_ViewParameterDlg.h | 2 +- src/SVTK/SVTK_ViewWindow.cxx | 12 +- src/SVTK/SVTK_ViewWindow.h | 2 +- src/SVTK/salomevtkPVAxesActor.cxx | 6 +- src/SVTK/salomevtkPVAxesActor.h | 2 +- src/SVTK/salomevtkPVAxesWidget.cxx | 6 +- src/SVTK/salomevtkPVAxesWidget.h | 2 +- src/SalomeApp/SalomeApp_Application.cxx | 12 +- src/SalomeApp/SalomeApp_DataModel.cxx | 3 +- src/SalomeApp/SalomeApp_DataObject.cxx | 8 +- src/SalomeApp/SalomeApp_Engine_i.cxx | 9 +- src/SalomeApp/SalomeApp_ListView.cxx | 2 +- src/SalomeApp/SalomeApp_Module.cxx | 6 +- src/SalomeApp/SalomeApp_NoteBook.cxx | 8 +- src/SalomeApp/SalomeApp_NoteBook.h | 2 +- src/SalomeApp/SalomeApp_Study.cxx | 7 +- .../SalomeApp_StudyPropertiesDlg.cxx | 6 +- src/SalomeApp/SalomeApp_VisualState.cxx | 2 +- src/Session/SALOME_Session_Server.cxx | 5 +- src/Session/Session_ServerThread.cxx | 14 +- src/Session/Session_Session_i.cxx | 8 +- src/Style/Style_Salome.cxx | 832 +++++++++--------- src/Style/Style_Tools.cxx | 15 +- src/TOOLSGUI/ToolsGUI.cxx | 8 +- src/TOOLSGUI/ToolsGUI_RegWidget.cxx | 2 +- src/TreeData/DataProcessor.hxx | 4 +- src/TreeData/DockWidgets.cxx | 3 +- src/TreeData/Test/tester.cxx | 2 +- src/TreeData/TreeGuiManager.cxx | 2 +- src/TreeData/TreeView.cxx | 4 +- src/VTKViewer/VTKViewer_AppendFilter.cxx | 2 +- src/VTKViewer/VTKViewer_ArcBuilder.cxx | 15 +- src/VTKViewer/VTKViewer_DataSetMapper.h | 2 +- src/VTKViewer/VTKViewer_GeometryFilter.cxx | 2 +- src/VTKViewer/VTKViewer_InteractorStyle.cxx | 2 +- src/VTKViewer/VTKViewer_InteractorStyle.h | 2 +- src/VTKViewer/VTKViewer_MarkerUtils.cxx | 2 +- src/VTKViewer/VTKViewer_OpenGLRenderer.cxx | 2 +- src/VTKViewer/VTKViewer_OpenGLRenderer.h | 2 +- src/VTKViewer/VTKViewer_PolyDataMapper.cxx | 17 +- src/VTKViewer/VTKViewer_RenderWindow.cxx | 4 +- .../VTKViewer_RenderWindowInteractor.cxx | 8 +- .../VTKViewer_RenderWindowInteractor.h | 2 +- src/VTKViewer/VTKViewer_ShrinkFilter.cxx | 2 +- src/VTKViewer/VTKViewer_ShrinkFilter.h | 2 +- src/VTKViewer/VTKViewer_Texture.cxx | 2 +- src/VTKViewer/VTKViewer_Texture.h | 2 +- src/VTKViewer/VTKViewer_Transform.cxx | 2 +- src/VTKViewer/VTKViewer_Transform.h | 2 +- src/VTKViewer/VTKViewer_TransformFilter.cxx | 2 +- src/VTKViewer/VTKViewer_TransformFilter.h | 2 +- src/VTKViewer/VTKViewer_Trihedron.cxx | 22 +- src/ViewerTools/ViewerTools_DialogBase.h | 2 +- .../ViewerTools_FontWidgetBase.cxx | 2 - .../CurvePlot/src/cpp/test/test_curveplot.cxx | 2 +- tools/PyConsole/src/PyConsole_Editor.h | 2 +- tools/PyEditor/src/PyEditor_Widget.cxx | 2 +- 208 files changed, 1042 insertions(+), 1182 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 75146d636..bf3e1db59 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -16,7 +16,7 @@ # # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com # -CMAKE_MINIMUM_REQUIRED(VERSION 2.8.8 FATAL_ERROR) +CMAKE_MINIMUM_REQUIRED(VERSION 3.1 FATAL_ERROR) INCLUDE(CMakeDependentOption) PROJECT(SalomeGUI C CXX) 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 c4adb6476..f5b7b43d5 100644 --- a/src/CAM/CAM_Module.cxx +++ b/src/CAM/CAM_Module.cxx @@ -1144,9 +1144,8 @@ 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*/ ) { - //GUI_UNUSED(actionId); return false; } @@ -1155,9 +1154,8 @@ 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*/ ) { - //GUI_UNUSED(actionId); return false; } @@ -1167,9 +1165,8 @@ 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*/ ) { - //GUI_UNUSED(actionId); 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 39a46a0e6..c6e9bdb48 100644 --- a/src/GLViewer/GLViewer_BaseObjects.cxx +++ b/src/GLViewer/GLViewer_BaseObjects.cxx @@ -425,8 +425,6 @@ GLboolean GLViewer_MarkerSet::unhighlight() GLboolean GLViewer_MarkerSet::select( GLfloat x, GLfloat y, GLfloat tol, GLViewer_Rect /*rect*/, GLboolean /*isFull*/, GLboolean isCircle, GLboolean isShift ) { - //GUI_UNUSED(isFull); - //GUI_UNUSED(rect); if( !myIsVisible ) return false; // cout << "GLViewer_MarkerSet::select " << x << " " << y << endl; @@ -818,11 +816,10 @@ bool GLViewer_MarkerSet::initializeFromByteCopy( QByteArray theArray ) */ GLViewer_Polyline::GLViewer_Polyline( int number, float /*size*/, const QString& toolTip ): GLViewer_Object(), - myNumber( 0 ), myXCoord( 0 ), - myYCoord( 0 ) + myYCoord( 0 ), + myNumber( 0 ) { - //GUI_UNUSED(size); myHighFlag = GL_TRUE; myHNumbers.clear(); @@ -1009,8 +1006,6 @@ GLViewer_Drawer* GLViewer_Polyline::createDrawer() */ GLboolean GLViewer_Polyline::highlight( GLfloat x, GLfloat y, GLfloat /*tol*/, GLboolean /*isCircle*/ ) { - //GUI_UNUSED(isCircle); - //GUI_UNUSED(tol); if( !myIsVisible ) return false; GLfloat xa, xb, ya, yb, l; diff --git a/src/GLViewer/GLViewer_Drawer.cxx b/src/GLViewer/GLViewer_Drawer.cxx index f8b57c27e..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 = long(QGLContext::currentContext()); //!::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_Group.cxx b/src/GLViewer/GLViewer_Group.cxx index 38bfe4cbb..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 (size_t)myList.size(); //!< TODO: conversion from size_t to int + 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 ea1c8405a..ca40d452d 100644 --- a/src/GLViewer/GLViewer_Selector2d.cxx +++ b/src/GLViewer/GLViewer_Selector2d.cxx @@ -170,9 +170,8 @@ 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 ) { - //GUI_UNUSED(append); int selAfter = numSelected(); if ( selBefore > 0 && selAfter < 1 ) emit selSelectionCancel(); diff --git a/src/GLViewer/GLViewer_Text.cxx b/src/GLViewer/GLViewer_Text.cxx index 23c5359d9..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 < (uint)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 6b2491403..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*/ ) { - //GUI_UNUSED(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 fb47ce486..ea7955d27 100644 --- a/src/GLViewer/GLViewer_Tools.cxx +++ b/src/GLViewer/GLViewer_Tools.cxx @@ -514,9 +514,8 @@ GLViewer_LineField::~GLViewer_LineField() /*! Adds line */ -void GLViewer_LineField::addLine( FieldDim theDim, GLViewer_LineList* ) +void GLViewer_LineField::addLine( FieldDim, GLViewer_LineList* ) { - //GUI_UNUSED(theDim); //not implemented } diff --git a/src/GLViewer/GLViewer_ViewPort2d.cxx b/src/GLViewer/GLViewer_ViewPort2d.cxx index c601b1fd9..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,9 +824,8 @@ 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*/ ) { - //GUI_UNUSED(withZ); //cout << "GLViewer_ViewPort2d::fitAll" << endl; float xa, xb, ya, yb; @@ -1141,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 cfb5d5c2d..cc3d8ea13 100644 --- a/src/GLViewer/GLViewer_Viewer.cxx +++ b/src/GLViewer/GLViewer_Viewer.cxx @@ -48,14 +48,13 @@ 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 ) { - //GUI_UNUSED(title); } /*! @@ -334,9 +333,8 @@ 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 ) { - //GUI_UNUSED(bAdded); emit selectionChanged( status ); } @@ -435,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 @@ -474,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 ) @@ -543,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 || @@ -790,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 539a7a7ac..ffb290df7 100644 --- a/src/GLViewer/GLViewer_Viewer2d.cxx +++ b/src/GLViewer/GLViewer_Viewer2d.cxx @@ -113,32 +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*/ ) { - //GUI_UNUSED(colorH); - //GUI_UNUSED(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 ); } @@ -217,14 +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*/ ) { - //GUI_UNUSED(scX); - //GUI_UNUSED(scY); -// cout << "GLViewer_Viewer2d::updateDrawers" << endl; - - //myGLContext->updateScales( scX, scY ); - //myGLSketcher->drawContour(); activateAllDrawers( update ); } @@ -643,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 c2b3bc494..9021ef00c 100644 --- a/src/GLViewer/GLViewer_Widget.cxx +++ b/src/GLViewer/GLViewer_Widget.cxx @@ -41,10 +41,9 @@ 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*/ ) { - //GUI_UNUSED(name); myViewPort = ( GLViewer_ViewPort2d* )parent; myXPan = 0.0; @@ -580,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 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 d701baa9c..52819f3c3 100644 --- a/src/GraphicsView/GraphicsView_Viewer.cxx +++ b/src/GraphicsView/GraphicsView_Viewer.cxx @@ -50,14 +50,13 @@ // 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 ), myWidget( widget ), myIsInitialized( false ) { - //GUI_UNUSED(title); } //======================================================================= @@ -379,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 @@ -408,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() ); @@ -564,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/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 8b95a36f6..13bc99a01 100644 --- a/src/LightApp/LightApp_Driver.cxx +++ b/src/LightApp/LightApp_Driver.cxx @@ -216,7 +216,7 @@ LightApp_Driver::ListOfFiles LightApp_Driver::GetListOfFiles( const char* theMod if (myMap.count(aName)) aListOfFiles = myMap[aName]; - return aListOfFiles; + return aListOfFiles; } /*! 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 35d1a5be6..1a91cc437 100644 --- a/src/LightApp/LightApp_Study.cxx +++ b/src/LightApp/LightApp_Study.cxx @@ -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*/) { } 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_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 5d535ec96..d15249450 100644 --- a/src/OCCViewer/OCCViewer_ClippingDlg.cxx +++ b/src/OCCViewer/OCCViewer_ClippingDlg.cxx @@ -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() < (size_t)clipPlanesCount()) { //TODO: mismatch signed/unsigned + 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 ); @@ -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 d6987ab11..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; //! 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_ViewModel.cxx b/src/OCCViewer/OCCViewer_ViewModel.cxx index 1f5817a03..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-3f; + 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 ab1548c6b..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 < (uint)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 0cd2c8525..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; //!< TODO: unused 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.h b/src/PVServerService/ServiceLoader/PVServer_ServiceLoader.h index 3f6630451..877318572 100644 --- a/src/PVServerService/ServiceLoader/PVServer_ServiceLoader.h +++ b/src/PVServerService/ServiceLoader/PVServer_ServiceLoader.h @@ -33,7 +33,7 @@ class PVSERVERSERVICELOADER_EXPORT PVServer_ServiceLoader_Exception: public std: { public: PVServer_ServiceLoader_Exception(const std::string & what):_what(what) {} - ~PVServer_ServiceLoader_Exception() {} + ~PVServer_ServiceLoader_Exception() noexcept {} virtual const char* what() const noexcept { return _what.c_str(); } private: std::string _what; diff --git a/src/PVViewer/PVViewer_Behaviors.cxx b/src/PVViewer/PVViewer_Behaviors.cxx index a7d7e4636..b2302b1f1 100644 --- a/src/PVViewer/PVViewer_Behaviors.cxx +++ b/src/PVViewer/PVViewer_Behaviors.cxx @@ -60,9 +60,8 @@ 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*/) { - //GUI_UNUSED(desk); if (BehaviorLoadingLevel < 1) { // Register ParaView interfaces. diff --git a/src/PVViewer/PVViewer_Core.cxx b/src/PVViewer/PVViewer_Core.cxx index 5fdd60a67..06730898a 100644 --- a/src/PVViewer/PVViewer_Core.cxx +++ b/src/PVViewer/PVViewer_Core.cxx @@ -60,9 +60,8 @@ 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*/) { - //GUI_UNUSED(aDesktop); if ( ! MyCoreApp) { // Obtain command-line arguments int argc = 0; 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 c435a71ef..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); //!< TODO: empty controlled statement found; is this the intent? - return (*it); + if((*it)->plotItem() == theItem) + return (*it); } return 0; } @@ -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 df32bda40..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*/ ) {/*GUI_UNUSED(theList);*/} + virtual void GetVisible( SALOME_ListIO& /*theList*/ ) {} }; /*! diff --git a/src/QDS/QDS_ComboBox.cxx b/src/QDS/QDS_ComboBox.cxx index a5eeafa25..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 < (uint)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 002b322c1..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,9 +1422,8 @@ void QDS_Datum::initialize() \param unitSystem new active units system */ -void QDS_Datum::unitSystemChanged( const QString& unitSystem ) +void QDS_Datum::unitSystemChanged( const QString& /*unitSystem*/ ) { - //GUI_UNUSED(initSystem); QString labText = label(); QString unitText = unitsToText( units() ); @@ -1884,7 +1883,7 @@ QString QDS_Datum::removeAccel( const QString& src ) { QString trg = src; - for ( uint i = 0; i < (uint)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 7b56d676b..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 < (uint)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 66944d330..cbefba7db 100644 --- a/src/Qtx/Qtx.cxx +++ b/src/Qtx/Qtx.cxx @@ -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 < (uint)vars.length() && qtPath.isEmpty(); i++ ) { //!< TODO: mismatch signed/unsigned + 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/QtxColorScale.cxx b/src/Qtx/QtxColorScale.cxx index d7c2cd3a9..1110126d4 100644 --- a/src/Qtx/QtxColorScale.cxx +++ b/src/Qtx/QtxColorScale.cxx @@ -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 6c3cb164d..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); @@ -326,7 +326,7 @@ QValidator::State QtxDoubleSpinBox::validate( QString& str, int& pos ) const state = v.validate( str, pos ); else { - if ( (uint)str.length() >= overhead && str.startsWith( pref ) && //!< TODO: mismatch signed/unsigned + if ( str.length() >= overhead && str.startsWith( pref ) && str.right( suff.length() ) == suff ) { QString core = str.mid( pref.length(), str.length() - overhead ); 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 df152aa74..a2bf89fa4 100644 --- a/src/Qtx/QtxMainWindow.cxx +++ b/src/Qtx/QtxMainWindow.cxx @@ -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/QtxPathListEdit.cxx b/src/Qtx/QtxPathListEdit.cxx index f3860e006..3b1ea4b57 100644 --- a/src/Qtx/QtxPathListEdit.cxx +++ b/src/Qtx/QtxPathListEdit.cxx @@ -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/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 0438d7905..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(); @@ -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 c8cb06723..655525fb3 100644 --- a/src/Qtx/QtxWorkstackAction.cxx +++ b/src/Qtx/QtxWorkstackAction.cxx @@ -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 3944d4d4f..2429c4610 100644 --- a/src/QxScene/QxScene_ViewModel.cxx +++ b/src/QxScene/QxScene_ViewModel.cxx @@ -84,9 +84,8 @@ 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*/) { - //GUI_UNUSED(thePopup); DEBTRACE("QxScene_Viewer::contextMenuPopup"); } diff --git a/src/QxScene/QxScene_ViewWindow.h b/src/QxScene/QxScene_ViewWindow.h index 7b6794056..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 7a2bdfe5c..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 { @@ -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 d7871c6d3..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,9 +112,8 @@ 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 { - //GUI_UNUSED(index); 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 39b4d70df..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,18 +108,16 @@ 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) { - //GUI_UNUSED(theStudy); myStudyURL = theURL; return save(theListOfFiles); } -bool SALOME_PYQT_DataModelLight::create( CAM_Study* study ) +bool SALOME_PYQT_DataModelLight::create( CAM_Study* /*study*/ ) { - //GUI_UNUSED(study); return true; } @@ -185,9 +183,8 @@ 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*/ ) { - //GUI_UNUSED(theObj);GUI_UNUSED(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 return; 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 70f3b2a92..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,9 +113,8 @@ 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 { - //GUI_UNUSED(index); 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 07ab2ebc9..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,9 +637,8 @@ 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*/) { - //GUI_UNUSED(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 86f607395..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,9 +2087,8 @@ void PyModuleHelper::internalCustomize( SUIT_Study* study ) \param study parent study */ -void PyModuleHelper::internalDeactivate( SUIT_Study* study ) +void PyModuleHelper::internalDeactivate( SUIT_Study* /*study*/ ) { - //GUI_UNUSED(study); FuncMsg fmsg( "--- PyModuleHelper::internalDeactivate()" ); // check that Python subinterpreter is initialized and Python module is imported @@ -2858,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 4f9d60ac2..6c00784b1 100644 --- a/src/SALOME_PYQT/SalomePyQt/SalomePyQt.cxx +++ b/src/SALOME_PYQT/SalomePyQt/SalomePyQt.cxx @@ -1633,7 +1633,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() ) { @@ -2072,13 +2072,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 { @@ -2088,26 +2088,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; } @@ -2224,17 +2231,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 { @@ -2244,31 +2251,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; } @@ -3932,10 +3947,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 220c1fdf8..7d7b9b6a5 100644 --- a/src/SOCC/SOCC_ViewModel.cxx +++ b/src/SOCC/SOCC_ViewModel.cxx @@ -103,9 +103,8 @@ 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*/ ) { - //GUI_UNUSED(on); AIS_ListOfInteractive List; getAISContext()->DisplayedObjects(List); AIS_ListIteratorOfListOfInteractive ite(List); @@ -364,9 +363,8 @@ 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*/ ) { - //GUI_UNUSED(forced); // try do downcast object const SOCC_Prs* anOCCPrs = dynamic_cast( prs ); if ( !anOCCPrs || anOCCPrs->IsNull() ) @@ -513,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 b0e92ce1e..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 2b58930e1..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 < (uint)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 f63c246d5..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 ) {/*GUI_UNUSED(highlight);GUI_UNUSED(IObject);*/} + 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/SUIT/SUIT_DataBrowser.cxx b/src/SUIT/SUIT_DataBrowser.cxx index 4431d324c..98d642b2e 100644 --- a/src/SUIT/SUIT_DataBrowser.cxx +++ b/src/SUIT/SUIT_DataBrowser.cxx @@ -145,7 +145,6 @@ void SUIT_DataBrowser::setUpdateModified( const bool on ) */ void SUIT_DataBrowser::updateTree( SUIT_DataObject* obj, const bool /*autoOpen*/ ) { - //GUI_UNUSED(autoOpen); SUIT_ProxyModel* m = qobject_cast( model() ); if ( m ) { m->updateTree( obj ); @@ -473,7 +472,6 @@ void SUIT_DataBrowser::onDblClicked( const QModelIndex& index ) */ void SUIT_DataBrowser::onExpanded( const QModelIndex& /*index*/ ) { - //GUI_UNUSED(index); if (myResizeOnExpandItem) { adjustFirstColumnWidth(); adjustColumnsWidth(); diff --git a/src/SUIT/SUIT_TreeModel.cxx b/src/SUIT/SUIT_TreeModel.cxx index 9c7970b4b..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; @@ -1730,7 +1730,6 @@ 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 ) { - //GUI_UNUSED(column); if ( action == Qt::IgnoreAction ) // do nothing with data return false; 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 057e7ac94..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*)(this)); + return int(reinterpret_cast(this)); // todo: unsafe - converting pointer to int can give non-unique result } /*! @@ -456,7 +456,6 @@ void SUIT_ViewWindow::updateSyncViews() */ void SUIT_ViewWindow::onSynchronizeView( bool /*checked*/ ) { - //GUI_UNUSED(checked); QAction* a = qobject_cast( sender() ); if ( a ) { synchronizeView( this, a->data().toInt() ); 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 59f60eab7..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()) { @@ -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 ) 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 a9b1d1679..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 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 992756033..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 = (int)ids.size(); //!< TODO: conversion from size_t to int + 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_InteractorStyle.cxx b/src/SVTK/SVTK_InteractorStyle.cxx index f1bbfd640..8afc5bc5f 100644 --- a/src/SVTK/SVTK_InteractorStyle.cxx +++ b/src/SVTK/SVTK_InteractorStyle.cxx @@ -78,24 +78,24 @@ namespace } -vtkStandardNewMacro(SVTK_InteractorStyle); +vtkStandardNewMacro(SVTK_InteractorStyle) /*! Constructor */ SVTK_InteractorStyle::SVTK_InteractorStyle(): - mySelectionEvent(new SVTK_SelectionEvent()), - myPointPicker(vtkPointPicker::New()), myLastHighlitedActor(NULL), myLastPreHighlitedActor(NULL), myControllerIncrement(SVTK_ControllerIncrement::New()), myControllerOnKeyDown(SVTK_ControllerOnKeyDown::New()), + mySelectionEvent(new SVTK_SelectionEvent()), myHighlightSelectionPointActor(SVTK_Actor::New()), + myPointPicker(vtkPointPicker::New()), myRectBand(0), myPolygonBand(0), - myIsAdvancedZoomingEnabled(false), - myPoligonState( Disable ) + myPoligonState(Disable), + myIsAdvancedZoomingEnabled(false) { myPointPicker->Delete(); @@ -538,7 +538,7 @@ void SVTK_InteractorStyle::OnLeftButtonDown(int ctrl, int shift, if( SALOME_Actor* anActor = SALOME_Actor::SafeDownCast( aVTKActor ) ) { Selection_Mode aSelectionMode = GetSelector()->SelectionMode(); - double* aCoords; + double* aCoords = NULL; int aVtkId; bool isTrueType = false; @@ -1326,7 +1326,7 @@ void SVTK_InteractorStyle::onOperation(QPoint mousePos) { if (!myCursorState) setCursor(VTK_INTERACTOR_STYLE_CAMERA_SELECT); - } + } // fall through! case VTK_INTERACTOR_STYLE_CAMERA_FIT: { myOtherPoint = mousePos; @@ -1343,7 +1343,7 @@ void SVTK_InteractorStyle::onOperation(QPoint mousePos) Called when user moves mouse inside viewer window and there is no active viewer operation (!put necessary processing here!) */ -void SVTK_InteractorStyle::onCursorMove(QPoint mousePos) +void SVTK_InteractorStyle::onCursorMove(QPoint /*mousePos*/) { if ( !GetSelector()->IsPreSelectionEnabled() ) return; @@ -1706,7 +1706,7 @@ bool isValid( const QPolygon* thePoints, const QPoint& theCurrent ) return true; bool res = true; - for ( uint i = 0; i < (uint)thePoints->count() - 1 && res; i++ ) + for ( int i = 0; i < thePoints->count() - 1 && res; i++ ) { const QPoint& aStart = thePoints->point( i ); const QPoint& anEnd = thePoints->point( i + 1 ); @@ -2026,7 +2026,7 @@ SVTK_ControllerIncrement* SVTK_InteractorStyle::ControllerIncrement() return myControllerIncrement.GetPointer(); } -vtkStandardNewMacro(SVTK_ControllerIncrement); +vtkStandardNewMacro(SVTK_ControllerIncrement) SVTK_ControllerIncrement::SVTK_ControllerIncrement() { myIncrement=10; @@ -2055,7 +2055,7 @@ int SVTK_ControllerIncrement::Decrease() return myIncrement; } -vtkStandardNewMacro(SVTK_GeomControllerIncrement); +vtkStandardNewMacro(SVTK_GeomControllerIncrement) SVTK_GeomControllerIncrement::SVTK_GeomControllerIncrement() { } @@ -2076,7 +2076,7 @@ int SVTK_GeomControllerIncrement::Decrease() return myIncrement; } -vtkStandardNewMacro(SVTK_ControllerOnKeyDown); +vtkStandardNewMacro(SVTK_ControllerOnKeyDown) /*! Constructor @@ -2092,7 +2092,7 @@ SVTK_ControllerOnKeyDown::~SVTK_ControllerOnKeyDown() { } -bool SVTK_ControllerOnKeyDown::OnKeyDown(vtkInteractorStyle* theIS) +bool SVTK_ControllerOnKeyDown::OnKeyDown(vtkInteractorStyle* /*theIS*/) { return true; } diff --git a/src/SVTK/SVTK_InteractorStyle.h b/src/SVTK/SVTK_InteractorStyle.h index e6b957ed2..f2dbde932 100644 --- a/src/SVTK/SVTK_InteractorStyle.h +++ b/src/SVTK/SVTK_InteractorStyle.h @@ -55,7 +55,7 @@ */ class SVTK_EXPORT SVTK_ControllerIncrement : public vtkObject{ public: - vtkTypeMacro(SVTK_ControllerIncrement, vtkObject); + vtkTypeMacro(SVTK_ControllerIncrement, vtkObject) static SVTK_ControllerIncrement* New(); //! Set start value of increment @@ -87,7 +87,7 @@ class SVTK_EXPORT SVTK_ControllerIncrement : public vtkObject{ */ class SVTK_EXPORT SVTK_GeomControllerIncrement : public SVTK_ControllerIncrement{ public: - vtkTypeMacro(SVTK_GeomControllerIncrement, SVTK_ControllerIncrement); + vtkTypeMacro(SVTK_GeomControllerIncrement, SVTK_ControllerIncrement) static SVTK_GeomControllerIncrement* New(); //! Increace the increment value by add 1 @@ -110,7 +110,7 @@ class SVTK_EXPORT SVTK_GeomControllerIncrement : public SVTK_ControllerIncrement */ class SVTK_EXPORT SVTK_ControllerOnKeyDown : public vtkObject{ public: - vtkTypeMacro(SVTK_ControllerOnKeyDown, vtkObject); + vtkTypeMacro(SVTK_ControllerOnKeyDown, vtkObject) static SVTK_ControllerOnKeyDown* New(); //! Provides the action on event @@ -157,7 +157,7 @@ class SVTK_EXPORT SVTK_InteractorStyle: public vtkInteractorStyle { public: static SVTK_InteractorStyle *New(); - vtkTypeMacro(SVTK_InteractorStyle, vtkInteractorStyle); + vtkTypeMacro(SVTK_InteractorStyle, vtkInteractorStyle) typedef boost::shared_ptr PSelectionEvent; diff --git a/src/SVTK/SVTK_KeyFreeInteractorStyle.cxx b/src/SVTK/SVTK_KeyFreeInteractorStyle.cxx index 9465b0afd..c07f7ac49 100644 --- a/src/SVTK/SVTK_KeyFreeInteractorStyle.cxx +++ b/src/SVTK/SVTK_KeyFreeInteractorStyle.cxx @@ -33,7 +33,7 @@ //---------------------------------------------------------------------------- -vtkStandardNewMacro(SVTK_KeyFreeInteractorStyle); +vtkStandardNewMacro(SVTK_KeyFreeInteractorStyle) //---------------------------------------------------------------------------- SVTK_KeyFreeInteractorStyle::SVTK_KeyFreeInteractorStyle(): diff --git a/src/SVTK/SVTK_KeyFreeInteractorStyle.h b/src/SVTK/SVTK_KeyFreeInteractorStyle.h index c984c8ae5..e8964f8f3 100644 --- a/src/SVTK/SVTK_KeyFreeInteractorStyle.h +++ b/src/SVTK/SVTK_KeyFreeInteractorStyle.h @@ -33,7 +33,7 @@ class SVTK_EXPORT SVTK_KeyFreeInteractorStyle : public SVTK_InteractorStyle { public: static SVTK_KeyFreeInteractorStyle *New(); - vtkTypeMacro(SVTK_KeyFreeInteractorStyle,SVTK_InteractorStyle); + vtkTypeMacro(SVTK_KeyFreeInteractorStyle,SVTK_InteractorStyle) protected: SVTK_KeyFreeInteractorStyle(); diff --git a/src/SVTK/SVTK_NonIsometricDlg.h b/src/SVTK/SVTK_NonIsometricDlg.h index c4b526c34..50c41db78 100644 --- a/src/SVTK/SVTK_NonIsometricDlg.h +++ b/src/SVTK/SVTK_NonIsometricDlg.h @@ -39,7 +39,7 @@ class QPushButton; class SVTK_NonIsometricDlg : public ViewerTools_DialogBase { - Q_OBJECT; + Q_OBJECT public: SVTK_NonIsometricDlg(QtxAction* theAction, diff --git a/src/SVTK/SVTK_Recorder.cxx b/src/SVTK/SVTK_Recorder.cxx index b7e2cba16..1fcab48dc 100644 --- a/src/SVTK/SVTK_Recorder.cxx +++ b/src/SVTK/SVTK_Recorder.cxx @@ -68,28 +68,28 @@ namespace } //---------------------------------------------------------------------------- -vtkStandardNewMacro(SVTK_Recorder); +vtkStandardNewMacro(SVTK_Recorder) //---------------------------------------------------------------------------- SVTK_Recorder ::SVTK_Recorder(): - myRenderWindow(NULL), myState(SVTK_Recorder_Stop), + myPaused(0), + myErrorStatus(0), + myPriority(0.0), + myTimeStart(0.0), + myFrameIndex(0), + myNbWrittenFrames(0), myNbFPS(5.5), myQuality(100), myProgressiveMode(true), myUseSkippedFrames(true), - myErrorStatus(0), + myNameAVIMaker("jpeg2yuv"), myCommand(vtkCallbackCommand::New()), - myPriority(0.0), - myTimeStart(0.0), - myFrameIndex(0), - myPaused(0), + myRenderWindow(NULL), myFilter(vtkWindowToImageFilter::New()), - myWriterMgr(new SVTK_ImageWriterMgr), - myNbWrittenFrames(0), - myNameAVIMaker("jpeg2yuv") + myWriterMgr(new SVTK_ImageWriterMgr) { myCommand->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.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 6eaec64d9..a7a78dc25 100644 --- a/src/SVTK/SVTK_ViewModel.cxx +++ b/src/SVTK/SVTK_ViewModel.cxx @@ -218,7 +218,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 < (uint)aViews.count(); i++ ) + for ( int i = 0; i < aViews.count(); i++ ) { if ( TViewWindow* aView = dynamic_cast(aViews.at( i )) ) aView->SetTrihedronSize( theSize, theRelative ); @@ -244,7 +244,7 @@ void SVTK_Viewer::setStaticTrihedronVisible( const bool theIsVisible ) if (SUIT_ViewManager* aViewManager = getViewManager()) { QVector aViews = aViewManager->getViews(); - for ( uint i = 0; i < (uint)aViews.count(); i++ ) + for ( int i = 0; i < aViews.count(); i++ ) { if ( TViewWindow* aView = dynamic_cast(aViews.at( i )) ) aView->SetStaticTrihedronVisible( theIsVisible ); @@ -272,7 +272,7 @@ void SVTK_Viewer::setProjectionMode( const int theMode ) myProjMode = theMode; if (SUIT_ViewManager* aViewManager = getViewManager()) { QVector aViews = aViewManager->getViews(); - for ( uint i = 0; i < (uint)aViews.count(); i++ ) + for ( int i = 0; i < aViews.count(); i++ ) { if ( TViewWindow* aView = dynamic_cast(aViews.at( i )) ) aView->SetProjectionMode( theMode ); @@ -300,7 +300,7 @@ void SVTK_Viewer::setStereoType( const int theType ) if (SUIT_ViewManager* aViewManager = getViewManager()) { QVector aViews = aViewManager->getViews(); - for ( uint i = 0; i < (uint)aViews.count(); i++ ) + for ( int i = 0; i < aViews.count(); i++ ) { if ( TViewWindow* aView = dynamic_cast(aViews.at( i )) ) aView->SetStereoType( theType ); @@ -328,7 +328,7 @@ void SVTK_Viewer::setAnaglyphFilter( const int theFilter ) if (SUIT_ViewManager* aViewManager = getViewManager()) { QVector aViews = aViewManager->getViews(); - for ( uint i = 0; i < (uint)aViews.count(); i++ ) + for ( int i = 0; i < aViews.count(); i++ ) { if ( TViewWindow* aView = dynamic_cast(aViews.at( i )) ) aView->SetAnaglyphFilter( theFilter ); @@ -356,7 +356,7 @@ void SVTK_Viewer::setQuadBufferSupport( const bool theEnable ) if (SUIT_ViewManager* aViewManager = getViewManager()) { QVector aViews = aViewManager->getViews(); - for ( uint i = 0; i < (uint)aViews.count(); i++ ) + for ( int i = 0; i < aViews.count(); i++ ) { if ( TViewWindow* aView = dynamic_cast(aViews.at( i )) ) aView->SetQuadBufferSupport( theEnable ); @@ -382,7 +382,7 @@ void SVTK_Viewer::setInteractionStyle( const int theStyle ) if (SUIT_ViewManager* aViewManager = getViewManager()) { QVector aViews = aViewManager->getViews(); - for ( uint i = 0; i < (uint)aViews.count(); i++ ) + for ( int i = 0; i < aViews.count(); i++ ) { if ( TViewWindow* aView = dynamic_cast(aViews.at( i )) ) aView->SetInteractionStyle( theStyle ); @@ -408,7 +408,7 @@ void SVTK_Viewer::setZoomingStyle( const int theStyle ) if (SUIT_ViewManager* aViewManager = getViewManager()) { QVector aViews = aViewManager->getViews(); - for ( uint i = 0; i < (uint)aViews.count(); i++ ) + for ( int i = 0; i < aViews.count(); i++ ) { if ( TViewWindow* aView = dynamic_cast(aViews.at( i )) ) aView->SetZoomingStyle( theStyle ); @@ -434,7 +434,7 @@ void SVTK_Viewer::setPreSelectionMode( Preselection_Mode theMode ) if (SUIT_ViewManager* aViewManager = getViewManager()) { QVector aViews = aViewManager->getViews(); - for ( uint i = 0; i < (uint)aViews.count(); i++ ) + for ( int i = 0; i < aViews.count(); i++ ) { if ( TViewWindow* aView = dynamic_cast(aViews.at( i )) ) aView->SetPreSelectionMode( theMode ); @@ -470,7 +470,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 < (uint)aViews.count(); i++ ) + for ( int i = 0; i < aViews.count(); i++ ) { if ( TViewWindow* aView = dynamic_cast(aViews.at( i )) ) aView->SetIncrementalSpeed( theValue, theMode ); @@ -501,7 +501,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 < (uint)aViews.count(); i++ ) + for ( int i = 0; i < aViews.count(); i++ ) { if ( TViewWindow* aView = dynamic_cast(aViews.at( i )) ) aView->SetSpacemouseButtons( theBtn1, theBtn2, theBtn3 ); @@ -553,19 +553,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*/) {} /*! @@ -579,7 +579,7 @@ void SVTK_Viewer::enableSelection(bool isEnabled) if (SUIT_ViewManager* aViewManager = getViewManager()) { QVector aViews = aViewManager->getViews(); - for ( uint i = 0; i < (uint)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 e341fb736..d561922c5 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 7e8a5aaf6..97321a7c9 100644 --- a/src/SVTK/SVTK_ViewWindow.cxx +++ b/src/SVTK/SVTK_ViewWindow.cxx @@ -137,9 +137,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 @@ -1224,7 +1224,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(); @@ -1881,7 +1881,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(); @@ -2724,9 +2724,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 5e8980bb7..80e977134 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 0f3a5eef9..b5a6c6a54 100644 --- a/src/SalomeApp/SalomeApp_Application.cxx +++ b/src/SalomeApp/SalomeApp_Application.cxx @@ -1190,9 +1190,8 @@ void SalomeApp_Application::updateDesktopTitle() { desktop()->setWindowTitle( aTitle ); } -int SalomeApp_Application::closeChoice( const QString& docName ) +int SalomeApp_Application::closeChoice( const QString& /*docName*/ ) { - //GUI_UNUSED(docName); QStringList buttons; QMap choices; int idx = 0; @@ -1234,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; @@ -1282,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; @@ -1899,9 +1898,8 @@ 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 ) { - //GUI_UNUSED(entry); SalomeApp_Study* aStudy = dynamic_cast( activeStudy() ); int savePoint = ::getSelectedSavePoint( selectionMgr() ); diff --git a/src/SalomeApp/SalomeApp_DataModel.cxx b/src/SalomeApp/SalomeApp_DataModel.cxx index 4e32f1405..e9b0f05e5 100644 --- a/src/SalomeApp/SalomeApp_DataModel.cxx +++ b/src/SalomeApp/SalomeApp_DataModel.cxx @@ -236,9 +236,8 @@ 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 { - //GUI_UNUSED(obj); } /*! 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 25247a12c..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; @@ -212,11 +212,10 @@ 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) { - //GUI_UNUSED(isPublished);GUI_UNUSED(isMultiFile); MESSAGE("SalomeApp_Engine_i::DumpPython(): myComponentName = "<< qPrintable( myComponentName ) << ", this = " << this); diff --git a/src/SalomeApp/SalomeApp_ListView.cxx b/src/SalomeApp/SalomeApp_ListView.cxx index 271f25233..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 < (unsigned int)theList.count(); i++) //!< TODO: mismatch signed/unsigned + for (int i = 0; i < theList.count(); i++) insertItem(theList[i]); } diff --git a/src/SalomeApp/SalomeApp_Module.cxx b/src/SalomeApp/SalomeApp_Module.cxx index 47ca15604..e6fe76ca7 100644 --- a/src/SalomeApp/SalomeApp_Module.cxx +++ b/src/SalomeApp/SalomeApp_Module.cxx @@ -135,9 +135,8 @@ 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*/) { - //GUI_UNUSED(savePoint); } /*! @@ -146,7 +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*/) { - //GUI_UNUSED(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 197391df4..c68065232 100644 --- a/src/SalomeApp/SalomeApp_Study.cxx +++ b/src/SalomeApp/SalomeApp_Study.cxx @@ -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); @@ -857,9 +857,8 @@ 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 ) { - //GUI_UNUSED(theFileName); ModelList list; dataModels( list ); QListIterator it( list ); while ( it.hasNext() ){ diff --git a/src/SalomeApp/SalomeApp_StudyPropertiesDlg.cxx b/src/SalomeApp/SalomeApp_StudyPropertiesDlg.cxx index 3c8404c17..b355724e5 100644 --- a/src/SalomeApp/SalomeApp_StudyPropertiesDlg.cxx +++ b/src/SalomeApp/SalomeApp_StudyPropertiesDlg.cxx @@ -225,8 +225,8 @@ void SalomeApp_StudyPropertiesDlg::initData() std::vector aUsers; std::vector aMins, aHours, aDays, aMonths, aYears; propAttr->GetModificationsList(aUsers, aMins, aHours, aDays, aMonths, aYears, false); - size_t aCnt = aUsers.size(); - for ( int i = 0; i < aCnt; i++ ) { + int aCnt = aUsers.size(); + 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 d628548dc..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,9 +698,8 @@ 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 ) { - //GUI_UNUSED(border_top) p->save(); QPainterPath path, bottomPath; if ( rad == 0 ) diff --git a/src/TOOLSGUI/ToolsGUI.cxx b/src/TOOLSGUI/ToolsGUI.cxx index 372845f37..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( *((int*)theId) ); //!< TODO: pointer truncation + 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( *((int*)theId), theValue ); //!< TODO: pointer truncation + 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( *((int*)theId), theValue ); //!< TODO: pointer truncation + 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 70a1d3a9f..886d7f194 100644 --- a/src/TOOLSGUI/ToolsGUI_RegWidget.cxx +++ b/src/TOOLSGUI/ToolsGUI_RegWidget.cxx @@ -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. 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 75801281c..845f27068 100644 --- a/src/TreeData/DockWidgets.cxx +++ b/src/TreeData/DockWidgets.cxx @@ -116,8 +116,7 @@ void DockWidgets::setDataView(QTreeView * dataView) { _dwDataPanel->setWidget(_tvDataView); } -void DockWidgets::setPropertiesView(QTreeView * propertiesView) { - //GUI_UNUSED(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_AppendFilter.cxx b/src/VTKViewer/VTKViewer_AppendFilter.cxx index 78249ba62..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() diff --git a/src/VTKViewer/VTKViewer_ArcBuilder.cxx b/src/VTKViewer/VTKViewer_ArcBuilder.cxx index ab3a880da..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(), @@ -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_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_GeometryFilter.cxx b/src/VTKViewer/VTKViewer_GeometryFilter.cxx index 996f443a3..a4ce3be23 100644 --- a/src/VTKViewer/VTKViewer_GeometryFilter.cxx +++ b/src/VTKViewer/VTKViewer_GeometryFilter.cxx @@ -180,7 +180,7 @@ int VTKViewer_GeometryFilter ::UnstructuredGridExecute(vtkDataSet *dataSetInput, vtkPolyData *output, - vtkInformation *outInfo) + vtkInformation */*outInfo*/) { vtkUnstructuredGrid *input= (vtkUnstructuredGrid *)dataSetInput; vtkCellArray *Connectivity = input->GetCells(); diff --git a/src/VTKViewer/VTKViewer_InteractorStyle.cxx b/src/VTKViewer/VTKViewer_InteractorStyle.cxx index bdc3eaf14..0a74de2ef 100644 --- a/src/VTKViewer/VTKViewer_InteractorStyle.cxx +++ b/src/VTKViewer/VTKViewer_InteractorStyle.cxx @@ -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; diff --git a/src/VTKViewer/VTKViewer_InteractorStyle.h b/src/VTKViewer/VTKViewer_InteractorStyle.h index d6111f78e..8a2fe13f7 100644 --- a/src/VTKViewer/VTKViewer_InteractorStyle.h +++ b/src/VTKViewer/VTKViewer_InteractorStyle.h @@ -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); 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_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_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 5dd07295d..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); 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 f2d60c43f..3f354ca61 100644 --- a/src/VTKViewer/VTKViewer_Transform.h +++ b/src/VTKViewer/VTKViewer_Transform.h @@ -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 c2fc87112..7a4b72ab4 100644 --- a/src/VTKViewer/VTKViewer_TransformFilter.h +++ b/src/VTKViewer/VTKViewer_TransformFilter.h @@ -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/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 d911195e3..bf99b1156 100644 --- a/src/ViewerTools/ViewerTools_FontWidgetBase.cxx +++ b/src/ViewerTools/ViewerTools_FontWidgetBase.cxx @@ -107,7 +107,6 @@ void ViewerTools_FontWidgetBase::SetData( const QColor& theColor, const bool theItalic, const bool theShadow ) { - //GUI_UNUSED(theFamily); SetColor( theColor ); myBold->setChecked( theBold ); @@ -121,7 +120,6 @@ void ViewerTools_FontWidgetBase::GetData( QColor& theColor, bool& theItalic, bool& theShadow ) const { - //GUI_UNUSED(theFamily); theColor = GetColor(); theBold = myBold->isChecked(); 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 ); -- 2.39.2