53935: "Add" item of sub-mesh pop-up does not work and is not documented

Rename "Add" -> "Add to Group"
    Show "Add" only if manual edition is enabled in Group dialog

+ Do not clear a sub-mesh if it's algorithm is same as a global one
    (SMESH_submesh.cxx)
This commit is contained in:
eap 2017-02-02 17:32:11 +03:00
parent b99e203236
commit b5e94caaa3
13 changed files with 57 additions and 14 deletions

View File

@ -109,6 +109,7 @@ SET(SMESH_RESOURCES_FILES
mesh_tree_hypo.png mesh_tree_hypo.png
mesh_tree_hypo_segment.png mesh_tree_hypo_segment.png
mesh_tree_hypo_volume.png mesh_tree_hypo_volume.png
mesh_tree_hypo_cartesian.png
mesh_tree_mesh.png mesh_tree_mesh.png
mesh_tree_importedmesh.png mesh_tree_importedmesh.png
mesh_tree_mesh_warn.png mesh_tree_mesh_warn.png
@ -224,6 +225,7 @@ SET(SMESH_RESOURCES_FILES
mesh_extmeth_node_offset.png mesh_extmeth_node_offset.png
mesh_extmeth_surf_offset_smooth.png mesh_extmeth_surf_offset_smooth.png
mesh_extmeth_face_offset.png mesh_extmeth_face_offset.png
mesh_quality.png
) )
INSTALL(FILES ${SMESH_RESOURCES_FILES} DESTINATION ${SALOME_SMESH_INSTALL_RES_DATA}) INSTALL(FILES ${SMESH_RESOURCES_FILES} DESTINATION ${SALOME_SMESH_INSTALL_RES_DATA})

BIN
resources/mesh_quality.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 778 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 299 B

View File

@ -577,6 +577,8 @@ vtkUnstructuredGrid* SMESH_VisualObjDef::GetUnstructuredGrid()
{ {
NulData(); // detach from the SMDS grid to allow immediate memory de-allocation in compactMesh() NulData(); // detach from the SMDS grid to allow immediate memory de-allocation in compactMesh()
GetMesh()->compactMesh(); GetMesh()->compactMesh();
if ( SMESHDS_Mesh* m = dynamic_cast<SMESHDS_Mesh*>( GetMesh() )) // IPAL53915
m->GetScript()->SetModified(false); // drop IsModified set in compactMesh()
updateEntitiesFlags(); updateEntitiesFlags();
vtkUnstructuredGrid *theGrid = GetMesh()->getGrid(); vtkUnstructuredGrid *theGrid = GetMesh()->getGrid();
myGrid->ShallowCopy(theGrid); myGrid->ShallowCopy(theGrid);

View File

@ -646,7 +646,7 @@ SMESH_Hypothesis::Hypothesis_Status
filter.Or( SMESH_HypoFilter::HasType( algo->GetType()+1 )); filter.Or( SMESH_HypoFilter::HasType( algo->GetType()+1 ));
filter.Or( SMESH_HypoFilter::HasType( algo->GetType()+2 )); filter.Or( SMESH_HypoFilter::HasType( algo->GetType()+2 ));
if ( SMESH_Algo * curAlgo = (SMESH_Algo*)_father->GetHypothesis( this, filter, true )) if ( SMESH_Algo * curAlgo = (SMESH_Algo*)_father->GetHypothesis( this, filter, true ))
if ( !curAlgo->NeedDiscreteBoundary() ) if ( !curAlgo->NeedDiscreteBoundary() && curAlgo != anHyp )
algoRequiringCleaning = curAlgo; algoRequiringCleaning = curAlgo;
} }
} }

View File

@ -3853,7 +3853,7 @@ void SMESHGUI::initialize( CAM_Application* app )
createSMESHAction( SMESHOp::OpBuildCompoundMesh, "BUILD_COMPOUND", "ICON_BUILD_COMPOUND" ); createSMESHAction( SMESHOp::OpBuildCompoundMesh, "BUILD_COMPOUND", "ICON_BUILD_COMPOUND" );
createSMESHAction( SMESHOp::OpCopyMesh, "COPY_MESH", "ICON_COPY_MESH" ); createSMESHAction( SMESHOp::OpCopyMesh, "COPY_MESH", "ICON_COPY_MESH" );
createSMESHAction( SMESHOp::OpCompute, "COMPUTE", "ICON_COMPUTE" ); createSMESHAction( SMESHOp::OpCompute, "COMPUTE", "ICON_COMPUTE" );
createSMESHAction( SMESHOp::OpComputeSubMesh, "COMPUTE_SUBMESH", "ICON_COMPUTE" ); createSMESHAction( SMESHOp::OpComputeSubMesh, "COMPUTE_SUBMESH", "ICON_COMPUTE" );
createSMESHAction( SMESHOp::OpPreCompute, "PRECOMPUTE", "ICON_PRECOMPUTE" ); createSMESHAction( SMESHOp::OpPreCompute, "PRECOMPUTE", "ICON_PRECOMPUTE" );
createSMESHAction( SMESHOp::OpEvaluate, "EVALUATE", "ICON_EVALUATE" ); createSMESHAction( SMESHOp::OpEvaluate, "EVALUATE", "ICON_EVALUATE" );
createSMESHAction( SMESHOp::OpMeshOrder, "MESH_ORDER", "ICON_MESH_ORDER"); createSMESHAction( SMESHOp::OpMeshOrder, "MESH_ORDER", "ICON_MESH_ORDER");
@ -3866,8 +3866,8 @@ void SMESHGUI::initialize( CAM_Application* app )
createSMESHAction( SMESHOp::OpIntersectGroups, "INT_GROUP", "ICON_INTERSECT" ); createSMESHAction( SMESHOp::OpIntersectGroups, "INT_GROUP", "ICON_INTERSECT" );
createSMESHAction( SMESHOp::OpCutGroups, "CUT_GROUP", "ICON_CUT" ); createSMESHAction( SMESHOp::OpCutGroups, "CUT_GROUP", "ICON_CUT" );
createSMESHAction( SMESHOp::OpGroupUnderlyingElem, "UNDERLYING_ELEMS", "ICON_UNDERLYING_ELEMS" ); createSMESHAction( SMESHOp::OpGroupUnderlyingElem, "UNDERLYING_ELEMS", "ICON_UNDERLYING_ELEMS" );
createSMESHAction( SMESHOp::OpAddElemGroupPopup, "ADD" ); createSMESHAction( SMESHOp::OpAddElemGroupPopup, "ADD_TO_GROUP" );
createSMESHAction( SMESHOp::OpRemoveElemGroupPopup, "REMOVE" ); createSMESHAction( SMESHOp::OpRemoveElemGroupPopup, "REMOVE_FROM_GROUP" );
createSMESHAction( SMESHOp::OpDeleteGroup, "DEL_GROUP", "ICON_DEL_GROUP" ); createSMESHAction( SMESHOp::OpDeleteGroup, "DEL_GROUP", "ICON_DEL_GROUP" );
createSMESHAction( SMESHOp::OpMeshInformation , "ADV_INFO", "ICON_ADV_INFO" ); createSMESHAction( SMESHOp::OpMeshInformation , "ADV_INFO", "ICON_ADV_INFO" );
//createSMESHAction( SMESHOp::OpStdInfo, "STD_INFO", "ICON_STD_INFO" ); //createSMESHAction( SMESHOp::OpStdInfo, "STD_INFO", "ICON_STD_INFO" );
@ -3901,7 +3901,7 @@ void SMESHGUI::initialize( CAM_Application* app )
createSMESHAction( SMESHOp::OpBareBorderVolume, "BARE_BORDER_VOLUME", "ICON_BARE_BORDER_VOLUME", 0, true ); createSMESHAction( SMESHOp::OpBareBorderVolume, "BARE_BORDER_VOLUME", "ICON_BARE_BORDER_VOLUME", 0, true );
createSMESHAction( SMESHOp::OpOverConstrainedVolume, "OVER_CONSTRAINED_VOLUME", "ICON_OVER_CONSTRAINED_VOLUME", 0, true ); createSMESHAction( SMESHOp::OpOverConstrainedVolume, "OVER_CONSTRAINED_VOLUME", "ICON_OVER_CONSTRAINED_VOLUME", 0, true );
createSMESHAction( SMESHOp::OpEqualVolume, "EQUAL_VOLUME", "ICON_EQUAL_VOLUME", 0, true ); createSMESHAction( SMESHOp::OpEqualVolume, "EQUAL_VOLUME", "ICON_EQUAL_VOLUME", 0, true );
createSMESHAction( SMESHOp::OpOverallMeshQuality, "OVERALL_MESH_QUALITY" ); createSMESHAction( SMESHOp::OpOverallMeshQuality, "OVERALL_MESH_QUALITY", "ICON_OVL_MESH_QUALITY" );
createSMESHAction( SMESHOp::OpNode, "NODE", "ICON_DLG_NODE" ); createSMESHAction( SMESHOp::OpNode, "NODE", "ICON_DLG_NODE" );
createSMESHAction( SMESHOp::OpElem0D, "ELEM0D", "ICON_DLG_ELEM0D" ); createSMESHAction( SMESHOp::OpElem0D, "ELEM0D", "ICON_DLG_ELEM0D" );
@ -4441,8 +4441,8 @@ void SMESHGUI::initialize( CAM_Application* app )
// popup for viewer // popup for viewer
createPopupItem( SMESHOp::OpEditGroup, View, group ); createPopupItem( SMESHOp::OpEditGroup, View, group );
createPopupItem( SMESHOp::OpAddElemGroupPopup, View, elems ); createPopupItem( SMESHOp::OpAddElemGroupPopup, View, elems, "&& guiState = 800" );
createPopupItem( SMESHOp::OpRemoveElemGroupPopup, View, elems ); createPopupItem( SMESHOp::OpRemoveElemGroupPopup, View, elems, "&& guiState = 800" );
popupMgr()->insert( separator(), -1, 0 ); popupMgr()->insert( separator(), -1, 0 );
createPopupItem( SMESHOp::OpUpdate, View, mesh_part ); createPopupItem( SMESHOp::OpUpdate, View, mesh_part );

View File

@ -115,6 +115,7 @@ public :
void ResetState(); void ResetState();
void SetState( int ); void SetState( int );
int GetState() const { return myState; }
bool DefineDlgPosition( QWidget*, int&, int& ); bool DefineDlgPosition( QWidget*, int&, int& );
void switchToOperation( int ); void switchToOperation( int );

View File

@ -444,7 +444,6 @@ void SMESHGUI_GroupDlg::initDialog( bool create)
/* Init selection */ /* Init selection */
mySMESHGUI->SetActiveDialogBox(this); mySMESHGUI->SetActiveDialogBox(this);
mySMESHGUI->SetState(800);
SalomeApp_Study* aStudy = dynamic_cast<SalomeApp_Study*>( mySMESHGUI->application()->activeStudy() ); SalomeApp_Study* aStudy = dynamic_cast<SalomeApp_Study*>( mySMESHGUI->application()->activeStudy() );
mySelectionMode = grpNoSelection; mySelectionMode = grpNoSelection;
@ -1609,6 +1608,8 @@ void SMESHGUI_GroupDlg::onSelectAll()
mySortBtn->setEnabled ( !noElemsModif ); mySortBtn->setEnabled ( !noElemsModif );
mySelectBox->setEnabled ( !noElemsModif ); mySelectBox->setEnabled ( !noElemsModif );
myAllowElemsModif->setEnabled( !mySelectAll->isChecked() ); myAllowElemsModif->setEnabled( !mySelectAll->isChecked() );
if ( noElemsModif ) mySMESHGUI->ResetState();
else mySMESHGUI->SetState(800);
int selMode = mySelectionMode; int selMode = mySelectionMode;
mySelectionMode = grpNoSelection; mySelectionMode = grpNoSelection;
@ -2332,9 +2333,9 @@ void SMESHGUI_GroupDlg::enterEvent (QEvent*)
setEnabled(true); setEnabled(true);
mySelectionMode = grpNoSelection; mySelectionMode = grpNoSelection;
setSelectionMode(myTypeId); setSelectionMode(myTypeId);
//mySMESHGUI->SetActiveDialogBox((QDialog*)this);
mySMESHGUI->SetActiveDialogBox(this); mySMESHGUI->SetActiveDialogBox(this);
mySMESHGUI->SetState(800); if ( mySelectBox->isEnabled() ) mySMESHGUI->SetState(800);
else mySMESHGUI->ResetState();
} }
} }

View File

@ -28,11 +28,12 @@
// SMESH includes // SMESH includes
#include "SMESHGUI_Selection.h" #include "SMESHGUI_Selection.h"
#include "SMESHGUI_Utils.h" #include "SMESHGUI.h"
#include "SMESHGUI_VTKUtils.h"
#include "SMESHGUI_GEOMGenUtils.h"
#include "SMESHGUI_ComputeDlg.h" #include "SMESHGUI_ComputeDlg.h"
#include "SMESHGUI_ConvToQuadOp.h" #include "SMESHGUI_ConvToQuadOp.h"
#include "SMESHGUI_GEOMGenUtils.h"
#include "SMESHGUI_Utils.h"
#include "SMESHGUI_VTKUtils.h"
#include <SMESH_Type.h> #include <SMESH_Type.h>
#include <SMESH_Actor.h> #include <SMESH_Actor.h>
@ -142,6 +143,7 @@ QVariant SMESHGUI_Selection::parameter( const int ind, const QString& p ) const
else if ( p=="hasChildren") val = QVariant( hasChildren( ind ) ); else if ( p=="hasChildren") val = QVariant( hasChildren( ind ) );
else if ( p=="nbChildren") val = QVariant( nbChildren( ind ) ); else if ( p=="nbChildren") val = QVariant( nbChildren( ind ) );
else if ( p=="isContainer") val = QVariant( isContainer( ind ) ); else if ( p=="isContainer") val = QVariant( isContainer( ind ) );
else if ( p=="guiState") val = QVariant( guiState() );
if ( val.isValid() ) if ( val.isValid() )
return val; return val;
@ -775,6 +777,16 @@ bool SMESHGUI_Selection::isImported( const int ind ) const
return res; return res;
} }
//=======================================================================
//function : guiState
//purpose :
//=======================================================================
int SMESHGUI_Selection::guiState()
{
return SMESHGUI::GetSMESHGUI() ? SMESHGUI::GetSMESHGUI()->GetState() : -1;
}
//======================================================================= //=======================================================================
//function : groupType //function : groupType
//purpose : //purpose :

View File

@ -87,7 +87,8 @@ public:
static int type( const QString&, _PTR(Study) ); static int type( const QString&, _PTR(Study) );
static QString typeName( const int ); static QString typeName( const int );
static int guiState();
bool isImported( const int ) const; bool isImported( const int ) const;
private: private:

View File

@ -39,6 +39,10 @@
<source>ICON_COMPUTE</source> <source>ICON_COMPUTE</source>
<translation>mesh_compute.png</translation> <translation>mesh_compute.png</translation>
</message> </message>
<message>
<source>ICON_OVL_MESH_QUALITY</source>
<translation>mesh_quality.png</translation>
</message>
<message> <message>
<source>ICON_EVALUATE</source> <source>ICON_EVALUATE</source>
<translation>mesh_evaluate.png</translation> <translation>mesh_evaluate.png</translation>

View File

@ -384,6 +384,22 @@
<source>MEN_DEL_GROUP</source> <source>MEN_DEL_GROUP</source>
<translation>Delete Groups with Contents</translation> <translation>Delete Groups with Contents</translation>
</message> </message>
<message>
<source>MEN_ADD_TO_GROUP</source>
<translation>Add to Group</translation>
</message>
<message>
<source>MEN_REMOVE_FROM_GROUP</source>
<translation>Remove from Group</translation>
</message>
<message>
<source>STB_ADD_TO_GROUP</source>
<translation>Add selected elements to group</translation>
</message>
<message>
<source>STB_REMOVE_FROM_GROUP</source>
<translation>Remove selected elements from group</translation>
</message>
<message> <message>
<source>MEN_FACE_ORIENTATION</source> <source>MEN_FACE_ORIENTATION</source>
<translation>Orientation of Faces</translation> <translation>Orientation of Faces</translation>

View File

@ -175,6 +175,10 @@
<source>ICON_SMESH_TREE_HYPO_Arithmetic1D</source> <source>ICON_SMESH_TREE_HYPO_Arithmetic1D</source>
<translation>mesh_tree_hypo_length.png</translation> <translation>mesh_tree_hypo_length.png</translation>
</message> </message>
<message>
<source>ICON_SMESH_TREE_HYPO_CartesianParameters3D</source>
<translation>mesh_tree_hypo_cartesian.png</translation>
</message>
<message> <message>
<source>ICON_SMESH_TREE_HYPO_Geometric1D</source> <source>ICON_SMESH_TREE_HYPO_Geometric1D</source>
<translation>mesh_tree_hypo_length.png</translation> <translation>mesh_tree_hypo_length.png</translation>