if(MYDEBUG) cout << "CreateHolder " << theType << endl;
CORBA::Float aRequiredMemory = 0.0;
if(IsPossible(theType, theInput, aRequiredMemory, "")){
- VISU::ColoredPrs3dHolder_i* aHolder = new VISU::ColoredPrs3dHolder_i(*this);
- VISU::ColoredPrs3d_i* aColoredPrs3d = CreateColoredPrs3d(theType, theInput);
- std::string aComment = std::string("myComment=") + aColoredPrs3d->GetComment();
- std::string aName = aColoredPrs3d->GenerateName().latin1();
- aHolder->PublishInStudy(aName, aComment);
- RegisterInHolder(aColoredPrs3d, aHolder->GetEntry());
- if( aRequiredMemory > 1.0 / VTK_LARGE_FLOAT )
- ClearMemory( aRequiredMemory, aHolder->GetEntry() );
- return aHolder->_this();
+ if(VISU::ColoredPrs3d_i* aColoredPrs3d = CreateColoredPrs3d(theType, theInput)){
+ VISU::ColoredPrs3dHolder_i* aHolder = new VISU::ColoredPrs3dHolder_i(*this);
+ std::string aComment = std::string("myComment=") + aColoredPrs3d->GetComment();
+ std::string aName = aColoredPrs3d->GenerateName().latin1();
+ aHolder->PublishInStudy(aName, aComment);
+ RegisterInHolder(aColoredPrs3d, aHolder->GetEntry());
+ if( aRequiredMemory > 1.0 / VTK_LARGE_FLOAT )
+ ClearMemory( aRequiredMemory, aHolder->GetEntry() );
+ return aHolder->_this();
+ }
}
return VISU::ColoredPrs3dHolder::_nil();
}
aPrs3d->SetEntity( theInput.myEntity );
aPrs3d->SetFieldName( theInput.myFieldName );
aPrs3d->SetTimeStampNumber( theInput.myTimeStampNumber );
- aPrs3d->Apply( false );
- return aPrs3d;
+ if(aPrs3d->Apply( false ))
+ return aPrs3d;
+ return NULL;
}
const std::string& theHolderEntry)
{
if(MYDEBUG) cout << "RegisterInHolder " << theHolderEntry.c_str() << " " << thePrs3d << endl;
- TPrs3dPtr aPrs3d(thePrs3d);
- myHolderMap[theHolderEntry].push_front(aPrs3d);
- thePrs3d->SetHolderEntry( theHolderEntry );
- thePrs3d->Destroy();
+ if(thePrs3d){
+ TPrs3dPtr aPrs3d(thePrs3d);
+ myHolderMap[theHolderEntry].push_front(aPrs3d);
+ thePrs3d->SetHolderEntry( theHolderEntry );
+ thePrs3d->Destroy();
+ }
return thePrs3d;
}