CheckLock( _PTR(Study) theStudy )
{
if(IsStudyLocked(theStudy))
- throw std::runtime_error(QObject::tr("WRN_STUDY_LOCKED").latin1());
+ {
+ SalomeApp_Application* anApp = dynamic_cast<SalomeApp_Application*>
+ (SUIT_Session::session()->activeApplication());
+ if (anApp)
+ {
+ SUIT_MessageBox::warn1(anApp->desktop(),
+ QObject::tr("WRN_VISU_WARNING"),
+ QObject::tr("WRN_STUDY_LOCKED"),
+ QObject::tr("BUT_OK"));
+ return true;
+ }
+ }
return false;
}
_PTR(SObject) aChildSObject = aChildIter->Value();
CORBA::Object_var aChildObj = VISU::ClientSObjectToObject(aChildSObject);
- VISU::RemovableObject_var aRemovableObject = VISU::RemovableObject::_narrow(aChildObj);
- if( !CORBA::is_nil( aRemovableObject ) )
- study->deleteReferencesTo( aChildSObject );
ErasePrs(theModule, aChildObj);
}
VISU::RemovableObject_var aRemovableObject = VISU::RemovableObject::_narrow(anObj);
if (!CORBA::is_nil(aRemovableObject)) {
- study->deleteReferencesTo( theSObject );
aRemovableObject->RemoveFromStudy();
}
} else {
else
{
SUIT_ViewManager* aViewManager = anApp->getViewManager( SVTK_Viewer::Type(), theCreate );
- return dynamic_cast<SVTK_ViewWindow*>( aViewManager->getActiveView() );
+ return aViewManager ? dynamic_cast<SVTK_ViewWindow*>( aViewManager->getActiveView() ) : 0;
}
}
return NULL;
int theDisplaying)
{
if ( theDisplaying == VISU::eErase ) {
- if ( plotCurve )
+ if ( plotCurve && aPlot )
aPlot->eraseCurve( plotCurve, false );
}
else if ( theDisplaying == VISU::eDisplay || theDisplaying == VISU::eDisplayOnly ) {
plotCurve->setColor( QColor( (int)(color.R*255.), (int)(color.G*255.), (int)(color.B*255.) ) );
}
plotCurve->setAutoAssign( theCurve->IsAuto() );
- aPlot->displayCurve( plotCurve, false );
+ if( aPlot )
+ aPlot->displayCurve( plotCurve, false );
}
else {
Plot2d_Curve* crv = theCurve->CreatePresentation();
if ( crv ) {
- aPlot->displayCurve( crv, false );
+ if( aPlot )
+ aPlot->displayCurve( crv, false );
theCurve->SetLine( (VISU::Curve::LineType)crv->getLine(), crv->getLineWidth() );
theCurve->SetMarker( (VISU::Curve::MarkerType)crv->getMarker());
SALOMEDS::Color newColor;