From: vsr Date: Fri, 23 Oct 2020 08:46:10 +0000 (+0300) Subject: fight warnings c++17, additional corrections X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=8ce6d30447558d7bf6f6838aac703289a9a85122;p=plugins%2Fghs3dplugin.git fight warnings c++17, additional corrections --- diff --git a/src/GHS3DPlugin/GHS3DPlugin_Hypothesis.cxx b/src/GHS3DPlugin/GHS3DPlugin_Hypothesis.cxx index dd0cce1..c80e30c 100644 --- a/src/GHS3DPlugin/GHS3DPlugin_Hypothesis.cxx +++ b/src/GHS3DPlugin/GHS3DPlugin_Hypothesis.cxx @@ -1997,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; } diff --git a/src/GHS3DPlugin/GHS3DPlugin_Hypothesis.hxx b/src/GHS3DPlugin/GHS3DPlugin_Hypothesis.hxx index 69b79a0..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,24 +216,24 @@ 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) ; + const std::string& optionValue); std::string GetOptionValue(const std::string& optionName, bool* isDefault=0) const; bool HasOptionDefined( const std::string& optionName ) const; @@ -270,8 +270,8 @@ 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) ; - TGHS3DEnforcedVertex* GetEnforcedVertex(const std::string anEntry) ; + 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; } diff --git a/src/GHS3DPlugin/GHS3DPlugin_Hypothesis_i.cxx b/src/GHS3DPlugin/GHS3DPlugin_Hypothesis_i.cxx index 7266e64..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) - { 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) - { 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) - { ::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) +void GHS3DPlugin_Hypothesis_i::SetWorkingDirectory(const char* path) { if (!path ) THROW_SALOME_CORBA_EXCEPTION( "Null working directory",SALOME::BAD_PARAM ); @@ -466,7 +463,6 @@ char* GHS3DPlugin_Hypothesis_i::GetAdvancedOption() //============================================================================= void GHS3DPlugin_Hypothesis_i::SetOptionValue(const char* optionName, const char* optionValue) - { ASSERT(myBaseImpl); try { @@ -528,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 ) { @@ -546,7 +542,6 @@ void GHS3DPlugin_Hypothesis_i::SetOptionValue(const char* optionName, const char //============================================================================= char* GHS3DPlugin_Hypothesis_i::GetOptionValue(const char* optionName) - { ASSERT(myBaseImpl); try { @@ -624,7 +619,6 @@ GHS3DPlugin::string_array* GHS3DPlugin_Hypothesis_i::GetAdvancedOptionValues() //============================================================================= void GHS3DPlugin_Hypothesis_i::SetOptionValues(const GHS3DPlugin::string_array& options) - { for (CORBA::ULong i = 0; i < options.length(); ++i) { @@ -685,7 +679,6 @@ void GHS3DPlugin_Hypothesis_i::SetAdvancedOptionValues(const GHS3DPlugin::string //============================================================================= void GHS3DPlugin_Hypothesis_i::SetAdvancedOption(const char* optionsAndValues) - { if ( !optionsAndValues ) return; @@ -803,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) - { +{ 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) - { +{ 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) - { +{ 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) - { +{ ASSERT(myBaseImpl); return p_SetEnforcedVertex(size, x, y, z, theVertexName, "", theGroupName); } bool GHS3DPlugin_Hypothesis_i::SetEnforcedVertexGeom(GEOM::GEOM_Object_ptr theVertex, CORBA::Double size) - { +{ ASSERT(myBaseImpl); if ((theVertex->GetShapeType() != GEOM::VERTEX) && (theVertex->GetShapeType() != GEOM::COMPOUND)) { @@ -869,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) - { +{ ASSERT(myBaseImpl); if ((theVertex->GetShapeType() != GEOM::VERTEX) && (theVertex->GetShapeType() != GEOM::COMPOUND)) { @@ -913,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) - { +{ ASSERT(myBaseImpl); bool newValue = false; @@ -981,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) - { ASSERT(myBaseImpl); try { @@ -1002,7 +994,6 @@ CORBA::Double GHS3DPlugin_Hypothesis_i::GetEnforcedVertex(CORBA::Double x, CORBA //======================================================================= CORBA::Double GHS3DPlugin_Hypothesis_i::GetEnforcedVertexGeom(GEOM::GEOM_Object_ptr theVertex) - { ASSERT(myBaseImpl); @@ -1088,7 +1079,6 @@ GHS3DPlugin::GHS3DEnforcedVertexList* GHS3DPlugin_Hypothesis_i::GetEnforcedVerti //======================================================================= bool GHS3DPlugin_Hypothesis_i::RemoveEnforcedVertex(CORBA::Double x, CORBA::Double y, CORBA::Double z) - { ASSERT(myBaseImpl); try { @@ -1105,7 +1095,6 @@ bool GHS3DPlugin_Hypothesis_i::RemoveEnforcedVertex(CORBA::Double x, CORBA::Doub } bool GHS3DPlugin_Hypothesis_i::RemoveEnforcedVertexGeom(GEOM::GEOM_Object_ptr theVertex) - { ASSERT(myBaseImpl); @@ -1202,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) - { return p_SetEnforcedMesh(theSource, theType, "", theGroupName); } @@ -1211,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) - { return p_SetEnforcedMesh(theSource, theType); } @@ -1220,7 +1207,6 @@ 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) - { return p_SetEnforcedMesh(theSource, theType, "", theGroupName); } @@ -1229,7 +1215,6 @@ 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*/) - { return p_SetEnforcedMesh(theSource, theType); } @@ -1238,7 +1223,6 @@ bool GHS3DPlugin_Hypothesis_i::p_SetEnforcedMesh(SMESH::SMESH_IDSource_ptr theSo SMESH::ElementType theType, const char* theName, const char* theGroupName) - { ASSERT(myBaseImpl); diff --git a/src/GHS3DPlugin/GHS3DPlugin_Hypothesis_i.hxx b/src/GHS3DPlugin/GHS3DPlugin_Hypothesis_i.hxx index d039b6f..cf6589c 100644 --- a/src/GHS3DPlugin/GHS3DPlugin_Hypothesis_i.hxx +++ b/src/GHS3DPlugin/GHS3DPlugin_Hypothesis_i.hxx @@ -179,29 +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) ; - 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) ; + 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="") ; - bool SetEnforcedMesh(SMESH::SMESH_IDSource_ptr theSource, SMESH::ElementType elementType) ; - bool SetEnforcedMeshWithGroup(SMESH::SMESH_IDSource_ptr theSource, SMESH::ElementType elementType, const char* theGroupName) ; + 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*/) ; - bool SetEnforcedMeshSizeWithGroup(SMESH::SMESH_IDSource_ptr theSource, SMESH::ElementType elementType, double /*size*/, const char* theGroupName) ; + 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(); @@ -223,11 +223,11 @@ class GHS3DPLUGIN_EXPORT GHS3DPlugin_Hypothesis_i: // Return geometry this hypothesis depends on. Return false if there is no geometry parameter virtual bool getObjectsDependOn( std::vector< std::string > & entryArray, - std::vector< int > & /*subIDArray*/ ) const; + std::vector< int > & subIDArray ) const; // Set new geometry instead of that returned by getObjectsDependOn() virtual bool setObjectsDependOn( std::vector< std::string > & entryArray, - std::vector< int > & /*subIDArray*/ ); + std::vector< int > & subIDArray ); }; #endif diff --git a/src/GHS3DPlugin/GHS3DPlugin_Optimizer.hxx b/src/GHS3DPlugin/GHS3DPlugin_Optimizer.hxx index fd8d21c..cea0d57 100644 --- a/src/GHS3DPlugin/GHS3DPlugin_Optimizer.hxx +++ b/src/GHS3DPlugin/GHS3DPlugin_Optimizer.hxx @@ -39,13 +39,13 @@ public: virtual void CancelCompute(); bool computeCanceled() { return _computeCanceled; } - virtual bool Evaluate(SMESH_Mesh& /*aMesh*/, const TopoDS_Shape& /*aShape*/, - MapShapeNbElems& /*aResMap*/); + virtual bool Evaluate(SMESH_Mesh& aMesh, const TopoDS_Shape& aShape, + MapShapeNbElems& aResMap); virtual bool Compute(SMESH_Mesh& theMesh, SMESH_MesherHelper* theHelper); - virtual bool Compute(SMESH_Mesh & /*aMesh*/, - const TopoDS_Shape & /*aShape*/); + 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.hxx b/src/GHS3DPlugin/GHS3DPlugin_OptimizerHypothesis.hxx index 12f7dfc..d981c09 100644 --- a/src/GHS3DPlugin/GHS3DPlugin_OptimizerHypothesis.hxx +++ b/src/GHS3DPlugin/GHS3DPlugin_OptimizerHypothesis.hxx @@ -68,8 +68,8 @@ public: /*! * \brief Does nothing */ - virtual bool SetParametersByMesh(const SMESH_Mesh* /*theMesh*/, const TopoDS_Shape& /*theShape*/); - virtual bool SetParametersByDefaults(const TDefaults& /*dflts*/, const SMESH_Mesh* /*theMesh=0*/); + virtual bool SetParametersByMesh(const SMESH_Mesh* theMesh, const TopoDS_Shape& theShape); + virtual bool SetParametersByDefaults(const TDefaults& dflts, const SMESH_Mesh* theMesh=0); static std::string CommandToRun(const GHS3DPlugin_OptimizerHypothesis* hyp); diff --git a/src/GHS3DPlugin/MG_Tetra_API.cxx b/src/GHS3DPlugin/MG_Tetra_API.cxx index 3e39d27..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 ); @@ -563,10 +563,10 @@ namespace // functions called by MG library to exchange with the application // progress message (10%): "MGMESSAGE 1009001 0 1 1.000000e+01" data->_progress = atof( desc + 24 ); - _progressInCallBack = true; + data->_progressInCallBack = true; } - if ( !_progressInCallBack ) + if ( !data->_progressInCallBack ) { // Compute progress // corresponding messages are: @@ -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; diff --git a/src/GHS3DPlugin/MG_Tetra_API.hxx b/src/GHS3DPlugin/MG_Tetra_API.hxx index 858d9a1..a1dc4ac 100644 --- a/src/GHS3DPlugin/MG_Tetra_API.hxx +++ b/src/GHS3DPlugin/MG_Tetra_API.hxx @@ -59,7 +59,7 @@ public: int GmfOpenMesh(const char* theFile, int rdOrWr, int * ver, int * dim); int GmfStatKwd( int iMesh, GmfKwdCod what ); void GmfGotoKwd( int iMesh, GmfKwdCod what ); - void GmfGetLin( int iMesh, GmfKwdCod what, int* nbNodes, int* faceInd, int* ori, int* domain, int /*dummy*/ ); + void GmfGetLin( int iMesh, GmfKwdCod what, int* nbNodes, int* faceInd, int* ori, int* domain, int dummy ); void GmfGetLin(int iMesh, GmfKwdCod what, float* x, float* y, float *z, int* domain ); void GmfGetLin(int iMesh, GmfKwdCod what, double* x, double* y, double *z, int* domain ); void GmfGetLin(int iMesh, GmfKwdCod what, int* node ); diff --git a/src/GUI/GHS3DPluginGUI_HypothesisCreator.cxx b/src/GUI/GHS3DPluginGUI_HypothesisCreator.cxx index 23dc087..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 @@ -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 )