+void SMESHGUI::BuildPresentation( const Handle(SALOME_InteractiveObject) & theIO,
+ SUIT_ViewWindow* wnd )
+{
+ if(theIO->hasEntry()){
+ //SUIT_ViewWindow* wnd = SMESH::GetActiveWindow();
+ SMESH::UpdateView(wnd,SMESH::eDisplay,theIO->getEntry());
+ }
+}
+
+//=======================================================================
+// function : createSMESHAction
+// purpose :
+//=======================================================================
+void SMESHGUI::createSMESHAction( const int id, const QString& po_id, const QString& icon_id,
+ const int key, const bool toggle, const QString& shortcutAction )
+{
+ QIcon icon;
+ QWidget* parent = application()->desktop();
+ SUIT_ResourceMgr* resMgr = resourceMgr();
+ QPixmap pix;
+ if ( !icon_id.isEmpty() )
+ pix = resMgr->loadPixmap( "SMESH", tr( icon_id.toLatin1().data() ) );
+ else
+ pix = resMgr->loadPixmap( "SMESH", tr( QString( "ICO_%1" ).arg( po_id ).toLatin1().data() ), false );
+ if ( !pix.isNull() )
+ icon = QIcon( pix );
+
+ QString tooltip = tr( QString( "TOP_%1" ).arg( po_id ).toLatin1().data() ),
+ menu = tr( QString( "MEN_%1" ).arg( po_id ).toLatin1().data() ),
+ status_bar = tr( QString( "STB_%1" ).arg( po_id ).toLatin1().data() );
+
+ createAction( id, tooltip, icon, menu, status_bar, key, parent,
+ toggle, this, SLOT( OnGUIEvent() ), shortcutAction );
+}
+
+//=======================================================================
+// function : createPopupItem
+// purpose :
+//=======================================================================
+void SMESHGUI::createPopupItem( const int id,
+ const QString& clients,
+ const QString& types,
+ const QString& theRule,
+ const int pId )
+{
+ if( !popupMgr()->contains( popupMgr()->actionId( action( id ) ) ) )
+ popupMgr()->insert( action( id ), pId, 0 );
+
+ QString lc = "$"; // VSR : instead of QtxPopupSelection::defEquality();
+ QString dc = "selcount"; // VSR : insetad of QtxPopupSelection::defSelCountParam()
+ QString rule = "(%1) and (%2) and (%3)";
+ rule = rule.arg( QString( "%1>0" ).arg( dc ) );
+ if( clients.isEmpty() )
+ rule = rule.arg( QString( "true" ) );
+ else
+ rule = rule.arg( QString( "%1client in {%2}" ).arg( lc ).arg( clients ) );
+ rule = rule.arg( QString( "%1type in {%2}" ).arg( lc ).arg( types ) );
+ rule += theRule;
+
+ bool cont = myRules.contains( id );
+ if( cont )
+ rule = QString( "%1 or (%2)" ).arg( myRules[ id ] ).arg( rule );
+
+ popupMgr()->setRule( action( id ), rule, QtxPopupMgr::VisibleRule );
+ myRules[ id ] = QString( cont ? "%1" : "(%1)" ).arg( rule );
+}
+
+//=======================================================================
+// function : initialize
+// purpose :
+//=======================================================================
+void SMESHGUI::initialize( CAM_Application* app )
+{
+ SalomeApp_Module::initialize( app );
+
+// SUIT_ResourceMgr* mgr = app->resourceMgr();
+// if ( mgr )
+ /* Automatic Update flag */
+// myAutomaticUpdate = mgr->booleanValue( "SMESH", "AutomaticUpdate", myAutomaticUpdate );
+
+ // ----- create actions --------------
+
+ //createSMESHAction( 111, "IMPORT_DAT", "", (Qt::CTRL+Qt::Key_B) );
+ createSMESHAction( 112, "IMPORT_UNV", "", (Qt::CTRL+Qt::Key_U) );
+ createSMESHAction( 113, "IMPORT_MED", "", (Qt::CTRL+Qt::Key_M) );
+ createSMESHAction( 114, "NUM" );
+ createSMESHAction( 115, "IMPORT_STL" );
+ createSMESHAction( 116, "IMPORT_CGNS" );
+ createSMESHAction( 117, "IMPORT_SAUV" );
+ createSMESHAction( 118, "IMPORT_GMF" );
+ createSMESHAction( 121, "DAT" );
+ createSMESHAction( 122, "MED" );
+ createSMESHAction( 123, "UNV" );
+ createSMESHAction( 140, "STL" );
+ createSMESHAction( 142, "CGNS");
+ createSMESHAction( 144, "SAUV");
+ createSMESHAction( 146, "GMF" );
+ createSMESHAction( 124, "DAT" );
+ createSMESHAction( 125, "MED" );
+ createSMESHAction( 126, "UNV" );
+ createSMESHAction( 141, "STL" );
+ createSMESHAction( 143, "CGNS");
+ createSMESHAction( 145, "SAUV");
+ createSMESHAction( 147, "GMF" );
+ createSMESHAction( 150, "FILE_INFO" );
+ createSMESHAction( 33, "DELETE", "ICON_DELETE", Qt::Key_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( 705, "COPY_MESH", "ICON_COPY_MESH" );
+ createSMESHAction( 710, "BUILD_COMPOUND", "ICON_BUILD_COMPOUND" );
+ createSMESHAction( 711, "PRECOMPUTE", "ICON_PRECOMPUTE" );
+ createSMESHAction( 712, "EVALUATE", "ICON_COMPUTE" );
+ createSMESHAction( 713, "MESH_ORDER", "ICON_COMPUTE" );
+ createSMESHAction( 806, "CREATE_GEO_GROUP","ICON_CREATE_GEO_GROUP" );
+ createSMESHAction( 801, "CREATE_GROUP", "ICON_CREATE_GROUP" );
+ createSMESHAction( 802, "CONSTRUCT_GROUP", "ICON_CONSTRUCT_GROUP" );
+ createSMESHAction( 803, "EDIT_GROUP", "ICON_EDIT_GROUP" );
+ createSMESHAction( 815, "EDIT_GEOMGROUP_AS_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( 814, "UNDERLYING_ELEMS","ICON_UNDERLYING_ELEMS" );
+ createSMESHAction( 813, "DEL_GROUP", "ICON_DEL_GROUP" );
+ createSMESHAction( 900, "ADV_INFO", "ICON_ADV_INFO" );
+ //createSMESHAction( 902, "STD_INFO", "ICON_STD_INFO" );
+ //createSMESHAction( 903, "WHAT_IS", "ICON_WHAT_IS" ); // VSR: issue #0021242 (eliminate "Mesh Element Information" command)
+ createSMESHAction( 904, "FIND_ELEM", "ICON_FIND_ELEM" );
+ createSMESHAction( 6001, "LENGTH", "ICON_LENGTH", 0, true );
+ createSMESHAction( 6002, "FREE_EDGE", "ICON_FREE_EDGE", 0, true );
+ createSMESHAction( 6021, "FREE_FACES", "ICON_FREE_FACES", 0, true );
+ createSMESHAction( 6022, "MAX_ELEMENT_LENGTH_2D", "ICON_MAX_ELEMENT_LENGTH_2D", 0, true );
+ createSMESHAction( 6023, "MAX_ELEMENT_LENGTH_3D", "ICON_MAX_ELEMENT_LENGTH_3D", 0, true );
+ createSMESHAction( 6024, "BARE_BORDER_VOLUME", "ICON_BARE_BORDER_VOLUME", 0, true );
+ createSMESHAction( 6025, "BARE_BORDER_FACE", "ICON_BARE_BORDER_FACE", 0, true );
+ createSMESHAction( 6026, "OVER_CONSTRAINED_VOLUME","ICON_OVER_CONSTRAINED_VOLUME", 0, true );
+ createSMESHAction( 6027, "OVER_CONSTRAINED_FACE", "ICON_OVER_CONSTRAINED_FACE", 0, true );
+ createSMESHAction( 6028, "EQUAL_NODE", "ICON_EQUAL_NODE", 0, true );
+ createSMESHAction( 6029, "EQUAL_EDGE", "ICON_EQUAL_EDGE", 0, true );
+ createSMESHAction( 6030, "EQUAL_FACE", "ICON_EQUAL_FACE", 0, true );
+ createSMESHAction( 6031, "EQUAL_VOLUME", "ICON_EQUAL_VOLUME", 0, true );
+ createSMESHAction( 6003, "FREE_BORDER", "ICON_FREE_EDGE_2D", 0, true );
+ createSMESHAction( 6004, "CONNECTION", "ICON_CONNECTION", 0, true );
+ createSMESHAction( 6005, "FREE_NODE", "ICON_FREE_NODE", 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( 6009, "VOLUME_3D", "ICON_VOLUME_3D", 0, true );
+ createSMESHAction( 4000, "NODE", "ICON_DLG_NODE" );
+ createSMESHAction( 4009, "ELEM0D", "ICON_DLG_ELEM0D" );
+ createSMESHAction( 4008, "BALL", "ICON_DLG_BALL" );
+ createSMESHAction( 4010, "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( 4133, "PENTA", "ICON_DLG_PENTA" );
+ createSMESHAction( 4134, "PYRAMID", "ICON_DLG_PYRAMID" );
+ createSMESHAction( 4135, "OCTA", "ICON_DLG_OCTA" );
+ createSMESHAction( 4033, "POLYHEDRON", "ICON_DLG_POLYHEDRON" );
+ createSMESHAction( 4034, "QUADRATIC_EDGE", "ICON_DLG_QUADRATIC_EDGE" );
+ createSMESHAction( 4035, "QUADRATIC_TRIANGLE", "ICON_DLG_QUADRATIC_TRIANGLE" );
+ createSMESHAction( 4036, "QUADRATIC_QUADRANGLE", "ICON_DLG_QUADRATIC_QUADRANGLE" );
+ createSMESHAction( 4136, "BIQUADRATIC_QUADRANGLE", "ICON_DLG_BIQUADRATIC_QUADRANGLE" );
+ createSMESHAction( 4037, "QUADRATIC_TETRAHEDRON", "ICON_DLG_QUADRATIC_TETRAHEDRON" );
+ createSMESHAction( 4038, "QUADRATIC_PYRAMID", "ICON_DLG_QUADRATIC_PYRAMID" );
+ createSMESHAction( 4039, "QUADRATIC_PENTAHEDRON", "ICON_DLG_QUADRATIC_PENTAHEDRON" );
+ createSMESHAction( 4040, "QUADRATIC_HEXAHEDRON", "ICON_DLG_QUADRATIC_HEXAHEDRON" );
+ createSMESHAction( 4140, "TRIQUADRATIC_HEXAHEDRON", "ICON_DLG_TRIQUADRATIC_HEXAHEDRON" );
+ createSMESHAction( 4041, "REMOVE_NODES", "ICON_DLG_REM_NODE" );
+ createSMESHAction( 4042, "REMOVE_ELEMENTS", "ICON_DLG_REM_ELEMENT" );
+ createSMESHAction( 4044, "REMOVE_ORPHAN_NODES", "ICON_DLG_REM_ORPHAN_NODES" );
+ createSMESHAction( 4043, "CLEAR_MESH" , "ICON_CLEAR_MESH" );
+ 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_MESH_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( 4067, "MESH_THROU_POINT","ICON_DLG_MOVE_NODE" );
+ createSMESHAction( 4068, "SCALE", "ICON_DLG_MESH_SCALE" );
+ createSMESHAction( 4069, "DUPLICATE_NODES", "ICON_SMESH_DUPLICATE_NODES" );
+ createSMESHAction( 4070, "0D_ON_ALL_NODES", "ICON_0D_ON_ALL_NODES" );
+ 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( 417, "CONV_TO_QUAD", "ICON_CONV_TO_QUAD" );
+ createSMESHAction( 418, "2D_FROM_3D", "ICON_2D_FROM_3D" );
+ createSMESHAction( 419, "SPLIT_TO_TETRA", "ICON_SPLIT_TO_TETRA" );
+ createSMESHAction( 420, "REORIENT_2D", "ICON_REORIENT_2D" );
+ createSMESHAction( 200, "RESET" );
+ createSMESHAction( 201, "SCALAR_BAR_PROP" );
+ createSMESHAction( 2021, "SAVE_DISTRIBUTION" );
+ createSMESHAction( 2022, "SHOW_DISTRIBUTION","",0, true );
+#ifndef DISABLE_PLOT2DVIEWER
+ createSMESHAction( 2023, "PLOT_DISTRIBUTION" );
+#endif
+ 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( 222, "BALLS", "ICON_DLG_BALL", 0, true );
+ createSMESHAction( 216, "ELEMS0D", "ICON_DLG_ELEM0D", 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( 221, "FACE_ORIENTATION", "", 0, true );
+
+ createSMESHAction( 231, "LINE_REPRESENTATION", "", 0, true );
+ createSMESHAction( 232, "ARC_REPRESENTATION", "", 0, true );
+
+ createSMESHAction( 1100, "EDIT_HYPO" );
+ 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( 1136, "AUTO_COLOR" );
+ createSMESHAction( 1137, "DISABLE_AUTO_COLOR" );
+ createSMESHAction( 2000, "CTRL" );
+
+ createSMESHAction( 501, "MEASURE_MIN_DIST", "ICON_MEASURE_MIN_DIST" );
+ createSMESHAction( 502, "MEASURE_BND_BOX", "ICON_MEASURE_BND_BOX" );
+
+ createSMESHAction( 300, "HIDE" );
+ createSMESHAction( 301, "SHOW" );
+ createSMESHAction( 302, "DISPLAY_ONLY" );
+
+ // ----- 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 ),
+ measureId = createMenu( tr( "MEN_MEASURE" ), -1, 50, 10 ),
+ viewId = createMenu( tr( "MEN_VIEW" ), -1, 2 );
+
+ createMenu( separator(), fileId );
+
+ int importId = createMenu( tr( "MEN_IMPORT" ), fileId, -1, 10 ),
+ exportId = createMenu( tr( "MEN_EXPORT" ), fileId, -1, 10 ),
+ nodeId = createMenu( tr( "MEN_NODE_CTRL" ), ctrlId, -1, 10 ),
+ edgeId = createMenu( tr( "MEN_EDGE_CTRL" ), ctrlId, -1, 10 ),
+ faceId = createMenu( tr( "MEN_FACE_CTRL" ), ctrlId, -1, 10 ),
+ volumeId = createMenu( tr( "MEN_VOLUME_CTRL" ), ctrlId, -1, 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( 115, importId, -1 );
+#ifdef WITH_CGNS
+ createMenu( 116, importId, -1 );
+#endif
+ createMenu( 117, importId, -1 );
+ createMenu( 118, importId, -1 );
+ createMenu( 121, exportId, -1 );
+ createMenu( 122, exportId, -1 );
+ createMenu( 123, exportId, -1 );
+ createMenu( 140, exportId, -1 ); // export to STL
+#ifdef WITH_CGNS
+ createMenu( 142, exportId, -1 ); // export to CGNS
+#endif
+ createMenu( 144, exportId, -1 ); // export to SAUV
+ createMenu( 146, exportId, -1 ); // export to GMF
+ createMenu( separator(), fileId, 10 );
+
+ createMenu( 33, editId, -1 );
+
+ createMenu( 5105, toolsId, -1 );
+
+ createMenu( 702, meshId, -1 ); // "Mesh" menu
+ createMenu( 703, meshId, -1 );
+ createMenu( 704, meshId, -1 );
+ createMenu( 710, meshId, -1 );
+ createMenu( 705, meshId, -1 );
+ createMenu( separator(), meshId, -1 );
+ createMenu( 701, meshId, -1 );
+ createMenu( 711, meshId, -1 );
+ createMenu( 712, meshId, -1 );
+ createMenu( 713, meshId, -1 );
+ createMenu( separator(), meshId, -1 );
+ createMenu( 801, meshId, -1 );
+ createMenu( 806, meshId, -1 );
+ createMenu( 802, meshId, -1 );
+ createMenu( 803, meshId, -1 );
+ createMenu( 815, meshId, -1 );
+ createMenu( separator(), meshId, -1 );
+ createMenu( 810, meshId, -1 );
+ createMenu( 811, meshId, -1 );
+ createMenu( 812, meshId, -1 );
+ createMenu( separator(), meshId, -1 );
+ createMenu( 814, meshId, -1 );
+ createMenu( separator(), meshId, -1 );
+ createMenu( 900, meshId, -1 );
+ //createMenu( 902, meshId, -1 );
+ //createMenu( 903, meshId, -1 ); // VSR: issue #0021242 (eliminate "Mesh Element Information" command)
+ createMenu( 904, meshId, -1 );
+ createMenu( separator(), meshId, -1 );
+
+ createMenu( 6005, nodeId, -1 );
+ createMenu( 6028, nodeId, -1 );
+ createMenu( 6002, edgeId, -1 );
+ createMenu( 6003, edgeId, -1 );
+ createMenu( 6001, edgeId, -1 );
+ createMenu( 6004, edgeId, -1 );
+ createMenu( 6029, edgeId, -1 );
+ createMenu( 6021, faceId, -1 );
+ createMenu( 6025, faceId, -1 );
+ createMenu( 6027, faceId, -1 );
+ createMenu( 6018, faceId, -1 );
+ createMenu( 6019, faceId, -1 );
+ createMenu( 6011, faceId, -1 );
+ createMenu( 6012, faceId, -1 );
+ createMenu( 6013, faceId, -1 );
+ createMenu( 6014, faceId, -1 );
+ createMenu( 6015, faceId, -1 );
+ createMenu( 6016, faceId, -1 );
+ createMenu( 6022, faceId, -1 );
+ createMenu( 6030, faceId, -1 );
+ createMenu( 6017, volumeId, -1 );
+ createMenu( 6009, volumeId, -1 );
+ createMenu( 6023, volumeId, -1 );
+ createMenu( 6024, volumeId, -1 );
+ createMenu( 6026, volumeId, -1 );
+ createMenu( 6031, volumeId, -1 );
+
+ createMenu( 4000, addId, -1 );
+ createMenu( 4009, addId, -1 );
+ createMenu( 4070, addId, -1 );
+ createMenu( 4008, addId, -1 );
+ createMenu( 4010, addId, -1 );
+ createMenu( 4021, addId, -1 );
+ createMenu( 4022, addId, -1 );
+ createMenu( 4023, addId, -1 );
+ createMenu( 4031, addId, -1 );
+ createMenu( 4032, addId, -1 );
+ createMenu( 4133, addId, -1 );
+ createMenu( 4134, addId, -1 );
+ createMenu( 4135, addId, -1 );
+ createMenu( 4033, addId, -1 );
+ createMenu( separator(), addId, -1 );
+ createMenu( 4034, addId, -1 );
+ createMenu( 4035, addId, -1 );
+ createMenu( 4036, addId, -1 );
+ createMenu( 4136, addId, -1 );
+ createMenu( 4037, addId, -1 );
+ createMenu( 4038, addId, -1 );
+ createMenu( 4039, addId, -1 );
+ createMenu( 4040, addId, -1 );
+ createMenu( 4140, addId, -1 );
+
+ createMenu( 4041, removeId, -1 );
+ createMenu( 4042, removeId, -1 );
+ createMenu( 4044, removeId, -1 );
+ createMenu( separator(), removeId, -1 );
+ createMenu( 813, removeId, -1 );
+ createMenu( separator(), removeId, -1 );
+ createMenu( 4043, removeId, -1 );
+
+ createMenu( 4051, renumId, -1 );
+ createMenu( 4052, renumId, -1 );
+
+ createMenu( 4061, transfId, -1 );
+ createMenu( 4062, transfId, -1 );
+ createMenu( 4063, transfId, -1 );
+ createMenu( 4068, transfId, -1 );
+ createMenu( 4064, transfId, -1 );
+ createMenu( 4065, transfId, -1 );
+ createMenu( 4066, transfId, -1 );
+ createMenu( 4069, transfId, -1 );
+
+ createMenu( 4067,modifyId, -1 );
+ createMenu( 407, modifyId, -1 );
+ createMenu( 408, modifyId, -1 );
+ createMenu( 409, modifyId, -1 );
+ createMenu( 420, modifyId, -1 );
+ createMenu( 410, modifyId, -1 );
+ createMenu( 411, modifyId, -1 );
+ createMenu( 419, modifyId, -1 );
+ createMenu( 412, modifyId, -1 );
+ createMenu( 413, modifyId, -1 );
+ createMenu( 416, modifyId, -1 );
+ createMenu( 414, modifyId, -1 );
+ createMenu( 415, modifyId, -1 );
+ createMenu( 417, modifyId, -1 );
+ createMenu( 418, modifyId, -1 );
+
+ createMenu( 501, measureId, -1 );
+ createMenu( 502, measureId, -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( 710, meshTb );
+ createTool( 705, meshTb );
+ createTool( separator(), meshTb );
+ createTool( 701, meshTb );
+ createTool( 711, meshTb );
+ createTool( 712, meshTb );
+ createTool( 713, meshTb );
+ createTool( separator(), meshTb );
+ createTool( 801, meshTb );
+ createTool( 806, meshTb );
+ createTool( 802, meshTb );
+ createTool( 803, meshTb );
+ //createTool( 815, meshTb );
+ createTool( separator(), meshTb );
+ createTool( 900, meshTb );
+ //createTool( 902, meshTb );
+ //createTool( 903, meshTb ); // VSR: issue #0021242 (eliminate "Mesh Element Information" command)
+ createTool( 904, meshTb );
+ createTool( separator(), meshTb );
+
+ createTool( 6005, ctrlTb );
+ createTool( 6028, ctrlTb );
+ createTool( separator(), ctrlTb );
+ createTool( 6002, ctrlTb );
+ createTool( 6003, ctrlTb );
+ createTool( 6001, ctrlTb );
+ createTool( 6004, ctrlTb );
+ createTool( 6029, ctrlTb );
+ createTool( separator(), ctrlTb );
+ createTool( 6021, ctrlTb );
+ createTool( 6025, ctrlTb );
+ createTool( 6027, 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( 6022, ctrlTb );
+ createTool( 6030, ctrlTb );
+ createTool( separator(), ctrlTb );
+ createTool( 6017, ctrlTb );
+ createTool( 6009, ctrlTb );
+ createTool( 6023, ctrlTb );
+ createTool( 6024, ctrlTb );
+ createTool( 6026, ctrlTb );
+ createTool( 6031, ctrlTb );
+ createTool( separator(), ctrlTb );
+
+ createTool( 4000, addRemTb );
+ createTool( 4009, addRemTb );
+ createTool( 4070, addRemTb );
+ createTool( 4008, addRemTb );
+ createTool( 4010, addRemTb );
+ createTool( 4021, addRemTb );
+ createTool( 4022, addRemTb );
+ createTool( 4023, addRemTb );
+ createTool( 4031, addRemTb );
+ createTool( 4032, addRemTb );
+ createTool( 4133, addRemTb );
+ createTool( 4134, addRemTb );
+ createTool( 4135, addRemTb );
+ createTool( 4033, addRemTb );
+ createTool( separator(), addRemTb );
+ createTool( 4034, addRemTb );
+ createTool( 4035, addRemTb );
+ createTool( 4036, addRemTb );
+ createTool( 4136, addRemTb );
+ createTool( 4037, addRemTb );
+ createTool( 4038, addRemTb );
+ createTool( 4039, addRemTb );
+ createTool( 4040, addRemTb );
+ createTool( 4140, addRemTb );
+ createTool( separator(), addRemTb );
+ createTool( 4041, addRemTb );
+ createTool( 4042, addRemTb );
+ createTool( 4044, addRemTb );
+ createTool( 4043, addRemTb );
+ createTool( separator(), addRemTb );
+ createTool( 4051, addRemTb );
+ createTool( 4052, addRemTb );
+ createTool( separator(), addRemTb );
+ createTool( 4061, addRemTb );
+ createTool( 4062, addRemTb );
+ createTool( 4063, addRemTb );
+ createTool( 4068, addRemTb );
+ createTool( 4064, addRemTb );
+ createTool( 4065, addRemTb );
+ createTool( 4066, addRemTb );
+ createTool( 4069, addRemTb );
+ createTool( separator(), addRemTb );
+
+ createTool( 4067,modifyTb );
+ createTool( 407, modifyTb );
+ createTool( 408, modifyTb );
+ createTool( 409, modifyTb );
+ createTool( 420, modifyTb );
+ createTool( 410, modifyTb );
+ createTool( 411, modifyTb );
+ createTool( 419, modifyTb );
+ createTool( 412, modifyTb );
+ createTool( 413, modifyTb );
+ createTool( 416, modifyTb );
+ createTool( 414, modifyTb );
+ createTool( 415, modifyTb );
+ createTool( 417, modifyTb );
+ createTool( 418, modifyTb );
+
+ createTool( 214, dispModeTb );
+
+ QString lc = "$"; // VSR : instead of QtxPopupSelection::defEquality();
+ QString dc = "selcount"; // VSR : instead of QtxPopupSelection::defSelCountParam()
+
+ myRules.clear();
+ QString OB = "'ObjectBrowser'",
+ View = "'" + SVTK_Viewer::Type() + "'",
+ pat = "'%1'",
+ mesh = pat.arg( SMESHGUI_Selection::typeName( SMESH::MESH ) ),
+ group = pat.arg( SMESHGUI_Selection::typeName( SMESH::GROUP ) ),
+ hypo = pat.arg( SMESHGUI_Selection::typeName( SMESH::HYPOTHESIS ) ),
+ algo = pat.arg( SMESHGUI_Selection::typeName( SMESH::ALGORITHM ) ),
+ elems = QString( "'%1' '%2' '%3' '%4' '%5' '%6'" ).
+ arg( SMESHGUI_Selection::typeName( SMESH::SUBMESH_VERTEX ) ).
+ arg( SMESHGUI_Selection::typeName( SMESH::SUBMESH_EDGE ) ).
+ arg( SMESHGUI_Selection::typeName( SMESH::SUBMESH_FACE ) ).
+ arg( SMESHGUI_Selection::typeName( SMESH::SUBMESH_SOLID ) ).
+ arg( SMESHGUI_Selection::typeName( SMESH::SUBMESH_COMPOUND ) ).
+ arg( SMESHGUI_Selection::typeName( SMESH::SUBMESH ) ),
+ subMesh = elems,
+ mesh_part = mesh + " " + subMesh + " " + group,
+ mesh_group = mesh + " " + group,
+ hyp_alg = hypo + " " + algo;
+
+ // popup for object browser
+ 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)"),
+ hasBalls("({'BallElem'} in elemTypes)"),
+ hasElems0d("({'Elem0d'} in elemTypes)"),
+ hasEdges("({'Edge'} in elemTypes)"),
+ hasFaces("({'Face'} in elemTypes)"),
+ hasVolumes("({'Volume'} in elemTypes)");
+
+ createPopupItem( 150, OB, mesh, "&& selcount=1 && isImported" ); // FILE INFORMATION
+ createPopupItem( 703, OB, mesh, "&& isComputable"); // CREATE_SUBMESH
+ createPopupItem( 704, OB, mesh, "&& isComputable"); // EDIT_MESHSUBMESH
+ createPopupItem( 704, OB, subMesh, "&& isComputable" ); // EDIT_MESHSUBMESH
+ createPopupItem( 803, OB, group ); // EDIT_GROUP
+ createPopupItem( 815, OB, group, "&& groupType != 'Group'" ); // EDIT AS STANDALONE
+
+ popupMgr()->insert( separator(), -1, 0 );
+ createPopupItem( 701, OB, mesh, "&& isComputable" ); // COMPUTE
+ createPopupItem( 711, OB, mesh, "&& isComputable && isPreComputable" ); // PRECOMPUTE
+ createPopupItem( 712, OB, mesh, "&& isComputable" ); // EVALUATE
+ createPopupItem( 713, OB, mesh, "&& isComputable" ); // MESH ORDER
+ createPopupItem( 214, OB, mesh_part ); // UPDATE
+ createPopupItem( 900, OB, mesh_part ); // ADV_INFO
+ createPopupItem( 904, OB, mesh_group ); // FIND_ELEM
+ popupMgr()->insert( separator(), -1, 0 );
+ createPopupItem( 801, OB, mesh ); // CREATE_GROUP
+ createPopupItem( 806, OB, mesh ); // CREATE_GEO_GROUP
+ createPopupItem( 802, OB, subMesh ); // CONSTRUCT_GROUP
+ popupMgr()->insert( separator(), -1, 0 );
+ createPopupItem( 1100, OB, hypo); // EDIT HYPOTHESIS
+ createPopupItem( 1102, OB, hyp_alg ); // REMOVE HYPOTHESIS / ALGORITHMS
+ popupMgr()->insert( separator(), -1, 0 );
+ createPopupItem( 4043, OB, mesh ); // CLEAR_MESH
+ popupMgr()->insert( separator(), -1, 0 );
+ createPopupItem( 417, OB, mesh + " " + subMesh ); // convert to quadratic
+ createPopupItem( 418, OB, mesh + " " + group, // create 2D mesh from 3D
+ "&& dim>=2");
+ popupMgr()->insert( separator(), -1, 0 );
+
+ QString only_one_non_empty = QString( " && %1=1 && numberOfNodes>0" ).arg( dc );
+ QString multiple_non_empty = QString( " && %1>0 && numberOfNodes>0" ).arg( dc );
+ QString only_one_2D = only_one_non_empty + " && dim>1";
+
+ int anId = popupMgr()->insert( tr( "MEN_EXPORT" ), -1, -1 ); // EXPORT submenu
+ createPopupItem( 125, OB, mesh_group, multiple_non_empty, anId ); // EXPORT_MED
+ createPopupItem( 126, OB, mesh_group, only_one_non_empty, anId ); // EXPORT_UNV
+ createPopupItem( 141, OB, mesh_group, only_one_2D, anId ); // EXPORT_STL
+#ifdef WITH_CGNS
+ createPopupItem( 143, OB, mesh_group, multiple_non_empty, anId ); // EXPORT_CGNS
+#endif
+ createPopupItem( 145, OB, mesh_group, multiple_non_empty, anId ); // EXPORT_SAUV
+ createPopupItem( 147, OB, mesh_group, multiple_non_empty, anId ); // EXPORT_GMF
+ createPopupItem( 124, OB, mesh_group, multiple_non_empty, anId ); // EXPORT_DAT
+ createPopupItem( 33, OB, mesh_part + " " + hyp_alg ); // DELETE
+ createPopupItem( 813, OB, group ); // DEL_GROUP with contents
+ 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_part ); // UPDATE
+ createPopupItem( 900, View, mesh_part ); // ADV_INFO
+ createPopupItem( 904, View, mesh ); // FIND_ELEM
+ popupMgr()->insert( separator(), -1, 0 );
+
+ createPopupItem( 1136, OB + " " + View, mesh, "&& (not isAutoColor)" ); // AUTO_COLOR
+ createPopupItem( 1137, OB + " " + View, mesh, "&& isAutoColor" ); // DISABLE_AUTO_COLOR
+ popupMgr()->insert( separator(), -1, 0 );
+
+ QString aClient = QString( "%1client in {%2}" ).arg( lc ).arg( "'VTKViewer'" );
+ QString aType = QString( "%1type in {%2}" ).arg( lc );
+ aType = aType.arg( mesh_part );
+ QString aMeshInVTK = aClient + "&&" + aType;
+
+ aClient = "($client in {'VTKViewer' 'ObjectBrowser'})";
+ QString anActiveVTK = QString("activeView = '%1'").arg(SVTK_Viewer::Type());
+ QString aSelCount = QString( "%1 > 0" ).arg( dc );
+
+ //-------------------------------------------------
+ // Numbering
+ //-------------------------------------------------
+ anId = popupMgr()->insert( tr( "MEN_NUM" ), -1, -1 );
+
+ popupMgr()->insert( action( 9010 ), anId, -1 );
+ popupMgr()->setRule( action( 9010 ), aMeshInVTK + "&& isVisible &&" + hasNodes, QtxPopupMgr::VisibleRule );
+ popupMgr()->setRule( action( 9010 ), "{'Point'} in labeledTypes", QtxPopupMgr::ToggleRule );
+
+ popupMgr()->insert( action( 9011 ), anId, -1 );
+ popupMgr()->setRule( action( 9011 ), aMeshInVTK + "&& isVisible &&" + hasElems, QtxPopupMgr::VisibleRule );
+ popupMgr()->setRule( action( 9011 ), "{'Cell'} in labeledTypes", QtxPopupMgr::ToggleRule );
+
+ 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, QtxPopupMgr::VisibleRule );
+ popupMgr()->setRule( action( 211 ), "displayMode = 'eEdge'", QtxPopupMgr::ToggleRule );
+
+ popupMgr()->insert( action( 212 ), anId, -1 ); // SHADE
+ popupMgr()->setRule( action( 212 ),aMeshInVTK+ "&& (" + hasFaces + "||" + hasVolumes + ")", QtxPopupMgr::VisibleRule);
+ popupMgr()->setRule( action( 212 ), "displayMode = 'eSurface'", QtxPopupMgr::ToggleRule );
+
+ popupMgr()->insert( action( 215 ), anId, -1 ); // POINTS
+ popupMgr()->setRule( action( 215 ), aMeshInVTK + "&&" + hasNodes, QtxPopupMgr::VisibleRule );
+ popupMgr()->setRule( action( 215 ), "displayMode = 'ePoint'", QtxPopupMgr::ToggleRule );
+
+ popupMgr()->insert( separator(), anId, -1 );
+
+ popupMgr()->insert( action( 213 ), anId, -1 ); // SHRINK
+ popupMgr()->setRule( action( 213 ), aMeshInVTK + "&& shrinkMode <> 'IsNotShrinkable' && displayMode <> 'ePoint'", QtxPopupMgr::VisibleRule);
+ popupMgr()->setRule( action( 213 ), "shrinkMode = 'IsShrunk'", QtxPopupMgr::ToggleRule );
+
+ //-------------------------------------------------
+ // Display Entity
+ //-------------------------------------------------
+ QString aDiffElemsInVTK = aMeshInVTK + "&&" + hasDifferentElems;
+
+ anId = popupMgr()->insert( tr( "MEN_DISP_ENT" ), -1, -1 );
+
+ popupMgr()->insert( action(216), anId, -1 ); // ELEMS 0D
+ popupMgr()->setRule(action(216), aDiffElemsInVTK + "&& isVisible &&" + hasElems0d, QtxPopupMgr::VisibleRule);
+ popupMgr()->setRule(action(216), "{'Elem0d'} in entityMode", QtxPopupMgr::ToggleRule);
+
+ popupMgr()->insert( action( 217 ), anId, -1 ); // EDGES
+ popupMgr()->setRule( action( 217 ), aDiffElemsInVTK + "&& isVisible &&" + hasEdges, QtxPopupMgr::VisibleRule );
+ popupMgr()->setRule( action( 217 ), "{'Edge'} in entityMode", QtxPopupMgr::ToggleRule );
+
+ popupMgr()->insert( action( 218 ), anId, -1 ); // FACES
+ popupMgr()->setRule( action( 218 ), aDiffElemsInVTK + "&& isVisible &&" + hasFaces, QtxPopupMgr::VisibleRule );
+ popupMgr()->setRule( action( 218 ), "{'Face'} in entityMode", QtxPopupMgr::ToggleRule );
+
+ popupMgr()->insert( action( 219 ), anId, -1 ); // VOLUMES
+ popupMgr()->setRule( action( 219 ), aDiffElemsInVTK + "&& isVisible &&" + hasVolumes, QtxPopupMgr::VisibleRule );
+ popupMgr()->setRule( action( 219 ), "{'Volume'} in entityMode", QtxPopupMgr::ToggleRule );
+
+ popupMgr()->insert( action( 222 ), anId, -1 ); // BALLS
+ popupMgr()->setRule( action( 222 ), aDiffElemsInVTK + "&& isVisible &&" + hasBalls, QtxPopupMgr::VisibleRule );
+ popupMgr()->setRule( action( 222 ), "{'BallElem'} in entityMode", QtxPopupMgr::ToggleRule );
+
+ popupMgr()->insert( separator(), anId, -1 );
+
+ popupMgr()->insert( action( 220 ), anId, -1 ); // ALL
+ popupMgr()->setRule( action( 220 ), aDiffElemsInVTK + "&& isVisible && not( elemTypes in entityMode )", QtxPopupMgr::VisibleRule );
+
+
+ //-------------------------------------------------
+ // Representation of the 2D Quadratic elements
+ //-------------------------------------------------
+ anId = popupMgr()->insert( tr( "MEN_QUADRATIC_REPRESENT" ), -1, -1 );
+ popupMgr()->insert( action( 231 ), anId, -1 ); // LINE REPRESENTATION
+ popupMgr()->setRule( action( 231 ), aMeshInVTK + "and isVisible",QtxPopupMgr::VisibleRule );
+ popupMgr()->setRule( action( 231 ), "quadratic2DMode = 'eLines'", QtxPopupMgr::ToggleRule );
+
+ popupMgr()->insert( action( 232 ), anId, -1 ); // ARC REPRESENTATION
+ popupMgr()->setRule( action( 232 ), aMeshInVTK + "and isVisible", QtxPopupMgr::VisibleRule );
+ popupMgr()->setRule( action( 232 ), "quadratic2DMode = 'eArcs'", QtxPopupMgr::ToggleRule );
+
+ //-------------------------------------------------
+ // Orientation of faces
+ //-------------------------------------------------
+ popupMgr()->insert( action( 221 ), -1, -1 );
+ popupMgr()->setRule( action( 221 ), aMeshInVTK + "&& isVisible", QtxPopupMgr::VisibleRule);
+ popupMgr()->setRule( action( 221 ), "facesOrientationMode = 'IsOriented'", QtxPopupMgr::ToggleRule );
+
+ //-------------------------------------------------
+ // Color / Size
+ //-------------------------------------------------
+ popupMgr()->insert( action( 1132 ), -1, -1 );
+ popupMgr()->setRule( action( 1132 ), aMeshInVTK + "&& isVisible", QtxPopupMgr::VisibleRule );
+
+ //-------------------------------------------------
+ // Transparency
+ //-------------------------------------------------
+ popupMgr()->insert( action( 1133 ), -1, -1 );
+ popupMgr()->setRule( action( 1133 ), aMeshInVTK + "&& isVisible", QtxPopupMgr::VisibleRule );
+
+ //-------------------------------------------------
+ // Controls
+ //-------------------------------------------------
+ QString
+ aMeshInVtkHasNodes = aMeshInVTK + "&&" + hasNodes,
+ 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'", QtxPopupMgr::VisibleRule );
+
+ popupMgr()->insert( separator(), anId, -1 );
+
+ int aSubId = popupMgr()->insert( tr( "MEN_NODE_CTRL" ), anId, -1 ); // NODE CONTROLS
+
+ popupMgr()->insert( action( 6005 ), aSubId, -1 ); // FREE_NODE
+ popupMgr()->setRule( action( 6005 ), aMeshInVtkHasNodes, QtxPopupMgr::VisibleRule );
+ popupMgr()->setRule( action( 6005 ), "controlMode = 'eFreeNodes'", QtxPopupMgr::ToggleRule );
+
+ popupMgr()->insert ( action( 6028 ), aSubId, -1 ); // EQUAL_NODE
+ popupMgr()->setRule( action( 6028 ), aMeshInVtkHasNodes, QtxPopupMgr::VisibleRule );
+ popupMgr()->setRule( action( 6028 ), "controlMode = 'eCoincidentNodes'", QtxPopupMgr::ToggleRule);
+
+ aSubId = popupMgr()->insert( tr( "MEN_EDGE_CTRL" ), anId, -1 ); // EDGE CONTROLS
+
+ popupMgr()->insert( action( 6002 ), aSubId, -1 ); // FREE_EDGE
+ popupMgr()->setRule( action( 6002 ), aMeshInVtkHasEdges, QtxPopupMgr::VisibleRule );
+ popupMgr()->setRule( action( 6002 ), "controlMode = 'eFreeEdges'", QtxPopupMgr::ToggleRule );
+
+ popupMgr()->insert( action( 6003 ), aSubId, -1 ); // FREE_BORDER
+ popupMgr()->setRule( action( 6003 ), aMeshInVtkHasEdges, QtxPopupMgr::VisibleRule );
+ popupMgr()->setRule( action( 6003 ), "controlMode = 'eFreeBorders'", QtxPopupMgr::ToggleRule );
+
+ popupMgr()->insert( action( 6001 ), aSubId, -1 ); // LENGTH
+ popupMgr()->setRule( action( 6001 ), aMeshInVtkHasEdges, QtxPopupMgr::VisibleRule );
+ popupMgr()->setRule( action( 6001 ), "controlMode = 'eLength'", QtxPopupMgr::ToggleRule );
+
+ popupMgr()->insert( action( 6004 ), aSubId, -1 ); // CONNECTION
+ popupMgr()->setRule( action( 6004 ), aMeshInVtkHasEdges, QtxPopupMgr::VisibleRule );
+ popupMgr()->setRule( action( 6004 ), "controlMode = 'eMultiConnection'", QtxPopupMgr::ToggleRule );
+ popupMgr()->insert ( action( 6029 ), aSubId, -1 ); // EQUAL_EDGE
+ popupMgr()->setRule( action( 6029 ), aMeshInVtkHasEdges, QtxPopupMgr::VisibleRule );
+ popupMgr()->setRule( action( 6029 ), "controlMode = 'eCoincidentElems1D'", QtxPopupMgr::ToggleRule);
+
+ aSubId = popupMgr()->insert( tr( "MEN_FACE_CTRL" ), anId, -1 ); // FACE CONTROLS
+
+ popupMgr()->insert ( action( 6021 ), aSubId, -1 ); // FREE_FACE
+ popupMgr()->setRule( action( 6021 ), aMeshInVtkHasFaces /*aMeshInVtkHasVolumes*/,
+ QtxPopupMgr::VisibleRule );
+ popupMgr()->setRule( action( 6021 ), "controlMode = 'eFreeFaces'", QtxPopupMgr::ToggleRule );
+
+ popupMgr()->insert ( action( 6018 ), aSubId, -1 ); // LENGTH_2D
+ popupMgr()->setRule( action( 6018 ), aMeshInVtkHasFaces, QtxPopupMgr::VisibleRule );
+ popupMgr()->setRule( action( 6018 ), "controlMode = 'eLength2D'", QtxPopupMgr::ToggleRule );
+
+ popupMgr()->insert ( action( 6019 ), aSubId, -1 ); // CONNECTION_2D
+ popupMgr()->setRule( action( 6019 ), aMeshInVtkHasFaces, QtxPopupMgr::VisibleRule );
+ popupMgr()->setRule( action( 6019 ), "controlMode = 'eMultiConnection2D'", QtxPopupMgr::ToggleRule );
+
+ popupMgr()->insert ( action( 6011 ), aSubId, -1 ); // AREA
+ popupMgr()->setRule( action( 6011 ), aMeshInVtkHasFaces, QtxPopupMgr::VisibleRule );
+ popupMgr()->setRule( action( 6011 ), "controlMode = 'eArea'", QtxPopupMgr::ToggleRule );
+
+ popupMgr()->insert ( action( 6012 ), aSubId, -1 ); // TAPER
+ popupMgr()->setRule( action( 6012 ), aMeshInVtkHasFaces, QtxPopupMgr::VisibleRule );
+ popupMgr()->setRule( action( 6012 ), "controlMode = 'eTaper'", QtxPopupMgr::ToggleRule );
+
+ popupMgr()->insert ( action( 6013 ), aSubId, -1 ); // ASPECT
+ popupMgr()->setRule( action( 6013 ), aMeshInVtkHasFaces, QtxPopupMgr::VisibleRule );
+ popupMgr()->setRule( action( 6013 ), "controlMode = 'eAspectRatio'", QtxPopupMgr::ToggleRule );
+
+ popupMgr()->insert ( action( 6014 ), aSubId, -1 ); // MIN_ANG
+ popupMgr()->setRule( action( 6014 ), aMeshInVtkHasFaces, QtxPopupMgr::VisibleRule );
+ popupMgr()->setRule( action( 6014 ), "controlMode = 'eMinimumAngle'", QtxPopupMgr::ToggleRule );
+
+ popupMgr()->insert ( action( 6015 ), aSubId, -1 ); // WARP
+ popupMgr()->setRule( action( 6015 ), aMeshInVtkHasFaces, QtxPopupMgr::VisibleRule );
+ popupMgr()->setRule( action( 6015 ), "controlMode = 'eWarping'", QtxPopupMgr::ToggleRule );
+
+ popupMgr()->insert ( action( 6016 ), aSubId, -1 ); // SKEW
+ popupMgr()->setRule( action( 6016 ), aMeshInVtkHasFaces, QtxPopupMgr::VisibleRule );
+ popupMgr()->setRule( action( 6016 ), "controlMode = 'eSkew'", QtxPopupMgr::ToggleRule );
+
+ popupMgr()->insert ( action( 6022 ), aSubId, -1 ); // MAX_ELEMENT_LENGTH_2D
+ popupMgr()->setRule( action( 6022 ), aMeshInVtkHasFaces, QtxPopupMgr::VisibleRule );
+ popupMgr()->setRule( action( 6022 ), "controlMode = 'eMaxElementLength2D'", QtxPopupMgr::ToggleRule );
+
+ popupMgr()->insert ( action( 6025 ), aSubId, -1 ); // BARE_BORDER_FACE
+ popupMgr()->setRule( action( 6025 ), aMeshInVtkHasFaces, QtxPopupMgr::VisibleRule );
+ popupMgr()->setRule( action( 6025 ), "controlMode = 'eBareBorderFace'", QtxPopupMgr::ToggleRule );
+
+ popupMgr()->insert ( action( 6027 ), aSubId, -1 ); // OVER_CONSTRAINED_FACE
+ popupMgr()->setRule( action( 6027 ), aMeshInVtkHasFaces, QtxPopupMgr::VisibleRule );
+ popupMgr()->setRule( action( 6027 ), "controlMode = 'eOverConstrainedFace'", QtxPopupMgr::ToggleRule );
+ popupMgr()->insert ( action( 6030 ), aSubId, -1 ); // EQUAL_FACE
+ popupMgr()->setRule( action( 6030 ), aMeshInVtkHasFaces, QtxPopupMgr::VisibleRule );
+ popupMgr()->setRule( action( 6030 ), "controlMode = 'eCoincidentElems2D'", QtxPopupMgr::ToggleRule );
+
+ aSubId = popupMgr()->insert( tr( "MEN_VOLUME_CTRL" ), anId, -1 ); // VOLUME CONTROLS
+
+ popupMgr()->insert ( action( 6017 ), aSubId, -1 ); // ASPECT_3D
+ popupMgr()->setRule( action( 6017 ), aMeshInVtkHasVolumes, QtxPopupMgr::VisibleRule );
+ popupMgr()->setRule( action( 6017 ), "controlMode = 'eAspectRatio3D'", QtxPopupMgr::ToggleRule );
+
+ popupMgr()->insert ( action( 6009 ), aSubId, -1 ); // VOLUME_3D
+ popupMgr()->setRule( action( 6009 ), aMeshInVtkHasVolumes, QtxPopupMgr::VisibleRule );
+ popupMgr()->setRule( action( 6009 ), "controlMode = 'eVolume3D'", QtxPopupMgr::ToggleRule );
+
+ popupMgr()->insert ( action( 6023 ), aSubId, -1 ); // MAX_ELEMENT_LENGTH_3D
+ popupMgr()->setRule( action( 6023 ), aMeshInVtkHasVolumes, QtxPopupMgr::VisibleRule );
+ popupMgr()->setRule( action( 6023 ), "controlMode = 'eMaxElementLength3D'", QtxPopupMgr::ToggleRule );
+
+ popupMgr()->insert ( action( 6024 ), aSubId, -1 ); // BARE_BORDER_VOLUME
+ popupMgr()->setRule( action( 6024 ), aMeshInVtkHasVolumes, QtxPopupMgr::VisibleRule );
+ popupMgr()->setRule( action( 6024 ), "controlMode = 'eBareBorderVolume'", QtxPopupMgr::ToggleRule );
+
+ popupMgr()->insert ( action( 6026 ), aSubId, -1 ); // OVER_CONSTRAINED_VOLUME
+ popupMgr()->setRule( action( 6026 ), aMeshInVtkHasVolumes, QtxPopupMgr::VisibleRule );
+ popupMgr()->setRule( action( 6026 ), "controlMode = 'eOverConstrainedVolume'", QtxPopupMgr::ToggleRule );
+
+ popupMgr()->insert ( action( 6031 ), aSubId, -1 ); // EQUAL_VOLUME
+ popupMgr()->setRule( action( 6031 ), aMeshInVtkHasVolumes, QtxPopupMgr::VisibleRule );
+ popupMgr()->setRule( action( 6031 ), "controlMode = 'eCoincidentElems3D'", QtxPopupMgr::ToggleRule );
+
+ popupMgr()->insert( separator(), anId, -1 );
+
+ popupMgr()->insert( action( 201 ), anId, -1 ); // SCALAR_BAR_PROP
+ popupMgr()->setRule( action( 201 ), aMeshInVTK + "&& controlMode <> 'eNone'", QtxPopupMgr::VisibleRule );
+
+ popupMgr()->insert( separator(), anId, -1 );
+
+ aSubId = popupMgr()->insert( tr( "MEN_DISTRIBUTION_CTRL" ), anId, -1 ); // NODE CONTROLS
+
+ popupMgr()->insert( action( 2021 ), aSubId, -1 ); // SAVE_DISTRIBUTION
+ popupMgr()->setRule( action( 2021 ), aMeshInVTK + "&& isNumFunctor", QtxPopupMgr::VisibleRule );
+
+ popupMgr()->insert( action( 2022 ), aSubId, -1 ); // SHOW_DISTRIBUTION
+ popupMgr()->setRule( action( 2022 ), aMeshInVTK + "&& isNumFunctor", QtxPopupMgr::VisibleRule );
+ popupMgr()->setRule( action( 2022 ), aMeshInVTK + "&& isNumFunctor && isDistributionVisible", QtxPopupMgr::ToggleRule);
+
+#ifndef DISABLE_PLOT2DVIEWER
+ popupMgr()->insert( action( 2023 ), aSubId, -1 ); // PLOT_DISTRIBUTION
+ popupMgr()->setRule( action( 2023 ), aMeshInVTK + "&& isNumFunctor", QtxPopupMgr::VisibleRule );
+#endif
+
+ //-------------------------------------------------
+ // Display / Erase
+ //-------------------------------------------------
+ popupMgr()->insert( separator(), -1, -1 );
+ QString aRule = "$component={'SMESH'} and ( type='Component' or (" + aClient + " and " +
+ aType + " and " + aSelCount + " and " + anActiveVTK + " and " + isNotEmpty + " %1 ) )";
+ popupMgr()->insert( action( 301 ), -1, -1 ); // DISPLAY
+ popupMgr()->setRule( action( 301 ), aRule.arg( "and (not isVisible)" ), QtxPopupMgr::VisibleRule );
+
+ popupMgr()->insert( action( 300 ), -1, -1 ); // ERASE
+ popupMgr()->setRule( action( 300 ), aRule.arg( "and isVisible" ), QtxPopupMgr::VisibleRule );
+
+ popupMgr()->insert( action( 302 ), -1, -1 ); // DISPLAY_ONLY
+ popupMgr()->setRule( action( 302 ), aRule.arg( "" ), QtxPopupMgr::VisibleRule );
+
+ popupMgr()->insert( separator(), -1, -1 );
+
+ //-------------------------------------------------
+ // Clipping
+ //-------------------------------------------------
+ popupMgr()->insert( action( 1134 ), -1, -1 );
+ popupMgr()->setRule( action( 1134 ), "client='VTKViewer'", QtxPopupMgr::VisibleRule );
+
+ popupMgr()->insert( separator(), -1, -1 );
+
+ connect( application(), SIGNAL( viewManagerActivated( SUIT_ViewManager* ) ),
+ this, SLOT( onViewManagerActivated( SUIT_ViewManager* ) ) );
+
+ connect( application(), SIGNAL( viewManagerRemoved( SUIT_ViewManager* ) ),
+ this, SLOT( onViewManagerRemoved( SUIT_ViewManager* ) ) );
+}
+
+//================================================================================
+/*!
+ * \brief Return true if SMESH or GEOM objects are selected.
+ * Is called form LightApp_Module::activateModule() which clear selection if
+ * not isSelectionCompatible()
+ */
+//================================================================================
+
+bool SMESHGUI::isSelectionCompatible()