if(MYDEBUG) MESSAGE("VisuGUI::OnDisplayPrs");
SVTK_ViewWindow* vw = GetViewWindow( this, /*create=*/true );
-
+
QApplication::setOverrideCursor(Qt::waitCursor);
SALOME_ListIO aList;
SalomeApp_SelectionMgr* mgr = GetSelectionMgr(this);
QApplication::setOverrideCursor(Qt::waitCursor);
SVTK_ViewWindow* vw = GetViewWindow( this );
- if (vw)
+ if (vw)
vw->unHighlightAll();
SALOME_ListIO aList;
ErasePrs( this, anObject, false );
}
- if (vw)
+ if (vw)
vw->Repaint();
QApplication::restoreOverrideCursor();
// Rules
- QString aSel_One_ObjBr ("client='ObjectBrowser' and selcount=1");
- QString aSel_Some_ObjBr ("client='ObjectBrowser' and selcount>0");
- QString aSel_Many_ObjBr ("client='ObjectBrowser' and selcount>1");
-
QString aPrsAll ("'VISU::TSCALARMAP' 'VISU::TISOSURFACE' 'VISU::TDEFORMEDSHAPE' 'VISU::TCUTPLANES' "
"'VISU::TCUTLINES' 'VISU::TVECTORS' 'VISU::TSTREAMLINES' 'VISU::TPLOT3D'");
- QString aCurveAll = "'VISU::TTABLE' 'VISU::TCURVE' 'VISU::TCONTAINER'";
-
// VISU root commands
- QString aRule = aSel_One_ObjBr + " and type='VISU::TVISUGEN'";
+ QString aRule = "client='ObjectBrowser' and selcount=1 and type='VISU::TVISUGEN'";
mgr->setRule( action( VISU_IMPORT_FROM_FILE ), aRule, true );
mgr->setRule( action( VISU_IMPORT_TABLE ), aRule, true );
mgr->setRule( action( VISU_PLOT2D ), aRule, true );
// timestamp commands
- aRule = aSel_One_ObjBr + " and type='VISU::TTIMESTAMP'";
+ aRule = "client='ObjectBrowser' and selcount=1 and type='VISU::TTIMESTAMP'";
mgr->setRule( action( VISU_SCALAR_MAP ), aRule, true );
mgr->setRule( action( VISU_ISO_SURFACES ), aRule, true );
mgr->setRule( action( VISU_CUT_PLANES ), aRule, true );
mgr->setRule( action( VISU_VECTORS ), aRule, true );
mgr->setRule( action( VISU_STREAM_LINES ), aRule, true );
- // table commands
- //aRule = aSel_One_ObjBr + " and type='VISU::TTABLE'";
- //mgr->setRule( action( VISU_SHOW_TABLE ), aRule, true );
- //mgr->setRule( action( VISU_CREATE_CURVES ), aRule, true );
- //mgr->setRule( action( VISU_EXPORT_TABLE ), aRule, true );
+ // display/erase commands
+ QString andInvisible = " and (((not isVisible) and isActiveView) or (not isActiveView))";
+ QString aTableOrCont = "(type='VISU::TTABLE' and nbChildren>0) or type='VISU::TCONTAINER'";
+ QString orCurveVisible = "or (type='VISU::TCURVE' and isVisible)";
+ QString orCurveInvisible = "or (type='VISU::TCURVE'" + andInvisible + ")";
+ QString aPrsVisible = "(($type in {'VISU::TMESH' " + aPrsAll + "}) and isVisible)";
+ QString aPrsInvisible = "(($type in {'VISU::TMESH' " + aPrsAll + "})" + andInvisible + ")";
- aRule = "(" + aSel_Some_ObjBr + " and ((type='VISU::TTABLE' and nbChildren>0) or"
- " ($type in {'VISU::TCURVE' 'VISU::TCONTAINER'}))"
- ") or (selcount>0 and $type in {'VISU::TMESH' " + aPrsAll + "})";
+ QString anEraseRule = "selcount>0 and (" + aPrsVisible +
+ " or (client='ObjectBrowser' and (" + aTableOrCont + orCurveVisible + ")))";
- mgr->setRule( action( VISU_ERASE ), aRule + "and (isVisible=true)", true );// TODO: aRule.arg(" and isVisible=1"), true );
- mgr->setRule( action( VISU_DISPLAY ), aRule + "and ((isVisible=false and isActiveView=true) or (isActiveView=false))", true );// TODO: aRule.arg(" and isVisible=0"), true );
- mgr->setRule( action( VISU_DISPLAY_ONLY ), aRule, true );
+ QString aDisplayRule = "selcount>0 and (" + aPrsInvisible +
+ " or (client='ObjectBrowser' and (" + aTableOrCont + orCurveInvisible + ")))";
+
+ QString aDOnlyRule = "selcount>0 and (($type in {'VISU::TMESH' " + aPrsAll + "})"
+ " or (client='ObjectBrowser' and ((type='VISU::TTABLE' and nbChildren>0) or"
+ " ($type in {'VISU::TCURVE' 'VISU::TCONTAINER'}))))";
+
+ mgr->setRule( action( VISU_ERASE ), anEraseRule, true );
+ mgr->setRule( action( VISU_DISPLAY ), aDisplayRule, true );
+ mgr->setRule( action( VISU_DISPLAY_ONLY ), aDOnlyRule, true );
aRule = "selcount>0 and $type in {'VISU::TMESH' " + aPrsAll + "}";
mgr->setRule( action( VISU_TRANSLATE_PRS ), aRule, true );
mgr->setRule( action( VISU_MERGE_SCALAR_BARS ), aRule, true );
mgr->setRule( action( VISU_FREE_SCALAR_BARS ), aRule, true );
- // View parameters
+ // view parameters
aRule = "selcount=1 and type='VISU::TVIEW3D'";
mgr->setRule( action( VISU_SAVE_VIEW_PARAMS_1 ), aRule, true );
mgr->setRule( action( VISU_SAVE_VIEW_PARAMS ), "client='VTKViewer' and selcount=0", true );
mgr->setRule( action( VISU_LINE_WIDTH ), aRule + aLineType + " and hasActor=1", true );
// rename command
+ QString aCurveAll = "'VISU::TTABLE' 'VISU::TCURVE' 'VISU::TCONTAINER'";
+
aRule = "selcount=1 and ($type in {'VISU::TVIEW3D' 'VISU::TMESH' " + aCurveAll + " " + aPrsAll + "})";
mgr->setRule( action( VISU_RENAME ), aRule, true );
mgr->setRule( action( VISU_CURVE_PROPS ), aRule, true );
// curve container commands
- aRule = aSel_One_ObjBr + " and type='VISU::TCONTAINER'";
+ aRule = "client='ObjectBrowser' and selcount=1 and type='VISU::TCONTAINER'";
mgr->setRule( action( VISU_EDIT_CONTAINER ), aRule, true );
mgr->setRule( action( VISU_CLEAR_CONTAINER ), aRule, true );
- mgr->setRule( action( VISU_EDIT_SCALARMAP ),
+ mgr->setRule( action( VISU_EDIT_SCALARMAP ),
"selcount=1 and type='VISU::TSCALARMAP'", true );
- mgr->setRule( action( VISU_EDIT_DEFORMEDSHAPE ),
+ mgr->setRule( action( VISU_EDIT_DEFORMEDSHAPE ),
"selcount=1 and type='VISU::TDEFORMEDSHAPE'", true );
- mgr->setRule( action( VISU_EDIT_CUTPLANES ),
+ mgr->setRule( action( VISU_EDIT_CUTPLANES ),
"selcount=1 and type='VISU::TCUTPLANES'", true );
- mgr->setRule( action( VISU_EDIT_CUTLINES ),
+ mgr->setRule( action( VISU_EDIT_CUTLINES ),
"selcount=1 and type='VISU::TCUTLINES'", true );
- mgr->setRule( action( VISU_EDIT_ISOSURFACE ),
+ mgr->setRule( action( VISU_EDIT_ISOSURFACE ),
"selcount=1 and type='VISU::TISOSURFACE'", true );
- mgr->setRule( action( VISU_EDIT_VECTORS ),
+ mgr->setRule( action( VISU_EDIT_VECTORS ),
"selcount=1 and type='VISU::TVECTORS'", true );
- mgr->setRule( action( VISU_EDIT_STREAMLINES ),
+ mgr->setRule( action( VISU_EDIT_STREAMLINES ),
"selcount=1 and type='VISU::TSTREAMLINES'", true );
- mgr->setRule( action( VISU_EDIT_PLOT3D ),
+ mgr->setRule( action( VISU_EDIT_PLOT3D ),
"selcount=1 and type='VISU::TPLOT3D'", true );
aRule = "selcount=1 and type='VISU::TCUTLINES' and nbNamedChildren=0";
aRule = "selcount=1 and ($type in {" + aPrsAll + "})";
mgr->setRule( action( VISU_SWEEP ), aRule, true );
- // Selection info popup item
+ // "Selection info" popup item
aRule = "client='VTKViewer' and selcount=1" + aInsideType;
mgr->setRule( action( VISU_SELECTION_INFO ), aRule, true );
SUIT_ViewManager*
VisuGUI
-::getViewManager(const QString& theType,
+::getViewManager(const QString& theType,
const bool theIsCreate)
{
return getApp()->getViewManager(theType,theIsCreate);