+// SUIT_ResourceMgr* mgr = app->resourceMgr();
+// if ( mgr )
+ /* Automatic Update flag */
+// myAutomaticUpdate = mgr->booleanValue( "SMESH", "AutomaticUpdate", myAutomaticUpdate );
+
+ // ----- create actions --------------
+
+ createSMESHAction( 111, "DAT", "", (CTRL+Key_B) );
+ createSMESHAction( 112, "UNV", "", (CTRL+Key_U) );
+ createSMESHAction( 113, "MED", "", (CTRL+Key_M) );
+ createSMESHAction( 114, "NUM" );
+ createSMESHAction( 121, "DAT" );
+ createSMESHAction( 122, "MED" );
+ createSMESHAction( 123, "UNV" );
+ createSMESHAction( 124, "EXPORT_DAT" );
+ createSMESHAction( 125, "EXPORT_MED" );
+ createSMESHAction( 126, "EXPORT_UNV" );
+ createSMESHAction( 33, "DELETE", "ICON_DELETE" );
+ createSMESHAction( 5105, "SEL_FILTER_LIB" );
+ createSMESHAction( 701, "COMPUTE", "ICON_COMPUTE" );
+ createSMESHAction( 702, "CREATE_MESH", "ICON_DLG_INIT_MESH" );
+ createSMESHAction( 703, "CREATE_SUBMESH", "ICON_DLG_ADD_SUBMESH" );
+ createSMESHAction( 704, "EDIT_MESHSUBMESH","ICON_DLG_EDIT_MESH" );
+ createSMESHAction( 801, "CREATE_GROUP", "ICON_SMESH_TREE_GROUP" );
+ createSMESHAction( 802, "CONSTRUCT_GROUP", "ICON_CONSTRUCT_GROUP" );
+ createSMESHAction( 803, "EDIT_GROUP", "ICON_EDIT_GROUP" );
+ createSMESHAction( 804, "ADD" );
+ createSMESHAction( 805, "REMOVE" );
+ createSMESHAction( 810, "UN_GROUP", "ICON_UNION" );
+ createSMESHAction( 811, "INT_GROUP", "ICON_INTERSECT" );
+ createSMESHAction( 812, "CUT_GROUP", "ICON_CUT" );
+ createSMESHAction( 813, "DEL_GROUP", "ICON_DEL_GROUP" );
+ createSMESHAction( 900, "ADV_INFO", "ICON_ADV_INFO" );
+ createSMESHAction( 902, "STD_INFO", "ICON_STD_INFO" );
+ createSMESHAction( 6001, "LENGTH", "ICON_LENGTH" , 0, true );
+ createSMESHAction( 6002, "FREE_EDGE", "ICON_FREE_EDGE" , 0, true );
+ createSMESHAction( 6003, "FREE_BORDER", "ICON_FREE_EDGE_2D" , 0, true );
+ createSMESHAction( 6004, "CONNECTION", "ICON_CONNECTION" , 0, true );
+ createSMESHAction( 6011, "AREA", "ICON_AREA" , 0, true );
+ createSMESHAction( 6012, "TAPER", "ICON_TAPER" , 0, true );
+ createSMESHAction( 6013, "ASPECT", "ICON_ASPECT" , 0, true );
+ createSMESHAction( 6014, "MIN_ANG", "ICON_ANGLE" , 0, true );
+ createSMESHAction( 6015, "WARP", "ICON_WARP" , 0, true );
+ createSMESHAction( 6016, "SKEW", "ICON_SKEW", 0, true );
+ createSMESHAction( 6017, "ASPECT_3D", "ICON_ASPECT_3D", 0, true );
+ createSMESHAction( 6018, "LENGTH_2D", "ICON_LENGTH_2D", 0, true );
+ createSMESHAction( 6019, "CONNECTION_2D", "ICON_CONNECTION_2D", 0, true );
+ createSMESHAction( 400, "NODE", "ICON_DLG_NODE" );
+ createSMESHAction( 401, "EDGE", "ICON_DLG_EDGE" );
+ createSMESHAction( 4021, "TRIANGLE", "ICON_DLG_TRIANGLE" );
+ createSMESHAction( 4022, "QUAD", "ICON_DLG_QUADRANGLE" );
+ createSMESHAction( 4023, "POLYGON", "ICON_DLG_POLYGON" );
+ createSMESHAction( 4031, "TETRA", "ICON_DLG_TETRAS" );
+ createSMESHAction( 4032, "HEXA", "ICON_DLG_HEXAS" );
+ createSMESHAction( 4041, "REMOVE_NODES", "ICON_DLG_REM_NODE" );
+ createSMESHAction( 4042, "REMOVE_ELEMENTS", "ICON_DLG_REM_ELEMENT" );
+ createSMESHAction( 4051, "RENUM_NODES", "ICON_DLG_RENUMBERING_NODES" );
+ createSMESHAction( 4052, "RENUM_ELEMENTS", "ICON_DLG_RENUMBERING_ELEMENTS" );
+ createSMESHAction( 4061, "TRANS", "ICON_SMESH_TRANSLATION_VECTOR" );
+ createSMESHAction( 4062, "ROT", "ICON_DLG_ROTATION" );
+ createSMESHAction( 4063, "SYM", "ICON_SMESH_SYMMETRY_PLANE" );
+ createSMESHAction( 4064, "SEW", "ICON_SMESH_SEWING_FREEBORDERS" );
+ createSMESHAction( 4065, "MERGE", "ICON_SMESH_MERGE_NODES" );
+ createSMESHAction( 4066, "MERGE_ELEMENTS", "ICON_DLG_MERGE_ELEMENTS" );
+ createSMESHAction( 406, "MOVE", "ICON_DLG_MOVE_NODE" );
+ createSMESHAction( 407, "INV", "ICON_DLG_MESH_DIAGONAL" );
+ createSMESHAction( 408, "UNION2", "ICON_UNION2TRI" );
+ createSMESHAction( 409, "ORIENT", "ICON_DLG_MESH_ORIENTATION" );
+ createSMESHAction( 410, "UNION", "ICON_UNIONTRI" );
+ createSMESHAction( 411, "CUT", "ICON_CUTQUAD" );
+ createSMESHAction( 412, "SMOOTH", "ICON_DLG_SMOOTHING" );
+ createSMESHAction( 413, "EXTRUSION", "ICON_EXTRUSION" );
+ createSMESHAction( 414, "REVOLUTION", "ICON_REVOLUTION" );
+ createSMESHAction( 415, "MAP", "ICON_MAP" );
+ createSMESHAction( 416, "EXTRUSION_ALONG", "ICON_EXTRUSION_ALONG" );
+ createSMESHAction( 200, "RESET" );
+ createSMESHAction( 201, "SCALAR_BAR_PROP" );
+ createSMESHAction( 211, "WIRE", "ICON_WIRE", 0, true );
+ createSMESHAction( 212, "SHADE", "ICON_SHADE", 0, true );
+ createSMESHAction( 213, "SHRINK", "ICON_SHRINK", 0, true );
+ createSMESHAction( 214, "UPDATE", "ICON_UPDATE" );
+ createSMESHAction( 215, "NODES", "ICON_POINTS", 0, true );
+ createSMESHAction( 217, "EDGES", "ICON_DLG_EDGE", 0, true );
+ createSMESHAction( 218, "FACES", "ICON_DLG_TRIANGLE", 0, true );
+ createSMESHAction( 219, "VOLUMES", "ICON_DLG_TETRAS", 0, true );
+ createSMESHAction( 220, "ALL" );
+ createSMESHAction( 1100, "EDIT_HYPO" );
+ createSMESHAction( 1101, "RENAME" );
+ createSMESHAction( 1102, "UNASSIGN" );
+ createSMESHAction( 9010, "NUM_NODES", "", 0, true );
+ createSMESHAction( 9011, "NUM_ELEMENTS", "", 0, true );
+ createSMESHAction( 1131, "DISPMODE" );
+ createSMESHAction( 1132, "COLORS" );
+ createSMESHAction( 1133, "TRANSP" );
+ createSMESHAction( 1134, "CLIP" );
+ createSMESHAction( 1135, "DISP_ENT" );
+ createSMESHAction( 2000, "CTRL" );
+
+ 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, 50 ),
+ meshId = createMenu( tr( "MEN_MESH" ), -1, 70, 10 ),
+ ctrlId = createMenu( tr( "MEN_CTRL" ), -1, 60, 10 ),
+ modifyId = createMenu( tr( "MEN_MODIFY" ), -1, 40, 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 );
+
+ 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( 702, meshId, -1 );
+ createMenu( 703, 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( 4066, 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( 214, viewId, -1 );
+
+ // ----- create toolbars --------------
+ int meshTb = createTool( tr( "TB_MESH" ) ),
+ ctrlTb = createTool( tr( "TB_CTRL" ) ),
+ addRemTb = createTool( tr( "TB_ADD_REMOVE" ) ),
+ modifyTb = createTool( tr( "TB_MODIFY" ) ),
+ dispModeTb = createTool( tr( "TB_DISP_MODE" ) );
+
+ createTool( 702, meshTb );
+ createTool( 703, 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( 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( 4066, 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( 704, OB, mesh, "&& isComputable"); // EDIT_MESHSUBMESH
+ createPopupItem( 704, OB, subMesh, "&& isComputable" ); // EDIT_MESHSUBMESH
+ 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, "&& $hasReference={false}" ); // EDIT HYPOTHESIS
+ createPopupItem( 1102, OB, hyp_alg ); // REMOVE HYPOTHESIS / ALGORITHMS
+ createPopupItem( 1101, OB, mesh_group + " " + hyp_alg, "&& $hasReference={false}" ); // 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 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;
+
+ //-------------------------------------------------
+ // Numbering
+ //-------------------------------------------------
+ anId = popupMgr()->insert( tr( "MEN_NUM" ), -1, -1 );
+
+ popupMgr()->insert( action( 9010 ), anId, -1 );
+ popupMgr()->setRule( action( 9010 ), aMeshInVTK + "&& isVisible &&" + hasNodes, true );
+ popupMgr()->setRule( action( 9010 ), "{'Point'} in labeledTypes", false );
+
+ popupMgr()->insert( action( 9011 ), anId, -1 );
+ popupMgr()->setRule( action( 9011 ), aMeshInVTK + "&& isVisible &&" + hasElems, true );
+ popupMgr()->setRule( action( 9011 ), "{'Cell'} in labeledTypes", false );
+
+ popupMgr()->insert( separator(), -1, -1 );
+
+ //-------------------------------------------------
+ // Display Mode
+ //-------------------------------------------------
+ anId = popupMgr()->insert( tr( "MEN_DISPMODE" ), -1, -1 );
+
+ popupMgr()->insert( action( 211 ), anId, -1 ); // WIRE
+ popupMgr()->setRule( action( 211 ), aMeshInVTK + "&&" + hasElems, true );
+ popupMgr()->setRule( action( 211 ), "displayMode = 'eEdge'", false );
+
+ popupMgr()->insert( action( 212 ), anId, -1 ); // SHADE
+ popupMgr()->setRule( action( 212 ),aMeshInVTK+ "&& (" + hasFaces + "||" + hasVolumes + ")",true);
+ popupMgr()->setRule( action( 212 ), "displayMode = 'eSurface'", false );
+
+ popupMgr()->insert( action( 215 ), anId, -1 ); // POINTS
+ popupMgr()->setRule( action( 215 ), aMeshInVTK + "&&" + hasNodes, true );
+ popupMgr()->setRule( action( 215 ), "displayMode = 'ePoint'", false );
+
+ popupMgr()->insert( separator(), anId, -1 );
+
+ popupMgr()->insert( action( 213 ), anId, -1 ); // SHRINK
+ popupMgr()->setRule( action( 213 ), aMeshInVTK + "&& shrinkMode <> 'IsNotShrinkable' && displayMode <> 'ePoint'",true);
+ popupMgr()->setRule( action( 213 ), "shrinkMode = 'IsShrunk'", false );
+
+ //-------------------------------------------------
+ // Display Entity
+ //-------------------------------------------------
+ QString aDiffElemsInVTK = aMeshInVTK + "&&" + hasDifferentElems;
+
+ anId = popupMgr()->insert( tr( "MEN_DISP_ENT" ), -1, -1 );
+
+ popupMgr()->insert( action( 217 ), anId, -1 ); // EDGES
+ popupMgr()->setRule( action( 217 ), aDiffElemsInVTK + "&& isVisible &&" + hasEdges, true );
+ popupMgr()->setRule( action( 217 ), "{'Edge'} in entityMode", false );
+
+ popupMgr()->insert( action( 218 ), anId, -1 ); // FACES
+ popupMgr()->setRule( action( 218 ), aDiffElemsInVTK + "&& isVisible &&" + hasFaces, true );
+ popupMgr()->setRule( action( 218 ), "{'Face'} in entityMode", false );
+
+ popupMgr()->insert( action( 219 ), anId, -1 ); // VOLUMES
+ popupMgr()->setRule( action( 219 ), aDiffElemsInVTK + "&& isVisible &&" + hasVolumes, true );
+ popupMgr()->setRule( action( 219 ), "{'Volume'} in entityMode", false );
+
+ popupMgr()->insert( separator(), anId, -1 );
+
+ popupMgr()->insert( action( 220 ), anId, -1 ); // ALL
+ popupMgr()->setRule( action( 220 ), aDiffElemsInVTK + "&& isVisible && not( elemTypes in entityMode )", true );
+
+ //-------------------------------------------------
+ // Color / Size
+ //-------------------------------------------------
+ popupMgr()->insert( action( 1132 ), -1, -1 );
+ popupMgr()->setRule( action( 1132 ), aMeshInVTK + "&& isVisible", true );
+
+ //-------------------------------------------------
+ // Transparency
+ //-------------------------------------------------
+ popupMgr()->insert( action( 1133 ), -1, -1 );
+ popupMgr()->setRule( action( 1133 ), aMeshInVTK + "&& isVisible", true );
+
+ //-------------------------------------------------
+ // Clipping
+ //-------------------------------------------------
+ popupMgr()->insert( action( 1134 ), -1, -1 );
+ popupMgr()->setRule( action( 1134 ), aMeshInVTK + "&& isVisible", true );
+
+ popupMgr()->insert( separator(), -1, -1 );
+
+ //-------------------------------------------------
+ // Controls
+ //-------------------------------------------------
+ QString
+ aMeshInVtkHasEdges = aMeshInVTK + "&&" + hasEdges,
+ aMeshInVtkHasFaces = aMeshInVTK + "&&" + hasFaces,
+ aMeshInVtkHasVolumes = aMeshInVTK + "&&" + hasVolumes;
+
+ anId = popupMgr()->insert( tr( "MEN_CTRL" ), -1, -1 );
+
+ popupMgr()->insert( action( 200 ), anId, -1 ); // RESET
+ popupMgr()->setRule( action( 200 ), aMeshInVTK + "&& controlMode <> 'eNone'", true );
+
+ popupMgr()->insert( separator(), anId, -1 );
+
+ popupMgr()->insert( action( 6003 ), anId, -1 ); // FREE_BORDER
+ popupMgr()->setRule( action( 6003 ), aMeshInVtkHasEdges, true );
+ popupMgr()->setRule( action( 6003 ), "controlMode = 'eFreeEdges'", false );
+
+ popupMgr()->insert( action( 6001 ), anId, -1 ); // LENGTH
+ popupMgr()->setRule( action( 6001 ), aMeshInVtkHasEdges, true );
+ popupMgr()->setRule( action( 6001 ), "controlMode = 'eLength'", false );
+
+ popupMgr()->insert( action( 6004 ), anId, -1 ); // CONNECTION
+ popupMgr()->setRule( action( 6004 ), aMeshInVtkHasEdges, true );
+ popupMgr()->setRule( action( 6004 ), "controlMode = 'eMultiConnection'", false );
+
+ popupMgr()->insert( separator(), anId, -1 );
+
+ popupMgr()->insert( action( 6002 ), anId, -1 ); // FREE_EDGE
+ popupMgr()->setRule( action( 6002 ), aMeshInVtkHasFaces, true );
+ popupMgr()->setRule( action( 6002 ), "controlMode = 'eFreeBorders'", false );
+
+ popupMgr()->insert( action( 6018 ), anId, -1 ); // LENGTH_2D
+ popupMgr()->setRule( action( 6018 ), aMeshInVtkHasFaces, true );
+ popupMgr()->setRule( action( 6018 ), "controlMode = 'eLength2D'", false );
+
+ popupMgr()->insert( action( 6019 ), anId, -1 ); // CONNECTION_2D
+ popupMgr()->setRule( action( 6019 ), aMeshInVtkHasFaces, true );
+ popupMgr()->setRule( action( 6019 ), "controlMode = 'eMultiConnection2D'", false );
+
+ popupMgr()->insert( action( 6011 ), anId, -1 ); // AREA
+ popupMgr()->setRule( action( 6011 ), aMeshInVtkHasFaces, true );
+ popupMgr()->setRule( action( 6011 ), "controlMode = 'eArea'", false );
+
+ popupMgr()->insert( action( 6012 ), anId, -1 ); // TAPER
+ popupMgr()->setRule( action( 6012 ), aMeshInVtkHasFaces, true );
+ popupMgr()->setRule( action( 6012 ), "controlMode = 'eTaper'", false );
+
+ popupMgr()->insert( action( 6013 ), anId, -1 ); // ASPECT
+ popupMgr()->setRule( action( 6013 ), aMeshInVtkHasFaces, true );
+ popupMgr()->setRule( action( 6013 ), "controlMode = 'eAspectRatio'", false );
+
+ popupMgr()->insert( action( 6014 ), anId, -1 ); // MIN_ANG
+ popupMgr()->setRule( action( 6014 ), aMeshInVtkHasFaces, true );
+ popupMgr()->setRule( action( 6014 ), "controlMode = 'eMinimumAngle'", false );
+
+ popupMgr()->insert( action( 6015 ), anId, -1 ); // WARP
+ popupMgr()->setRule( action( 6015 ), aMeshInVtkHasFaces, true );
+ popupMgr()->setRule( action( 6015 ), "controlMode = 'eWarping'", false );
+
+ popupMgr()->insert( action( 6016 ), anId, -1 ); // SKEW
+ popupMgr()->setRule( action( 6016 ), aMeshInVtkHasFaces, true );
+ popupMgr()->setRule( action( 6016 ), "controlMode = 'eSkew'", false );
+
+ popupMgr()->insert( separator(), anId, -1 );
+
+ popupMgr()->insert( action( 6017 ), anId, -1 ); // ASPECT_3D
+ popupMgr()->setRule( action( 6017 ), aMeshInVtkHasVolumes, true );
+ popupMgr()->setRule( action( 6017 ), "controlMode = 'eAspectRatio3D'", false );
+
+ popupMgr()->insert( separator(), anId, -1 );
+
+ popupMgr()->insert( action( 201 ), anId, -1 ); // SCALAR_BAR_PROP
+ popupMgr()->setRule( action( 201 ), aMeshInVTK + "&& controlMode <> 'eNone'", true );
+
+ popupMgr()->insert( separator(), -1, -1 );
+
+ //-------------------------------------------------
+ // Display / Erase
+ //-------------------------------------------------
+ aClient = "($client in {'VTKViewer' 'ObjectBrowser'})";
+ QString anActiveVTK = QString("activeView = '%1'").arg(VTKViewer_Viewer::Type());
+ QString aSelCount = QString( "%1 > 0" ).arg( QtxPopupMgr::Selection::defSelCountParam() );
+ QString aRule = aClient + " and " + aType + " and " + aSelCount + " and " + anActiveVTK;
+ popupMgr()->insert( action( 301 ), -1, -1 ); // DISPLAY
+ popupMgr()->setRule( action( 301 ), aRule + "&&" + isNotEmpty + "&&" + isInvisible, true);
+
+ popupMgr()->insert( action( 300 ), -1, -1 ); // ERASE
+ popupMgr()->setRule( action( 300 ), aRule + "&&" + isNotEmpty + "&& isVisible", true );
+
+ popupMgr()->insert( action( 302 ), -1, -1 ); // DISPLAY_ONLY
+ popupMgr()->setRule( action( 302 ), aRule + "&&" + isNotEmpty, true );
+
+ popupMgr()->insert( separator(), -1, -1 );
+
+ connect( application(), SIGNAL( viewManagerAdded( SUIT_ViewManager* ) ),
+ this, SLOT( onViewManagerAdded( SUIT_ViewManager* ) ) );