Salome HOME
Merge branch 'V8_4_BR'
authorvsr <vsr@opencascade.com>
Mon, 2 Apr 2018 13:58:30 +0000 (16:58 +0300)
committervsr <vsr@opencascade.com>
Mon, 2 Apr 2018 13:58:30 +0000 (16:58 +0300)
1  2 
src/SMESHGUI/SMESHGUI.cxx

@@@ -74,7 -74,6 +74,7 @@@
  #include "SMESHGUI_RevolutionDlg.h"
  #include "SMESHGUI_RotationDlg.h"
  #include "SMESHGUI_ScaleDlg.h"
 +#include "SMESHGUI_OffsetDlg.h"
  #include "SMESHGUI_Selection.h"
  #include "SMESHGUI_SewingDlg.h"
  #include "SMESHGUI_SingleEditDlg.h"
@@@ -629,7 -628,7 +629,7 @@@ namespac
          "SMESH_TETRAHEDRA","SMESH_QUADRATIC_TETRAHEDRONS","SMESH_PYRAMIDS",
          "SMESH_QUADRATIC_PYRAMIDS","SMESH_HEXAHEDRA","SMESH_QUADRATIC_HEXAHEDRONS",
          "SMESH_TRIQUADRATIC_HEXAHEDRONS","SMESH_PENTAHEDRA","SMESH_QUADRATIC_PENTAHEDRONS",
 -              "SMESH_BIQUADRATIC_PENTAHEDRONS",
 +        "SMESH_BIQUADRATIC_PENTAHEDRONS",
          "SMESH_OCTAHEDRA","SMESH_POLYEDRONS","SMESH_QUADRATIC_POLYEDRONS","SMESH_BALLS"
        };
        // is typeMsg complete? (compilation failure mains that enum SMDSAbs_EntityType changed)
        type = QObject::tr( "LENGTH_EDGES" );
      else if ( dynamic_cast< SMESH::Controls::Length2D* >( f.get() ) )
        type = QObject::tr( "LENGTH2D_EDGES" );
 +    else if ( dynamic_cast< SMESH::Controls::Deflection2D* >( f.get() ) )
 +      type = QObject::tr( "DEFLECTION2D_FACES" );
      else if ( dynamic_cast< SMESH::Controls::MultiConnection* >( f.get() ) )
        type = QObject::tr( "MULTI_BORDERS" );
      else if ( dynamic_cast< SMESH::Controls::MultiConnection2D* >( f.get() ) )
      ActionControl.Bind( SMESHOp::OpBareBorderFace,        SMESH_Actor::eBareBorderFace );
      ActionControl.Bind( SMESHOp::OpOverConstrainedFace,   SMESH_Actor::eOverConstrainedFace );
      ActionControl.Bind( SMESHOp::OpLength2D,              SMESH_Actor::eLength2D );
 +    ActionControl.Bind( SMESHOp::OpDeflection2D,          SMESH_Actor::eDeflection2D );
      ActionControl.Bind( SMESHOp::OpConnection2D,          SMESH_Actor::eMultiConnection2D );
      ActionControl.Bind( SMESHOp::OpArea,                  SMESH_Actor::eArea );
      ActionControl.Bind( SMESHOp::OpTaper,                 SMESH_Actor::eTaper );
      ActionControl.Bind( SMESHOp::OpOverConstrainedVolume, SMESH_Actor::eOverConstrainedVolume );
      ActionControl.Bind( SMESHOp::OpEqualVolume,           SMESH_Actor::eCoincidentElems3D );
  
 -    return theReversed ? ActionControl.Find2( theID ) : ActionControl.Find1( theID );
 +    if ( theReversed )
 +      return ActionControl.IsBound2( theID ) ? ActionControl.Find2( theID ) : 0;
 +    return   ActionControl.IsBound1( theID ) ? ActionControl.Find1( theID ) : 0;
    }
  
    void Control( int theCommandID )
@@@ -1856,20 -1850,24 +1856,24 @@@ void SMESHGUI::OnEditDelete(
    int objectCount = 0;
    QString aNameList;
    QString aParentComponent = QString::null;
-   Handle(SALOME_InteractiveObject) anIO;
+   
    for( SALOME_ListIteratorOfListIO anIt( selected ); anIt.More(); anIt.Next() )
    {
-     anIO = anIt.Value();
-     QString cur = anIO->getComponentDataType();
-     _PTR(SObject) aSO = aStudy->FindObjectID(anIO->getEntry());
+     Handle(SALOME_InteractiveObject) anIO = anIt.Value();
+     if ( anIO.IsNull() ) continue;
+     
+     QString father = "unknown";
+     _PTR(SObject) aSO = aStudy->FindObjectID( anIO->getEntry() );
      if (aSO) {
+       father = QString::fromStdString( aSO->GetFatherComponent()->ComponentDataType() );
        // check if object is reference
        _PTR(SObject) aRefSObj;
        aNameList.append("\n    - ");
        if ( aSO->ReferencedObject( aRefSObj ) ) {
          QString aRefName = QString::fromStdString ( aRefSObj->GetName() );
          aNameList.append( aRefName );
-         cur = QString::fromStdString ( aRefSObj->GetFatherComponent()->ComponentDataType() );
+         father = QString::fromStdString ( aRefSObj->GetFatherComponent()->ComponentDataType() );
        }
        else
          aNameList.append(anIO->getName());
      }
  
      if( aParentComponent.isNull() )
-       aParentComponent = cur;
-     else if( !aParentComponent.isEmpty() && aParentComponent!=cur )
+       aParentComponent = father;
+     else if( !aParentComponent.isEmpty() && aParentComponent!=father )
        aParentComponent = "";
    }
  
@@@ -3537,20 -3535,6 +3541,20 @@@ bool SMESHGUI::OnGUIEvent( int theComma
        break;
      }
  
 +  case SMESHOp::OpOffset:
 +    {
 +      if(checkLock(aStudy)) break;
 +      if ( vtkwnd ) {
 +        EmitSignalDeactivateDialog();
 +        ( new SMESHGUI_OffsetDlg( this ) )->show();
 +      }
 +      else {
 +        SUIT_MessageBox::warning(SMESHGUI::desktop(),
 +                                 tr("SMESH_WRN_WARNING"), tr("SMESH_WRN_VIEWER_VTK"));
 +      }
 +      break;
 +    }
 +
    case SMESHOp::OpSewing:
      {
        if(checkLock(aStudy)) break;
    case SMESHOp::OpBareBorderFace:
    case SMESHOp::OpOverConstrainedFace:
    case SMESHOp::OpLength2D:
 +  case SMESHOp::OpDeflection2D:
    case SMESHOp::OpConnection2D:
    case SMESHOp::OpArea:
    case SMESHOp::OpTaper:
@@@ -3944,7 -3927,6 +3948,7 @@@ void SMESHGUI::initialize( CAM_Applicat
    createSMESHAction( SMESHOp::OpBareBorderFace,        "BARE_BORDER_FACE",        "ICON_BARE_BORDER_FACE",        0, true );
    createSMESHAction( SMESHOp::OpOverConstrainedFace,   "OVER_CONSTRAINED_FACE",   "ICON_OVER_CONSTRAINED_FACE",   0, true );
    createSMESHAction( SMESHOp::OpLength2D,              "LENGTH_2D",               "ICON_LENGTH_2D",     0, true );
 +  createSMESHAction( SMESHOp::OpDeflection2D,          "DEFLECTION_2D",           "ICON_DEFLECTION_2D", 0, true );
    createSMESHAction( SMESHOp::OpConnection2D,          "CONNECTION_2D",           "ICON_CONNECTION_2D", 0, true );
    createSMESHAction( SMESHOp::OpArea,                  "AREA",                    "ICON_AREA",          0, true );
    createSMESHAction( SMESHOp::OpTaper,                 "TAPER",                   "ICON_TAPER",         0, true );
    createSMESHAction( SMESHOp::OpRotation,               "ROT",             "ICON_DLG_MESH_ROTATION" );
    createSMESHAction( SMESHOp::OpSymmetry,               "SYM",             "ICON_SMESH_SYMMETRY_PLANE" );
    createSMESHAction( SMESHOp::OpScale,                  "SCALE",           "ICON_DLG_MESH_SCALE" );
 +  createSMESHAction( SMESHOp::OpOffset,                 "OFFSET",          "ICON_DLG_MESH_OFFSET" );
    createSMESHAction( SMESHOp::OpSewing,                 "SEW",             "ICON_SMESH_SEWING_FREEBORDERS" );
    createSMESHAction( SMESHOp::OpMergeNodes,             "MERGE",           "ICON_SMESH_MERGE_NODES" );
    createSMESHAction( SMESHOp::OpMergeElements,          "MERGE_ELEMENTS",  "ICON_DLG_MERGE_ELEMENTS" );
                 << SMESHOp::OpNodeConnectivityNb                                         // node controls
                 << SMESHOp::OpFreeEdge << SMESHOp::OpFreeBorder
                 << SMESHOp::OpLength << SMESHOp::OpConnection << SMESHOp::OpEqualEdge    // edge controls
 +               << SMESHOp::OpDeflection2D
                 << SMESHOp::OpFreeFace << SMESHOp::OpLength2D << SMESHOp::OpConnection2D
                 << SMESHOp::OpArea << SMESHOp::OpTaper << SMESHOp::OpAspectRatio
                 << SMESHOp::OpMinimumAngle << SMESHOp::OpWarpingAngle << SMESHOp::OpSkew
    createMenu( SMESHOp::OpSkew,                  faceId,   -1 );
    createMenu( SMESHOp::OpMaxElementLength2D,    faceId,   -1 );
    createMenu( SMESHOp::OpEqualFace,             faceId,   -1 );
 +  createMenu( SMESHOp::OpDeflection2D,          faceId,   -1 );
    createMenu( SMESHOp::OpAspectRatio3D,         volumeId, -1 );
    createMenu( SMESHOp::OpVolume,                volumeId, -1 );
    createMenu( SMESHOp::OpMaxElementLength3D,    volumeId, -1 );
    //createMenu( SMESHOp::OpRenumberingNodes,    renumId, -1 );
    //createMenu( SMESHOp::OpRenumberingElements, renumId, -1 );
  
 +  createMenu( SMESHOp::OpMergeNodes,     transfId, -1 );
 +  createMenu( SMESHOp::OpMergeElements,  transfId, -1 );
    createMenu( SMESHOp::OpTranslation,    transfId, -1 );
    createMenu( SMESHOp::OpRotation,       transfId, -1 );
    createMenu( SMESHOp::OpSymmetry,       transfId, -1 );
    createMenu( SMESHOp::OpScale,          transfId, -1 );
 +  createMenu( SMESHOp::OpOffset,         transfId, -1 );
    createMenu( SMESHOp::OpSewing,         transfId, -1 );
 -  createMenu( SMESHOp::OpMergeNodes,     transfId, -1 );
 -  createMenu( SMESHOp::OpMergeElements,  transfId, -1 );
    createMenu( SMESHOp::OpDuplicateNodes, transfId, -1 );
  
 +  createMenu( SMESHOp::OpConvertMeshToQuadratic, modifyId, -1 );
 +  createMenu( SMESHOp::OpCreateBoundaryElements, modifyId, -1 );
 +  createMenu( SMESHOp::OpExtrusion,              modifyId, -1 );
 +  createMenu( SMESHOp::OpExtrusionAlongAPath,    modifyId, -1 );
 +  createMenu( SMESHOp::OpRevolution,             modifyId, -1 );
 +  createMenu( SMESHOp::OpOrientation,            modifyId, -1 );
 +  createMenu( SMESHOp::OpReorientFaces,          modifyId, -1 );
    createMenu( SMESHOp::OpMoveNode,               modifyId, -1 );
    createMenu( SMESHOp::OpDiagonalInversion,      modifyId, -1 );
    createMenu( SMESHOp::OpUnionOfTwoTriangle,     modifyId, -1 );
 -  createMenu( SMESHOp::OpOrientation,            modifyId, -1 );
 -  createMenu( SMESHOp::OpReorientFaces,          modifyId, -1 );
    createMenu( SMESHOp::OpUnionOfTriangles,       modifyId, -1 );
    createMenu( SMESHOp::OpCuttingOfQuadrangles,   modifyId, -1 );
    createMenu( SMESHOp::OpSplitVolumes,           modifyId, -1 );
    createMenu( SMESHOp::OpSplitBiQuadratic,       modifyId, -1 );
    createMenu( SMESHOp::OpSmoothing,              modifyId, -1 );
 -  createMenu( SMESHOp::OpExtrusion,              modifyId, -1 );
 -  createMenu( SMESHOp::OpExtrusionAlongAPath ,   modifyId, -1 );
 -  createMenu( SMESHOp::OpRevolution,             modifyId, -1 );
    createMenu( SMESHOp::OpPatternMapping,         modifyId, -1 );
 -  createMenu( SMESHOp::OpConvertMeshToQuadratic, modifyId, -1 );
 -  createMenu( SMESHOp::OpCreateBoundaryElements, modifyId, -1 );
  
    createMenu( SMESHOp::OpMinimumDistance,  measureId,   -1 );
    createMenu( SMESHOp::OpBoundingBox,      measureId,   -1 );
    createTool( SMESHOp::OpSkew,                ctrl2dTb );
    createTool( SMESHOp::OpMaxElementLength2D,  ctrl2dTb );
    createTool( SMESHOp::OpEqualFace,           ctrl2dTb );
 +  createTool( SMESHOp::OpDeflection2D,        ctrl2dTb );
  
    createTool( SMESHOp::OpAspectRatio3D,         ctrl3dTb );
    createTool( SMESHOp::OpVolume,                ctrl3dTb );
    //createTool( SMESHOp::OpRenumberingNodes,    renumbTb );
    //createTool( SMESHOp::OpRenumberingElements, renumbTb );
  
 +  createTool( SMESHOp::OpMergeNodes,     transformTb );
 +  createTool( SMESHOp::OpMergeElements,  transformTb );
    createTool( SMESHOp::OpTranslation,    transformTb );
    createTool( SMESHOp::OpRotation,       transformTb );
    createTool( SMESHOp::OpSymmetry,       transformTb );
    createTool( SMESHOp::OpScale,          transformTb );
 +  createTool( SMESHOp::OpOffset,         transformTb );
    createTool( SMESHOp::OpSewing,         transformTb );
 -  createTool( SMESHOp::OpMergeNodes,     transformTb );
 -  createTool( SMESHOp::OpMergeElements,  transformTb );
    createTool( SMESHOp::OpDuplicateNodes, transformTb );
  
 +  createTool( SMESHOp::OpConvertMeshToQuadratic, modifyTb );
 +  createTool( SMESHOp::OpCreateBoundaryElements, modifyTb );
 +  createTool( SMESHOp::OpExtrusion,              modifyTb );
 +  createTool( SMESHOp::OpExtrusionAlongAPath,    modifyTb );
 +  createTool( SMESHOp::OpRevolution,             modifyTb );
 +  createTool( SMESHOp::OpOrientation,            modifyTb );
 +  createTool( SMESHOp::OpReorientFaces,          modifyTb );
    createTool( SMESHOp::OpMoveNode,               modifyTb );
    createTool( SMESHOp::OpDiagonalInversion,      modifyTb );
    createTool( SMESHOp::OpUnionOfTwoTriangle,     modifyTb );
 -  createTool( SMESHOp::OpOrientation,            modifyTb );
 -  createTool( SMESHOp::OpReorientFaces,          modifyTb );
    createTool( SMESHOp::OpUnionOfTriangles,       modifyTb );
    createTool( SMESHOp::OpCuttingOfQuadrangles,   modifyTb );
    createTool( SMESHOp::OpSplitVolumes,           modifyTb );
    createTool( SMESHOp::OpSplitBiQuadratic,       modifyTb );
    createTool( SMESHOp::OpSmoothing,              modifyTb );
 -  createTool( SMESHOp::OpExtrusion,              modifyTb );
 -  createTool( SMESHOp::OpExtrusionAlongAPath,    modifyTb );
 -  createTool( SMESHOp::OpRevolution,             modifyTb );
    createTool( SMESHOp::OpPatternMapping,         modifyTb );
 -  createTool( SMESHOp::OpConvertMeshToQuadratic, modifyTb );
 -  createTool( SMESHOp::OpCreateBoundaryElements, modifyTb );
  
    createTool( SMESHOp::OpMinimumDistance, measuremTb );
  
    popupMgr()->insert ( action( SMESHOp::OpOverConstrainedFace ), aSubId, -1 );
    popupMgr()->setRule( action( SMESHOp::OpOverConstrainedFace ), aMeshInVtkHasFaces, QtxPopupMgr::VisibleRule );
    popupMgr()->setRule( action( SMESHOp::OpOverConstrainedFace ), "controlMode = 'eOverConstrainedFace'", QtxPopupMgr::ToggleRule );
 +
    popupMgr()->insert ( action( SMESHOp::OpEqualFace ), aSubId, -1 );
    popupMgr()->setRule( action( SMESHOp::OpEqualFace ), aMeshInVtkHasFaces, QtxPopupMgr::VisibleRule );
    popupMgr()->setRule( action( SMESHOp::OpEqualFace ), "controlMode = 'eCoincidentElems2D'", QtxPopupMgr::ToggleRule );
  
 +  popupMgr()->insert ( action( SMESHOp::OpDeflection2D ), aSubId, -1 );
 +  popupMgr()->setRule( action( SMESHOp::OpDeflection2D ), aMeshInVtkHasFaces + " && hasGeomReference", QtxPopupMgr::VisibleRule );
 +  popupMgr()->setRule( action( SMESHOp::OpDeflection2D ), "controlMode = 'eDeflection2D'", QtxPopupMgr::ToggleRule );
 +
    aSubId = popupMgr()->insert( tr( "MEN_VOLUME_CTRL" ), anId, -1 ); // VOLUME CONTROLS
  
    popupMgr()->insert ( action( SMESHOp::OpAspectRatio3D  ), aSubId, -1 );