VisuGUI::
OnDeletePrs()
{
+ _PTR(Study) aCStudy = GetCStudy(GetAppStudy(this));
+ if (CheckLock(aCStudy))
+ return;
+ SALOMEDS::Study_var aStudy = GetDSStudy(aCStudy);
+
+ Handle(SALOME_InteractiveObject) anIO;
+ CORBA::Object_var anObject = GetSelectedObj(this, &anIO);
+ if (anIO.IsNull())
+ return;
+
+ // There is a transaction
+ SALOMEDS::StudyBuilder_var aStudyBuilder = aStudy->NewBuilder();
+ aStudyBuilder->NewCommand();
+
+ // is it Prs3d object ?
+ VISU::Prs3d_i* aPrsObject = dynamic_cast<VISU::Prs3d_i*>(VISU::GetServant(anObject).in());
+ if (aPrsObject) {
+ //jfa tmp:DeletePresentation(aPrsObject);
+ DeletePrs3d(this, aPrsObject, anIO);
+ }
+
+ // is it Curve object ?
+ VISU::Curve_i* aCurveObject = dynamic_cast<VISU::Curve_i*>(VISU::GetServant(anObject).in());
+ if (aCurveObject) {
+ //jfa tmp:DeletePresentation(aCurveObject);
+ //DeleteCurve(this, aCurveObject, anIO);
+ }
+
+ aStudyBuilder->CommitCommand();
}
void
if (CORBA::is_nil(aPrs3d)) continue;
VISU::Prs3d_i* pPrs3d = dynamic_cast<VISU::Prs3d_i*>(VISU::GetServant(aPrs3d).in());
//jfa tmp:DeletePresentation(pPrs3d);
+ DeletePrs3d(this, pPrs3d, NULL);
}
break;
}
mgr->insert( action( 4032 ), -1, -1, -1 ); // display only
mgr->setRule( action( 4032 ), aRule.arg(""), true );
+ aRule = "client='ObjectBrowser' and selcount=1 and $type in {'VISU::TTABLE' "
+ "'VISU::TCURVE' 'VISU::TCONTAINER' 'VISU::TMESH' 'VISU::TSCALARMAP' "
+ "'VISU::TISOSURFACE' 'VISU::TDEFORMEDSHAPE' 'VISU::TCUTPLANES' "
+ "'VISU::TCUTLINES' 'VISU::TVECTORS' 'VISU::TSTREAMLINES'}";
+ mgr->insert( action( 4033 ), -1, -1, -1 ); // delete presentation
+ mgr->setRule( action( 4033 ), aRule.arg(""), true );
+
// View parameters
mgr->insert ( action( 4046 ), -1, -1, -1 ); // save view params
//jfa tmp:mgr->setRule( action( 4046 ), "(client='VTKViewer' and selcount=0) or (selcount=1 and type='VISU::TVIEW3D')", true );
Remove(SalomeApp_SelectionMgr* theSelectionMgr,
const Handle(SALOME_InteractiveObject)& theIO)
{
- SALOME_ListIO aListIO;
+ SALOME_ListIO aListIO, aNewListIO;
theSelectionMgr->selectedObjects(aListIO);
- SALOME_ListIteratorOfListIO anIter(aListIO);
- while(anIter.More()){
+ SALOME_ListIteratorOfListIO anIter (aListIO);
+ for (; anIter.More(); anIter.Next()) {
Handle(SALOME_InteractiveObject) anIO = anIter.Value();
- if(anIO->isSame(theIO)){
- aListIO.Remove(anIter);
+ if (!anIO->isSame(theIO)) {
+ aNewListIO.Append(theIO);
}
- anIter.Next();
}
- theSelectionMgr->setSelectedObjects(aListIO);
+ theSelectionMgr->setSelectedObjects(aNewListIO);
}
void