0020788: EDF 1339 SMESH : Crash after enabling "Auto Color" feature in attached MED file

This commit is contained in:
dmv 2010-03-22 12:17:15 +00:00
parent 8a6ef93bb1
commit 736b66759f

View File

@ -684,8 +684,8 @@
aReservedColors.append( aColor ); aReservedColors.append( aColor );
_PTR(SObject) aGroupSObject = SMESH::FindSObject(aGroupObject); _PTR(SObject) aGroupSObject = SMESH::FindSObject(aGroupObject);
if(SMESH_Actor *anActor = SMESH::FindActorByEntry(aGroupSObject->GetID().c_str())) if (aGroupSObject) {
{ if(SMESH_Actor *anActor = SMESH::FindActorByEntry(aGroupSObject->GetID().c_str())) {
if( aGroupObject->GetType() == SMESH::NODE ) if( aGroupObject->GetType() == SMESH::NODE )
anActor->SetNodeColor( aColor.R, aColor.G, aColor.B ); anActor->SetNodeColor( aColor.R, aColor.G, aColor.B );
else if( aGroupObject->GetType() == SMESH::EDGE ) else if( aGroupObject->GetType() == SMESH::EDGE )
@ -694,6 +694,7 @@
anActor->SetSufaceColor( aColor.R, aColor.G, aColor.B ); anActor->SetSufaceColor( aColor.R, aColor.G, aColor.B );
} }
} }
}
SMESH::RepaintCurrentView(); SMESH::RepaintCurrentView();
} }