+//=======================================================================
+//function : HighLightInvalid
+//purpose : change font color of a object in the Object Browser
+//=======================================================================
+
+void SMESH_Gen_i::HighLightInvalid( CORBA::Object_ptr theObject, bool isInvalid )
+{
+ SALOMEDS::SObject_wrap so = ObjectToSObject(theObject);
+ highLightInvalid( so.in(), isInvalid );
+}
+
+//=======================================================================
+//function : highLightInvalid
+//purpose : change font color of a object in the Object Browser
+//=======================================================================
+
+void SMESH_Gen_i::highLightInvalid( SALOMEDS::SObject_ptr theSObject, bool isInvalid )
+{
+ if ( !theSObject->_is_nil() )
+ {
+ SALOMEDS::StudyBuilder_var studyBuilder = getStudyServant()->NewBuilder();
+ if ( isInvalid )
+ {
+ SALOMEDS::Color red = { 178,34,34 }; // to differ from reference color
+ SALOMEDS::GenericAttribute_wrap attr =
+ studyBuilder->FindOrCreateAttribute( theSObject, "AttributeTextColor" );
+ SALOMEDS::AttributeTextColor_wrap colorAttr = attr;
+ colorAttr->SetTextColor( red );
+ }
+ else
+ {
+ studyBuilder->RemoveAttribute( theSObject, "AttributeTextColor" );
+ }
+ }
+}
+
+//=======================================================================
+//function : IsInvalid
+//purpose : Check object validity == absence of AttributeTextColor=(178,34,34)
+//=======================================================================
+
+bool SMESH_Gen_i::IsInvalid( SALOMEDS::SObject_ptr theSObject )
+{
+ bool isValid = true;
+ if ( !theSObject->_is_nil() )
+ {
+ SALOMEDS::GenericAttribute_wrap attr;
+ SALOMEDS::StudyBuilder_var studyBuilder = getStudyServant()->NewBuilder();
+ if ( studyBuilder->FindAttribute( theSObject, attr.inout(), "AttributeTextColor" ))
+ {
+ SALOMEDS::AttributeTextColor_wrap colorAttr = attr;
+ SALOMEDS::Color color = colorAttr->TextColor();
+ isValid = ( color.R != 178 || color.G != 34 || color.B != 34 );
+ }
+ }
+ return isValid;
+}
+