Salome HOME
#17927: EDF 20035 - perfs of mesh creation
[modules/smesh.git] / src / SMESH_I / SMESH_Gen_i_1.cxx
index 1d7301ffe8b59f524767d6d77671cbf5ea5b026a..af7abc3d580d851bb54b4b250bdabd7d383baccf 100644 (file)
@@ -1030,6 +1030,28 @@ void SMESH_Gen_i::highLightInvalid( SALOMEDS::SObject_ptr theSObject, bool isInv
   }
 }
 
+//=======================================================================
+//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;
+}
+
 //=======================================================================
 //function : GetMeshOrSubmeshByShape
 //purpose  :