+ createSMESHAction( 300, "ERASE" );
+ createSMESHAction( 301, "DISPLAY" );
+ createSMESHAction( 302, "DISPLAY_ONLY" );
+ createSMESHAction( 4033, "POLYHEDRON", "ICON_DLG_POLYHEDRON" );
+
+ // ----- create menu --------------
+ int fileId = createMenu( tr( "MEN_FILE" ), -1, 1 ),
+ editId = createMenu( tr( "MEN_EDIT" ), -1, 3 ),
+ toolsId = createMenu( tr( "MEN_TOOLS" ), -1, 5, 10 ),
+ hypoId = createMenu( tr( "MEN_HYPO" ), -1, 50, 10 ),
+ meshId = createMenu( tr( "MEN_MESH" ), -1, 70, 10 ),
+ ctrlId = createMenu( tr( "MEN_CTRL" ), -1, 60, 10 ),
+ modifyId = createMenu( tr( "MEN_MODIFY" ), -1, 40, 10 ),
+ prefId = createMenu( tr( "MEN_PREF" ), -1, 4, 10 ),
+ viewId = createMenu( tr( "MEN_VIEW" ), -1, 2 );
+
+ createMenu( separator(), fileId );
+
+ int importId = createMenu( tr( "MEN_IMPORT" ), fileId, 11, 10 ),
+ exportId = createMenu( tr( "MEN_EXPORT" ), fileId, 12, 10 ),
+
+ addId = createMenu( tr( "MEN_ADD" ), modifyId, 402 ),
+ removeId = createMenu( tr( "MEN_REMOVE" ), modifyId, 403 ),
+ renumId = createMenu( tr( "MEN_RENUM" ), modifyId, 404 ),
+ transfId = createMenu( tr( "MEN_TRANSF" ), modifyId, 405 ),
+
+ meshPrefId = createMenu( tr( "MEN_MESH" ), prefId, 100 ),
+
+ dispModeId = createMenu( tr( "MEN_DISPMODE" ), meshPrefId, 1000 ),
+ qualityId = createMenu( tr( "MEN_QUALITY" ), meshPrefId, 1007 );
+
+ createMenu( 111, importId, -1 );
+ createMenu( 112, importId, -1 );
+ createMenu( 113, importId, -1 );
+
+ createMenu( 121, exportId, -1 );
+ createMenu( 122, exportId, -1 );
+ createMenu( 123, exportId, -1 );
+
+ createMenu( separator(), fileId, 10 );
+
+ createMenu( 33, editId, -1 );
+
+ createMenu( 5105, toolsId, -1 );
+
+ createMenu( 5000, hypoId, -1 );
+ createMenu( 5010, hypoId, -1 );
+
+ createMenu( 703, meshId, -1 );
+ createMenu( 702, meshId, -1 );
+ createMenu( 704, meshId, -1 );
+ createMenu( separator(), meshId, -1 );
+ createMenu( 701, meshId, -1 );
+ createMenu( separator(), meshId, -1 );
+ createMenu( 801, meshId, -1 );
+ createMenu( 802, meshId, -1 );
+ createMenu( 803, meshId, -1 );
+ createMenu( separator(), meshId, -1 );
+ createMenu( 810, meshId, -1 );
+ createMenu( 811, meshId, -1 );
+ createMenu( 812, meshId, -1 );
+ createMenu( separator(), meshId, -1 );
+ createMenu( 813, meshId, -1 );
+ createMenu( separator(), meshId, -1 );
+ createMenu( 900, meshId, -1 );
+ createMenu( 902, meshId, -1 );
+ createMenu( separator(), meshId, -1 );
+
+ createMenu( 6003, ctrlId, -1 );
+ createMenu( 6001, ctrlId, -1 );
+ createMenu( 6004, ctrlId, -1 );
+ createMenu( separator(), ctrlId, -1 );
+ createMenu( 6002, ctrlId, -1 );
+ createMenu( 6018, ctrlId, -1 );
+ createMenu( 6019, ctrlId, -1 );
+ createMenu( 6011, ctrlId, -1 );
+ createMenu( 6012, ctrlId, -1 );
+ createMenu( 6013, ctrlId, -1 );
+ createMenu( 6014, ctrlId, -1 );
+ createMenu( 6015, ctrlId, -1 );
+ createMenu( 6016, ctrlId, -1 );
+ createMenu( separator(), ctrlId, -1 );
+ createMenu( 6017, ctrlId, -1 );
+ createMenu( separator(), ctrlId, -1 );
+
+ createMenu( 400, addId, -1 );
+ createMenu( 401, addId, -1 );
+ createMenu( 4021, addId, -1 );
+ createMenu( 4022, addId, -1 );
+ createMenu( 4023, addId, -1 );
+ createMenu( 4031, addId, -1 );
+ createMenu( 4032, addId, -1 );
+ createMenu( 4033, addId, -1 );
+
+ createMenu( 4041, removeId, -1 );
+ createMenu( 4042, removeId, -1 );
+
+ createMenu( 4051, renumId, -1 );
+ createMenu( 4052, renumId, -1 );
+
+ createMenu( 4061, transfId, -1 );
+ createMenu( 4062, transfId, -1 );
+ createMenu( 4063, transfId, -1 );
+ createMenu( 4064, transfId, -1 );
+ createMenu( 4065, transfId, -1 );
+
+ createMenu( 406, modifyId, -1 );
+ createMenu( 407, modifyId, -1 );
+ createMenu( 408, modifyId, -1 );
+ createMenu( 409, modifyId, -1 );
+ createMenu( 410, modifyId, -1 );
+ createMenu( 411, modifyId, -1 );
+ createMenu( 412, modifyId, -1 );
+ createMenu( 413, modifyId, -1 );
+ createMenu( 416, modifyId, -1 );
+ createMenu( 414, modifyId, -1 );
+ createMenu( 415, modifyId, -1 );
+
+ createMenu( 10001, dispModeId, -1 );
+ createMenu( 10002, dispModeId, -1 );
+ createMenu( 10004, dispModeId, -1 );
+ createMenu( 10003, dispModeId, -1 );
+
+ createMenu( 1001, prefId, -1 );
+ createMenu( separator(), prefId, -1 );
+ createMenu( 1003, prefId, -1 );
+ createMenu( separator(), prefId, -1 );
+ createMenu( 1005, prefId, -1 );
+ createMenu( separator(), prefId, -1 );
+ createMenu( 1006, prefId, -1 );
+ createMenu( separator(), prefId, -1 );
+
+ createMenu( 10070, qualityId, -1 );
+ createMenu( 10071, qualityId, -1 );
+
+ createMenu( separator(), prefId, -1 );
+
+ createMenu( 214, viewId, -1 );
+
+ // ----- create toolbars --------------
+ int meshTb = createTool( tr( "TB_MESH" ) ),
+ hypoTb = createTool( tr( "TB_HYPO" ) ),
+ ctrlTb = createTool( tr( "TB_CTRL" ) ),
+ addRemTb = createTool( tr( "TB_ADD_REMOVE" ) ),
+ modifyTb = createTool( tr( "TB_MODIFY" ) ),
+ dispModeTb = createTool( tr( "TB_DISP_MODE" ) );
+
+ createTool( 703, meshTb );
+ createTool( 702, meshTb );
+ createTool( 704, meshTb );
+ createTool( separator(), meshTb );
+ createTool( 701, meshTb );
+ createTool( separator(), meshTb );
+ createTool( 801, meshTb );
+ createTool( 802, meshTb );
+ createTool( 803, meshTb );
+ createTool( separator(), meshTb );
+ createTool( 900, meshTb );
+ createTool( 902, meshTb );
+ createTool( separator(), meshTb );
+
+ createTool( 5000, hypoTb );
+ createTool( 5010, hypoTb );
+
+ createTool( 6001, ctrlTb );
+ createTool( 6003, ctrlTb );
+ createTool( 6004, ctrlTb );
+ createTool( separator(), ctrlTb );
+ createTool( 6002, ctrlTb );
+ createTool( 6018, ctrlTb );
+ createTool( 6019, ctrlTb );
+ createTool( 6011, ctrlTb );
+ createTool( 6012, ctrlTb );
+ createTool( 6013, ctrlTb );
+ createTool( 6014, ctrlTb );
+ createTool( 6015, ctrlTb );
+ createTool( 6016, ctrlTb );
+ createTool( separator(), ctrlTb );
+ createTool( 6017, ctrlTb );
+ createTool( separator(), ctrlTb );
+
+ createTool( 400, addRemTb );
+ createTool( 401, addRemTb );
+ createTool( 4021, addRemTb );
+ createTool( 4022, addRemTb );
+ createTool( 4023, addRemTb );
+ createTool( 4031, addRemTb );
+ createTool( 4032, addRemTb );
+ createTool( 4033, addRemTb );
+ createTool( separator(), addRemTb );
+ createTool( 4041, addRemTb );
+ createTool( 4042, addRemTb );
+ createTool( separator(), addRemTb );
+ createTool( 4051, addRemTb );
+ createTool( 4052, addRemTb );
+ createTool( separator(), addRemTb );
+ createTool( 4061, addRemTb );
+ createTool( 4062, addRemTb );
+ createTool( 4063, addRemTb );
+ createTool( 4064, addRemTb );
+ createTool( 4065, addRemTb );
+ createTool( separator(), addRemTb );
+
+ createTool( 406, modifyTb );
+ createTool( 407, modifyTb );
+ createTool( 408, modifyTb );
+ createTool( 409, modifyTb );
+ createTool( 410, modifyTb );
+ createTool( 411, modifyTb );
+ createTool( 412, modifyTb );
+ createTool( 413, modifyTb );
+ createTool( 416, modifyTb );
+ createTool( 414, modifyTb );
+ createTool( 415, modifyTb );
+
+ createTool( 214, dispModeTb );
+
+
+ myRules.clear();
+ QString OB = "'ObjectBrowser'",
+ View = "'" + SVTK_Viewer::Type() + "'",
+ pat = "'%1'",
+ mesh = pat.arg( SMESHGUI_Selection::typeName( MESH ) ),
+ group = pat.arg( SMESHGUI_Selection::typeName( GROUP ) ),
+ hypo = pat.arg( SMESHGUI_Selection::typeName( HYPOTHESIS ) ),
+ algo = pat.arg( SMESHGUI_Selection::typeName( ALGORITHM ) ),
+ elems = QString( "'%1' '%2' '%3' '%4' '%5'" ).
+ arg( SMESHGUI_Selection::typeName( SUBMESH_VERTEX ) ).
+ arg( SMESHGUI_Selection::typeName( SUBMESH_EDGE ) ).
+ arg( SMESHGUI_Selection::typeName( SUBMESH_FACE ) ).
+ arg( SMESHGUI_Selection::typeName( SUBMESH_SOLID ) ).
+ arg( SMESHGUI_Selection::typeName( SUBMESH_COMPOUND ) ),
+ subMesh = elems,
+ mesh_group = mesh + " " + subMesh + " " + group,
+ hyp_alg = hypo + " " + algo;
+
+ // popup for object browser
+
+ createPopupItem( 705, OB, mesh, "&& isComputable"); // EDIT_GLOBAL_HYPO
+ createPopupItem( 706, OB, subMesh, "&& isComputable" ); // EDIT_LOCAL_HYPO
+ createPopupItem( 803, OB, group ); // EDIT_GROUP
+ popupMgr()->insert( separator(), -1, 0 );
+ createPopupItem( 701, OB, mesh, "&& isComputable" ); // COMPUTE
+ createPopupItem( 214, OB, mesh_group ); // UPDATE
+ createPopupItem( 900, OB, mesh_group ); // ADV_INFO
+ createPopupItem( 902, OB, mesh ); // STD_INFO
+ popupMgr()->insert( separator(), -1, 0 );
+ createPopupItem( 801, OB, mesh ); // CREATE_GROUP
+ createPopupItem( 802, OB, subMesh ); // CONSTRUCT_GROUP
+ popupMgr()->insert( separator(), -1, 0 );
+ createPopupItem( 1100, OB, hypo ); // EDIT HYPOTHESIS
+ createPopupItem( 1102, OB, hyp_alg, "&& hasReference" ); // REMOVE HYPOTHESIS / ALGORITHMS
+ createPopupItem( 1101, OB, mesh_group + " " + hyp_alg ); // RENAME
+ popupMgr()->insert( separator(), -1, 0 );
+ createPopupItem( 125, OB, mesh ); // EXPORT_MED
+ createPopupItem( 126, OB, mesh ); // EXPORT_UNV
+ createPopupItem( 33, OB, subMesh + " " + group ); // DELETE
+ popupMgr()->insert( separator(), -1, 0 );
+
+ // popup for viewer
+ createPopupItem( 803, View, group ); // EDIT_GROUP
+ createPopupItem( 804, View, elems ); // ADD
+ createPopupItem( 805, View, elems ); // REMOVE
+ popupMgr()->insert( separator(), -1, 0 );
+ createPopupItem( 214, View, mesh_group ); // UPDATE
+ createPopupItem( 900, View, mesh_group ); // ADV_INFO
+ createPopupItem( 902, View, mesh ); // STD_INFO
+ popupMgr()->insert( separator(), -1, 0 );
+
+ int anId;
+ QString
+ isInvisible("not( isVisible )"),
+ isEmpty("numberOfNodes = 0"),
+ isNotEmpty("numberOfNodes <> 0"),
+
+ // has nodes, edges, etc in VISIBLE! actor
+ hasNodes("(numberOfNodes > 0 )"),//&& isVisible)"),
+ hasElems("(count( elemTypes ) > 0)"),
+ hasDifferentElems("(count( elemTypes ) > 1)"),
+ hasEdges("({'Edge'} in elemTypes)"),
+ hasFaces("({'Face'} in elemTypes)"),
+ hasVolumes("({'Volume'} in elemTypes)");
+
+ QString aSelCount = QString( "%1 = 1" ).arg( QtxPopupMgr::Selection::defSelCountParam() );
+ QString lc = QtxPopupMgr::Selection::defEquality();
+ QString aClient = QString( "%1client in {%2}" ).arg( lc ).arg( "'VTKViewer'" );
+ QString aType = QString( "%1type in {%2}" ).arg( QtxPopupMgr::Selection::defEquality() ).arg( mesh_group );
+ QString aMeshInVTK = aClient + "&&" + aType;// + "&&" + aSelCount;
+
+ //-------------------------------------------------
+ // Numbering
+ //-------------------------------------------------
+ anId = popupMgr()->insert( tr( "MEN_NUM" ), -1, -1 );