Salome HOME
Merge branch V7_3_1_BR
authorvsr <vsr@opencascade.com>
Thu, 3 Apr 2014 11:25:50 +0000 (15:25 +0400)
committervsr <vsr@opencascade.com>
Thu, 3 Apr 2014 11:36:10 +0000 (15:36 +0400)
1  2 
CMakeLists.txt
src/SMESHGUI/SMESHGUI.cxx
src/StdMeshersGUI/StdMeshersGUI_DistrPreview.cxx

diff --combined CMakeLists.txt
index 441f79c0a8717777d3a9ef796409ec854c26623d,97b780d46bdb3582277aa5d51a3559e964f20707..4dd5f2eb1d3e738d44affa3307d3f2f5d98b2168
@@@ -1,9 -1,9 +1,9 @@@
 -# Copyright (C) 2012-2013  CEA/DEN, EDF R&D, OPEN CASCADE
 +# Copyright (C) 2012-2014  CEA/DEN, EDF R&D, OPEN CASCADE
  #
  # This library is free software; you can redistribute it and/or
  # modify it under the terms of the GNU Lesser General Public
  # License as published by the Free Software Foundation; either
 -# version 2.1 of the License.
 +# version 2.1 of the License, or (at your option) any later version.
  #
  # This library is distributed in the hope that it will be useful,
  # but WITHOUT ANY WARRANTY; without even the implied warranty of
@@@ -29,10 -29,10 +29,10 @@@ STRING(TOUPPER ${PROJECT_NAME} PROJECT_
  
  SET(${PROJECT_NAME_UC}_MAJOR_VERSION 7)
  SET(${PROJECT_NAME_UC}_MINOR_VERSION 3)
- SET(${PROJECT_NAME_UC}_PATCH_VERSION 0)
+ SET(${PROJECT_NAME_UC}_PATCH_VERSION 1)
  SET(${PROJECT_NAME_UC}_VERSION
    ${${PROJECT_NAME_UC}_MAJOR_VERSION}.${${PROJECT_NAME_UC}_MINOR_VERSION}.${${PROJECT_NAME_UC}_PATCH_VERSION})
 -SET(${PROJECT_NAME_UC}_VERSION_DEV 0)
 +SET(${PROJECT_NAME_UC}_VERSION_DEV 1)
  
  # Find KERNEL
  # ===========
@@@ -41,11 -41,14 +41,11 @@@ IF(EXISTS ${KERNEL_ROOT_DIR}
    LIST(APPEND CMAKE_MODULE_PATH "${KERNEL_ROOT_DIR}/salome_adm/cmake_files")
    INCLUDE(SalomeMacros)
    FIND_PACKAGE(SalomeKERNEL REQUIRED)
 +  KERNEL_WITH_CORBA() #check whether KERNEL builded with CORBA
  ELSE(EXISTS ${KERNEL_ROOT_DIR})
    MESSAGE(FATAL_ERROR "We absolutely need a Salome KERNEL, please define KERNEL_ROOT_DIR")
  ENDIF(EXISTS ${KERNEL_ROOT_DIR})
  
 -IF(SALOME_LIGHT_ONLY)
 -  MESSAGE(FATAL_ERROR "SMESH module can't be built in Light mode (without CORBA)")
 -ENDIF()
 -
  # Platform setup
  # ==============
  INCLUDE(SalomeSetupPlatform)   # From KERNEL
@@@ -122,7 -125,7 +122,7 @@@ IF(SALOME_BUILD_GUI
    IF(EXISTS ${GUI_ROOT_DIR})
      LIST(APPEND CMAKE_MODULE_PATH "${GUI_ROOT_DIR}/adm_local/cmake_files")
      FIND_PACKAGE(SalomeGUI)
 -    
 +    FULL_GUI(TRUE) #check whether GUI builded in full mode and with CORBA
      ##
      ## Prerequisites From GUI:
      ##
@@@ -162,7 -165,7 +162,7 @@@ ENDIF(EXISTS ${GEOM_ROOT_DIR}
  ##
  
  # VTK is obligatiry for the SMESH
- FIND_PACKAGE(SalomeVTK 6.0 REQUIRED)
+ FIND_PACKAGE(SalomeVTK 6.1 REQUIRED)
  
  FIND_PACKAGE(SalomeCAS REQUIRED) 
  
index c90cb0fa9efe48868146d72afef3b6b371624d3d,6fb58cea1ddc998627ad5579751107b9cb734c47..336363ecbc9e3f52393352a1d2f9df01d8c32f21
@@@ -1,4 -1,4 +1,4 @@@
 -// Copyright (C) 2007-2013  CEA/DEN, EDF R&D, OPEN CASCADE
 +// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
  //
  // Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
  // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
@@@ -6,7 -6,7 +6,7 @@@
  // This library is free software; you can redistribute it and/or
  // modify it under the terms of the GNU Lesser General Public
  // License as published by the Free Software Foundation; either
 -// version 2.1 of the License.
 +// version 2.1 of the License, or (at your option) any later version.
  //
  // This library is distributed in the hope that it will be useful,
  // but WITHOUT ANY WARRANTY; without even the implied warranty of
@@@ -44,7 -44,6 +44,7 @@@
  #include "SMESHGUI_DuplicateNodesDlg.h"
  #include "SMESHGUI_ExtrusionAlongPathDlg.h"
  #include "SMESHGUI_ExtrusionDlg.h"
 +#include "SMESHGUI_FieldSelectorWdg.h"
  #include "SMESHGUI_FileInfoDlg.h"
  #include "SMESHGUI_FileValidator.h"
  #include "SMESHGUI_FilterDlg.h"
  // of auto-color picking up
  #define SIMPLE_AUTOCOLOR
  
- // REMOVE the code about MPLMathText_Disabler if it does not complite at porting to ParaView-4.1
- #include <vtkMatplotlibMathTextUtilities.h>
- namespace
- {
-   // Creation of this class disables vtkMatplotlibMathTextUtilities
-   struct MPLMathText_Disabler : protected vtkMatplotlibMathTextUtilities
-   {
-     MPLMathText_Disabler()
-     {
-       vtkMatplotlibMathTextUtilities::MPLMathTextAvailable =
-         vtkMatplotlibMathTextUtilities::UNAVAILABLE;
-     }
-   };
- } 
 -//namespace{
 +namespace
 +{
    // Declarations
    //=============================================================
    void ImportMeshesFromFile(SMESH::SMESH_Gen_ptr theComponentMesh,
  
    void Control( int theCommandID );
  
 -
    // Definitions
 -  //=============================================================
 +  //================================================================================
 +  /*!
 +   * \brief Reads meshes from file
 +   */
 +  //================================================================================
 +
    void ImportMeshesFromFile( SMESH::SMESH_Gen_ptr theComponentMesh,
                               int theCommandID )
    {
      if ( SUIT_FileDlg::getLastVisitedPath().isEmpty() )
        anInitialPath = QDir::currentPath();
  
 +    QList< QPair< GEOM::ListOfFields_var, QString > > aFieldList;
 +
      // Get a file name to write in and additional otions
      if ( isUNV || isDAT || isGMF ) // Export w/o options
      {
        QStringList checkBoxes;
        checkBoxes << QObject::tr("SMESH_AUTO_GROUPS") << QObject::tr("SMESH_AUTO_DIM");
  
 +      SMESHGUI_FieldSelectorWdg* fieldSelWdg = new SMESHGUI_FieldSelectorWdg();
 +      QList< QWidget* > wdgList;
 +      if ( fieldSelWdg->GetAllFeilds( aMeshList, aFieldList ))
 +        wdgList.append( fieldSelWdg );
 +
        SalomeApp_CheckFileDlg* fd =
 -        new SalomeApp_CheckFileDlg ( SMESHGUI::desktop(), false, checkBoxes, true, true );
 +        new SalomeApp_CheckFileDlg ( SMESHGUI::desktop(), false, checkBoxes, true, true, wdgList );
        fd->setWindowTitle( aTitle );
        fd->setNameFilters( filters );
        fd->selectNameFilter( aDefaultFilter );
        }
        toCreateGroups = fd->IsChecked(0);
        toFindOutDim   = fd->IsChecked(1);
 +      fieldSelWdg->GetSelectedFeilds();
 +      if ( !fieldSelWdg->parent() )
 +        delete fieldSelWdg;
        delete fd;
      }
      else
            {
              SMESH::SMESH_IDSource_var aMeshOrGroup = (*aMeshIter).first;
              SMESH::SMESH_Mesh_var        aMeshItem = aMeshOrGroup->GetMesh();
 -            if ( aMeshOrGroup->_is_equivalent( aMeshItem ))
 +            const GEOM::ListOfFields&       fields = aFieldList[ aMeshIndex ].first.in();
 +            const QString&            geoAssFields = aFieldList[ aMeshIndex ].second;
 +            const bool                   hasFields = ( fields.length() || !geoAssFields.isEmpty() );
 +            if ( !hasFields && aMeshOrGroup->_is_equivalent( aMeshItem ))
                aMeshItem->ExportToMEDX( aFilename.toUtf8().data(), toCreateGroups,
                                         aFormat, toOverwrite && aMeshIndex == 0, toFindOutDim );
              else
                aMeshItem->ExportPartToMED( aMeshOrGroup, aFilename.toUtf8().data(), toCreateGroups,
 -                                          aFormat, toOverwrite && aMeshIndex == 0, toFindOutDim );
 +                                          aFormat, toOverwrite && aMeshIndex == 0, toFindOutDim,
 +                                          fields, geoAssFields.toLatin1().data() );
            }
          }
          else if ( isSAUV )
          int deltaF = 0, deltaV = 0;
          int elem0dSize   = 1;
          int ballSize     = 1;
 +        double ballScale = 1.0;
          int edgeWidth    = 1;
          int outlineWidth = 1;
          double shrinkCoef = 0.0;
              anActor->GetBallColor( color[0], color[1], color[2] );
              ballColor.setRgbF( color[0], color[1], color[2] );
              ballSize = qMax( (int)anActor->GetBallSize(), 1 ); // minimum allowed size is 1
 +            ballScale = qMax( (double)anActor->GetBallScale(), 1e-2 ); // minimum allowed scale is 1e-2
              // outlines: color
              anActor->GetOutlineColor( color[0], color[1], color[2] );
              outlineColor.setRgbF( color[0], color[1], color[2] );
          // balls: color, size
          dlg.setBallColor( ballColor );
          dlg.setBallSize( ballSize );
 +        dlg.setBallScale( ballScale );
          // orientation: color, scale, 3d flag
          dlg.setOrientationColor( orientationColor );
          dlg.setOrientationSize( int( orientationScale * 100. ) );
            elem0dSize       = dlg.elem0dSize();
            ballColor        = dlg.ballColor();
            ballSize         = dlg.ballSize();
 +          ballScale        = dlg.ballScale();
            orientationColor = dlg.orientationColor();
            orientationScale = dlg.orientationSize() / 100.;
            orientation3d    = dlg.orientation3d();
              // balls: color, size
              anActor->SetBallColor( ballColor.redF(), ballColor.greenF(), ballColor.blueF() );
              anActor->SetBallSize( ballSize );
 +            anActor->SetBallScale( ballScale );
              // orientation: color, scale, 3d flag
              anActor->SetFacesOrientationColor( orientationColor.redF(), orientationColor.greenF(), orientationColor.blueF() );
              anActor->SetFacesOrientationScale( orientationScale );
      QString RefType = CheckTypeObject(selected.First());
      SALOME_ListIteratorOfListIO It(selected);
      for ( ; It.More(); It.Next())
 -      {
 -        Handle(SALOME_InteractiveObject) IObject = It.Value();
 -        QString Type = CheckTypeObject(IObject);
 -        if (Type.compare(RefType) != 0)
 -          return "Heterogeneous Selection";
 -      }
 +    {
 +      Handle(SALOME_InteractiveObject) IObject = It.Value();
 +      QString Type = CheckTypeObject(IObject);
 +      if (Type.compare(RefType) != 0)
 +        return "Heterogeneous Selection";
 +    }
  
      return RefType;
    }
  
 +} //namespace
  
 -  void SMESHGUI::OnEditDelete()
 +void SMESHGUI::OnEditDelete()
 +{
 +  // VSR 17/11/04: check if all objects selected belong to SMESH component --> start
 +  LightApp_SelectionMgr* aSel = SMESHGUI::selectionMgr();
 +  SALOME_ListIO selected; aSel->selectedObjects( selected, QString::null, false );
 +
 +  _PTR(Study) aStudy = SMESH::GetActiveStudyDocument();
 +  _PTR(StudyBuilder) aStudyBuilder = aStudy->NewBuilder();
 +  _PTR(GenericAttribute) anAttr;
 +  _PTR(AttributeIOR) anIOR;
 +
 +  int objectCount = 0;
 +  QString aNameList;
 +  QString aParentComponent = QString::null;
 +  Handle(SALOME_InteractiveObject) anIO;
 +  for( SALOME_ListIteratorOfListIO anIt( selected ); anIt.More(); anIt.Next() )
    {
 -    // VSR 17/11/04: check if all objects selected belong to SMESH component --> start
 -    LightApp_SelectionMgr* aSel = SMESHGUI::selectionMgr();
 -    SALOME_ListIO selected; aSel->selectedObjects( selected, QString::null, false );
 -
 -    _PTR(Study) aStudy = SMESH::GetActiveStudyDocument();
 -    _PTR(StudyBuilder) aStudyBuilder = aStudy->NewBuilder();
 -    _PTR(GenericAttribute) anAttr;
 -    _PTR(AttributeIOR) anIOR;
 -
 -    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());
 -      if (aSO) {
 -        // 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() );
 -        }
 -        else
 -          aNameList.append(anIO->getName());
 -        objectCount++;
 +    anIO = anIt.Value();
 +    QString cur = anIO->getComponentDataType();
 +    _PTR(SObject) aSO = aStudy->FindObjectID(anIO->getEntry());
 +    if (aSO) {
 +      // 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() );
        }
 -
 -      if( aParentComponent.isNull() )
 -        aParentComponent = cur;
 -      else if( !aParentComponent.isEmpty() && aParentComponent!=cur )
 -        aParentComponent = "";
 +      else
 +        aNameList.append(anIO->getName());
 +      objectCount++;
      }
  
 -    if ( objectCount == 0 )
 -      return; // No Valid Objects Selected
 +    if( aParentComponent.isNull() )
 +      aParentComponent = cur;
 +    else if( !aParentComponent.isEmpty() && aParentComponent!=cur )
 +      aParentComponent = "";
 +  }
  
 -    if ( aParentComponent != SMESHGUI::GetSMESHGUI()->name() )  {
 -      SUIT_MessageBox::warning( SMESHGUI::desktop(),
 -                                QObject::tr("ERR_ERROR"),
 -                                QObject::tr("NON_SMESH_OBJECTS_SELECTED").arg( SMESHGUI::GetSMESHGUI()->moduleName() ) );
 -      return;
 -    }
 -    // VSR 17/11/04: check if all objects selected belong to SMESH component <-- finish
 -    if (SUIT_MessageBox::warning
 -        (SMESHGUI::desktop(),
 -         QObject::tr("SMESH_WRN_WARNING"),
 -         QObject::tr("SMESH_REALLY_DELETE").arg( objectCount ).arg( aNameList ),
 -         SUIT_MessageBox::Yes | SUIT_MessageBox::No,
 -         SUIT_MessageBox::Yes) != SUIT_MessageBox::Yes)
 -      return;
 +  if ( objectCount == 0 )
 +    return; // No Valid Objects Selected
  
 -    SalomeApp_Application* anApp = dynamic_cast<SalomeApp_Application*>( SUIT_Session::session()->activeApplication() );
 +  if ( aParentComponent != SMESHGUI::GetSMESHGUI()->name() )  {
 +    SUIT_MessageBox::warning( SMESHGUI::desktop(),
 +                              QObject::tr("ERR_ERROR"),
 +                              QObject::tr("NON_SMESH_OBJECTS_SELECTED").arg( SMESHGUI::GetSMESHGUI()->moduleName() ) );
 +    return;
 +  }
 +  // VSR 17/11/04: check if all objects selected belong to SMESH component <-- finish
 +  if (SUIT_MessageBox::warning
 +      (SMESHGUI::desktop(),
 +       QObject::tr("SMESH_WRN_WARNING"),
 +       QObject::tr("SMESH_REALLY_DELETE").arg( objectCount ).arg( aNameList ),
 +       SUIT_MessageBox::Yes | SUIT_MessageBox::No,
 +       SUIT_MessageBox::Yes) != SUIT_MessageBox::Yes)
 +    return;
  
 -    // Put the whole hierarchy of sub-objects of the selected SO's into a list and
 -    // then treat them all starting from the deepest objects (at list back)
 -    std::list< _PTR(SObject) > listSO;
 -    SALOME_ListIteratorOfListIO It(selected);
 -    for( ; It.More(); It.Next()) // loop on selected IO's
 -    {
 -      Handle(SALOME_InteractiveObject) IObject = It.Value();
 -      if(IObject->hasEntry()) {
 -        _PTR(SObject) aSO = aStudy->FindObjectID(IObject->getEntry());
 -
 -        // disable removal of "SMESH" component object
 -        if(aSO->FindAttribute(anAttr, "AttributeIOR")){
 -          anIOR = anAttr;
 -          if ( engineIOR() == anIOR->Value().c_str() )
 -            continue;
 -        }
 -        //Check the referenced object
 -        _PTR(SObject) aRefSObject;
 -        if ( aSO && aSO->ReferencedObject( aRefSObject ) )
 -          aSO = aRefSObject; // Delete main Object instead of reference
 -
 -        listSO.push_back( aSO );
 -        std::list< _PTR(SObject) >::iterator itSO = --listSO.end();
 -        for ( ; itSO != listSO.end(); ++itSO ) {
 -          _PTR(ChildIterator) it = aStudy->NewChildIterator( *itSO );
 -          for (it->InitEx(false); it->More(); it->Next())
 -            listSO.push_back( it->Value() );
 -        }
 +  SalomeApp_Application* anApp = dynamic_cast<SalomeApp_Application*>( SUIT_Session::session()->activeApplication() );
 +
 +  // Put the whole hierarchy of sub-objects of the selected SO's into a list and
 +  // then treat them all starting from the deepest objects (at list back)
 +  std::list< _PTR(SObject) > listSO;
 +  SALOME_ListIteratorOfListIO It(selected);
 +  for( ; It.More(); It.Next()) // loop on selected IO's
 +  {
 +    Handle(SALOME_InteractiveObject) IObject = It.Value();
 +    if(IObject->hasEntry()) {
 +      _PTR(SObject) aSO = aStudy->FindObjectID(IObject->getEntry());
 +
 +      // disable removal of "SMESH" component object
 +      if(aSO->FindAttribute(anAttr, "AttributeIOR")){
 +        anIOR = anAttr;
 +        if ( engineIOR() == anIOR->Value().c_str() )
 +          continue;
 +      }
 +      //Check the referenced object
 +      _PTR(SObject) aRefSObject;
 +      if ( aSO && aSO->ReferencedObject( aRefSObject ) )
 +        aSO = aRefSObject; // Delete main Object instead of reference
 +
 +      listSO.push_back( aSO );
 +      std::list< _PTR(SObject) >::iterator itSO = --listSO.end();
 +      for ( ; itSO != listSO.end(); ++itSO ) {
 +        _PTR(ChildIterator) it = aStudy->NewChildIterator( *itSO );
 +        for (it->InitEx(false); it->More(); it->Next())
 +          listSO.push_back( it->Value() );
        }
      }
 -    // Check if none of objects to delete is referred from outside
 -    std::list< _PTR(SObject) >::reverse_iterator ritSO;
 -    for ( ritSO = listSO.rbegin(); ritSO != listSO.rend(); ++ritSO )
 -    {
 -      _PTR(SObject) SO = *ritSO;
 -      if ( !SO ) continue;
 -      std::vector<_PTR(SObject)> aReferences = aStudy->FindDependances( *ritSO  );
 -      for (size_t i = 0; i < aReferences.size(); i++) {
 -        _PTR(SComponent) aComponent = aReferences[i]->GetFatherComponent();
 -        std::string type = aComponent->ComponentDataType();
 -        if ( type != "SMESH" )
 -        {
 -          SUIT_MessageBox::warning( anApp->desktop(),
 -                                    QObject::tr("WRN_WARNING"),
 -                                    QObject::tr("DEP_OBJECT") );
 -          return; // outside SMESH, there is an object depending on a SMESH object 
 -        }
 +  }
 +  // Check if none of objects to delete is referred from outside
 +  std::list< _PTR(SObject) >::reverse_iterator ritSO;
 +  for ( ritSO = listSO.rbegin(); ritSO != listSO.rend(); ++ritSO )
 +  {
 +    _PTR(SObject) SO = *ritSO;
 +    if ( !SO ) continue;
 +    std::vector<_PTR(SObject)> aReferences = aStudy->FindDependances( *ritSO  );
 +    for (size_t i = 0; i < aReferences.size(); i++) {
 +      _PTR(SComponent) aComponent = aReferences[i]->GetFatherComponent();
 +      std::string type = aComponent->ComponentDataType();
 +      if ( type != "SMESH" )
 +      {
 +        SUIT_MessageBox::warning( anApp->desktop(),
 +                                  QObject::tr("WRN_WARNING"),
 +                                  QObject::tr("DEP_OBJECT") );
 +        return; // outside SMESH, there is an object depending on a SMESH object
        }
      }
 +  }
  
 -    // Call mesh->Clear() to prevent loading mesh from file caused by hypotheses removal
 -    for( It.Initialize( selected ); It.More(); It.Next()) // loop on selected IO's
 -    {
 -      Handle(SALOME_InteractiveObject) IObject = It.Value();
 -      SMESH::SMESH_Mesh_var mesh = SMESH::IObjectToInterface< SMESH::SMESH_Mesh >( IObject );
 -      if ( !mesh->_is_nil() )
 -        mesh->Clear();
 -    }
 +  // Call mesh->Clear() to prevent loading mesh from file caused by hypotheses removal
 +  for( It.Initialize( selected ); It.More(); It.Next()) // loop on selected IO's
 +  {
 +    Handle(SALOME_InteractiveObject) IObject = It.Value();
 +    SMESH::SMESH_Mesh_var mesh = SMESH::IObjectToInterface< SMESH::SMESH_Mesh >( IObject );
 +    if ( !mesh->_is_nil() )
 +      mesh->Clear();
 +  }
  
 -    // Treat SO's in the list starting from the back
 -    aStudyBuilder->NewCommand();  // There is a transaction
 -    for ( ritSO = listSO.rbegin(); ritSO != listSO.rend(); ++ritSO )
 -    {
 -      _PTR(SObject) SO = *ritSO;
 -      if ( !SO ) continue;
 -      std::string anEntry = SO->GetID();
 +  // Treat SO's in the list starting from the back
 +  aStudyBuilder->NewCommand();  // There is a transaction
 +  for ( ritSO = listSO.rbegin(); ritSO != listSO.rend(); ++ritSO )
 +  {
 +    _PTR(SObject) SO = *ritSO;
 +    if ( !SO ) continue;
 +    std::string anEntry = SO->GetID();
  
 -      /** Erase graphical object and remove all its data **/
 -      if(SO->FindAttribute(anAttr, "AttributeIOR")) {
 -        SMESH::RemoveVisualObjectWithActors( anEntry.c_str(), true);
 -      }
 -      /** Remove an object from data structures **/
 -      SMESH::SMESH_GroupBase_var aGroup = SMESH::SMESH_GroupBase::_narrow( SMESH::SObjectToObject( SO ));
 -      SMESH::SMESH_subMesh_var   aSubMesh = SMESH::SMESH_subMesh::_narrow( SMESH::SObjectToObject( SO ));
 -      if ( !aGroup->_is_nil() ) {                          // DELETE GROUP
 -        SMESH::SMESH_Mesh_var aMesh = aGroup->GetMesh();
 -        aMesh->RemoveGroup( aGroup );
 -      }
 -      else if ( !aSubMesh->_is_nil() ) {                   // DELETE SUBMESH
 -        SMESH::SMESH_Mesh_var aMesh = aSubMesh->GetFather();
 -        aMesh->RemoveSubMesh( aSubMesh );
 +    /** Erase graphical object and remove all its data **/
 +    if(SO->FindAttribute(anAttr, "AttributeIOR")) {
 +      SMESH::RemoveVisualObjectWithActors( anEntry.c_str(), true);
 +    }
 +    /** Remove an object from data structures **/
 +    SMESH::SMESH_GroupBase_var aGroup = SMESH::SMESH_GroupBase::_narrow( SMESH::SObjectToObject( SO ));
 +    SMESH::SMESH_subMesh_var   aSubMesh = SMESH::SMESH_subMesh::_narrow( SMESH::SObjectToObject( SO ));
 +    if ( !aGroup->_is_nil() ) {                          // DELETE GROUP
 +      SMESH::SMESH_Mesh_var aMesh = aGroup->GetMesh();
 +      aMesh->RemoveGroup( aGroup );
 +    }
 +    else if ( !aSubMesh->_is_nil() ) {                   // DELETE SUBMESH
 +      SMESH::SMESH_Mesh_var aMesh = aSubMesh->GetFather();
 +      aMesh->RemoveSubMesh( aSubMesh );
  
 -        _PTR(SObject) aMeshSO = SMESH::FindSObject(aMesh);
 -        if (aMeshSO)
 -          SMESH::ModifiedMesh(aMeshSO, false, aMesh->NbNodes()==0);
 +      _PTR(SObject) aMeshSO = SMESH::FindSObject(aMesh);
 +      if (aMeshSO)
 +        SMESH::ModifiedMesh(aMeshSO, false, aMesh->NbNodes()==0);
 +    }
 +    else {
 +      Handle(SALOME_InteractiveObject) IObject = new SALOME_InteractiveObject
 +        ( anEntry.c_str(), engineIOR().toLatin1().data(), SO->GetName().c_str() );
 +      QString objType = CheckTypeObject(IObject);
 +      if ( objType == "Hypothesis" || objType == "Algorithm" ) {// DELETE HYPOTHESIS
 +        SMESH::RemoveHypothesisOrAlgorithmOnMesh(IObject);
 +        aStudyBuilder->RemoveObjectWithChildren( SO );
        }
 -      else {
 -        Handle(SALOME_InteractiveObject) IObject = new SALOME_InteractiveObject
 -          ( anEntry.c_str(), engineIOR().toLatin1().data(), SO->GetName().c_str() );
 -        QString objType = CheckTypeObject(IObject);
 -        if ( objType == "Hypothesis" || objType == "Algorithm" ) {// DELETE HYPOTHESIS
 -          SMESH::RemoveHypothesisOrAlgorithmOnMesh(IObject);
 -          aStudyBuilder->RemoveObjectWithChildren( SO );
 -        }
 -        else {// default action: remove SObject from the study
 -              // san - it's no use opening a transaction here until UNDO/REDO is provided in SMESH
 -              //SUIT_Operation *op = new SALOMEGUI_ImportOperation(myActiveStudy);
 -              //op->start();
 -          aStudyBuilder->RemoveObjectWithChildren( SO );
 -          //op->finish();
 -        }
 +      else {// default action: remove SObject from the study
 +        // san - it's no use opening a transaction here until UNDO/REDO is provided in SMESH
 +        //SUIT_Operation *op = new SALOMEGUI_ImportOperation(myActiveStudy);
 +        //op->start();
 +        aStudyBuilder->RemoveObjectWithChildren( SO );
 +        //op->finish();
        }
 -    } /* listSO back loop */
 +    }
 +  } /* listSO back loop */
  
 -    aStudyBuilder->CommitCommand();
 +  aStudyBuilder->CommitCommand();
  
 -    /* Clear any previous selection */
 -    SALOME_ListIO l1;
 -    aSel->setSelectedObjects( l1 );
 +  /* Clear any previous selection */
 +  SALOME_ListIO l1;
 +  aSel->setSelectedObjects( l1 );
  
 -    SMESHGUI::GetSMESHGUI()->updateObjBrowser();
 -  }
 -//} namespace
 +  SMESHGUI::GetSMESHGUI()->updateObjBrowser();
 +}
  
  extern "C" {
    SMESHGUI_EXPORT CAM_Module* createModule()
@@@ -1979,8 -1939,6 +1964,6 @@@ SalomeApp_Module( "SMESH" 
  
    /* load resources for all available meshers */
    SMESH::InitAvailableHypotheses();
-   MPLMathText_Disabler d; // disable vtkMatplotlibMathTextUtilities
  }
  
  //=============================================================================
@@@ -2710,7 -2668,7 +2693,7 @@@ bool SMESHGUI::OnGUIEvent( int theComma
        else if ( theCommandID == 410 )
          aDlg = new SMESHGUI_UnionOfTrianglesDlg(this);
        else if ( theCommandID == 419 )
 -        aDlg = new SMESHGUI_CuttingIntoTetraDlg(this);
 +        aDlg = new SMESHGUI_SplitVolumesDlg(this);
        else
          aDlg = new SMESHGUI_CuttingOfQuadsDlg(this);
  
@@@ -5058,8 -5016,6 +5041,8 @@@ void SMESHGUI::createPreferences(
                               LightApp_Preferences::IntSpin, "SMESH", "elem0d_size");
    int ballSize = addPreference(tr("PREF_BALL_SIZE"), elemGroup,
                               LightApp_Preferences::IntSpin, "SMESH", "ball_elem_size");
 +  double ballScale = addPreference(tr("PREF_BALL_SCALE"), elemGroup,
 +                             LightApp_Preferences::DblSpin, "SMESH", "ball_elem_scale");
    int elemW  = addPreference(tr("PREF_WIDTH"), elemGroup,
                               LightApp_Preferences::IntSpin, "SMESH", "element_width");
    int outW  = addPreference(tr("PREF_OUTLINE_WIDTH"), elemGroup,
    setPreferenceProperty( ballSize, "min", 1 );
    setPreferenceProperty( ballSize, "max", 10 );
  
 +  setPreferenceProperty( ballScale, "min", 1e-2 );
 +  setPreferenceProperty( ballScale, "max", 1e7 );
 +  setPreferenceProperty( ballScale, "step", 0.5 );
 +
    setPreferenceProperty( elemW, "min", 1 );
    setPreferenceProperty( elemW, "max", 5 );
  
@@@ -5749,7 -5701,6 +5732,7 @@@ void SMESHGUI::storeVisualParameters (i
                    sizeStr << QString::number((int)aSmeshActor->Get0DSize());
                    sizeStr << "ball";
                    sizeStr << QString::number((int)aSmeshActor->GetBallSize());
 +                  sizeStr << QString::number((double)aSmeshActor->GetBallScale());
                    sizeStr << "shrink";
                    sizeStr << QString::number(aSmeshActor->GetShrinkFactor());
                    sizeStr << "orientation";
@@@ -6334,7 -6285,6 +6317,7 @@@ void SMESHGUI::restoreVisualParameters 
                int outlineWidth = -1;
                int elem0dSize = -1;
                int ballSize = -1;
 +              double ballScale = -1.0;
                double shrinkSize = -1;
                double orientationSize = -1;
                bool orientation3d = false;
                    i++;
                  }
                  else if ( type == "ball" ) {
 -                  // ball size is given as single integer value
 -                  if ( i+1 >= sizes.count() ) break;                    // format error
 -                  int v = sizes[i+1].toInt( &bOk ); if ( !bOk ) break;  // format error
 -                  ballSize = v;
 -                  i++;
 +                  // balls are specified by two values: size:scale, where
 +                  // - size - is a integer value specifying size
 +                  // - scale - is a double value specifying scale factor
 +                  if ( i+1 >= sizes.count() ) break;                       // format error
 +                  int v1 = sizes[i+1].toInt( &bOk ); if ( !bOk ) break;    // format error
 +                  if ( i+2 >= sizes.count() ) break;                       // format error
 +                  double v2 = sizes[i+2].toDouble( &bOk ); if ( !bOk ) break; // format error
 +                  ballSize = v1;
 +                  ballScale = v2;
 +                  i += 2;
                  }
                  else if ( type == "shrink" ) {
                    // shrink factor is given as single floating point value
                // ball size
                if ( ballSize > 0 )
                  aSmeshActor->SetBallSize( ballSize );
 +              // ball scale
 +              if ( ballScale > 0.0 )
 +                aSmeshActor->SetBallScale( ballScale );
                // shrink factor
                if ( shrinkSize > 0 )
                  aSmeshActor->SetShrinkFactor( shrinkSize );
index be1b5b85dd175d8f42a1156f3038b5cf94ebf2aa,cac019a7b42718cef118b37665b88f93b0bf0b93..5234cf911ad42c7629c978a15bb93dbff2275c4f
@@@ -1,4 -1,4 +1,4 @@@
 -// Copyright (C) 2007-2013  CEA/DEN, EDF R&D, OPEN CASCADE
 +// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
  //
  // Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
  // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
@@@ -6,7 -6,7 +6,7 @@@
  // This library is free software; you can redistribute it and/or
  // modify it under the terms of the GNU Lesser General Public
  // License as published by the Free Software Foundation; either
 -// version 2.1 of the License.
 +// version 2.1 of the License, or (at your option) any later version.
  //
  // This library is distributed in the hope that it will be useful,
  // but WITHOUT ANY WARRANTY; without even the implied warranty of
  #include <math.h>
  #include <limits>
  
+ // SALOME KERNEL includes
  #include <Basics_Utils.hxx>
+ // SALOME GUI includes
+ #include <Plot2d_PlotItems.h>
+ Plot2d_QwtLegendLabel* getLegendLabel( QwtPlotCurve* plotCurve )
+ {
+   const QVariant itemInfo = plotCurve->plot()->itemToInfo( plotCurve );
+   QwtLegend* legend = dynamic_cast<QwtLegend*>( plotCurve->plot()->legend() );
+   QWidget* widget = legend->legendWidget( itemInfo );
+   QwtLegendLabel* label = dynamic_cast<QwtLegendLabel*>( widget );
+   if( Plot2d_QwtLegendLabel* anItem = (Plot2d_QwtLegendLabel*)label )
+     return anItem;
+ }
  
  StdMeshersGUI_DistrPreview::StdMeshersGUI_DistrPreview( QWidget* p, StdMeshers::StdMeshers_NumberOfSegments_ptr h )
  : QwtPlot( p ),
    Kernel_Utils::Localizer loc;
    myHypo = StdMeshers::StdMeshers_NumberOfSegments::_duplicate( h );
    myVars.ChangeValue( 1 ) = new Expr_NamedUnknown( "t" );
+   QwtAbstractLegend* absLegend = legend();
+   QwtLegend* legend = 0;
+   if ( !absLegend ) {
+     legend = new Plot2d_QwtLegend( this );
+     legend->setFrameStyle( QFrame::Box | QFrame::Sunken );
+   }
+   else
+     legend = dynamic_cast<QwtLegend*>( absLegend );
+   if( legend )
+     insertLegend( legend, QwtPlot::BottomLegend );
    myDensity = new QwtPlotCurve( QString() );
    myDensity->attach( this );
+   QPen densityPen = QPen( Qt::red, 1 );
+   myDensity->setPen( QPen( Qt::red, 1 ) );
+   if( Plot2d_QwtLegendLabel* anItem = getLegendLabel( myDensity ) ) {
+     anItem->setPen( densityPen );
+     anItem->repaint();
+   }
    myDistr = new QwtPlotCurve( QString() );
    myDistr->attach( this );
+   QPen distrPen = QPen( Qt::blue, 1 );
+   QwtSymbol* distrSymbol = new QwtSymbol( QwtSymbol::XCross, QBrush( Qt::blue ),
+                                                 QPen( Qt::blue ), QSize( 5, 5 ) );
+   myDistr->setPen( distrPen );
+   myDistr->setSymbol( distrSymbol );
+   if( Plot2d_QwtLegendLabel* anItem = getLegendLabel( myDistr ) ) {
+     anItem->setPen( distrPen );
+     anItem->setSymbol( distrSymbol );
+     anItem->repaint();
+   }
    myMsg = new QwtPlotMarker();
    myMsg->attach( this );
    myMsg->setValue( 0.5, 0.5 );
    QwtText mt = myMsg->label();
-   mt.setBackgroundPen( QPen( Qt::red, 1 ) );
+   mt.setBorderPen( QPen( Qt::red, 1 ) );
    QFont f = mt.font();
    f.setPointSize( 14 ); //f.setBold( true );
    mt.setFont( f );
    myMsg->setLabel( mt );
-   myDensity->setPen( QPen( Qt::red, 1 ) );
-   QColor dc = Qt::blue;
-   myDistr->setPen( QPen( dc, 1 ) );
-   myDistr->setSymbol( QwtSymbol( QwtSymbol::XCross, QBrush( dc ), QPen( dc ), QSize( 5, 5 ) ) );
-   QwtLegend* l = legend();
-   if ( !l ) {
-     l = new QwtLegend( this );
-     l->setFrameStyle( QFrame::Box | QFrame::Sunken );
-   }
-   insertLegend( l, QwtPlot::BottomLegend );
  
    enableAxis(QwtPlot::yLeft, false);
    enableAxis(QwtPlot::yRight, true);
    myDistr->setTitle( tr( "SMESH_DISTR" ) );
    
    QwtPlotGrid* aGrid = new QwtPlotGrid();
-   QPen aMajPen = aGrid->majPen();
+   QPen aMajPen = aGrid->majorPen();
    aMajPen.setStyle( Qt::DashLine );
    aGrid->setPen( aMajPen );
  
@@@ -304,7 -335,7 +335,7 @@@ void StdMeshersGUI_DistrPreview::update
      std::max( 0.0, max_y )
  #endif
      );
-   myDensity->setData( x, y, size );
+   myDensity->setSamples( x, y, size );
    if( x )
      delete[] x;
    if( y )
      x[i] = distr[i];
      y[i] = 0;
    }
-   myDistr->setData( x, y, size );
+   myDistr->setSamples( x, y, size );
    delete[] x;
    delete[] y;
    x = y = 0;
@@@ -338,8 -369,8 +369,8 @@@ void StdMeshersGUI_DistrPreview::showEr
  {
    setAxisScale( myDensity->xAxis(), 0.0, 1.0 );
    setAxisScale( myDensity->yAxis(), 0.0, 1.0 );
-   myDensity->setData( 0, 0, 0 );
-   myDistr->setData( 0, 0, 0 );
+   myDensity->setSamples( 0, 0, 0 );
+   myDistr->setSamples( 0, 0, 0 );
    QwtText mt = myMsg->label();
    mt.setText( tr( "SMESH_INVALID_FUNCTION" ) );
    myMsg->setLabel( mt );