From: eap Date: Thu, 29 Oct 2015 16:18:36 +0000 (+0300) Subject: IPAL10786: "Edit" is unnecessary functionality for some Mesh hypotheses X-Git-Tag: V8_0_pre~1 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=a5a9b778aaaab382d357dc107c161190a13f7b5c;p=modules%2Fsmesh.git IPAL10786: "Edit" is unnecessary functionality for some Mesh hypotheses + Eliminate compilation warnings --- diff --git a/idl/SMESH_Hypothesis.idl b/idl/SMESH_Hypothesis.idl index 6157618d6..ab6e7dd43 100644 --- a/idl/SMESH_Hypothesis.idl +++ b/idl/SMESH_Hypothesis.idl @@ -87,6 +87,13 @@ module SMESH * Verify whether hypothesis supports given entity type */ boolean IsDimSupported( in Dimension type ); + + /*! + * Return true if a hypothesis has parameters. + * + * This method is intended for GUI to know if "Edit" menu item sould be available + */ + boolean HasParameters(); }; typedef sequence ListOfHypothesisName; diff --git a/src/SMESHGUI/SMESHGUI.cxx b/src/SMESHGUI/SMESHGUI.cxx index a465cd3be..b3d61a763 100644 --- a/src/SMESHGUI/SMESHGUI.cxx +++ b/src/SMESHGUI/SMESHGUI.cxx @@ -4353,7 +4353,7 @@ void SMESHGUI::initialize( CAM_Application* app ) createPopupItem( SMESHOp::OpCreateGeometryGroup, OB, mesh, "&& hasGeomReference" ); createPopupItem( SMESHOp::OpConstructGroup, OB, subMesh ); popupMgr()->insert( separator(), -1, 0 ); - createPopupItem( SMESHOp::OpEditHypothesis, OB, hypo); + createPopupItem( SMESHOp::OpEditHypothesis, OB, hypo, "&& isEditableHyp"); createPopupItem( SMESHOp::OpUnassign, OB, hyp_alg ); // REMOVE HYPOTHESIS / ALGORITHMS popupMgr()->insert( separator(), -1, 0 ); createPopupItem( SMESHOp::OpConvertMeshToQuadratic, OB, mesh + " " + subMesh ); // convert to quadratic diff --git a/src/SMESHGUI/SMESHGUI_Selection.cxx b/src/SMESHGUI/SMESHGUI_Selection.cxx index fa6f4c386..3d446d96d 100644 --- a/src/SMESHGUI/SMESHGUI_Selection.cxx +++ b/src/SMESHGUI/SMESHGUI_Selection.cxx @@ -129,6 +129,7 @@ QVariant SMESHGUI_Selection::parameter( const int ind, const QString& p ) const else if ( p=="isComputable" ) val = QVariant( isComputable( ind ) ); else if ( p=="isPreComputable" ) val = QVariant( isPreComputable( ind ) ); else if ( p=="hasGeomReference" ) val = QVariant( hasGeomReference( ind ) ); + else if ( p=="isEditableHyp" ) val = QVariant( isEditableHyp( ind ) ); else if ( p=="isImported" ) val = QVariant( isImported( ind ) ); else if ( p=="facesOrientationMode" ) val = QVariant( facesOrientationMode( ind ) ); else if ( p=="groupType" ) val = QVariant( groupType( ind ) ); @@ -495,16 +496,16 @@ int SMESHGUI_Selection::dim( int ind ) const //purpose : return true for a ready-to-compute mesh //======================================================================= -QVariant SMESHGUI_Selection::isComputable( int ind ) const +bool SMESHGUI_Selection::isComputable( int ind ) const { if ( ind >= 0 && ind < myTypes.count() && myTypes[ind] == "Mesh" ) { QMap modeMap; _PTR(SObject) so = SMESH::GetActiveStudyDocument()->FindObjectID( entry( ind ).toLatin1().data() ); SMESHGUI_PrecomputeOp::getAssignedAlgos( so, modeMap ); - return QVariant( modeMap.size() > 0 ); + return modeMap.size() > 0; } - return QVariant( false ); + return false; } //======================================================================= @@ -512,7 +513,7 @@ QVariant SMESHGUI_Selection::isComputable( int ind ) const //purpose : returns true for a mesh with algorithms //======================================================================= -QVariant SMESHGUI_Selection::isPreComputable( int ind ) const +bool SMESHGUI_Selection::isPreComputable( int ind ) const { if ( ind >= 0 && ind < myTypes.count() && myTypes[ind] == "Mesh" ) { @@ -523,11 +524,11 @@ QVariant SMESHGUI_Selection::isPreComputable( int ind ) const _PTR(SObject) pMesh = SMESH::GetActiveStudyDocument()->FindObjectID( entry( ind ).toLatin1().data() ); SMESHGUI_PrecomputeOp::getAssignedAlgos( pMesh, modeMap ); if ( modeMap.size() > 1 ) - return QVariant( ( modeMap.contains( SMESH::DIM_3D )) || - ( modeMap.contains( SMESH::DIM_2D ) && maxDim < 1 )); + return (( modeMap.contains( SMESH::DIM_3D )) || + ( modeMap.contains( SMESH::DIM_2D ) && maxDim < 1 )); } } - return QVariant( false ); + return false; } //======================================================================= @@ -535,15 +536,35 @@ QVariant SMESHGUI_Selection::isPreComputable( int ind ) const //purpose : returns true for a mesh or sub-mesh on geometry //======================================================================= -QVariant SMESHGUI_Selection::hasGeomReference( int ind ) const +bool SMESHGUI_Selection::hasGeomReference( int ind ) const { if ( ind >= 0 && ind < myTypes.count() && myTypes[ind] != "Unknown" ) { _PTR(SObject) so = SMESH::GetActiveStudyDocument()->FindObjectID( entry( ind ).toLatin1().data() ); GEOM::GEOM_Object_var shape = SMESH::GetShapeOnMeshOrSubMesh( so ); - return QVariant( !shape->_is_nil() ); + return !shape->_is_nil(); + } + return false; +} + +//======================================================================= +//function : isEditableHyp +//purpose : +//======================================================================= + +bool SMESHGUI_Selection::isEditableHyp( int ind ) const +{ + bool isEditable = true; + if ( ind >= 0 && ind < myTypes.count() && myTypes[ind] == "Hypothesis" ) + { + _PTR(SObject) so = SMESH::GetActiveStudyDocument()->FindObjectID( entry( ind ).toLatin1().data() ); + SMESH::SMESH_Hypothesis_var hyp = SMESH::SObjectToInterface( so ); + if ( !hyp->_is_nil() ) + { + isEditable = hyp->HasParameters(); + } } - return QVariant( false ); + return isEditable; } //======================================================================= @@ -551,17 +572,17 @@ QVariant SMESHGUI_Selection::hasGeomReference( int ind ) const //purpose : //======================================================================= -QVariant SMESHGUI_Selection::isVisible( int ind ) const +bool SMESHGUI_Selection::isVisible( int ind ) const { if ( ind >= 0 && ind < myTypes.count() && myTypes[ind] != "Unknown" ) { SMESH_Actor* actor = SMESH::FindActorByEntry( entry( ind ).toLatin1().data() ); if ( actor && actor->hasIO() ) { if ( SVTK_ViewWindow* aViewWindow = SMESH::GetCurrentVtkView() ) - return QVariant( aViewWindow->isVisible( actor->getIO() ) ); + return aViewWindow->isVisible( actor->getIO() ); } } - return QVariant( false ); + return false; } //======================================================================= diff --git a/src/SMESHGUI/SMESHGUI_Selection.h b/src/SMESHGUI/SMESHGUI_Selection.h index de0d0d12f..e3146cad3 100644 --- a/src/SMESHGUI/SMESHGUI_Selection.h +++ b/src/SMESHGUI/SMESHGUI_Selection.h @@ -56,10 +56,11 @@ public: virtual bool isAutoColor( int ) const; virtual int numberOfNodes( int ) const; virtual int dim( int ) const; - virtual QVariant isComputable( int ) const; - virtual QVariant isPreComputable( int ) const; - virtual QVariant hasGeomReference( int ) const; - virtual QVariant isVisible( int ) const; + virtual bool isComputable( int ) const; + virtual bool isPreComputable( int ) const; + virtual bool hasGeomReference( int ) const; + virtual bool isEditableHyp( int ) const; + virtual bool isVisible( int ) const; virtual QString quadratic2DMode( int ) const; diff --git a/src/SMESH_I/SMESH_2smeshpy.cxx b/src/SMESH_I/SMESH_2smeshpy.cxx index 3ea0f6acd..2669db47b 100644 --- a/src/SMESH_I/SMESH_2smeshpy.cxx +++ b/src/SMESH_I/SMESH_2smeshpy.cxx @@ -919,7 +919,7 @@ Handle(_pyCommand) _pyGen::AddCommand( const TCollection_AsciiString& theCommand Threshold = SMESH + types[ iGeom ]; #ifdef _DEBUG_ // is types complete? (compilation failure mains that enum GeometryType changed) - int _assert[( sizeof(types) / sizeof(const char*) == nbTypes ) ? 1 : -1 ]; + int _assert[( sizeof(types) / sizeof(const char*) == nbTypes ) ? 1 : -1 ]; _assert[0]=1; #endif } if (Type == "SMESH.FT_EntityType") @@ -939,7 +939,7 @@ Handle(_pyCommand) _pyGen::AddCommand( const TCollection_AsciiString& theCommand Threshold = SMESH + types[ iGeom ]; #ifdef _DEBUG_ // is types complete? (compilation failure mains that enum EntityType changed) - int _assert[( sizeof(types) / sizeof(const char*) == nbTypes ) ? 1 : -1 ]; + int _assert[( sizeof(types) / sizeof(const char*) == nbTypes ) ? 1 : -1 ]; _assert[0]=1; #endif } } @@ -1930,7 +1930,7 @@ void _pyMesh::Process( const Handle(_pyCommand)& theCommand ) TCollection_AsciiString grIDs = theCommand->GetResultValue(); list< _pyID > idList = theCommand->GetStudyEntries( grIDs ); list< _pyID >::iterator grID = idList.begin(); - const int nbGroupsBefore = myGroups.size(); + const size_t nbGroupsBefore = myGroups.size(); Handle(_pyObject) obj; for ( ; grID != idList.end(); ++grID ) { @@ -3133,7 +3133,7 @@ void _pyHypothesis::setCreationArg( const int argNb, const _AString& arg ) { if ( myCurCrMethod ) { - while ( myCurCrMethod->myArgs.size() < argNb ) + while ( (int) myCurCrMethod->myArgs.size() < argNb ) myCurCrMethod->myArgs.push_back( "None" ); if ( arg.IsEmpty() ) myCurCrMethod->myArgs[ argNb-1 ] = "None"; @@ -3200,7 +3200,7 @@ void _pyComplexParamHypo::Process( const Handle(_pyCommand)& theCommand) for ( ; type2meth != myAlgoType2CreationMethod.end(); ++type2meth ) { CreationMethod& crMethod = type2meth->second; - while ( crMethod.myArgs.size() < i+1 ) + while ( (int) crMethod.myArgs.size() < i+1 ) crMethod.myArgs.push_back( "[]" ); crMethod.myArgs[ i ] = theCommand->GetArg( 1 ); // arg value } diff --git a/src/SMESH_I/SMESH_2smeshpy.hxx b/src/SMESH_I/SMESH_2smeshpy.hxx index a67e3cbca..ca1f78337 100644 --- a/src/SMESH_I/SMESH_2smeshpy.hxx +++ b/src/SMESH_I/SMESH_2smeshpy.hxx @@ -115,7 +115,7 @@ class _pyCommand: public Standard_Transient public: _pyCommand() {}; _pyCommand( const _AString& theString, int theNb=-1 ) - : myString( theString ), myOrderNb( theNb ) {}; + : myOrderNb( theNb ), myString( theString ) {}; _AString & GetString() { return myString; } int GetOrderNb() const { return myOrderNb; } void SetOrderNb( int theNb ) { myOrderNb = theNb; } diff --git a/src/SMESH_I/SMESH_Filter_i.cxx b/src/SMESH_I/SMESH_Filter_i.cxx index 7ceeb904f..36808eed4 100644 --- a/src/SMESH_I/SMESH_Filter_i.cxx +++ b/src/SMESH_I/SMESH_Filter_i.cxx @@ -170,21 +170,21 @@ static TopoDS_Shape getShapeByID (const char* theID) return TopoDS_Shape(); } -static std::string getShapeNameByID (const char* theID) -{ - if ( theID && strlen( theID ) > 0 ) { - SMESH_Gen_i* aSMESHGen = SMESH_Gen_i::GetSMESHGen(); - SALOMEDS::Study_var aStudy = aSMESHGen->GetCurrentStudy(); - if ( !aStudy->_is_nil() ) { - SALOMEDS::SObject_wrap aSObj = aStudy->FindObjectID(theID); - if ( !aSObj->_is_nil() ) { - CORBA::String_var name = aSObj->GetName(); - return name.in(); - } - } - } - return ""; -} +// static std::string getShapeNameByID (const char* theID) +// { +// if ( theID && strlen( theID ) > 0 ) { +// SMESH_Gen_i* aSMESHGen = SMESH_Gen_i::GetSMESHGen(); +// SALOMEDS::Study_var aStudy = aSMESHGen->GetCurrentStudy(); +// if ( !aStudy->_is_nil() ) { +// SALOMEDS::SObject_wrap aSObj = aStudy->FindObjectID(theID); +// if ( !aSObj->_is_nil() ) { +// CORBA::String_var name = aSObj->GetName(); +// return name.in(); +// } +// } +// } +// return ""; +// } /* FUNCTORS @@ -1830,9 +1830,9 @@ FunctorType EqualTo_i::GetFunctorType() Class : LogicalNOT_i Description : Logical NOT predicate */ -LogicalNOT_i::LogicalNOT_i() -: myPredicate( NULL ), - myLogicalNOTPtr( new Controls::LogicalNOT() ) +LogicalNOT_i::LogicalNOT_i(): + myLogicalNOTPtr( new Controls::LogicalNOT() ), + myPredicate( NULL ) { myFunctorPtr = myPredicatePtr = myLogicalNOTPtr; } @@ -4068,7 +4068,7 @@ static const char** getFunctNames() #ifdef _DEBUG_ // check if functName is complete, compilation failure means that enum FunctorType changed const int nbFunctors = sizeof(functName) / sizeof(const char*); - int _assert[( nbFunctors == SMESH::FT_Undefined + 1 ) ? 1 : -1 ]; + int _assert[( nbFunctors == SMESH::FT_Undefined + 1 ) ? 1 : -1 ]; _assert[0]=1; #endif return functName; diff --git a/src/SMESH_I/SMESH_Hypothesis_i.cxx b/src/SMESH_I/SMESH_Hypothesis_i.cxx index 04667edaa..1f0517f3a 100644 --- a/src/SMESH_I/SMESH_Hypothesis_i.cxx +++ b/src/SMESH_I/SMESH_Hypothesis_i.cxx @@ -237,6 +237,19 @@ void SMESH_Hypothesis_i::setOldParameters (const char* theParameters) return myBaseImpl; } +//================================================================================ +/*! + * \brief Return true if a hypothesis has parameters + */ +//================================================================================ + +CORBA::Boolean SMESH_Hypothesis_i::HasParameters() +{ + std::ostringstream os; + myBaseImpl->SaveTo( os ); + return ( !os.str().empty() ); +} + //============================================================================= /*! * SMESH_Hypothesis_i::SaveTo diff --git a/src/SMESH_I/SMESH_Hypothesis_i.hxx b/src/SMESH_I/SMESH_Hypothesis_i.hxx index b589fd319..55c1e2779 100644 --- a/src/SMESH_I/SMESH_Hypothesis_i.hxx +++ b/src/SMESH_I/SMESH_Hypothesis_i.hxx @@ -59,31 +59,34 @@ public: virtual ~SMESH_Hypothesis_i(); // Get type name of hypothesis - char* GetName(); + virtual char* GetName(); // Get plugin library name of hypothesis - char* GetLibName(); + virtual char* GetLibName(); // Set plugin library name of hypothesis void SetLibName( const char* theLibName ); // Get unique id of hypothesis - CORBA::Long GetId(); - + virtual CORBA::Long GetId(); + + // Return true if a hypothesis has parameters + virtual CORBA::Boolean HasParameters(); + // Set the variable parameter (a variable name or a parameter value); \a method is a name // of method setting this parameter. // This method must be called by the hypothesis creator just before calling hyp->method() - void SetVarParameter (const char* parameter, const char* method); + virtual void SetVarParameter (const char* parameter, const char* method); // Return the variable parameter used at Hypothesis Creation by the name of method // setting this parameter. The returned variable name is used at Hypothesis Edition. - char* GetVarParameter (const char* methodName); + virtual char* GetVarParameter (const char* methodName); // Store a hypothesis wrapping this not published one. This hyp, which has // no own parameters but is published, is used to store variables defining parameters // of this hypothesis. This method is to be called before setting parameters // of this hypothesis. - void SetHolderHypothesis(const SMESH::SMESH_Hypothesis_ptr hyp); + virtual void SetHolderHypothesis(const SMESH::SMESH_Hypothesis_ptr hyp); //Return true if hypothesis was published in study bool IsPublished(); diff --git a/src/SMESH_I/SMESH_Measurements_i.cxx b/src/SMESH_I/SMESH_Measurements_i.cxx index f078bdc10..b17fc6c4a 100644 --- a/src/SMESH_I/SMESH_Measurements_i.cxx +++ b/src/SMESH_I/SMESH_Measurements_i.cxx @@ -132,7 +132,8 @@ static bool isNodeType (SMESH::array_of_ElementType_var theTypes) return theTypes->length() > 0 && theTypes[0] == SMESH::NODE; } -static double getNumericalValue(SMESH::SMESH_IDSource_ptr theSource, SMESH::Controls::NumericalFunctorPtr theFunctor) +static double getNumericalValue(SMESH::SMESH_IDSource_ptr theSource, + SMESH::Controls::NumericalFunctorPtr theFunctor) { double value = 0; @@ -142,7 +143,7 @@ static double getNumericalValue(SMESH::SMESH_IDSource_ptr theSource, SMESH::Cont theFunctor->SetMesh( aMesh ); SMESH::long_array_var anElementsId = theSource->GetIDs(); - for (int i = 0; i < anElementsId->length(); i++) { + for ( CORBA::ULong i = 0; i < anElementsId->length(); i++) { value += theFunctor->GetValue( anElementsId[i] ); } } diff --git a/src/SMESH_I/SMESH_Pattern_i.cxx b/src/SMESH_I/SMESH_Pattern_i.cxx index f7fcbb493..511433f6f 100644 --- a/src/SMESH_I/SMESH_Pattern_i.cxx +++ b/src/SMESH_I/SMESH_Pattern_i.cxx @@ -284,7 +284,7 @@ SMESH::point_array* list xyzList; set fset; - for (int i = 0; i < theFacesIDs.length(); i++) + for ( CORBA::ULong i = 0; i < theFacesIDs.length(); i++) { CORBA::Long index = theFacesIDs[i]; const SMDS_MeshElement * elem = aMesh->GetMeshDS()->FindElement(index); @@ -345,7 +345,7 @@ SMESH::point_array* list xyzList; set vset; - for (int i = 0; i < theVolumesIDs.length(); i++) + for ( CORBA::ULong i = 0; i < theVolumesIDs.length(); i++) { CORBA::Long index = theVolumesIDs[i]; const SMDS_MeshElement * elem = aMesh->GetMeshDS()->FindElement(index); diff --git a/src/SMESH_I/SMESH_PreMeshInfo.cxx b/src/SMESH_I/SMESH_PreMeshInfo.cxx index 130330c1c..21fe1513e 100644 --- a/src/SMESH_I/SMESH_PreMeshInfo.cxx +++ b/src/SMESH_I/SMESH_PreMeshInfo.cxx @@ -899,7 +899,7 @@ void SMESH_PreMeshInfo::readSubMeshes(DriverMED_R_SMESHDS_Mesh* reader) const HDFdataset* aDataset = new HDFdataset( (char*) aDSName.c_str(), aGroup ); aDataset->OpenOnDisk(); // read submesh IDs for all elements sorted by ID - int nbElems = aDataset->GetSize(); + size_t nbElems = aDataset->GetSize(); int* smIDs = new int [ nbElems ]; aDataset->ReadFromDisk( smIDs ); aDataset->CloseOnDisk(); @@ -921,7 +921,7 @@ void SMESH_PreMeshInfo::readSubMeshes(DriverMED_R_SMESHDS_Mesh* reader) const } // add elements to submeshes TIDSortedElemSet::iterator iE = elemSet.begin(); - for ( int i = 0; i < nbElems; ++i, ++iE ) + for ( size_t i = 0; i < nbElems; ++i, ++iE ) { int smID = smIDs[ i ]; if ( smID == 0 ) continue; diff --git a/src/SMESH_I/SMESH_subMesh_i.cxx b/src/SMESH_I/SMESH_subMesh_i.cxx index 02c2664f0..ee9117e2c 100644 --- a/src/SMESH_I/SMESH_subMesh_i.cxx +++ b/src/SMESH_I/SMESH_subMesh_i.cxx @@ -95,7 +95,7 @@ typedef list TListOfSubMeshes; bool getSubMeshes(::SMESH_subMesh* theSubMesh, TListOfSubMeshes& theSubMeshList) { - int size = theSubMeshList.size(); + size_t size = theSubMeshList.size(); SMESH_Mesh* aMesh = theSubMesh->GetFather(); SMESHDS_Mesh* aMeshDS = aMesh->GetMeshDS(); diff --git a/src/StdMeshers/StdMeshers_QuadFromMedialAxis_1D2D.cxx b/src/StdMeshers/StdMeshers_QuadFromMedialAxis_1D2D.cxx index 8bf7d6ac2..55e0d19ab 100644 --- a/src/StdMeshers/StdMeshers_QuadFromMedialAxis_1D2D.cxx +++ b/src/StdMeshers/StdMeshers_QuadFromMedialAxis_1D2D.cxx @@ -551,7 +551,7 @@ namespace allEdges, theShortEdges[ nbBranchPoints > 0 ] )) return false; - for ( size_t iS = 0; iS < theShortEdges[ nbBranchPoints ].size(); ++iS ) + for ( size_t iS = 0; iS < theShortEdges[ nbBranchPoints > 0 ].size(); ++iS ) shortMap.Add( theShortEdges[ nbBranchPoints ][ iS ]); ++nbBranchPoints; diff --git a/src/StdMeshers_I/StdMeshers_FixedPoints1D_i.cxx b/src/StdMeshers_I/StdMeshers_FixedPoints1D_i.cxx index 2db85387e..580331db5 100644 --- a/src/StdMeshers_I/StdMeshers_FixedPoints1D_i.cxx +++ b/src/StdMeshers_I/StdMeshers_FixedPoints1D_i.cxx @@ -137,7 +137,7 @@ SMESH::double_array* StdMeshers_FixedPoints1D_i::GetPoints() SMESH::double_array_var anArray = new SMESH::double_array; std::vector params = this->GetImpl()->GetPoints(); anArray->length( params.size() ); - for ( CORBA::Long i = 0; i < params.size(); i++) + for ( CORBA::ULong i = 0; i < params.size(); i++) anArray [ i ] = params [ i ]; return anArray._retn(); @@ -158,7 +158,7 @@ SMESH::long_array* StdMeshers_FixedPoints1D_i::GetNbSegments() SMESH::long_array_var anArray = new SMESH::long_array; std::vector nbsegs = this->GetImpl()->GetNbSegments(); anArray->length( nbsegs.size() ); - for ( CORBA::Long i = 0; i < nbsegs.size(); i++) + for ( CORBA::ULong i = 0; i < nbsegs.size(); i++) anArray [ i ] = nbsegs [ i ]; return anArray._retn(); @@ -252,7 +252,7 @@ SMESH::long_array* StdMeshers_FixedPoints1D_i::GetReversedEdges() SMESH::long_array_var anArray = new SMESH::long_array; std::vector ids = this->GetImpl()->GetReversedEdges(); anArray->length( ids.size() ); - for ( CORBA::Long i = 0; i < ids.size(); i++) + for ( CORBA::ULong i = 0; i < ids.size(); i++) anArray [ i ] = ids [ i ]; return anArray._retn(); diff --git a/src/StdMeshers_I/StdMeshers_ImportSource1D_i.cxx b/src/StdMeshers_I/StdMeshers_ImportSource1D_i.cxx index 681092fc2..9b6f41db1 100644 --- a/src/StdMeshers_I/StdMeshers_ImportSource1D_i.cxx +++ b/src/StdMeshers_I/StdMeshers_ImportSource1D_i.cxx @@ -91,7 +91,7 @@ void StdMeshers_ImportSource1D_i::SetSourceEdges(const SMESH::ListOfGroups& grou std::vector smesh_groups; std::vector entries; SALOMEDS::Study_var study = SMESH_Gen_i::GetSMESHGen()->GetCurrentStudy(); - for ( int i = 0; i < groups.length(); ++i ) + for ( CORBA::ULong i = 0; i < groups.length(); ++i ) if ( SMESH_GroupBase_i* gp_i = SMESH::DownCast( groups[i] )) { if ( gp_i->GetType() != SMESH::EDGE ) @@ -109,7 +109,7 @@ void StdMeshers_ImportSource1D_i::SetSourceEdges(const SMESH::ListOfGroups& grou _groupEntries = new SMESH::string_array; _groupEntries->length( entries.size ()); - for ( int i = 0; i < entries.size(); ++i ) + for ( size_t i = 0; i < entries.size(); ++i ) _groupEntries[i] = entries[i].c_str(); } catch ( SALOME_Exception& S_ex ) @@ -173,7 +173,7 @@ char* StdMeshers_ImportSource1D_i::SaveTo() os << " " << _groupEntries->length(); SALOMEDS::Study_var study = SMESH_Gen_i::GetSMESHGen()->GetCurrentStudy(); - for ( int i = 0; i < _groupEntries->length(); ++i ) + for ( size_t i = 0; i < _groupEntries->length(); ++i ) { // entry os << " " << _groupEntries[i]; @@ -208,7 +208,7 @@ void StdMeshers_ImportSource1D_i::LoadFrom( const char* theStream ) _groupEntries = new SMESH::string_array; _groupEntries->length( nbGroups ); std::string id, entry; - for ( int i = 0; i < _groupEntries->length(); ++i ) + for ( size_t i = 0; i < _groupEntries->length(); ++i ) { if ( is >> entry ) _groupEntries[i] = entry.c_str(); diff --git a/src/StdMeshers_I/StdMeshers_ImportSource2D_i.cxx b/src/StdMeshers_I/StdMeshers_ImportSource2D_i.cxx index f8305e9c7..051ae469c 100644 --- a/src/StdMeshers_I/StdMeshers_ImportSource2D_i.cxx +++ b/src/StdMeshers_I/StdMeshers_ImportSource2D_i.cxx @@ -90,7 +90,7 @@ void StdMeshers_ImportSource2D_i::SetSourceFaces(const SMESH::ListOfGroups& grou std::vector smesh_groups; std::vector entries; SALOMEDS::Study_var study = SMESH_Gen_i::GetSMESHGen()->GetCurrentStudy(); - for ( int i = 0; i < groups.length(); ++i ) + for ( CORBA::ULong i = 0; i < groups.length(); ++i ) if ( SMESH_GroupBase_i* gp_i = SMESH::DownCast( groups[i] )) { if ( gp_i->GetType() != SMESH::FACE ) @@ -109,7 +109,7 @@ void StdMeshers_ImportSource2D_i::SetSourceFaces(const SMESH::ListOfGroups& grou _groupEntries = new SMESH::string_array; _groupEntries->length( entries.size ()); - for ( int i = 0; i < entries.size(); ++i ) + for ( size_t i = 0; i < entries.size(); ++i ) _groupEntries[i] = entries[i].c_str(); } catch ( SALOME_Exception& S_ex ) @@ -173,7 +173,7 @@ char* StdMeshers_ImportSource2D_i::SaveTo() os << " " << _groupEntries->length(); SALOMEDS::Study_var study = SMESH_Gen_i::GetSMESHGen()->GetCurrentStudy(); - for ( int i = 0; i < _groupEntries->length(); ++i ) + for ( CORBA::ULong i = 0; i < _groupEntries->length(); ++i ) { // entry os << " " << _groupEntries[i]; @@ -210,7 +210,7 @@ void StdMeshers_ImportSource2D_i::LoadFrom( const char* theStream ) _groupEntries = new SMESH::string_array; _groupEntries->length( nbGroups ); std::string id, entry; - for ( int i = 0; i < _groupEntries->length(); ++i ) + for ( CORBA::ULong i = 0; i < _groupEntries->length(); ++i ) { if ( is >> entry ) _groupEntries[i] = entry.c_str(); diff --git a/src/StdMeshers_I/StdMeshers_LengthFromEdges_i.cxx b/src/StdMeshers_I/StdMeshers_LengthFromEdges_i.cxx index 59e6d7713..da92224e8 100644 --- a/src/StdMeshers_I/StdMeshers_LengthFromEdges_i.cxx +++ b/src/StdMeshers_I/StdMeshers_LengthFromEdges_i.cxx @@ -105,6 +105,16 @@ CORBA::Long StdMeshers_LengthFromEdges_i::GetMode() return this->GetImpl()->GetMode(); } +//================================================================================ +/*! + * \brief Return false as in SALOME the mode is not used + */ +//================================================================================ + +CORBA::Boolean StdMeshers_LengthFromEdges_i::HasParameters() +{ + return false; +} //============================================================================= /*! diff --git a/src/StdMeshers_I/StdMeshers_LengthFromEdges_i.hxx b/src/StdMeshers_I/StdMeshers_LengthFromEdges_i.hxx index 06f98664f..6e121afc7 100644 --- a/src/StdMeshers_I/StdMeshers_LengthFromEdges_i.hxx +++ b/src/StdMeshers_I/StdMeshers_LengthFromEdges_i.hxx @@ -59,6 +59,9 @@ public: // Get mode CORBA::Long GetMode(); + // Return false as in SALOME the mode is not used + CORBA::Boolean HasParameters(); + // Get implementation ::StdMeshers_LengthFromEdges* GetImpl();