From 30000a08ed340bbf83708102954f58fea79c6d93 Mon Sep 17 00:00:00 2001 From: vsr Date: Thu, 22 Oct 2020 17:46:47 +0300 Subject: [PATCH] fight warnings c++17, additional corrections --- src/BLSURFPlugin/BLSURFPlugin_BLSURF.cxx | 16 ++- src/BLSURFPlugin/BLSURFPlugin_Hypothesis.cxx | 64 +++++------ src/BLSURFPlugin/BLSURFPlugin_Hypothesis.hxx | 38 +++---- .../BLSURFPlugin_Hypothesis_i.cxx | 107 +++++++----------- .../BLSURFPlugin_Hypothesis_i.hxx | 97 ++++++---------- src/GUI/BLSURFPluginGUI_HypothesisCreator.cxx | 12 +- src/GUI/BLSURFPluginGUI_HypothesisCreator.h | 2 +- 7 files changed, 146 insertions(+), 190 deletions(-) diff --git a/src/BLSURFPlugin/BLSURFPlugin_BLSURF.cxx b/src/BLSURFPlugin/BLSURFPlugin_BLSURF.cxx index 8f496d1..3e530fa 100644 --- a/src/BLSURFPlugin/BLSURFPlugin_BLSURF.cxx +++ b/src/BLSURFPlugin/BLSURFPlugin_BLSURF.cxx @@ -133,13 +133,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 = { @@ -187,6 +187,14 @@ namespace 0, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ + 0, /*tp_bases*/ + 0, /*tp_mro*/ + 0, /*tp_cache*/ + 0, /*tp_subclasses*/ + 0, /*tp_weaklist*/ + 0, /*tp_del*/ + 0, /*tp_version_tag*/ + 0, /*tp_finalize*/ }; PyObject * newPyStdOut( std::string& out ) @@ -612,7 +620,7 @@ void BLSURFPlugin_BLSURF::createEnforcedVertexOnFace(TopoDS_Shape faceShape, BLS ///////////////////////////////////////////////////////// void createAttractorOnFace(TopoDS_Shape GeomShape, std::string AttractorFunction, double defaultSize) { - double xa, ya, za; // Coordinates of attractor point + double xa=0., ya=0., za=0.; // Coordinates of attractor point // todo: xa, ya, za must be explicitly initialized to avoid warning (see below) double a, b; // Attractor parameter double d = 0.; bool createNode=false; // To create a node on attractor projection @@ -669,7 +677,7 @@ void createAttractorOnFace(TopoDS_Shape GeomShape, std::string AttractorFunction } // Get the (u,v) values of the attractor on the face - projectionPoint myPoint = getProjectionPoint(TopoDS::Face(GeomShape),gp_Pnt(xa,ya,za)); + projectionPoint myPoint = getProjectionPoint(TopoDS::Face(GeomShape),gp_Pnt(xa,ya,za)); // todo: xa, ya, za must be explicitly initialized to avoid warning (see above) gp_XY uvPoint = myPoint.uv; gp_XYZ xyzPoint = myPoint.xyz; Standard_Real u0 = uvPoint.X(); diff --git a/src/BLSURFPlugin/BLSURFPlugin_Hypothesis.cxx b/src/BLSURFPlugin/BLSURFPlugin_Hypothesis.cxx index 5e6e531..7553c40 100644 --- a/src/BLSURFPlugin/BLSURFPlugin_Hypothesis.cxx +++ b/src/BLSURFPlugin/BLSURFPlugin_Hypothesis.cxx @@ -577,6 +577,8 @@ void BLSURFPlugin_Hypothesis::SetEnforceCadEdgesSize( bool toEnforce ) SetOptionValue( "enforce_cad_edge_sizes", toEnforce ? "yes" : "no" ); NotifySubMeshesHypothesisModification(); } +#else + (void)toEnforce; // maybe unused #endif } //============================================================================= @@ -637,7 +639,6 @@ bool BLSURFPlugin_Hypothesis::GetUseDeprecatedPatchMesher() //============================================================================= void BLSURFPlugin_Hypothesis::SetMaxNumberOfPointsPerPatch( int nb ) - { #if MESHGEMS_VERSION_HEX < 0x020A00 // Deprecated since MeshGems 2.10 @@ -649,6 +650,8 @@ void BLSURFPlugin_Hypothesis::SetMaxNumberOfPointsPerPatch( int nb ) SetOptionValue("max_number_of_points_per_patch", SMESH_Comment( nb )); NotifySubMeshesHypothesisModification(); } +#else + (void)nb; // maybe unused #endif } //============================================================================= @@ -664,7 +667,6 @@ int BLSURFPlugin_Hypothesis::GetMaxNumberOfPointsPerPatch() //============================================================================= void BLSURFPlugin_Hypothesis::SetMaxNumberOfThreads( int nb ) - { if ( nb < 0 ) throw std::invalid_argument( SMESH_Comment("Invalid number of threads: ") << nb ); @@ -743,7 +745,6 @@ bool BLSURFPlugin_Hypothesis::GetDebug() //============================================================================= void BLSURFPlugin_Hypothesis::SetPeriodicTolerance( CORBA::Double tol ) - { if ( tol <= 0 ) throw std::invalid_argument( SMESH_Comment("Invalid tolerance: ") << tol ); @@ -761,7 +762,6 @@ double BLSURFPlugin_Hypothesis::GetPeriodicTolerance() //============================================================================= void BLSURFPlugin_Hypothesis::SetRequiredEntities( const std::string& howToTreat ) - { if ( howToTreat != "respect" && howToTreat != "ignore" && howToTreat != "clear" ) throw std::invalid_argument @@ -781,7 +781,6 @@ std::string BLSURFPlugin_Hypothesis::GetRequiredEntities() //============================================================================= void BLSURFPlugin_Hypothesis::SetSewingTolerance( CORBA::Double tol ) - { if ( tol <= 0 ) throw std::invalid_argument( SMESH_Comment("Invalid tolerance: ") << tol ); @@ -799,7 +798,6 @@ CORBA::Double BLSURFPlugin_Hypothesis::GetSewingTolerance() //============================================================================= void BLSURFPlugin_Hypothesis::SetTags( const std::string& howToTreat ) - { if ( howToTreat != "respect" && howToTreat != "ignore" && howToTreat != "clear" ) throw std::invalid_argument @@ -964,8 +962,7 @@ void BLSURFPlugin_Hypothesis::SetGMFFile(const std::string& theFileName) //============================================================================= void BLSURFPlugin_Hypothesis::SetOptionValue(const std::string& optionName, const std::string& optionValue) - { - +{ TOptionValues::iterator op_val = _option2value.find(optionName); if (op_val == _option2value.end()) { @@ -1021,8 +1018,7 @@ void BLSURFPlugin_Hypothesis::SetOptionValue(const std::string& optionName, cons //============================================================================= void BLSURFPlugin_Hypothesis::SetPreCADOptionValue(const std::string& optionName, const std::string& optionValue) - { - +{ TOptionValues::iterator op_val = _preCADoption2value.find(optionName); if (op_val == _preCADoption2value.end()) { op_val = _option2value.find(optionName); @@ -1081,7 +1077,6 @@ void BLSURFPlugin_Hypothesis::SetPreCADOptionValue(const std::string& optionName //============================================================================= std::string BLSURFPlugin_Hypothesis::GetOptionValue(const std::string& optionName, bool* isDefault) const - { TOptionValues::const_iterator op_val = _option2value.find(optionName); if (op_val == _option2value.end()) @@ -1112,7 +1107,6 @@ std::string BLSURFPlugin_Hypothesis::GetOptionValue(const std::string& optionNam //============================================================================= std::string BLSURFPlugin_Hypothesis::GetPreCADOptionValue(const std::string& optionName, bool* isDefault) const - { TOptionValues::const_iterator op_val = _preCADoption2value.find(optionName); if (op_val == _preCADoption2value.end()) @@ -1573,8 +1567,7 @@ void BLSURFPlugin_Hypothesis::AddEnforcedVertex( const TEntry& faceEntry, //======================================================================= BLSURFPlugin_Hypothesis::TEnfVertexList BLSURFPlugin_Hypothesis::GetEnfVertexList(const TEntry& theFaceEntry) - { - +{ if (_faceEntryEnfVertexListMap.count(theFaceEntry) > 0) return _faceEntryEnfVertexListMap[theFaceEntry]; else @@ -1589,9 +1582,8 @@ BLSURFPlugin_Hypothesis::TEnfVertexList BLSURFPlugin_Hypothesis::GetEnfVertexLis //function : GetEnfVertexCoordsList //======================================================================= -BLSURFPlugin_Hypothesis::TEnfVertexCoordsList BLSURFPlugin_Hypothesis::GetEnfVertexCoordsList( - const TEntry& theFaceEntry) { - +BLSURFPlugin_Hypothesis::TEnfVertexCoordsList BLSURFPlugin_Hypothesis::GetEnfVertexCoordsList(const TEntry& theFaceEntry) +{ if (_faceEntryCoordsListMap.count(theFaceEntry) > 0) return _faceEntryCoordsListMap[theFaceEntry]; @@ -1605,8 +1597,7 @@ BLSURFPlugin_Hypothesis::TEnfVertexCoordsList BLSURFPlugin_Hypothesis::GetEnfVer //======================================================================= BLSURFPlugin_Hypothesis::TEntryList BLSURFPlugin_Hypothesis::GetEnfVertexEntryList(const TEntry& theFaceEntry) - { - +{ if (_faceEntryEnfVertexEntryListMap.count(theFaceEntry) > 0) return _faceEntryEnfVertexEntryListMap[theFaceEntry]; @@ -1620,8 +1611,7 @@ BLSURFPlugin_Hypothesis::TEntryList BLSURFPlugin_Hypothesis::GetEnfVertexEntryLi //======================================================================= BLSURFPlugin_Hypothesis::TEnfVertex* BLSURFPlugin_Hypothesis::GetEnfVertex(TEnfVertexCoords coords) - { - +{ if (_coordsEnfVertexMap.count(coords) > 0) return _coordsEnfVertexMap[coords]; @@ -1635,8 +1625,7 @@ BLSURFPlugin_Hypothesis::TEnfVertex* BLSURFPlugin_Hypothesis::GetEnfVertex(TEnfV //======================================================================= BLSURFPlugin_Hypothesis::TEnfVertex* BLSURFPlugin_Hypothesis::GetEnfVertex(const TEntry& theEnfVertexEntry) - { - +{ if (_enfVertexEntryEnfVertexMap.count(theEnfVertexEntry) > 0) return _enfVertexEntryEnfVertexMap[theEnfVertexEntry]; @@ -1662,8 +1651,8 @@ BLSURFPlugin_Hypothesis::TEnfVertex* BLSURFPlugin_Hypothesis::GetEnfVertex(const //======================================================================= bool BLSURFPlugin_Hypothesis::ClearEnforcedVertex(const TEntry& theFaceEntry, double x, double y, double z, - const TEntry& theVertexEntry) { - + const TEntry& theVertexEntry) +{ bool toNotify = false; std::ostringstream msg; TEnfVertex *oldEnfVertex; @@ -1748,8 +1737,8 @@ bool BLSURFPlugin_Hypothesis::ClearEnforcedVertex(const TEntry& theFaceEntry, do //function : ClearEnforcedVertices //======================================================================= -bool BLSURFPlugin_Hypothesis::ClearEnforcedVertices(const TEntry& theFaceEntry) { - +bool BLSURFPlugin_Hypothesis::ClearEnforcedVertices(const TEntry& theFaceEntry) +{ bool toNotify = false; TEnfVertex *oldEnfVertex; @@ -1883,7 +1872,7 @@ BLSURFPlugin_Hypothesis::TEnfVertexEntryEnfVertexMap BLSURFPlugin_Hypothesis::Ge return hyp ? hyp->_GetAllEnforcedVerticesByEnfVertexEntry() : GetDefaultEnfVertexEntryEnfVertexMap(); } -std::set BLSURFPlugin_Hypothesis::GetEnfVertexNodeIDs(TEnfGroupName theGroupName) +std::set BLSURFPlugin_Hypothesis::GetEnfVertexNodeIDs(TEnfGroupName theGroupName) { TGroupNameNodeIDMap::const_iterator it = _groupNameNodeIDMap.find(theGroupName); if (it != _groupNameNodeIDMap.end()) { @@ -1899,7 +1888,7 @@ void BLSURFPlugin_Hypothesis::AddEnfVertexNodeID(TEnfGroupName theGroupName,int _groupNameNodeIDMap[theGroupName].insert(theNodeID); } -void BLSURFPlugin_Hypothesis::RemoveEnfVertexNodeID(TEnfGroupName theGroupName,int theNodeID) +void BLSURFPlugin_Hypothesis::RemoveEnfVertexNodeID(TEnfGroupName theGroupName,int theNodeID) { TGroupNameNodeIDMap::iterator it = _groupNameNodeIDMap.find(theGroupName); if (it != _groupNameNodeIDMap.end()) { @@ -2487,13 +2476,13 @@ std::istream & BLSURFPlugin_Hypothesis::LoadFrom(std::istream & load) bool hasVerticesPeriodicity = false; isOK = static_cast(load >> option_or_sm); - if (isOK) + if (isOK) { if ( (option_or_sm == "1")||(option_or_sm == "0") ) { i = atoi(option_or_sm.c_str()); hasCADSurfOptions = true; _phySizeRel = (bool) i; } - if (option_or_sm == "__OPTIONS_BEGIN__") + else if (option_or_sm == "__OPTIONS_BEGIN__") hasOptions = true; else if (option_or_sm == "__CUSTOM_OPTIONS_BEGIN__") hasCustomOptions = true; @@ -2517,6 +2506,7 @@ std::istream & BLSURFPlugin_Hypothesis::LoadFrom(std::istream & load) hasEdgesPeriodicity = true; else if (option_or_sm == "__VERTICES_PERIODICITY_BEGIN__") hasVerticesPeriodicity = true; + } if (isOK && hasCADSurfOptions) { isOK = static_cast(load >> i); @@ -2869,10 +2859,10 @@ std::istream & BLSURFPlugin_Hypothesis::LoadFrom(std::istream & load) if (hasSizeMap) { isOK = static_cast(load >> option_or_sm); - if (isOK) + if (isOK) { if (option_or_sm == "__ATTRACTORS_BEGIN__") hasAttractor = true; - if (option_or_sm == "__NEW_ATTRACTORS_BEGIN__") + else if (option_or_sm == "__NEW_ATTRACTORS_BEGIN__") hasNewAttractor = true; else if (option_or_sm == "__ENFORCED_VERTICES_BEGIN__") hasEnforcedVertex = true; @@ -2886,6 +2876,7 @@ std::istream & BLSURFPlugin_Hypothesis::LoadFrom(std::istream & load) hasEdgesPeriodicity = true; else if (option_or_sm == "__VERTICES_PERIODICITY_BEGIN__") hasVerticesPeriodicity = true; + } } std::string atEntry, atValue; @@ -3215,7 +3206,7 @@ std::istream & BLSURFPlugin_Hypothesis::LoadFrom(std::istream & load) } // New options in 2.9.6 (issue #17784) - if ( static_cast( load >> _useSurfaceProximity )); + if ( static_cast( load >> _useSurfaceProximity )) { load >> _nbSurfaceProximityLayers; load >> _surfaceProximityRatio; @@ -3608,7 +3599,7 @@ double BLSURFPlugin_Hypothesis::GetDefaultTinyEdgeOptimisationLength(double diag //============================================================================= bool BLSURFPlugin_Hypothesis::SetParametersByDefaults(const TDefaults& dflts, - const SMESH_Mesh* theMesh) + const SMESH_Mesh* /*theMesh*/) { _phySize = GetDefaultPhySize(dflts._diagonal, _gen->GetBoundaryBoxSegmentation()); _minSize = GetDefaultMinSize(dflts._diagonal); @@ -3641,7 +3632,6 @@ bool BLSURFPlugin_Hypothesis::SetParametersByDefaults(const TDefaults& dflts, //================================================================================ bool BLSURFPlugin_Hypothesis::ToBool(const std::string& str, bool* isOk ) - { std::string s = str; if ( isOk ) *isOk = true; @@ -3671,7 +3661,6 @@ bool BLSURFPlugin_Hypothesis::ToBool(const std::string& str, bool* isOk ) //================================================================================ double BLSURFPlugin_Hypothesis::ToDbl(const std::string& str, bool* isOk ) - { if ( str.empty() ) throw std::invalid_argument("Empty value provided"); @@ -3696,7 +3685,6 @@ double BLSURFPlugin_Hypothesis::ToDbl(const std::string& str, bool* isOk ) //================================================================================ int BLSURFPlugin_Hypothesis::ToInt(const std::string& str, bool* isOk ) - { if ( str.empty() ) throw std::invalid_argument("Empty value provided"); diff --git a/src/BLSURFPlugin/BLSURFPlugin_Hypothesis.hxx b/src/BLSURFPlugin/BLSURFPlugin_Hypothesis.hxx index 565d367..0bc6061 100644 --- a/src/BLSURFPlugin/BLSURFPlugin_Hypothesis.hxx +++ b/src/BLSURFPlugin/BLSURFPlugin_Hypothesis.hxx @@ -183,7 +183,7 @@ public: void SetJacobianRectificationRespectGeometry( bool allowRectification ); bool GetJacobianRectificationRespectGeometry(); - void SetUseDeprecatedPatchMesher( bool /*useDeprecatedPatchMesher*/ ); + void SetUseDeprecatedPatchMesher( bool useDeprecatedPatchMesher ); bool GetUseDeprecatedPatchMesher(); void SetJacobianRectification( bool allowRectification ); @@ -380,17 +380,17 @@ public: bool SetEnforcedVertex(TEntry theFaceEntry, TEnfName theVertexName, TEntry theVertexEntry, TEnfGroupName theGroupName, double x = 0.0, double y = 0.0, double z = 0.0); - TEnfVertexList GetEnfVertexList(const TEntry& theFaceEntry) ; - TEnfVertexCoordsList GetEnfVertexCoordsList(const TEntry& theFaceEntry) ; - TEntryList GetEnfVertexEntryList (const TEntry& theFaceEntry) ; - TEnfVertex* GetEnfVertex(TEnfVertexCoords coords) ; - TEnfVertex* GetEnfVertex(const TEntry& theEnfVertexEntry) ; + TEnfVertexList GetEnfVertexList(const TEntry& theFaceEntry); + TEnfVertexCoordsList GetEnfVertexCoordsList(const TEntry& theFaceEntry); + TEntryList GetEnfVertexEntryList (const TEntry& theFaceEntry); + TEnfVertex* GetEnfVertex(TEnfVertexCoords coords); + TEnfVertex* GetEnfVertex(const TEntry& theEnfVertexEntry); void AddEnfVertexNodeID(TEnfGroupName theGroupName,int theNodeID); - std::set GetEnfVertexNodeIDs(TEnfGroupName theGroupName) ; - void RemoveEnfVertexNodeID(TEnfGroupName theGroupName,int theNodeID) ; + std::set GetEnfVertexNodeIDs(TEnfGroupName theGroupName); + void RemoveEnfVertexNodeID(TEnfGroupName theGroupName,int theNodeID); - bool ClearEnforcedVertex(const TEntry& theFaceEntry, double x = 0.0, double y = 0.0, double z = 0.0, const TEntry& theVertexEntry="") ; - bool ClearEnforcedVertices(const TEntry& theFaceEntry) ; + bool ClearEnforcedVertex(const TEntry& theFaceEntry, double x = 0.0, double y = 0.0, double z = 0.0, const TEntry& theVertexEntry=""); + bool ClearEnforcedVertices(const TEntry& theFaceEntry); void ClearAllEnforcedVertices(); void AddEnforcedVertex( const TEntry& theFaceEntry, TEnfVertex * theEnfVertex ); @@ -424,7 +424,7 @@ public: * \brief Internal enforced vertices */ void SetInternalEnforcedVertexAllFaces(bool toEnforceInternalVertices); - const bool _GetInternalEnforcedVertexAllFaces() const { return _enforcedInternalVerticesAllFaces; } + bool _GetInternalEnforcedVertexAllFaces() const { return _enforcedInternalVerticesAllFaces; } static bool GetInternalEnforcedVertexAllFaces( const BLSURFPlugin_Hypothesis* hyp ); void SetInternalEnforcedVertexAllFacesGroup(TEnfGroupName theGroupName); const TEnfGroupName _GetInternalEnforcedVertexAllFacesGroup() const { return _enforcedInternalVerticesAllFacesGroup; } @@ -539,11 +539,11 @@ public: typedef std::set< std::string > TOptionNames; void SetOptionValue(const std::string& optionName, - const std::string& optionValue) ; + const std::string& optionValue); void SetPreCADOptionValue(const std::string& optionName, - const std::string& optionValue) ; - std::string GetOptionValue(const std::string& optionName, bool* isDefault=0) const ; - std::string GetPreCADOptionValue(const std::string& optionName, bool* isDefault=0) const ; + const std::string& optionValue); + std::string GetOptionValue(const std::string& optionName, bool* isDefault=0) const; + std::string GetPreCADOptionValue(const std::string& optionName, bool* isDefault=0) const; void ClearOption(const std::string& optionName); void ClearPreCADOption(const std::string& optionName); TOptionValues GetOptionValues() const; @@ -555,9 +555,9 @@ public: std::string GetOption(const std::string& optionName) const; std::string GetPreCADOption(const std::string& optionName) const; - 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) ; + 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); /*! * Sets the file for export resulting mesh in GMF format @@ -580,7 +580,7 @@ public: * \param theShape - the geometry of interest * \retval bool - always false */ - virtual bool SetParametersByMesh(const SMESH_Mesh* /*theMesh*/, const TopoDS_Shape& /*theShape*/); + virtual bool SetParametersByMesh(const SMESH_Mesh* theMesh, const TopoDS_Shape& theShape); /*! * \brief Initialize my parameter values by default parameters. diff --git a/src/BLSURFPlugin/BLSURFPlugin_Hypothesis_i.cxx b/src/BLSURFPlugin/BLSURFPlugin_Hypothesis_i.cxx index e629db3..557a882 100644 --- a/src/BLSURFPlugin/BLSURFPlugin_Hypothesis_i.cxx +++ b/src/BLSURFPlugin/BLSURFPlugin_Hypothesis_i.cxx @@ -905,7 +905,7 @@ CORBA::Double BLSURFPlugin_Hypothesis_i::GetVolumeProximityRatio() } //============================================================================= -void BLSURFPlugin_Hypothesis_i::SetVerbosity(CORBA::Short theVal) { +void BLSURFPlugin_Hypothesis_i::SetVerbosity(CORBA::Short theVal) { ASSERT(myBaseImpl); if (theVal < 0 || theVal > 100) THROW_SALOME_CORBA_EXCEPTION( "Invalid verbosity level",SALOME::BAD_PARAM ); @@ -981,7 +981,7 @@ CORBA::Boolean BLSURFPlugin_Hypothesis_i::GetUseDeprecatedPatchMesher() } //============================================================================= -void BLSURFPlugin_Hypothesis_i::SetMaxNumberOfPointsPerPatch( CORBA::Long nb ) +void BLSURFPlugin_Hypothesis_i::SetMaxNumberOfPointsPerPatch( CORBA::Long nb ) { if ( GetMaxNumberOfPointsPerPatch() != nb ) { @@ -1003,7 +1003,7 @@ CORBA::Long BLSURFPlugin_Hypothesis_i::GetMaxNumberOfPointsPerPatch() } //============================================================================= -void BLSURFPlugin_Hypothesis_i::SetMaxNumberOfThreads( CORBA::Long nb ) +void BLSURFPlugin_Hypothesis_i::SetMaxNumberOfThreads( CORBA::Long nb ) { if ( GetMaxNumberOfThreads() != nb ) { @@ -1085,7 +1085,7 @@ bool BLSURFPlugin_Hypothesis_i::GetDebug() } //============================================================================= -void BLSURFPlugin_Hypothesis_i::SetPeriodicTolerance( CORBA::Double tol ) +void BLSURFPlugin_Hypothesis_i::SetPeriodicTolerance( CORBA::Double tol ) { bool isDefault; if ( GetImpl()->GetPreCADOptionValue("periodic_tolerance",&isDefault) != SMESH_Comment( tol )) @@ -1103,7 +1103,7 @@ void BLSURFPlugin_Hypothesis_i::SetPeriodicTolerance( CORBA::Double tol ) } } //============================================================================= -double BLSURFPlugin_Hypothesis_i::GetPeriodicTolerance() +double BLSURFPlugin_Hypothesis_i::GetPeriodicTolerance() { try{ return this->GetImpl()->GetPeriodicTolerance(); @@ -1117,7 +1117,7 @@ double BLSURFPlugin_Hypothesis_i::GetPeriodicTolerance() } //============================================================================= -void BLSURFPlugin_Hypothesis_i::SetRequiredEntities( const char* howToTreat ) +void BLSURFPlugin_Hypothesis_i::SetRequiredEntities( const char* howToTreat ) { if ( GetImpl()->GetRequiredEntities() != howToTreat ) { @@ -1139,7 +1139,7 @@ char* BLSURFPlugin_Hypothesis_i::GetRequiredEntities() } //============================================================================= -void BLSURFPlugin_Hypothesis_i::SetSewingTolerance( CORBA::Double tol ) +void BLSURFPlugin_Hypothesis_i::SetSewingTolerance( CORBA::Double tol ) { bool isDefault; if ( GetImpl()->GetPreCADOptionValue("sewing_tolerance",&isDefault) != SMESH_Comment( tol )) @@ -1157,7 +1157,7 @@ void BLSURFPlugin_Hypothesis_i::SetSewingTolerance( CORBA::Double tol ) } } //============================================================================= -CORBA::Double BLSURFPlugin_Hypothesis_i::GetSewingTolerance() +CORBA::Double BLSURFPlugin_Hypothesis_i::GetSewingTolerance() { try { @@ -1172,7 +1172,7 @@ CORBA::Double BLSURFPlugin_Hypothesis_i::GetSewingTolerance() } //============================================================================= -void BLSURFPlugin_Hypothesis_i::SetTags( const char* howToTreat ) +void BLSURFPlugin_Hypothesis_i::SetTags( const char* howToTreat ) { if ( GetImpl()->GetTags() != howToTreat ) { @@ -1346,7 +1346,7 @@ CORBA::Boolean BLSURFPlugin_Hypothesis_i::GetPreCADDiscardInput() { //============================================================================= void BLSURFPlugin_Hypothesis_i::SetOptionValue(const char* optionName, const char* optionValue) - { +{ ASSERT(myBaseImpl); try { std::string name( optionName ); @@ -1458,7 +1458,7 @@ void BLSURFPlugin_Hypothesis_i::SetOptionValue(const char* optionName, const cha //============================================================================= void BLSURFPlugin_Hypothesis_i::SetPreCADOptionValue(const char* optionName, const char* optionValue) - { +{ ASSERT(myBaseImpl); bool valueChanged = false; try { @@ -1537,7 +1537,7 @@ void BLSURFPlugin_Hypothesis_i::SetPreCADOptionValue(const char* optionName, con //============================================================================= -char* BLSURFPlugin_Hypothesis_i::GetOptionValue(const char* optionName) { +char* BLSURFPlugin_Hypothesis_i::GetOptionValue(const char* optionName) { ASSERT(myBaseImpl); try { bool isDefault; @@ -1552,7 +1552,7 @@ char* BLSURFPlugin_Hypothesis_i::GetOptionValue(const char* optionName) { //============================================================================= -char* BLSURFPlugin_Hypothesis_i::GetPreCADOptionValue(const char* optionName) { +char* BLSURFPlugin_Hypothesis_i::GetPreCADOptionValue(const char* optionName) { ASSERT(myBaseImpl); try { bool isDefault; @@ -1662,7 +1662,7 @@ BLSURFPlugin::string_array* BLSURFPlugin_Hypothesis_i::GetAdvancedOptionValues() //============================================================================= void BLSURFPlugin_Hypothesis_i::SetOptionValues(const BLSURFPlugin::string_array& options) - { +{ ASSERT(myBaseImpl); for (CORBA::ULong i = 0; i < options.length(); ++i) { string name_value_type = options[i].in(); @@ -1690,7 +1690,7 @@ void BLSURFPlugin_Hypothesis_i::SetOptionValues(const BLSURFPlugin::string_array //============================================================================= void BLSURFPlugin_Hypothesis_i::SetPreCADOptionValues(const BLSURFPlugin::string_array& options) - { +{ ASSERT(myBaseImpl); for ( CORBA::ULong i = 0; i < options.length(); ++i) { string name_value_type = options[i].in(); @@ -1750,7 +1750,6 @@ void BLSURFPlugin_Hypothesis_i::SetAdvancedOptionValues(const BLSURFPlugin::stri //============================================================================= void BLSURFPlugin_Hypothesis_i::SetAdvancedOption(const char* optionsAndValues) - { if ( !optionsAndValues ) return; @@ -1829,7 +1828,7 @@ char* BLSURFPlugin_Hypothesis_i::GetPreCADOption(const char* optionName) //============================================================================= void BLSURFPlugin_Hypothesis_i::SetSizeMapEntry(const char* entry, const char* sizeMap) - { +{ ASSERT(myBaseImpl); if ( !entry || !entry[0] ) THROW_SALOME_CORBA_EXCEPTION( "SetSizeMapEntry(): empty geom entry", SALOME::BAD_PARAM ); @@ -1855,7 +1854,7 @@ void BLSURFPlugin_Hypothesis_i::SetSizeMapEntry(const char* entry, const char* s //============================================================================= void BLSURFPlugin_Hypothesis_i::SetConstantSizeMapEntry(const char* entry, GEOM::shape_type shapeType, CORBA::Double sizeMap) - { +{ ASSERT(myBaseImpl); bool valueChanged = false; std::ostringstream sizeMapFunction; @@ -1886,7 +1885,7 @@ void BLSURFPlugin_Hypothesis_i::SetConstantSizeMapEntry(const char* entry, GEOM: //============================================================================= void BLSURFPlugin_Hypothesis_i::SetAttractorEntry(const char* entry, const char* attractor) - { +{ ASSERT(myBaseImpl); bool valueChanged = false; try { @@ -1914,7 +1913,6 @@ void BLSURFPlugin_Hypothesis_i::SetAttractorEntry(const char* entry, const char* //============================================================================= void BLSURFPlugin_Hypothesis_i::SetClassAttractorEntry(const char* entry, const char* att_entry, CORBA::Double StartSize, CORBA::Double EndSize, CORBA::Double ActionRadius, CORBA::Double ConstantRadius) //TODO ?? finir - { ASSERT(myBaseImpl); //bool valueChanged = false; @@ -1938,7 +1936,7 @@ void BLSURFPlugin_Hypothesis_i::SetClassAttractorEntry(const char* entry, const //============================================================================= -char* BLSURFPlugin_Hypothesis_i::GetSizeMapEntry(const char* entry) { +char* BLSURFPlugin_Hypothesis_i::GetSizeMapEntry(const char* entry) { ASSERT(myBaseImpl); try { return CORBA::string_dup(this->GetImpl()->GetSizeMapEntry(entry).c_str()); @@ -1957,7 +1955,7 @@ char* BLSURFPlugin_Hypothesis_i::GetSizeMapEntry(const char* entry) { //============================================================================= -char* BLSURFPlugin_Hypothesis_i::GetAttractorEntry(const char* entry) { +char* BLSURFPlugin_Hypothesis_i::GetAttractorEntry(const char* entry) { ASSERT(myBaseImpl); try { return CORBA::string_dup(this->GetImpl()->GetAttractorEntry(entry).c_str()); @@ -1979,7 +1977,7 @@ char* BLSURFPlugin_Hypothesis_i::GetAttractorEntry(const char* entry) { // // TODO coder cette fonction (utilis??e pour savoir si la valeur a chang?? // // A finir pour le dump // char* BLSURFPlugin_Hypothesis_i::GetClassAttractorEntry(const char* entry) -// +// // { // ASSERT(myBaseImpl); // try { @@ -2063,7 +2061,7 @@ BLSURFPlugin::TAttParamsMap* BLSURFPlugin_Hypothesis_i::GetAttractorParams() for ( int i = 0 ; atIt != attractors.end(); ++atIt, ++i ) { string faceEntry = atIt->first; string attEntry; - double startSize, endSize, infDist, constDist; + double startSize=0., endSize=0., infDist=0., constDist=0.; // todo: startSize, endSize, infDist, constDist must be explicitly initialized to avoid warning (see below) if ( !atIt->second->Empty() ) { attEntry = atIt->second->GetAttractorEntry(); std::vector params = atIt->second->GetParameters(); @@ -2077,7 +2075,7 @@ BLSURFPlugin::TAttParamsMap* BLSURFPlugin_Hypothesis_i::GetAttractorParams() result[i].startSize = startSize; result[i].endSize = endSize; result[i].infDist = infDist; - result[i].constDist = constDist; + result[i].constDist = constDist; // todo: startSize, endSize, infDist, constDist must be explicitly initialized to avoid warning (see above) } return result._retn(); } @@ -2085,7 +2083,7 @@ BLSURFPlugin::TAttParamsMap* BLSURFPlugin_Hypothesis_i::GetAttractorParams() //============================================================================= void BLSURFPlugin_Hypothesis_i::SetSizeMapEntries(const BLSURFPlugin::string_array& sizeMaps) - { +{ ASSERT(myBaseImpl); for ( CORBA::ULong i = 0; i < sizeMaps.length(); ++i) { string entry_sizemap = sizeMaps[i].in(); @@ -2112,7 +2110,6 @@ void BLSURFPlugin_Hypothesis_i::ClearSizeMaps() { //============================================================================= void BLSURFPlugin_Hypothesis_i::SetSizeMap(const GEOM::GEOM_Object_ptr GeomObj, const char* sizeMap) - { ASSERT(myBaseImpl); string entry; @@ -2240,10 +2237,10 @@ void BLSURFPlugin_Hypothesis_i::UnsetAttractorEntry(const char* faceEntry, void BLSURFPlugin_Hypothesis_i::UnsetCustomSizeMap(GEOM::GEOM_Object_ptr GeomObj) {} - void BLSURFPlugin_Hypothesis_i::SetCustomSizeMapEntry(const char* entry,const char* sizeMap ) + void BLSURFPlugin_Hypothesis_i::SetCustomSizeMapEntry(const char* entry,const char* sizeMap ) {} - char* BLSURFPlugin_Hypothesis_i::GetCustomSizeMapEntry(const char* entry) + char* BLSURFPlugin_Hypothesis_i::GetCustomSizeMapEntry(const char* entry) {} void BLSURFPlugin_Hypothesis_i::UnsetCustomSizeMapEntry(const char* entry) @@ -2592,7 +2589,7 @@ void BLSURFPlugin_Hypothesis_i::ClearAllEnforcedVertices() { * Set/get/unset an enforced vertex on face - OBSOLETE */ bool BLSURFPlugin_Hypothesis_i::SetEnforcedVertex(GEOM::GEOM_Object_ptr theFace, CORBA::Double x, CORBA::Double y, - CORBA::Double z) { + CORBA::Double z) { ASSERT(myBaseImpl); if ((theFace->GetShapeType() != GEOM::FACE) && (theFace->GetShapeType() != GEOM::COMPOUND)) { @@ -2626,7 +2623,7 @@ bool BLSURFPlugin_Hypothesis_i::SetEnforcedVertex(GEOM::GEOM_Object_ptr theFace, * Set/get/unset an enforced vertex with name on face */ bool BLSURFPlugin_Hypothesis_i::SetEnforcedVertexNamed(GEOM::GEOM_Object_ptr theFace, CORBA::Double x, CORBA::Double y, - CORBA::Double z, const char* theVertexName) { + CORBA::Double z, const char* theVertexName) { ASSERT(myBaseImpl); if ((theFace->GetShapeType() != GEOM::FACE) && (theFace->GetShapeType() != GEOM::COMPOUND)) { @@ -2661,7 +2658,7 @@ bool BLSURFPlugin_Hypothesis_i::SetEnforcedVertexNamed(GEOM::GEOM_Object_ptr the * Set/get/unset an enforced vertex with geom object on face */ bool BLSURFPlugin_Hypothesis_i::SetEnforcedVertexGeom(GEOM::GEOM_Object_ptr theFace, GEOM::GEOM_Object_ptr theVertex) - { +{ ASSERT(myBaseImpl); if ((theFace->GetShapeType() != GEOM::FACE) && (theFace->GetShapeType() != GEOM::COMPOUND)) { @@ -2725,7 +2722,6 @@ bool BLSURFPlugin_Hypothesis_i::SetEnforcedVertexGeom(GEOM::GEOM_Object_ptr theF * Set an enforced vertex with group name on face */ bool BLSURFPlugin_Hypothesis_i::SetEnforcedVertexWithGroup(GEOM::GEOM_Object_ptr theFace, CORBA::Double x, CORBA::Double y, CORBA::Double z, const char* theGroupName) - { ASSERT(myBaseImpl); @@ -2761,7 +2757,6 @@ bool BLSURFPlugin_Hypothesis_i::SetEnforcedVertexWithGroup(GEOM::GEOM_Object_ptr */ bool BLSURFPlugin_Hypothesis_i::SetEnforcedVertexNamedWithGroup(GEOM::GEOM_Object_ptr theFace, CORBA::Double x, CORBA::Double y, CORBA::Double z, const char* theVertexName, const char* theGroupName) - { ASSERT(myBaseImpl); @@ -2796,7 +2791,6 @@ bool BLSURFPlugin_Hypothesis_i::SetEnforcedVertexNamedWithGroup(GEOM::GEOM_Objec * Set an enforced vertex with geom entry and group name on face */ bool BLSURFPlugin_Hypothesis_i::SetEnforcedVertexGeomWithGroup(GEOM::GEOM_Object_ptr theFace, GEOM::GEOM_Object_ptr theVertex, const char* theGroupName) - { ASSERT(myBaseImpl); @@ -2853,7 +2847,7 @@ bool BLSURFPlugin_Hypothesis_i::SetEnforcedVertexGeomWithGroup(GEOM::GEOM_Object // * Are internal enforced vertices used for a face ? // */ //CORBA::Boolean BLSURFPlugin_Hypothesis_i::GetInternalEnforcedVertex(GEOM::GEOM_Object_ptr theFace) -// { +//{ // ASSERT(myBaseImpl); // if ((theFace->GetShapeType() != GEOM::FACE) && (theFace->GetShapeType() != GEOM::COMPOUND)) { @@ -2888,7 +2882,7 @@ bool BLSURFPlugin_Hypothesis_i::SetEnforcedVertexGeomWithGroup(GEOM::GEOM_Object * Get the list of all enforced vertices */ BLSURFPlugin::TEnfVertexList* BLSURFPlugin_Hypothesis_i::GetEnforcedVertices(GEOM::GEOM_Object_ptr theFace) - { +{ ASSERT(myBaseImpl); if ((theFace->GetShapeType() != GEOM::FACE) && (theFace->GetShapeType() != GEOM::COMPOUND)) { @@ -2920,7 +2914,7 @@ BLSURFPlugin::TEnfVertexList* BLSURFPlugin_Hypothesis_i::GetEnforcedVertices(GEO } bool BLSURFPlugin_Hypothesis_i::UnsetEnforcedVertex(GEOM::GEOM_Object_ptr theFace, CORBA::Double x, CORBA::Double y, - CORBA::Double z) { + CORBA::Double z) { ASSERT(myBaseImpl); if ((theFace->GetShapeType() != GEOM::FACE) && (theFace->GetShapeType() != GEOM::COMPOUND)) { @@ -2952,7 +2946,7 @@ bool BLSURFPlugin_Hypothesis_i::UnsetEnforcedVertex(GEOM::GEOM_Object_ptr theFac } bool BLSURFPlugin_Hypothesis_i::UnsetEnforcedVertexGeom(GEOM::GEOM_Object_ptr theFace, GEOM::GEOM_Object_ptr theVertex) - { +{ ASSERT(myBaseImpl); if ((theFace->GetShapeType() != GEOM::FACE) && (theFace->GetShapeType() != GEOM::COMPOUND)) { @@ -3011,7 +3005,7 @@ bool BLSURFPlugin_Hypothesis_i::UnsetEnforcedVertexGeom(GEOM::GEOM_Object_ptr th } } -bool BLSURFPlugin_Hypothesis_i::UnsetEnforcedVertices(GEOM::GEOM_Object_ptr theFace) { +bool BLSURFPlugin_Hypothesis_i::UnsetEnforcedVertices(GEOM::GEOM_Object_ptr theFace) { ASSERT(myBaseImpl); if ((theFace->GetShapeType() != GEOM::FACE) && (theFace->GetShapeType() != GEOM::COMPOUND)) { @@ -3046,7 +3040,7 @@ bool BLSURFPlugin_Hypothesis_i::UnsetEnforcedVertices(GEOM::GEOM_Object_ptr theF /*! * Set/get/unset an enforced vertex on face - NEW (no face) */ -bool BLSURFPlugin_Hypothesis_i::AddEnforcedVertex(CORBA::Double x, CORBA::Double y, CORBA::Double z) +bool BLSURFPlugin_Hypothesis_i::AddEnforcedVertex(CORBA::Double x, CORBA::Double y, CORBA::Double z) { ASSERT(myBaseImpl); @@ -3060,7 +3054,7 @@ bool BLSURFPlugin_Hypothesis_i::AddEnforcedVertex(CORBA::Double x, CORBA::Double /*! * Set/get/unset an enforced vertex with name on face */ -bool BLSURFPlugin_Hypothesis_i::AddEnforcedVertexNamed(CORBA::Double x, CORBA::Double y, CORBA::Double z, const char* theVertexName) +bool BLSURFPlugin_Hypothesis_i::AddEnforcedVertexNamed(CORBA::Double x, CORBA::Double y, CORBA::Double z, const char* theVertexName) { try { return SetEnforcedVertexEntry("", x, y, z, theVertexName); @@ -3073,7 +3067,6 @@ bool BLSURFPlugin_Hypothesis_i::AddEnforcedVertexNamed(CORBA::Double x, CORBA::D * Set/get/unset an enforced vertex with geom object on face */ bool BLSURFPlugin_Hypothesis_i::AddEnforcedVertexGeom(GEOM::GEOM_Object_ptr theVertex) - { if ((theVertex->GetShapeType() != GEOM::VERTEX) && (theVertex->GetShapeType() != GEOM::COMPOUND)) { THROW_SALOME_CORBA_EXCEPTION("theVertex shape type is not VERTEX or COMPOUND", SALOME::BAD_PARAM); @@ -3108,7 +3101,6 @@ bool BLSURFPlugin_Hypothesis_i::AddEnforcedVertexGeom(GEOM::GEOM_Object_ptr theV * Set an enforced vertex with group name on face */ bool BLSURFPlugin_Hypothesis_i::AddEnforcedVertexWithGroup(CORBA::Double x, CORBA::Double y, CORBA::Double z, const char* theGroupName) - { ASSERT(myBaseImpl); @@ -3124,7 +3116,6 @@ bool BLSURFPlugin_Hypothesis_i::AddEnforcedVertexWithGroup(CORBA::Double x, CORB */ bool BLSURFPlugin_Hypothesis_i::AddEnforcedVertexNamedWithGroup(CORBA::Double x, CORBA::Double y, CORBA::Double z, const char* theVertexName, const char* theGroupName) - { ASSERT(myBaseImpl); @@ -3139,7 +3130,6 @@ bool BLSURFPlugin_Hypothesis_i::AddEnforcedVertexNamedWithGroup(CORBA::Double x, * Set an enforced vertex with geom entry and group name on face */ bool BLSURFPlugin_Hypothesis_i::AddEnforcedVertexGeomWithGroup(GEOM::GEOM_Object_ptr theVertex, const char* theGroupName) - { if ((theVertex->GetShapeType() != GEOM::VERTEX) && (theVertex->GetShapeType() != GEOM::COMPOUND)) { THROW_SALOME_CORBA_EXCEPTION("theVertex shape type is not VERTEX or COMPOUND", SALOME::BAD_PARAM); @@ -3171,7 +3161,7 @@ bool BLSURFPlugin_Hypothesis_i::AddEnforcedVertexGeomWithGroup(GEOM::GEOM_Object } } -bool BLSURFPlugin_Hypothesis_i::RemoveEnforcedVertex(CORBA::Double x, CORBA::Double y, CORBA::Double z) +bool BLSURFPlugin_Hypothesis_i::RemoveEnforcedVertex(CORBA::Double x, CORBA::Double y, CORBA::Double z) { try { return UnsetEnforcedVertexEntry("", x, y, z); @@ -3181,7 +3171,6 @@ bool BLSURFPlugin_Hypothesis_i::RemoveEnforcedVertex(CORBA::Double x, CORBA::Dou } bool BLSURFPlugin_Hypothesis_i::RemoveEnforcedVertexGeom(GEOM::GEOM_Object_ptr theVertex) - { if ((theVertex->GetShapeType() != GEOM::VERTEX) && (theVertex->GetShapeType() != GEOM::COMPOUND)) { THROW_SALOME_CORBA_EXCEPTION("theVertex shape type is not VERTEX or COMPOUND", SALOME::BAD_PARAM); @@ -3211,7 +3200,7 @@ bool BLSURFPlugin_Hypothesis_i::RemoveEnforcedVertexGeom(GEOM::GEOM_Object_ptr t } } -bool BLSURFPlugin_Hypothesis_i::RemoveEnforcedVertices() +bool BLSURFPlugin_Hypothesis_i::RemoveEnforcedVertices() { try { return UnsetEnforcedVerticesEntry(""); @@ -3230,7 +3219,6 @@ bool BLSURFPlugin_Hypothesis_i::SetEnforcedVertexEntry(const char* theFaceEntry, const char* theVertexName, const char* theVertexEntry, const char* theGroupName) - { bool newValue = false; if (string(theVertexEntry).empty()) { @@ -3300,7 +3288,6 @@ bool BLSURFPlugin_Hypothesis_i::SetEnforcedVertexEntry(const char* theFaceEntry, } BLSURFPlugin::TEnfVertexList* BLSURFPlugin_Hypothesis_i::GetEnforcedVerticesEntry(const char* entry) - { try { BLSURFPlugin::TEnfVertexList_var vertexList = new BLSURFPlugin::TEnfVertexList(); @@ -3348,7 +3335,7 @@ BLSURFPlugin::TEnfVertexList* BLSURFPlugin_Hypothesis_i::GetEnforcedVerticesEntr } } -bool BLSURFPlugin_Hypothesis_i::UnsetEnforcedVertexEntry(const char* theFaceEntry, CORBA::Double x, CORBA::Double y, CORBA::Double z, const char* theVertexEntry) +bool BLSURFPlugin_Hypothesis_i::UnsetEnforcedVertexEntry(const char* theFaceEntry, CORBA::Double x, CORBA::Double y, CORBA::Double z, const char* theVertexEntry) { ASSERT(myBaseImpl); @@ -3371,7 +3358,7 @@ bool BLSURFPlugin_Hypothesis_i::UnsetEnforcedVertexEntry(const char* theFaceEntr return res; } -bool BLSURFPlugin_Hypothesis_i::UnsetEnforcedVerticesEntry(const char* theFaceEntry) +bool BLSURFPlugin_Hypothesis_i::UnsetEnforcedVerticesEntry(const char* theFaceEntry) { ASSERT(myBaseImpl); @@ -3446,7 +3433,6 @@ char* BLSURFPlugin_Hypothesis_i::GetInternalEnforcedVertexAllFacesGroup() * Enable internal enforced vertices on specific face if requested by user * void BLSURFPlugin_Hypothesis_i::SetInternalEnforcedVertex(GEOM::GEOM_Object_ptr theFace, CORBA::Boolean toEnforceInternalVertices) - { try { SetInternalEnforcedVertexWithGroup(theFace, toEnforceInternalVertices); @@ -3456,9 +3442,7 @@ char* BLSURFPlugin_Hypothesis_i::GetInternalEnforcedVertexAllFacesGroup() } void BLSURFPlugin_Hypothesis_i::SetInternalEnforcedVertexWithGroup(GEOM::GEOM_Object_ptr theFace, CORBA::Boolean toEnforceInternalVertices, const char* theGroupName) - { - if ((theFace->GetShapeType() != GEOM::FACE) && (theFace->GetShapeType() != GEOM::COMPOUND)) { THROW_SALOME_CORBA_EXCEPTION("theFace shape type is not FACE or COMPOUND", SALOME::BAD_PARAM); } @@ -3489,7 +3473,6 @@ char* BLSURFPlugin_Hypothesis_i::GetInternalEnforcedVertexAllFacesGroup() } void BLSURFPlugin_Hypothesis_i::SetInternalEnforcedVertexEntry(const char* theFaceEntry, CORBA::Boolean toEnforceInternalVertices, const char* theGroupName) - { ASSERT(myBaseImpl); try { @@ -3531,7 +3514,6 @@ char* BLSURFPlugin_Hypothesis_i::GetInternalEnforcedVertexAllFacesGroup() void BLSURFPlugin_Hypothesis_i::SetEnforcedVertexGroupName(CORBA::Double x, CORBA::Double y, CORBA::Double z, const char* groupName) - { ASSERT(myBaseImpl); try { @@ -3732,7 +3714,6 @@ BLSURFPlugin::TPeriodicityList* BLSURFPlugin_Hypothesis_i::PreCadVectorToSequenc void BLSURFPlugin_Hypothesis_i::AddPreCadFacesPeriodicity(GEOM::GEOM_Object_ptr theFace1, GEOM::GEOM_Object_ptr theFace2) - { ASSERT(myBaseImpl); const GEOM::ListOfGO theSourceVertices; @@ -3743,7 +3724,6 @@ void BLSURFPlugin_Hypothesis_i::AddPreCadFacesPeriodicity(GEOM::GEOM_Object_ptr void BLSURFPlugin_Hypothesis_i::AddPreCadFacesPeriodicityWithVertices(GEOM::GEOM_Object_ptr theFace1, GEOM::GEOM_Object_ptr theFace2, const GEOM::ListOfGO& theSourceVertices, const GEOM::ListOfGO& theTargetVertices) - { ASSERT(myBaseImpl); @@ -3795,9 +3775,7 @@ void BLSURFPlugin_Hypothesis_i::AddPreCadFacesPeriodicityWithVertices(GEOM::GEOM void BLSURFPlugin_Hypothesis_i::AddPreCadFacesPeriodicityEntry(const char* theFace1Entry, const char* theFace2Entry, const BLSURFPlugin::TEntryList& theSourceVerticesEntriesCorba, const BLSURFPlugin::TEntryList& theTargetVerticesEntriesCorba) - { - ASSERT(myBaseImpl); // Convert BLSURFPlugin::TEntryList to vector @@ -3820,12 +3798,11 @@ void BLSURFPlugin_Hypothesis_i::AddPreCadFacesPeriodicityEntry(const char* theFa pd << listEntriesTxt.c_str(); pd << ")"; } - else + else pd << _this() << ".AddPreCadFacesPeriodicity(" << theFace1Entry << ", " << theFace2Entry << ")"; } void BLSURFPlugin_Hypothesis_i::AddPreCadEdgesPeriodicity(GEOM::GEOM_Object_ptr theEdge1, GEOM::GEOM_Object_ptr theEdge2) - { ASSERT(myBaseImpl); const GEOM::ListOfGO theSourceVertices; @@ -3835,7 +3812,6 @@ void BLSURFPlugin_Hypothesis_i::AddPreCadEdgesPeriodicity(GEOM::GEOM_Object_ptr void BLSURFPlugin_Hypothesis_i::AddPreCadEdgesPeriodicityWithVertices(GEOM::GEOM_Object_ptr theEdge1, GEOM::GEOM_Object_ptr theEdge2, const GEOM::ListOfGO& theSourceVertices, const GEOM::ListOfGO& theTargetVertices) - { ASSERT(myBaseImpl); @@ -3887,7 +3863,6 @@ void BLSURFPlugin_Hypothesis_i::AddPreCadEdgesPeriodicityWithVertices(GEOM::GEOM void BLSURFPlugin_Hypothesis_i::AddPreCadEdgesPeriodicityEntry(const char* theEdge1Entry, const char* theEdge2Entry, const BLSURFPlugin::TEntryList& theSourceVerticesEntriesCorba, const BLSURFPlugin::TEntryList& theTargetVerticesEntriesCorba) - { ASSERT(myBaseImpl); diff --git a/src/BLSURFPlugin/BLSURFPlugin_Hypothesis_i.hxx b/src/BLSURFPlugin/BLSURFPlugin_Hypothesis_i.hxx index 29db931..9dd6691 100644 --- a/src/BLSURFPlugin/BLSURFPlugin_Hypothesis_i.hxx +++ b/src/BLSURFPlugin/BLSURFPlugin_Hypothesis_i.hxx @@ -329,59 +329,42 @@ public: * Set/get/unset an enforced vertex on geom object */ // OBSOLETE - bool SetEnforcedVertex(GEOM::GEOM_Object_ptr theFace, CORBA::Double x, CORBA::Double y, CORBA::Double z) - ; - bool SetEnforcedVertexNamed(GEOM::GEOM_Object_ptr theFace, CORBA::Double x, CORBA::Double y, CORBA::Double z, const char* theVertexName) - ; - bool SetEnforcedVertexGeom(GEOM::GEOM_Object_ptr theFace, GEOM::GEOM_Object_ptr theVertex) - ; - bool SetEnforcedVertexWithGroup(GEOM::GEOM_Object_ptr theFace, CORBA::Double x, CORBA::Double y, CORBA::Double z, const char* theGroupName) - ; - bool SetEnforcedVertexNamedWithGroup(GEOM::GEOM_Object_ptr theFace, CORBA::Double x, CORBA::Double y, CORBA::Double z, const char* theVertexName, const char* theGroupName) - ; - bool SetEnforcedVertexGeomWithGroup(GEOM::GEOM_Object_ptr theFace, GEOM::GEOM_Object_ptr theVertex, const char* theGroupName) - ; - - BLSURFPlugin::TEnfVertexList* GetEnforcedVertices(GEOM::GEOM_Object_ptr theFace) ; - - bool UnsetEnforcedVertex(GEOM::GEOM_Object_ptr theFace, CORBA::Double x, CORBA::Double y, CORBA::Double z) - ; - bool UnsetEnforcedVertexGeom(GEOM::GEOM_Object_ptr theFace, GEOM::GEOM_Object_ptr theVertex) - ; - bool UnsetEnforcedVertices(GEOM::GEOM_Object_ptr theFace) ; + bool SetEnforcedVertex(GEOM::GEOM_Object_ptr theFace, CORBA::Double x, CORBA::Double y, CORBA::Double z); + bool SetEnforcedVertexNamed(GEOM::GEOM_Object_ptr theFace, CORBA::Double x, CORBA::Double y, CORBA::Double z, const char* theVertexName); + bool SetEnforcedVertexGeom(GEOM::GEOM_Object_ptr theFace, GEOM::GEOM_Object_ptr theVertex); + bool SetEnforcedVertexWithGroup(GEOM::GEOM_Object_ptr theFace, CORBA::Double x, CORBA::Double y, CORBA::Double z, const char* theGroupName); + bool SetEnforcedVertexNamedWithGroup(GEOM::GEOM_Object_ptr theFace, CORBA::Double x, CORBA::Double y, CORBA::Double z, const char* theVertexName, const char* theGroupName); + bool SetEnforcedVertexGeomWithGroup(GEOM::GEOM_Object_ptr theFace, GEOM::GEOM_Object_ptr theVertex, const char* theGroupName); + + BLSURFPlugin::TEnfVertexList* GetEnforcedVertices(GEOM::GEOM_Object_ptr theFace); + + bool UnsetEnforcedVertex(GEOM::GEOM_Object_ptr theFace, CORBA::Double x, CORBA::Double y, CORBA::Double z); + bool UnsetEnforcedVertexGeom(GEOM::GEOM_Object_ptr theFace, GEOM::GEOM_Object_ptr theVertex); + bool UnsetEnforcedVertices(GEOM::GEOM_Object_ptr theFace); // NEW - no face - bool AddEnforcedVertex(CORBA::Double x, CORBA::Double y, CORBA::Double z) - ; - bool AddEnforcedVertexNamed(CORBA::Double x, CORBA::Double y, CORBA::Double z, const char* theVertexName) - ; - bool AddEnforcedVertexGeom(GEOM::GEOM_Object_ptr theVertex) - ; - bool AddEnforcedVertexWithGroup(CORBA::Double x, CORBA::Double y, CORBA::Double z, const char* theGroupName) - ; - bool AddEnforcedVertexNamedWithGroup(CORBA::Double x, CORBA::Double y, CORBA::Double z, const char* theVertexName, const char* theGroupName) - ; - bool AddEnforcedVertexGeomWithGroup(GEOM::GEOM_Object_ptr theVertex, const char* theGroupName) - ; - - bool RemoveEnforcedVertex(CORBA::Double x, CORBA::Double y, CORBA::Double z) - ; - bool RemoveEnforcedVertexGeom(GEOM::GEOM_Object_ptr theVertex) - ; - bool RemoveEnforcedVertices() ; + bool AddEnforcedVertex(CORBA::Double x, CORBA::Double y, CORBA::Double z); + bool AddEnforcedVertexNamed(CORBA::Double x, CORBA::Double y, CORBA::Double z, const char* theVertexName); + bool AddEnforcedVertexGeom(GEOM::GEOM_Object_ptr theVertex); + bool AddEnforcedVertexWithGroup(CORBA::Double x, CORBA::Double y, CORBA::Double z, const char* theGroupName); + bool AddEnforcedVertexNamedWithGroup(CORBA::Double x, CORBA::Double y, CORBA::Double z, const char* theVertexName, const char* theGroupName); + bool AddEnforcedVertexGeomWithGroup(GEOM::GEOM_Object_ptr theVertex, const char* theGroupName); + + bool RemoveEnforcedVertex(CORBA::Double x, CORBA::Double y, CORBA::Double z); + bool RemoveEnforcedVertexGeom(GEOM::GEOM_Object_ptr theVertex); + bool RemoveEnforcedVertices(); /*! * Set/get/unset an enforced vertex on geom object given by entry */ bool SetEnforcedVertexEntry(const char* theFaceEntry, CORBA::Double x = 0, CORBA::Double y = 0, CORBA::Double z = 0, - const char* theVertexName = "", const char* theVertexEntry = "", const char* theGroupName = "") - ; + const char* theVertexName = "", const char* theVertexEntry = "", const char* theGroupName = ""); - BLSURFPlugin::TEnfVertexList* GetEnforcedVerticesEntry(const char* theFaceEntry) ; + BLSURFPlugin::TEnfVertexList* GetEnforcedVerticesEntry(const char* theFaceEntry); bool UnsetEnforcedVertexEntry(const char* theFaceEntry, CORBA::Double x, CORBA::Double y, CORBA::Double z, - const char* theVertexEntry = "") ; - bool UnsetEnforcedVerticesEntry(const char* theFaceEntry) ; + const char* theVertexEntry = ""); + bool UnsetEnforcedVerticesEntry(const char* theFaceEntry); /*! * To add internal vertices as enforced vertices @@ -392,11 +375,11 @@ public: char* GetInternalEnforcedVertexAllFacesGroup(); // Enable internal enforced vertices on specific face if requested by user -// void SetInternalEnforcedVertex(GEOM::GEOM_Object_ptr theFace, CORBA::Boolean toEnforceInternalVertices) ; -// void SetInternalEnforcedVertexWithGroup(GEOM::GEOM_Object_ptr theFace, CORBA::Boolean toEnforceInternalVertices, const char* theGroupName = "") ; -// void SetInternalEnforcedVertexEntry(const char* theFaceEntry, CORBA::Boolean toEnforceInternalVertices, const char* theGroupName = "") ; -// CORBA::Boolean GetInternalEnforcedVertex(GEOM::GEOM_Object_ptr theFace) ; -// CORBA::Boolean GetInternalEnforcedVertexEntry(const char* theFaceEntry) ; +// void SetInternalEnforcedVertex(GEOM::GEOM_Object_ptr theFace, CORBA::Boolean toEnforceInternalVertices); +// void SetInternalEnforcedVertexWithGroup(GEOM::GEOM_Object_ptr theFace, CORBA::Boolean toEnforceInternalVertices, const char* theGroupName = ""); +// void SetInternalEnforcedVertexEntry(const char* theFaceEntry, CORBA::Boolean toEnforceInternalVertices, const char* theGroupName = ""); +// CORBA::Boolean GetInternalEnforcedVertex(GEOM::GEOM_Object_ptr theFace); +// CORBA::Boolean GetInternalEnforcedVertexEntry(const char* theFaceEntry); /////////////////////// // PERIODICITY // @@ -409,27 +392,21 @@ public: BLSURFPlugin::TPeriodicityList* PreCadVectorToSequence(const ::BLSURFPlugin_Hypothesis::TPreCadPeriodicityVector& preCadPeriodicityVector); - void AddPreCadFacesPeriodicity(GEOM::GEOM_Object_ptr theFace1, GEOM::GEOM_Object_ptr theFace2) - ; + void AddPreCadFacesPeriodicity(GEOM::GEOM_Object_ptr theFace1, GEOM::GEOM_Object_ptr theFace2); void AddPreCadFacesPeriodicityWithVertices(GEOM::GEOM_Object_ptr theFace1, GEOM::GEOM_Object_ptr theFace2, - const GEOM::ListOfGO& theSourceVertices, const GEOM::ListOfGO& theTargetVertices) - ; + const GEOM::ListOfGO& theSourceVertices, const GEOM::ListOfGO& theTargetVertices); void AddPreCadFacesPeriodicityEntry(const char* theFace1Entry, const char* theFace2Entry, - const BLSURFPlugin::TEntryList& theSourceVerticesEntries, const BLSURFPlugin::TEntryList& theTargetVerticesEntries) - ; + const BLSURFPlugin::TEntryList& theSourceVerticesEntries, const BLSURFPlugin::TEntryList& theTargetVerticesEntries); - void AddPreCadEdgesPeriodicity(GEOM::GEOM_Object_ptr theEdge1, GEOM::GEOM_Object_ptr theEdge2) - ; + void AddPreCadEdgesPeriodicity(GEOM::GEOM_Object_ptr theEdge1, GEOM::GEOM_Object_ptr theEdge2); void AddPreCadEdgesPeriodicityWithVertices(GEOM::GEOM_Object_ptr theEdge1, GEOM::GEOM_Object_ptr theEdge2, - const GEOM::ListOfGO& theSourceVertices, const GEOM::ListOfGO& theTargetVertices) - ; + const GEOM::ListOfGO& theSourceVertices, const GEOM::ListOfGO& theTargetVertices); void AddPreCadEdgesPeriodicityEntry(const char* theEdge1Entry, const char* theEdge2Entry, - const BLSURFPlugin::TEntryList& theSourceVerticesEntries, const BLSURFPlugin::TEntryList& theTargetVerticesEntries) - ; + const BLSURFPlugin::TEntryList& theSourceVerticesEntries, const BLSURFPlugin::TEntryList& theTargetVerticesEntries); /////////////////////// diff --git a/src/GUI/BLSURFPluginGUI_HypothesisCreator.cxx b/src/GUI/BLSURFPluginGUI_HypothesisCreator.cxx index 5a591e9..873f781 100644 --- a/src/GUI/BLSURFPluginGUI_HypothesisCreator.cxx +++ b/src/GUI/BLSURFPluginGUI_HypothesisCreator.cxx @@ -213,13 +213,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 = { @@ -267,6 +267,14 @@ namespace { 0, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ + 0, /*tp_bases*/ + 0, /*tp_mro*/ + 0, /*tp_cache*/ + 0, /*tp_subclasses*/ + 0, /*tp_weaklist*/ + 0, /*tp_del*/ + 0, /*tp_version_tag*/ + 0, /*tp_finalize*/ }; PyObject * newPyStdOut( std::string& out ) diff --git a/src/GUI/BLSURFPluginGUI_HypothesisCreator.h b/src/GUI/BLSURFPluginGUI_HypothesisCreator.h index ed98874..9533eec 100644 --- a/src/GUI/BLSURFPluginGUI_HypothesisCreator.h +++ b/src/GUI/BLSURFPluginGUI_HypothesisCreator.h @@ -401,7 +401,7 @@ class EnforcedTreeWidgetDelegate : public QItemDelegate public: EnforcedTreeWidgetDelegate(QObject *parent = 0); - QWidget *createEditor(QWidget *parent, const QStyleOptionViewItem & /*option*/, + QWidget *createEditor(QWidget *parent, const QStyleOptionViewItem & option, const QModelIndex &index) const; void setEditorData(QWidget *editor, const QModelIndex &index) const; -- 2.39.2