aStudyBuilder->Addreference(newObj,aRefSObj);
}
+ //---------------------------------------------------------------
+ // Issue 0021403. Remove a ColoredPrs3dHolder if a Result it refers to is removed
+ //
+ void RemoveHolders(VISU::Result_i* theResult)
+ {
+ CORBA::String_var resultID1 = theResult->GetID();
+ SALOMEDS::SObject_var theResSObject = theResult->GetSObject();
+ SALOMEDS::Study_var aStudyDocument = theResSObject->GetStudy();
+ SALOMEDS::SComponent_var aCompSObj = theResSObject->GetFatherComponent();
+ SALOMEDS::ChildIterator_var aChildIter = aStudyDocument->NewChildIterator(aCompSObj);
+ for (aChildIter->InitEx(true); aChildIter->More(); aChildIter->Next())
+ {
+ SALOMEDS::SObject_var aChildSObject = aChildIter->Value();
+ if ( CORBA::is_nil( aChildSObject )) continue;
+ CORBA::Object_var aChildObj = aChildSObject->GetObject();
+ if ( CORBA::is_nil( aChildObj )) continue;
+ VISU::ColoredPrs3dHolder_var prsHolder = ColoredPrs3dHolder::_narrow( aChildObj );
+ if ( prsHolder->_is_nil() ) continue;
+ // check if the prsHolder refers to theResult
+ VISU::ColoredPrs3dHolder::BasicInput_var input = prsHolder->GetBasicInput();
+ CORBA::String_var resultID2 = input->myResult->GetID();
+ if ( strcmp( resultID1, resultID2 ) == 0 )
+ prsHolder->RemoveFromStudy();
+ }
+ }
//---------------------------------------------------------------
}
void
Execute()
{
+ RemoveHolders(myRemovable);
VISU::RemoveFromStudy(myRemovable->GetSObject(),false);
myRemovable->UnRegister();
}