+
+ SMESH_Gen_i* aSMESHGenI = SMESH_Gen_i::GetSMESHGen();
+ SALOMEDS::Study_ptr aStudy = aSMESHGenI->GetCurrentStudy();
+ if( !CORBA::is_nil(aStudy) )
+ {
+ SALOMEDS::SObject_var aComp = aStudy->FindComponent(ComponentDataType());
+ if( !CORBA::is_nil(aComp) )
+ {
+ SALOMEDS::ChildIterator_var Itr = aStudy->NewChildIterator(aComp);
+ for( Itr->InitEx(true); Itr->More(); Itr->Next() )
+ {
+ SALOMEDS::SObject_var aSObj = Itr->Value();
+ CORBA::String_var aName = aSObj->GetName();
+
+ SMESH::SMESH_Mesh_var aMesh = SMESH::SMESH_Mesh::_narrow( SMESH_Gen_i::SObjectToObject( aSObj ) );
+ if( !CORBA::is_nil(aMesh) )
+ {
+ bool isAutoColor = aMesh->GetAutoColor();
+ if( isAutoColor )
+ {
+ anUpdatedScript += "\n\t";
+ anUpdatedScript += (char*)aName.in();
+ anUpdatedScript += ".SetAutoColor(1)";
+ }
+ }
+
+ SMESH::SMESH_GroupBase_var aGroup = SMESH::SMESH_GroupBase::_narrow( SMESH_Gen_i::SObjectToObject( aSObj ) );
+ if( !CORBA::is_nil(aGroup) )
+ {
+ SALOMEDS::Color aColor = aGroup->GetColor();
+ if ( aColor.R > 0 || aColor.G > 0 || aColor.B > 0 )
+ {
+ anUpdatedScript += "\n\t";
+ anUpdatedScript += (char*)aName.in();
+ anUpdatedScript += ".SetColor(SALOMEDS.Color(";
+ anUpdatedScript += aColor.R;
+ anUpdatedScript += ",";
+ anUpdatedScript += aColor.G;
+ anUpdatedScript += ",";
+ anUpdatedScript += aColor.B;
+ anUpdatedScript += "))";
+ }
+ }
+ }
+ }
+ }
+