X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FHYDROGUI%2FHYDROGUI_Tool.cxx;fp=src%2FHYDROGUI%2FHYDROGUI_Tool.cxx;h=34f600f5cf43b907d6ab137c076f2f805b45739f;hb=e84c3bdbce884a7e150fff690f0c1a3e0b12ed90;hp=75526f52e295f1b136eb90d9b85a84d2875bb616;hpb=cacc27879eb1dc0b3aec9ac958e432451378e68f;p=modules%2Fhydro.git diff --git a/src/HYDROGUI/HYDROGUI_Tool.cxx b/src/HYDROGUI/HYDROGUI_Tool.cxx index 75526f52..34f600f5 100644 --- a/src/HYDROGUI/HYDROGUI_Tool.cxx +++ b/src/HYDROGUI/HYDROGUI_Tool.cxx @@ -31,6 +31,7 @@ #include #include #include +#include #include @@ -693,16 +694,26 @@ QColor HYDROGUI_Tool::GenerateFillingColor( const Handle(HYDROData_Document)& th } QStringList HYDROGUI_Tool::FindExistingObjectsNames( const Handle(HYDROData_Document)& theDoc, - const ObjectKind theObjectKind ) + const ObjectKind theObjectKind, + bool isCheckValidProfile ) { QStringList aNames; HYDROData_Iterator anIter( theDoc, theObjectKind ); for ( ; anIter.More(); anIter.Next() ) { Handle(HYDROData_Entity) anObject = anIter.Current(); - if( !anObject.IsNull() ) { - aNames.append( anObject->GetName() ); + + bool isOK = !anObject.IsNull(); + + if( isOK && isCheckValidProfile ) + { + Handle_HYDROData_Profile aProfile = Handle_HYDROData_Profile::DownCast( anObject ); + if( !aProfile.IsNull() && !aProfile->IsValid() ) + isOK = false; } + + if( isOK ) + aNames.append( anObject->GetName() ); } return aNames;