From 2577fe5eb16d5e16b44599630c29897356d7a9fd Mon Sep 17 00:00:00 2001 From: SALOME Date: Mon, 24 Aug 2020 13:55:11 +0300 Subject: [PATCH] #18963 Minimize compiler warnings --- src/GHS3DPlugin/GHS3DPlugin_GHS3D.cxx | 16 +++--- src/GHS3DPlugin/GHS3DPlugin_Hypothesis.cxx | 10 +--- src/GHS3DPlugin/GHS3DPlugin_Hypothesis.hxx | 24 ++++----- src/GHS3DPlugin/GHS3DPlugin_Hypothesis_i.cxx | 43 +++++----------- src/GHS3DPlugin/GHS3DPlugin_Hypothesis_i.hxx | 51 +++++++++---------- src/GHS3DPlugin/GHS3DPlugin_Optimizer.cxx | 6 +-- src/GHS3DPlugin/GHS3DPlugin_Optimizer.hxx | 2 +- .../GHS3DPlugin_OptimizerHypothesis.cxx | 8 +-- src/GHS3DPlugin/MG_Tetra_API.cxx | 20 +++++--- src/GUI/GHS3DPluginGUI_HypothesisCreator.cxx | 10 ++-- 10 files changed, 86 insertions(+), 104 deletions(-) diff --git a/src/GHS3DPlugin/GHS3DPlugin_GHS3D.cxx b/src/GHS3DPlugin/GHS3DPlugin_GHS3D.cxx index 1f11791..f339773 100644 --- a/src/GHS3DPlugin/GHS3DPlugin_GHS3D.cxx +++ b/src/GHS3DPlugin/GHS3DPlugin_GHS3D.cxx @@ -440,7 +440,7 @@ static int findShapeID(SMESH_Mesh& mesh, static void addElemInMeshGroup(SMESH_Mesh* theMesh, const SMDS_MeshElement* anElem, std::string& groupName, - std::set& groupsToRemove) + std::set& /*groupsToRemove*/) { if ( !anElem ) return; // issue 0021776 @@ -584,7 +584,7 @@ static bool readGMFFile(MG_Tetra_API* MGOutput, SMESH_MesherHelper* theHelper, std::vector & theNodeByGhs3dId, std::vector & theFaceByGhs3dId, - map & theNodeToGhs3dIdMap, + map & /*theNodeToGhs3dIdMap*/, std::vector & aNodeGroupByGhs3dId, std::vector & anEdgeGroupByGhs3dId, std::vector & aFaceGroupByGhs3dId, @@ -691,7 +691,7 @@ static bool readGMFFile(MG_Tetra_API* MGOutput, std::vector< const SMDS_MeshElement* > foundVolumes; if ( !hasGeom && theHelper->GetMesh()->NbVolumes() > 0 ) elemSearcher = SMESH_MeshAlgos::GetElementSearcher( *theMeshDS ); - auto_ptr< SMESH_ElementSearcher > elemSearcherDeleter( elemSearcher ); + unique_ptr< SMESH_ElementSearcher > elemSearcherDeleter( elemSearcher ); //auto_ptr // IMP 0022172: [CEA 790] create the groups corresponding to domains std::vector< std::vector< const SMDS_MeshElement* > > elemsOfDomain; @@ -2871,9 +2871,9 @@ namespace */ void ProcessEvent(const int event, const int eventType, - SMESH_subMesh* subMesh, + SMESH_subMesh* /*subMesh*/, SMESH_subMeshEventListenerData* data, - const SMESH_Hypothesis* hyp) + const SMESH_Hypothesis* /*hyp*/) { if ( SMESH_subMesh::SUBMESH_LOADED == event && SMESH_subMesh::COMPUTE_EVENT == eventType && @@ -2913,11 +2913,11 @@ namespace /*! * \brief Treat events of the subMesh */ - void ProcessEvent(const int event, + void ProcessEvent(const int /*event*/, const int eventType, SMESH_subMesh* subMesh, - SMESH_subMeshEventListenerData* data, - const SMESH_Hypothesis* hyp) + SMESH_subMeshEventListenerData* /*data*/, + const SMESH_Hypothesis* /*hyp*/) { if (SMESH_subMesh::ALGO_EVENT == eventType && !subMesh->GetAlgo() ) diff --git a/src/GHS3DPlugin/GHS3DPlugin_Hypothesis.cxx b/src/GHS3DPlugin/GHS3DPlugin_Hypothesis.cxx index 2a6be1f..c80e30c 100644 --- a/src/GHS3DPlugin/GHS3DPlugin_Hypothesis.cxx +++ b/src/GHS3DPlugin/GHS3DPlugin_Hypothesis.cxx @@ -818,7 +818,6 @@ bool GHS3DPlugin_Hypothesis::SetEnforcedElements(TIDSortedElemSet theElemSet, SM //======================================================================= GHS3DPlugin_Hypothesis::TGHS3DEnforcedVertex* GHS3DPlugin_Hypothesis::GetEnforcedVertex(double x, double y, double z) - throw (std::invalid_argument) { std::vector coord(3); coord[0] = x; @@ -832,7 +831,6 @@ GHS3DPlugin_Hypothesis::TGHS3DEnforcedVertex* GHS3DPlugin_Hypothesis::GetEnforce } GHS3DPlugin_Hypothesis::TGHS3DEnforcedVertex* GHS3DPlugin_Hypothesis::GetEnforcedVertex(const std::string theEntry) - throw (std::invalid_argument) { if (_geomEntryEnfVertexMap.count(theEntry)>0) return _geomEntryEnfVertexMap[theEntry]; @@ -847,7 +845,6 @@ GHS3DPlugin_Hypothesis::TGHS3DEnforcedVertex* GHS3DPlugin_Hypothesis::GetEnforce //======================================================================= bool GHS3DPlugin_Hypothesis::RemoveEnforcedVertex(double x, double y, double z, const std::string theEntry) - throw (std::invalid_argument) { bool toNotify = false; std::ostringstream msg; @@ -1904,7 +1901,6 @@ GHS3DPlugin_Hypothesis::TSetStrings GHS3DPlugin_Hypothesis::GetGroupsToRemove(co //============================================================================= void GHS3DPlugin_Hypothesis::SetOptionValue(const std::string& optionName, const std::string& optionValue) - throw (std::invalid_argument) { TOptionValues::iterator op_val = _option2value.find(optionName); if (op_val == _option2value.end()) @@ -1969,7 +1965,6 @@ void GHS3DPlugin_Hypothesis::SetOptionValue(const std::string& optionName, // empty if it equals a default one. std::string GHS3DPlugin_Hypothesis::GetOptionValue(const std::string& optionName, bool* isDefault) const - throw (std::invalid_argument) { TOptionValues::const_iterator op_val = _option2value.find(optionName); if (op_val == _option2value.end()) @@ -2002,7 +1997,7 @@ bool GHS3DPlugin_Hypothesis::HasOptionDefined( const std::string& optionName ) c { GetOptionValue( optionName, &isDefault ); } - catch ( std::invalid_argument ) + catch ( std::invalid_argument& ) { return false; } @@ -2040,7 +2035,6 @@ GHS3DPlugin_Hypothesis::TOptionValues GHS3DPlugin_Hypothesis::GetOptionValues() //================================================================================ bool GHS3DPlugin_Hypothesis::ToBool(const std::string& str, bool* isOk ) - throw (std::invalid_argument) { std::string s = str; if ( isOk ) *isOk = true; @@ -2070,7 +2064,6 @@ bool GHS3DPlugin_Hypothesis::ToBool(const std::string& str, bool* isOk ) //================================================================================ double GHS3DPlugin_Hypothesis::ToDbl(const std::string& str, bool* isOk ) - throw (std::invalid_argument) { if ( str.empty() ) throw std::invalid_argument("Empty value provided"); @@ -2095,7 +2088,6 @@ double GHS3DPlugin_Hypothesis::ToDbl(const std::string& str, bool* isOk ) //================================================================================ int GHS3DPlugin_Hypothesis::ToInt(const std::string& str, bool* isOk ) - throw (std::invalid_argument) { if ( str.empty() ) throw std::invalid_argument("Empty value provided"); diff --git a/src/GHS3DPlugin/GHS3DPlugin_Hypothesis.hxx b/src/GHS3DPlugin/GHS3DPlugin_Hypothesis.hxx index ad4d0f4..8a1e6fe 100644 --- a/src/GHS3DPlugin/GHS3DPlugin_Hypothesis.hxx +++ b/src/GHS3DPlugin/GHS3DPlugin_Hypothesis.hxx @@ -111,7 +111,7 @@ public: struct TIDMeshIDCompare { bool operator () (const SMDS_MeshElement* e1, const SMDS_MeshElement* e2) const - { return e1->GetMesh() == e2->GetMesh() ? e1->GetID() < e2->GetID() : e1->GetMesh() < e2->GetMesh() ; } + { return e1->GetMesh() == e2->GetMesh() ? e1->GetID() < e2->GetID() : e1->GetMesh() < e2->GetMesh(); } }; typedef std::map TIDSortedElemGroupMap; @@ -216,26 +216,26 @@ public: * To define the volumic gradation */ void SetGradation(double gradation); - double GetGradation() const ; + double GetGradation() const; /*! * Print log in standard output */ void SetStandardOutputLog(bool logInStandardOutput); - bool GetStandardOutputLog() const ; + bool GetStandardOutputLog() const; /*! * Remove log file on success */ void SetRemoveLogOnSuccess(bool removeLogOnSuccess); - bool GetRemoveLogOnSuccess() const ; + bool GetRemoveLogOnSuccess() const; typedef std::map< std::string, std::string > TOptionValues; typedef std::set< std::string > TOptionNames; void SetOptionValue(const std::string& optionName, - const std::string& optionValue) throw (std::invalid_argument); + const std::string& optionValue); std::string GetOptionValue(const std::string& optionName, - bool* isDefault=0) const throw (std::invalid_argument); + bool* isDefault=0) const; bool HasOptionDefined( const std::string& optionName ) const; void ClearOption(const std::string& optionName); TOptionValues GetOptionValues() const; @@ -270,9 +270,9 @@ public: */ bool SetEnforcedVertex(std::string aName, std::string anEntry, std::string aGroupName, double size, double x=0.0, double y=0.0, double z=0.0, bool isCompound = false); - TGHS3DEnforcedVertex* GetEnforcedVertex(double x, double y, double z) throw (std::invalid_argument); - TGHS3DEnforcedVertex* GetEnforcedVertex(const std::string anEntry) throw (std::invalid_argument); - bool RemoveEnforcedVertex(double x=0.0, double y=0.0, double z=0.0, const std::string anEntry="" ) throw (std::invalid_argument); + TGHS3DEnforcedVertex* GetEnforcedVertex(double x, double y, double z); + TGHS3DEnforcedVertex* GetEnforcedVertex(const std::string anEntry); + bool RemoveEnforcedVertex(double x=0.0, double y=0.0, double z=0.0, const std::string anEntry="" ); const TGHS3DEnforcedVertexCoordsValues& _GetEnforcedVerticesCoordsSize() const {return _enfVertexCoordsSizeList; } const TGHS3DEnforcedVertexEntryValues & _GetEnforcedVerticesEntrySize() const {return _enfVertexEntrySizeList; } const TGHS3DEnforcedVertexList & _GetEnforcedVertices() const { return _enfVertexList; } @@ -351,9 +351,9 @@ public: */ virtual bool SetParametersByDefaults(const TDefaults& dflts, const SMESH_Mesh* theMesh=0); - static bool ToBool(const std::string& str, bool* isOk=0) throw (std::invalid_argument); - static double ToDbl(const std::string& str, bool* isOk=0) throw (std::invalid_argument); - static int ToInt(const std::string& str, bool* isOk=0) throw (std::invalid_argument); + static bool ToBool(const std::string& str, bool* isOk=0); + static double ToDbl(const std::string& str, bool* isOk=0); + static int ToInt(const std::string& str, bool* isOk=0); protected: diff --git a/src/GHS3DPlugin/GHS3DPlugin_Hypothesis_i.cxx b/src/GHS3DPlugin/GHS3DPlugin_Hypothesis_i.cxx index 6161d83..20317fb 100644 --- a/src/GHS3DPlugin/GHS3DPlugin_Hypothesis_i.cxx +++ b/src/GHS3DPlugin/GHS3DPlugin_Hypothesis_i.cxx @@ -190,7 +190,6 @@ CORBA::Boolean GHS3DPlugin_Hypothesis_i::GetToMakeGroupsOfDomains() //======================================================================= void GHS3DPlugin_Hypothesis_i::SetMaximumMemory(CORBA::Float MB) - throw ( SALOME::SALOME_Exception ) { if ( MB == 0 ) THROW_SALOME_CORBA_EXCEPTION( "Invalid memory size",SALOME::BAD_PARAM ); @@ -214,7 +213,6 @@ CORBA::Float GHS3DPlugin_Hypothesis_i::GetMaximumMemory() //======================================================================= void GHS3DPlugin_Hypothesis_i::SetInitialMemory(CORBA::Float MB) - throw ( SALOME::SALOME_Exception ) { if ( MB == 0 ) THROW_SALOME_CORBA_EXCEPTION( "Invalid memory size",SALOME::BAD_PARAM ); @@ -238,7 +236,6 @@ CORBA::Float GHS3DPlugin_Hypothesis_i::GetInitialMemory() //======================================================================= void GHS3DPlugin_Hypothesis_i::SetOptimizationLevel(CORBA::Short level) - throw ( SALOME::SALOME_Exception ) { ::GHS3DPlugin_Hypothesis::OptimizationLevel l = (::GHS3DPlugin_Hypothesis::OptimizationLevel) level; @@ -265,7 +262,7 @@ CORBA::Short GHS3DPlugin_Hypothesis_i::GetOptimizationLevel() //function : SetWorkingDirectory //======================================================================= -void GHS3DPlugin_Hypothesis_i::SetWorkingDirectory(const char* path) throw ( SALOME::SALOME_Exception ) +void GHS3DPlugin_Hypothesis_i::SetWorkingDirectory(const char* path) { if (!path ) THROW_SALOME_CORBA_EXCEPTION( "Null working directory",SALOME::BAD_PARAM ); @@ -321,7 +318,6 @@ CORBA::Boolean GHS3DPlugin_Hypothesis_i::GetKeepFiles() //======================================================================= void GHS3DPlugin_Hypothesis_i::SetVerboseLevel(CORBA::Short level) - throw ( SALOME::SALOME_Exception ) { if (level < 0 || level > 10 ) THROW_SALOME_CORBA_EXCEPTION( "Invalid verbose level, valid range is [0-10]", @@ -467,7 +463,6 @@ char* GHS3DPlugin_Hypothesis_i::GetAdvancedOption() //============================================================================= void GHS3DPlugin_Hypothesis_i::SetOptionValue(const char* optionName, const char* optionValue) - throw (SALOME::SALOME_Exception) { ASSERT(myBaseImpl); try { @@ -529,7 +524,7 @@ void GHS3DPlugin_Hypothesis_i::SetOptionValue(const char* optionName, const char try { valueChanged = ( this->GetImpl()->GetOptionValue( name ) != optionValue ); } - catch ( std::invalid_argument ) { + catch ( std::invalid_argument& ) { } if ( valueChanged ) { @@ -547,7 +542,6 @@ void GHS3DPlugin_Hypothesis_i::SetOptionValue(const char* optionName, const char //============================================================================= char* GHS3DPlugin_Hypothesis_i::GetOptionValue(const char* optionName) - throw (SALOME::SALOME_Exception) { ASSERT(myBaseImpl); try { @@ -625,7 +619,6 @@ GHS3DPlugin::string_array* GHS3DPlugin_Hypothesis_i::GetAdvancedOptionValues() //============================================================================= void GHS3DPlugin_Hypothesis_i::SetOptionValues(const GHS3DPlugin::string_array& options) - throw (SALOME::SALOME_Exception) { for (CORBA::ULong i = 0; i < options.length(); ++i) { @@ -686,7 +679,6 @@ void GHS3DPlugin_Hypothesis_i::SetAdvancedOptionValues(const GHS3DPlugin::string //============================================================================= void GHS3DPlugin_Hypothesis_i::SetAdvancedOption(const char* optionsAndValues) - throw (SALOME::SALOME_Exception) { if ( !optionsAndValues ) return; @@ -804,31 +796,31 @@ CORBA::Boolean GHS3DPlugin_Hypothesis_i::GetRemoveLogOnSuccess() //======================================================================= bool GHS3DPlugin_Hypothesis_i::SetEnforcedVertex(CORBA::Double x, CORBA::Double y, CORBA::Double z, CORBA::Double size) - throw (SALOME::SALOME_Exception) { +{ ASSERT(myBaseImpl); return p_SetEnforcedVertex(size, x, y, z); } bool GHS3DPlugin_Hypothesis_i::SetEnforcedVertexNamed(CORBA::Double x, CORBA::Double y, CORBA::Double z, CORBA::Double size, const char* theVertexName) - throw (SALOME::SALOME_Exception) { +{ ASSERT(myBaseImpl); return p_SetEnforcedVertex(size, x, y, z, theVertexName, "", ""); } bool GHS3DPlugin_Hypothesis_i::SetEnforcedVertexWithGroup(CORBA::Double x, CORBA::Double y, CORBA::Double z, CORBA::Double size, const char* theGroupName) - throw (SALOME::SALOME_Exception) { +{ ASSERT(myBaseImpl); return p_SetEnforcedVertex(size, x, y, z, "", "", theGroupName); } bool GHS3DPlugin_Hypothesis_i::SetEnforcedVertexNamedWithGroup(CORBA::Double x, CORBA::Double y, CORBA::Double z, CORBA::Double size, const char* theVertexName, const char* theGroupName) - throw (SALOME::SALOME_Exception) { +{ ASSERT(myBaseImpl); return p_SetEnforcedVertex(size, x, y, z, theVertexName, "", theGroupName); } bool GHS3DPlugin_Hypothesis_i::SetEnforcedVertexGeom(GEOM::GEOM_Object_ptr theVertex, CORBA::Double size) - throw (SALOME::SALOME_Exception) { +{ ASSERT(myBaseImpl); if ((theVertex->GetShapeType() != GEOM::VERTEX) && (theVertex->GetShapeType() != GEOM::COMPOUND)) { @@ -870,7 +862,7 @@ bool GHS3DPlugin_Hypothesis_i::SetEnforcedVertexGeom(GEOM::GEOM_Object_ptr theVe } bool GHS3DPlugin_Hypothesis_i::SetEnforcedVertexGeomWithGroup(GEOM::GEOM_Object_ptr theVertex, CORBA::Double size, const char* theGroupName) - throw (SALOME::SALOME_Exception) { +{ ASSERT(myBaseImpl); if ((theVertex->GetShapeType() != GEOM::VERTEX) && (theVertex->GetShapeType() != GEOM::COMPOUND)) { @@ -914,7 +906,7 @@ bool GHS3DPlugin_Hypothesis_i::SetEnforcedVertexGeomWithGroup(GEOM::GEOM_Object_ bool GHS3DPlugin_Hypothesis_i:: p_SetEnforcedVertex(CORBA::Double size, CORBA::Double x, CORBA::Double y, CORBA::Double z, const char* theVertexName, const char* theVertexEntry, const char* theGroupName, CORBA::Boolean isCompound) - throw (SALOME::SALOME_Exception) { +{ ASSERT(myBaseImpl); bool newValue = false; @@ -982,7 +974,6 @@ bool GHS3DPlugin_Hypothesis_i:: p_SetEnforcedVertex(CORBA::Double size, CORBA::D //======================================================================= CORBA::Double GHS3DPlugin_Hypothesis_i::GetEnforcedVertex(CORBA::Double x, CORBA::Double y, CORBA::Double z) - throw (SALOME::SALOME_Exception) { ASSERT(myBaseImpl); try { @@ -1003,7 +994,6 @@ CORBA::Double GHS3DPlugin_Hypothesis_i::GetEnforcedVertex(CORBA::Double x, CORBA //======================================================================= CORBA::Double GHS3DPlugin_Hypothesis_i::GetEnforcedVertexGeom(GEOM::GEOM_Object_ptr theVertex) - throw (SALOME::SALOME_Exception) { ASSERT(myBaseImpl); @@ -1089,7 +1079,6 @@ GHS3DPlugin::GHS3DEnforcedVertexList* GHS3DPlugin_Hypothesis_i::GetEnforcedVerti //======================================================================= bool GHS3DPlugin_Hypothesis_i::RemoveEnforcedVertex(CORBA::Double x, CORBA::Double y, CORBA::Double z) - throw (SALOME::SALOME_Exception) { ASSERT(myBaseImpl); try { @@ -1106,7 +1095,6 @@ bool GHS3DPlugin_Hypothesis_i::RemoveEnforcedVertex(CORBA::Double x, CORBA::Doub } bool GHS3DPlugin_Hypothesis_i::RemoveEnforcedVertexGeom(GEOM::GEOM_Object_ptr theVertex) - throw (SALOME::SALOME_Exception) { ASSERT(myBaseImpl); @@ -1203,7 +1191,6 @@ GHS3DPlugin::GHS3DEnforcedMeshList* GHS3DPlugin_Hypothesis_i::GetEnforcedMeshes( * \brief Adds enforced elements of type elementType using another mesh/sub-mesh/mesh group theSource. The elements will be grouped in theGroupName. */ bool GHS3DPlugin_Hypothesis_i::SetEnforcedMeshWithGroup(SMESH::SMESH_IDSource_ptr theSource, SMESH::ElementType theType, const char* theGroupName) - throw (SALOME::SALOME_Exception) { return p_SetEnforcedMesh(theSource, theType, "", theGroupName); } @@ -1212,7 +1199,6 @@ bool GHS3DPlugin_Hypothesis_i::SetEnforcedMeshWithGroup(SMESH::SMESH_IDSource_pt * \brief Adds enforced elements of type elementType using another mesh/sub-mesh/mesh group theSource. */ bool GHS3DPlugin_Hypothesis_i::SetEnforcedMesh(SMESH::SMESH_IDSource_ptr theSource, SMESH::ElementType theType) - throw (SALOME::SALOME_Exception) { return p_SetEnforcedMesh(theSource, theType); } @@ -1220,8 +1206,7 @@ bool GHS3DPlugin_Hypothesis_i::SetEnforcedMesh(SMESH::SMESH_IDSource_ptr theSour /*! * \brief OBSOLETE FUNCTION - Adds enforced elements of type elementType using another mesh/sub-mesh/mesh group theSource and a size. The elements will be grouped in theGroupName. */ -bool GHS3DPlugin_Hypothesis_i::SetEnforcedMeshSizeWithGroup(SMESH::SMESH_IDSource_ptr theSource, SMESH::ElementType theType, double theSize, const char* theGroupName) - throw (SALOME::SALOME_Exception) +bool GHS3DPlugin_Hypothesis_i::SetEnforcedMeshSizeWithGroup(SMESH::SMESH_IDSource_ptr theSource, SMESH::ElementType theType, double /*theSize*/, const char* theGroupName) { return p_SetEnforcedMesh(theSource, theType, "", theGroupName); } @@ -1229,8 +1214,7 @@ bool GHS3DPlugin_Hypothesis_i::SetEnforcedMeshSizeWithGroup(SMESH::SMESH_IDSourc /*! * \brief OBSOLETE FUNCTION - Adds enforced elements of type elementType using another mesh/sub-mesh/mesh group theSource and a size. */ -bool GHS3DPlugin_Hypothesis_i::SetEnforcedMeshSize(SMESH::SMESH_IDSource_ptr theSource, SMESH::ElementType theType, double theSize) - throw (SALOME::SALOME_Exception) +bool GHS3DPlugin_Hypothesis_i::SetEnforcedMeshSize(SMESH::SMESH_IDSource_ptr theSource, SMESH::ElementType theType, double /*theSize*/) { return p_SetEnforcedMesh(theSource, theType); } @@ -1239,7 +1223,6 @@ bool GHS3DPlugin_Hypothesis_i::p_SetEnforcedMesh(SMESH::SMESH_IDSource_ptr theSo SMESH::ElementType theType, const char* theName, const char* theGroupName) - throw (SALOME::SALOME_Exception) { ASSERT(myBaseImpl); @@ -1382,7 +1365,7 @@ CORBA::Boolean GHS3DPlugin_Hypothesis_i::IsDimSupported( SMESH::Dimension type ) bool GHS3DPlugin_Hypothesis_i::getObjectsDependOn( std::vector< std::string > & entryArray, - std::vector< int > & subIDArray ) const + std::vector< int > & /*subIDArray*/ ) const { typedef ::GHS3DPlugin_Hypothesis THyp; const THyp* h = static_cast< const THyp*>( myBaseImpl ); @@ -1443,7 +1426,7 @@ GHS3DPlugin_Hypothesis_i::getObjectsDependOn( std::vector< std::string > & entry bool GHS3DPlugin_Hypothesis_i::setObjectsDependOn( std::vector< std::string > & entryArray, - std::vector< int > & subIDArray ) + std::vector< int > & /*subIDArray*/ ) { typedef ::GHS3DPlugin_Hypothesis THyp; THyp* h = static_cast< THyp*>( myBaseImpl ); diff --git a/src/GHS3DPlugin/GHS3DPlugin_Hypothesis_i.hxx b/src/GHS3DPlugin/GHS3DPlugin_Hypothesis_i.hxx index 9ce1468..cf6589c 100644 --- a/src/GHS3DPlugin/GHS3DPlugin_Hypothesis_i.hxx +++ b/src/GHS3DPlugin/GHS3DPlugin_Hypothesis_i.hxx @@ -80,23 +80,23 @@ class GHS3DPLUGIN_EXPORT GHS3DPlugin_Hypothesis_i: /*! * Maximal size of memory to be used by the algorithm (in Megabytes) */ - void SetMaximumMemory(CORBA::Float MB) throw ( SALOME::SALOME_Exception ); + void SetMaximumMemory(CORBA::Float MB); CORBA::Float GetMaximumMemory(); /*! * Initial size of memory to be used by the algorithm (in Megabytes) in * automatic memory adjustment mode. Default is zero */ - void SetInitialMemory(CORBA::Float MB) throw ( SALOME::SALOME_Exception ); + void SetInitialMemory(CORBA::Float MB); CORBA::Float GetInitialMemory(); /*! * Optimization level: 0-none, 1-light, 2-medium, 3-strong. Default is medium */ - void SetOptimizationLevel(CORBA::Short level) throw ( SALOME::SALOME_Exception ); + void SetOptimizationLevel(CORBA::Short level); CORBA::Short GetOptimizationLevel(); /*! * Path to working directory */ - void SetWorkingDirectory(const char* path) throw ( SALOME::SALOME_Exception ); + void SetWorkingDirectory(const char* path); char* GetWorkingDirectory(); /*! * To keep working files or remove them. Log file remains in case of errors anyway. @@ -113,7 +113,7 @@ class GHS3DPLUGIN_EXPORT GHS3DPlugin_Hypothesis_i: * histogram of the skin mesh, quality statistics histogram together with * the characteristics of the final mesh. */ - void SetVerboseLevel(CORBA::Short level) throw ( SALOME::SALOME_Exception ); + void SetVerboseLevel(CORBA::Short level); CORBA::Short GetVerboseLevel(); /*! * To create new nodes @@ -142,19 +142,19 @@ class GHS3DPLUGIN_EXPORT GHS3DPlugin_Hypothesis_i: /*! * To set hiden/undocumented/advanced options */ - void SetAdvancedOption(const char* option) throw (SALOME::SALOME_Exception); + void SetAdvancedOption(const char* option); char* GetAdvancedOption(); void SetTextOption(const char* option); // obsolete char* GetTextOption(); - void SetOptionValue(const char* optionName, const char* optionValue) throw (SALOME::SALOME_Exception); - char* GetOptionValue(const char* optionName) throw (SALOME::SALOME_Exception); + void SetOptionValue(const char* optionName, const char* optionValue); + char* GetOptionValue(const char* optionName); void UnsetOption(const char* optionName); GHS3DPlugin::string_array* GetOptionValues(); GHS3DPlugin::string_array* GetAdvancedOptionValues(); - void SetOptionValues(const GHS3DPlugin::string_array& options) throw (SALOME::SALOME_Exception); + void SetOptionValues(const GHS3DPlugin::string_array& options); void SetAdvancedOptionValues(const GHS3DPlugin::string_array& options); void AddOption(const char* optionName, const char* optionValue); @@ -179,30 +179,29 @@ class GHS3DPLUGIN_EXPORT GHS3DPlugin_Hypothesis_i: */ bool p_SetEnforcedVertex(CORBA::Double size, CORBA::Double x = 0, CORBA::Double y = 0, CORBA::Double z = 0, const char* theVertexName = "", const char* theVertexEntry = "", const char* theGroupName = "", - CORBA::Boolean isCompound = false) - throw (SALOME::SALOME_Exception); - bool SetEnforcedVertex(CORBA::Double x, CORBA::Double y, CORBA::Double z, CORBA::Double size) throw (SALOME::SALOME_Exception); - bool SetEnforcedVertexNamed(CORBA::Double x, CORBA::Double y, CORBA::Double z, CORBA::Double size, const char* theVertexName) throw (SALOME::SALOME_Exception); - bool SetEnforcedVertexWithGroup(CORBA::Double x, CORBA::Double y, CORBA::Double z, CORBA::Double size, const char* theGroupName) throw (SALOME::SALOME_Exception); - bool SetEnforcedVertexNamedWithGroup(CORBA::Double x, CORBA::Double y, CORBA::Double z, CORBA::Double size, const char* theVertexName, const char* theGroupName) throw (SALOME::SALOME_Exception); - bool SetEnforcedVertexGeom(GEOM::GEOM_Object_ptr theVertex, CORBA::Double size) throw (SALOME::SALOME_Exception); - bool SetEnforcedVertexGeomWithGroup(GEOM::GEOM_Object_ptr theVertex, CORBA::Double size, const char* theGroupName) throw (SALOME::SALOME_Exception); - CORBA::Double GetEnforcedVertex(CORBA::Double x, CORBA::Double y, CORBA::Double z) throw (SALOME::SALOME_Exception); - CORBA::Double GetEnforcedVertexGeom(GEOM::GEOM_Object_ptr theVertex) throw (SALOME::SALOME_Exception); - bool RemoveEnforcedVertex(CORBA::Double x, CORBA::Double y, CORBA::Double z) throw (SALOME::SALOME_Exception); - bool RemoveEnforcedVertexGeom(GEOM::GEOM_Object_ptr theVertex) throw (SALOME::SALOME_Exception); + CORBA::Boolean isCompound = false); + bool SetEnforcedVertex(CORBA::Double x, CORBA::Double y, CORBA::Double z, CORBA::Double size); + bool SetEnforcedVertexNamed(CORBA::Double x, CORBA::Double y, CORBA::Double z, CORBA::Double size, const char* theVertexName); + bool SetEnforcedVertexWithGroup(CORBA::Double x, CORBA::Double y, CORBA::Double z, CORBA::Double size, const char* theGroupName); + bool SetEnforcedVertexNamedWithGroup(CORBA::Double x, CORBA::Double y, CORBA::Double z, CORBA::Double size, const char* theVertexName, const char* theGroupName); + bool SetEnforcedVertexGeom(GEOM::GEOM_Object_ptr theVertex, CORBA::Double size); + bool SetEnforcedVertexGeomWithGroup(GEOM::GEOM_Object_ptr theVertex, CORBA::Double size, const char* theGroupName); + CORBA::Double GetEnforcedVertex(CORBA::Double x, CORBA::Double y, CORBA::Double z); + CORBA::Double GetEnforcedVertexGeom(GEOM::GEOM_Object_ptr theVertex); + bool RemoveEnforcedVertex(CORBA::Double x, CORBA::Double y, CORBA::Double z); + bool RemoveEnforcedVertexGeom(GEOM::GEOM_Object_ptr theVertex); GHS3DPlugin::GHS3DEnforcedVertexList* GetEnforcedVertices(); void ClearEnforcedVertices(); /*! * To set an enforced mesh */ - bool p_SetEnforcedMesh(SMESH::SMESH_IDSource_ptr theSource, SMESH::ElementType elementType, const char* theName="", const char* theGroupName="") throw (SALOME::SALOME_Exception); - bool SetEnforcedMesh(SMESH::SMESH_IDSource_ptr theSource, SMESH::ElementType elementType) throw (SALOME::SALOME_Exception); - bool SetEnforcedMeshWithGroup(SMESH::SMESH_IDSource_ptr theSource, SMESH::ElementType elementType, const char* theGroupName) throw (SALOME::SALOME_Exception); + bool p_SetEnforcedMesh(SMESH::SMESH_IDSource_ptr theSource, SMESH::ElementType elementType, const char* theName="", const char* theGroupName=""); + bool SetEnforcedMesh(SMESH::SMESH_IDSource_ptr theSource, SMESH::ElementType elementType); + bool SetEnforcedMeshWithGroup(SMESH::SMESH_IDSource_ptr theSource, SMESH::ElementType elementType, const char* theGroupName); /* OBSOLETE FUNCTIONS */ - bool SetEnforcedMeshSize(SMESH::SMESH_IDSource_ptr theSource, SMESH::ElementType elementType, double size) throw (SALOME::SALOME_Exception); - bool SetEnforcedMeshSizeWithGroup(SMESH::SMESH_IDSource_ptr theSource, SMESH::ElementType elementType, double size, const char* theGroupName) throw (SALOME::SALOME_Exception); + bool SetEnforcedMeshSize(SMESH::SMESH_IDSource_ptr theSource, SMESH::ElementType elementType, double /*size*/); + bool SetEnforcedMeshSizeWithGroup(SMESH::SMESH_IDSource_ptr theSource, SMESH::ElementType elementType, double /*size*/, const char* theGroupName); /* OBSOLETE FUNCTIONS */ GHS3DPlugin::GHS3DEnforcedMeshList* GetEnforcedMeshes(); diff --git a/src/GHS3DPlugin/GHS3DPlugin_Optimizer.cxx b/src/GHS3DPlugin/GHS3DPlugin_Optimizer.cxx index b261079..191c489 100644 --- a/src/GHS3DPlugin/GHS3DPlugin_Optimizer.cxx +++ b/src/GHS3DPlugin/GHS3DPlugin_Optimizer.cxx @@ -84,8 +84,8 @@ void GHS3DPlugin_Optimizer::CancelCompute() */ //================================================================================ -bool GHS3DPlugin_Optimizer::Evaluate(SMESH_Mesh& aMesh, const TopoDS_Shape& aShape, - MapShapeNbElems& aResMap) +bool GHS3DPlugin_Optimizer::Evaluate(SMESH_Mesh& /*aMesh*/, const TopoDS_Shape& /*aShape*/, + MapShapeNbElems& /*aResMap*/) { return false; } @@ -95,7 +95,7 @@ bool GHS3DPlugin_Optimizer::Evaluate(SMESH_Mesh& aMesh, const TopoDS_Shape& aSha */ //================================================================================ -bool GHS3DPlugin_Optimizer::Compute(SMESH_Mesh & aMesh, const TopoDS_Shape & aShape) +bool GHS3DPlugin_Optimizer::Compute(SMESH_Mesh & /*aMesh*/, const TopoDS_Shape & /*aShape*/) { return false; } diff --git a/src/GHS3DPlugin/GHS3DPlugin_Optimizer.hxx b/src/GHS3DPlugin/GHS3DPlugin_Optimizer.hxx index 21c09a2..cea0d57 100644 --- a/src/GHS3DPlugin/GHS3DPlugin_Optimizer.hxx +++ b/src/GHS3DPlugin/GHS3DPlugin_Optimizer.hxx @@ -44,7 +44,7 @@ public: virtual bool Compute(SMESH_Mesh& theMesh, SMESH_MesherHelper* theHelper); - virtual bool Compute(SMESH_Mesh & aMesh, + virtual bool Compute(SMESH_Mesh & aMesh, const TopoDS_Shape & aShape); static const char* Name() { return "MG-Tetra Optimization"; } diff --git a/src/GHS3DPlugin/GHS3DPlugin_OptimizerHypothesis.cxx b/src/GHS3DPlugin/GHS3DPlugin_OptimizerHypothesis.cxx index 5dc0fb4..eea711b 100644 --- a/src/GHS3DPlugin/GHS3DPlugin_OptimizerHypothesis.cxx +++ b/src/GHS3DPlugin/GHS3DPlugin_OptimizerHypothesis.cxx @@ -139,14 +139,14 @@ std::istream & GHS3DPlugin_OptimizerHypothesis::LoadFrom(std::istream & load) return load; } -bool GHS3DPlugin_OptimizerHypothesis::SetParametersByMesh(const SMESH_Mesh* theMesh, - const TopoDS_Shape& theShape) +bool GHS3DPlugin_OptimizerHypothesis::SetParametersByMesh(const SMESH_Mesh* /*theMesh*/, + const TopoDS_Shape& /*theShape*/) { return false; } -bool GHS3DPlugin_OptimizerHypothesis::SetParametersByDefaults(const TDefaults& theDflts, - const SMESH_Mesh* theMesh) +bool GHS3DPlugin_OptimizerHypothesis::SetParametersByDefaults(const TDefaults& /*theDflts*/, + const SMESH_Mesh* /*theMesh*/) { return false; } diff --git a/src/GHS3DPlugin/MG_Tetra_API.cxx b/src/GHS3DPlugin/MG_Tetra_API.cxx index 2df5cc2..4503061 100644 --- a/src/GHS3DPlugin/MG_Tetra_API.cxx +++ b/src/GHS3DPlugin/MG_Tetra_API.cxx @@ -351,7 +351,7 @@ struct MG_Tetra_API::LibData _nbRequiredTria = nb; } - void AddNode( double x, double y, double z, int domain ) + void AddNode( double x, double y, double z, int /*domain*/ ) { _xyz.push_back( x ); _xyz.push_back( y ); @@ -363,20 +363,20 @@ struct MG_Tetra_API::LibData _nodeSize.push_back( size ); } - void AddEdgeNodes( int node1, int node2, int domain ) + void AddEdgeNodes( int node1, int node2, int /*domain*/ ) { _edgeNodes.push_back( node1 ); _edgeNodes.push_back( node2 ); } - void AddTriaNodes( int node1, int node2, int node3, int domain ) + void AddTriaNodes( int node1, int node2, int node3, int /*domain*/ ) { _triaNodes.push_back( node1 ); _triaNodes.push_back( node2 ); _triaNodes.push_back( node3 ); } - void AddTetraNodes( int node1, int node2, int node3, int node4, int domain ) + void AddTetraNodes( int node1, int node2, int node3, int node4, int /*domain*/ ) { _tetraNodes.push_back( node1 ); _tetraNodes.push_back( node2 ); @@ -689,6 +689,14 @@ bool MG_Tetra_API::LibData::Compute() return true; } +#else // ifdef USE_MG_LIBS + +struct MG_Tetra_API::LibData // to avoid compiler warnings +{ + volatile bool& _cancelled_flag; + double& _progress; + LibData(volatile bool& cancelled_flag, double& progress): _cancelled_flag{cancelled_flag}, _progress{progress} {} +}; #endif // ifdef USE_MG_LIBS @@ -702,9 +710,9 @@ bool MG_Tetra_API::LibData::Compute() MG_Tetra_API::MG_Tetra_API(volatile bool& cancelled_flag, double& progress) { _useLib = false; + _libData = new LibData( cancelled_flag, progress ); #ifdef USE_MG_LIBS _useLib = true; - _libData = new LibData( cancelled_flag, progress ); _libData->Init(); if ( getenv("MG_TETRA_USE_EXE")) _useLib = false; @@ -888,7 +896,7 @@ void MG_Tetra_API::GmfGotoKwd( int iMesh, GmfKwdCod what ) */ //================================================================================ -void MG_Tetra_API::GmfGetLin( int iMesh, GmfKwdCod what, int* nbNodes, int* faceInd, int* ori, int* domain, int dummy ) +void MG_Tetra_API::GmfGetLin( int iMesh, GmfKwdCod what, int* nbNodes, int* faceInd, int* ori, int* domain, int /*dummy*/ ) { if ( _useLib ) { #ifdef USE_MG_LIBS diff --git a/src/GUI/GHS3DPluginGUI_HypothesisCreator.cxx b/src/GUI/GHS3DPluginGUI_HypothesisCreator.cxx index b322ba4..86295da 100644 --- a/src/GUI/GHS3DPluginGUI_HypothesisCreator.cxx +++ b/src/GUI/GHS3DPluginGUI_HypothesisCreator.cxx @@ -1038,7 +1038,7 @@ void GHS3DPluginGUI_HypothesisCreator::addEnforcedVertex(double x, double y, dou { myEnforcedTableWidget->disconnect(SIGNAL( itemChanged(QTableWidgetItem *))); bool okToCreate = true; - double itemX,itemY,itemZ,itemSize = 0; + double itemX=0.,itemY=0.,itemZ=0.,itemSize = 0; // todo: itemX, itemY, itemZ must be explicitly initialized to avoid warning (see below) QString itemEntry, itemGroupName = QString(""); // bool itemIsCompound; int rowCount = myEnforcedTableWidget->rowCount(); @@ -1083,7 +1083,7 @@ void GHS3DPluginGUI_HypothesisCreator::addEnforcedVertex(double x, double y, dou break; - if (( !isCompound && ((itemX == x) && (itemY == y) && (itemZ == z))) || + if (( !isCompound && ((itemX == x) && (itemY == y) && (itemZ == z))) || // todo: itemX, itemY, itemZ must be explicitly initialized to avoid warning (see above) ( !itemEntry.isEmpty() && ( itemEntry == geomEntry.c_str() ))) { // update size @@ -1365,7 +1365,7 @@ void GHS3DPluginGUI_HypothesisCreator::onRemoveEnforcedVertex() myEnforcedTableWidget->selectionModel()->clearSelection(); } -void GHS3DPluginGUI_HypothesisCreator::onToMeshHoles(bool isOn) +void GHS3DPluginGUI_HypothesisCreator::onToMeshHoles(bool /*isOn*/) { // myToMakeGroupsOfDomains->setEnabled( isOn ); // if ( !isOn ) @@ -1864,7 +1864,7 @@ bool GHS3DPluginGUI_HypothesisCreator::storeParamsToHypo( const GHS3DHypothesisD _PTR(SObject) aSObj = aStudy->FindObjectID(enfMesh->entry.c_str()); SMESH::SMESH_IDSource_var theSource = SMESH::SObjectToInterface( aSObj ); - SMESH::ElementType elementType; + SMESH::ElementType elementType = SMESH::NODE; // todo: elementType must be explicitly initialized to avoid warning (see below) switch(enfMesh->elementType) { case 0: elementType = SMESH::NODE; @@ -1879,7 +1879,7 @@ bool GHS3DPluginGUI_HypothesisCreator::storeParamsToHypo( const GHS3DHypothesisD break; } - ok = h->p_SetEnforcedMesh(theSource, elementType, enfMesh->name.c_str(), enfMesh->groupName.c_str()); + ok = h->p_SetEnforcedMesh(theSource, elementType, enfMesh->name.c_str(), enfMesh->groupName.c_str()); // todo: elementType must be explicitly initialized to avoid warning (see above) } // for } // try catch ( const SALOME::SALOME_Exception& ex ) -- 2.30.2