X-Git-Url: http://git.salome-platform.org/gitweb/?p=modules%2Fsmesh.git;a=blobdiff_plain;f=src%2FSMESHGUI%2FSMESHGUI.cxx;fp=src%2FSMESHGUI%2FSMESHGUI.cxx;h=762c7cb341a911478a46e8f9db8087f81a298abd;hp=e96570c1f06233a1e4e7d7c9d0bf14033abebf41;hb=a463e4643121ceea8a13c2fad631e0ef0ac8a824;hpb=1c356932084f5e9c4eb445becf40da1485a326a4 diff --git a/src/SMESHGUI/SMESHGUI.cxx b/src/SMESHGUI/SMESHGUI.cxx index e96570c1f..762c7cb34 100644 --- a/src/SMESHGUI/SMESHGUI.cxx +++ b/src/SMESHGUI/SMESHGUI.cxx @@ -30,6 +30,7 @@ // SMESH includes #include "SMESHGUI.h" +#include "SMESHGUI_AdaptDlg.h" #include "SMESHGUI_Add0DElemsOnAllNodesDlg.h" #include "SMESHGUI_AddMeshElementDlg.h" #include "SMESHGUI_AddQuadraticElementDlg.h" @@ -1971,12 +1972,12 @@ void SMESHGUI::OnEditDelete() int objectCount = 0; QString aNameList; QString aParentComponent = QString::null; - + for( SALOME_ListIteratorOfListIO anIt( selected ); anIt.More(); anIt.Next() ) { Handle(SALOME_InteractiveObject) anIO = anIt.Value(); if ( anIO.IsNull() ) continue; - + QString father = "unknown", name; _PTR(SObject) aSO = aStudy->FindObjectID( anIO->getEntry() ); @@ -3042,6 +3043,13 @@ bool SMESHGUI::OnGUIEvent( int theCommandID ) } break; } + // Adaptation - begin + case SMESHOp::OpMGAdapt: + { + SMESH::SMESH_Mesh_var aMesh = SMESH::SMESH_Mesh::_nil(); + SMESHGUI_AdaptDlg *objet = new SMESHGUI_AdaptDlg( this, theCommandID, aMesh); + } + // Adaptation - end case SMESHOp::OpSplitBiQuadratic: case SMESHOp::OpConvertMeshToQuadratic: case SMESHOp::OpCreateBoundaryElements: // create 2D mesh from 3D @@ -4279,6 +4287,10 @@ void SMESHGUI::initialize( CAM_Application* app ) createSMESHAction( SMESHOp::OpAutoColor, "AUTO_COLOR" ); createSMESHAction( SMESHOp::OpDisableAutoColor, "DISABLE_AUTO_COLOR" ); + // Adaptation - begin + createSMESHAction( SMESHOp::OpMGAdapt, "MG_ADAPT", "ICON_MG_ADAPT" ); + // Adaptation - end + createSMESHAction( SMESHOp::OpMinimumDistance, "MEASURE_MIN_DIST", "ICON_MEASURE_MIN_DIST" ); createSMESHAction( SMESHOp::OpBoundingBox, "MEASURE_BND_BOX", "ICON_MEASURE_BND_BOX" ); createSMESHAction( SMESHOp::OpPropertiesLength, "MEASURE_LENGTH", "ICON_MEASURE_LENGTH" ); @@ -4320,6 +4332,7 @@ void SMESHGUI::initialize( CAM_Application* app ) meshId = createMenu( tr( "MEN_MESH" ), -1, 70, 10 ), ctrlId = createMenu( tr( "MEN_CTRL" ), -1, 60, 10 ), modifyId = createMenu( tr( "MEN_MODIFY" ), -1, 40, 10 ), + adaptId = createMenu( tr( "MEN_ADAPT" ), -1, 80, 10 ), measureId = createMenu( tr( "MEN_MEASURE" ), -1, 50, 10 ), viewId = createMenu( tr( "MEN_VIEW" ), -1, 2 ); @@ -4492,6 +4505,10 @@ void SMESHGUI::initialize( CAM_Application* app ) createMenu( SMESHOp::OpSmoothing, modifyId, -1 ); createMenu( SMESHOp::OpPatternMapping, modifyId, -1 ); + // Adaptation - begin + createMenu( SMESHOp::OpMGAdapt, adaptId, -1 ); + // Adaptation - end + createMenu( SMESHOp::OpMinimumDistance, measureId, -1 ); createMenu( SMESHOp::OpBoundingBox, measureId, -1 ); createMenu( SMESHOp::OpAngle, measureId, -1 ); @@ -4506,22 +4523,7 @@ void SMESHGUI::initialize( CAM_Application* app ) connect( volumeMenu, SIGNAL( aboutToShow() ), this, SLOT( onUpdateControlActions() ) ); // ----- create toolbars -------------- - int meshTb = createTool( tr( "TB_MESH" ), QString( "SMESHMeshToolbar" ) ), - info = createTool( tr( "TB_INFO" ), QString( "SMESHInformationToolbar" ) ), - groupTb = createTool( tr( "TB_GROUP" ), QString( "SMESHGroupToolbar" ) ), - ctrl0dTb = createTool( tr( "TB_CTRL0D" ), QString( "SMESHNodeControlsToolbar" ) ), - ctrl1dTb = createTool( tr( "TB_CTRL1D" ), QString( "SMESHEdgeControlsToolbar" ) ), - ctrl2dTb = createTool( tr( "TB_CTRL2D" ), QString( "SMESHFaceControlsToolbar" ) ), - ctrl3dTb = createTool( tr( "TB_CTRL3D" ), QString( "SMESHVolumeControlsToolbar" ) ), - addElemTb = createTool( tr( "TB_ADD" ), QString( "SMESHAddElementToolbar" ) ), - addNonElemTb = createTool( tr( "TB_ADDNON" ), QString( "SMESHAddElementToolbar" ) ), - remTb = createTool( tr( "TB_REM" ), QString( "SMESHRemoveToolbar" ) ), - //renumbTb = createTool( tr( "TB_RENUMBER" ), QString( "SMESHRenumberingToolbar" ) ), - transformTb = createTool( tr( "TB_TRANSFORM" ), QString( "SMESHTransformationToolbar" ) ), - modifyTb = createTool( tr( "TB_MODIFY" ), QString( "SMESHModificationToolbar" ) ), - measuremTb = createTool( tr( "TB_MEASUREM" ), QString( "SMESHMeasurementsToolbar" ) ), - dispModeTb = createTool( tr( "TB_DISP_MODE" ), QString( "SMESHDisplayModeToolbar" ) ); - + int meshTb = createTool( tr( "TB_MESH" ), QString( "SMESHMeshToolbar" ) ) ; createTool( SMESHOp::OpCreateMesh, meshTb ); createTool( SMESHOp::OpCreateSubMesh, meshTb ); createTool( SMESHOp::OpEditMeshOrSubMesh, meshTb ); @@ -4533,25 +4535,30 @@ void SMESHGUI::initialize( CAM_Application* app ) createTool( SMESHOp::OpEvaluate, meshTb ); createTool( SMESHOp::OpMeshOrder, meshTb ); + int infoTb = createTool( tr( "TB_INFO" ), QString( "SMESHInformationToolbar" ) ) ; + createTool( SMESHOp::OpMeshInformation, infoTb ); + //createTool( SMESHOp::OpStdInfo, meshTb ); + //createTool( SMESHOp::OpWhatIs, meshTb ); // VSR: issue #0021242 (eliminate "Mesh Element Information" command) + createTool( SMESHOp::OpFindElementByPoint, infoTb ); + + int groupTb = createTool( tr( "TB_GROUP" ), QString( "SMESHGroupToolbar" ) ) ; createTool( SMESHOp::OpCreateGroup, groupTb ); createTool( SMESHOp::OpCreateGeometryGroup, groupTb ); createTool( SMESHOp::OpConstructGroup, groupTb ); createTool( SMESHOp::OpEditGroup, groupTb ); - createTool( SMESHOp::OpMeshInformation, info ); - //createTool( SMESHOp::OpStdInfo, meshTb ); - //createTool( SMESHOp::OpWhatIs, meshTb ); // VSR: issue #0021242 (eliminate "Mesh Element Information" command) - createTool( SMESHOp::OpFindElementByPoint, info ); - + int ctrl0dTb = createTool( tr( "TB_CTRL0D" ), QString( "SMESHNodeControlsToolbar" ) ) ; createTool( SMESHOp::OpFreeNode, ctrl0dTb ); createTool( SMESHOp::OpEqualNode, ctrl0dTb ); //createTool( SMESHOp::OpNodeConnectivityNb, ctrl0dTb ); + int ctrl1dTb = createTool( tr( "TB_CTRL1D" ), QString( "SMESHEdgeControlsToolbar" ) ) ; createTool( SMESHOp::OpFreeBorder, ctrl1dTb ); createTool( SMESHOp::OpLength, ctrl1dTb ); createTool( SMESHOp::OpConnection, ctrl1dTb ); createTool( SMESHOp::OpEqualEdge, ctrl1dTb ); + int ctrl2dTb = createTool( tr( "TB_CTRL2D" ), QString( "SMESHFaceControlsToolbar" ) ) ; createTool( SMESHOp::OpFreeEdge, ctrl2dTb ); createTool( SMESHOp::OpFreeFace, ctrl2dTb ); createTool( SMESHOp::OpBareBorderFace, ctrl2dTb ); @@ -4568,6 +4575,7 @@ void SMESHGUI::initialize( CAM_Application* app ) createTool( SMESHOp::OpEqualFace, ctrl2dTb ); createTool( SMESHOp::OpDeflection2D, ctrl2dTb ); + int ctrl3dTb = createTool( tr( "TB_CTRL3D" ), QString( "SMESHVolumeControlsToolbar" ) ) ; createTool( SMESHOp::OpAspectRatio3D, ctrl3dTb ); createTool( SMESHOp::OpVolume, ctrl3dTb ); createTool( SMESHOp::OpMaxElementLength3D, ctrl3dTb ); @@ -4575,6 +4583,7 @@ void SMESHGUI::initialize( CAM_Application* app ) createTool( SMESHOp::OpOverConstrainedVolume, ctrl3dTb ); createTool( SMESHOp::OpEqualVolume, ctrl3dTb ); + int addElemTb = createTool( tr( "TB_ADD" ), QString( "SMESHAddElementToolbar" ) ) ; createTool( SMESHOp::OpNode, addElemTb ); createTool( SMESHOp::OpElem0D, addElemTb ); createTool( SMESHOp::OpElem0DOnElemNodes, addElemTb ); @@ -4590,6 +4599,7 @@ void SMESHGUI::initialize( CAM_Application* app ) createTool( SMESHOp::OpHexagonalPrism, addElemTb ); createTool( SMESHOp::OpPolyhedron, addElemTb ); + int addNonElemTb = createTool( tr( "TB_ADDNON" ), QString( "SMESHAddElementToolbar" ) ) ; createTool( SMESHOp::OpQuadraticEdge, addNonElemTb ); createTool( SMESHOp::OpQuadraticTriangle, addNonElemTb ); createTool( SMESHOp::OpBiQuadraticTriangle, addNonElemTb ); @@ -4603,14 +4613,17 @@ void SMESHGUI::initialize( CAM_Application* app ) createTool( SMESHOp::OpQuadraticHexahedron, addNonElemTb ); createTool( SMESHOp::OpTriQuadraticHexahedron, addNonElemTb ); + int remTb = createTool( tr( "TB_REM" ), QString( "SMESHRemoveToolbar" ) ) ; createTool( SMESHOp::OpRemoveNodes, remTb ); createTool( SMESHOp::OpRemoveElements, remTb ); createTool( SMESHOp::OpRemoveOrphanNodes, remTb ); createTool( SMESHOp::OpClearMesh, remTb ); +// int renumbTb = createTool( tr( "TB_RENUMBER" ), QString( "SMESHRenumberingToolbar" ) ) ; //createTool( SMESHOp::OpRenumberingNodes, renumbTb ); //createTool( SMESHOp::OpRenumberingElements, renumbTb ); + int transformTb = createTool( tr( "TB_TRANSFORM" ), QString( "SMESHTransformationToolbar" ) ) ; createTool( SMESHOp::OpMergeNodes, transformTb ); createTool( SMESHOp::OpMergeElements, transformTb ); createTool( SMESHOp::OpTranslation, transformTb ); @@ -4621,6 +4634,7 @@ void SMESHGUI::initialize( CAM_Application* app ) createTool( SMESHOp::OpSewing, transformTb ); createTool( SMESHOp::OpDuplicateNodes, transformTb ); + int modifyTb = createTool( tr( "TB_MODIFY" ), QString( "SMESHModificationToolbar" ) ) ; createTool( SMESHOp::OpConvertMeshToQuadratic, modifyTb ); createTool( SMESHOp::OpCreateBoundaryElements, modifyTb ); createTool( SMESHOp::OpExtrusion, modifyTb ); @@ -4638,8 +4652,15 @@ void SMESHGUI::initialize( CAM_Application* app ) createTool( SMESHOp::OpSmoothing, modifyTb ); createTool( SMESHOp::OpPatternMapping, modifyTb ); + // Adaptation - begin + int adaptTb = createTool( tr( "TB_ADAPTATION" ),QString( "SMESHAdaptationToolbar" ) ) ; + createTool( SMESHOp::OpMGAdapt, adaptTb ); + // Adaptation - end + + int measuremTb = createTool( tr( "TB_MEASUREM" ), QString( "SMESHMeasurementsToolbar" ) ) ; createTool( SMESHOp::OpMinimumDistance, measuremTb ); + int dispModeTb = createTool( tr( "TB_DISP_MODE" ), QString( "SMESHDisplayModeToolbar" ) ); createTool( SMESHOp::OpUpdate, dispModeTb ); QString lc = "$"; // VSR : instead of QtxPopupSelection::defEquality(); @@ -4715,9 +4736,11 @@ void SMESHGUI::initialize( CAM_Application* app ) popupMgr()->insert( separator(), -1, 0 ); createPopupItem( SMESHOp::OpConvertMeshToQuadratic, OB, mesh_submesh, "&& " + hasElems ); createPopupItem( SMESHOp::OpCreateBoundaryElements, OB, mesh_group, "&& selcount=1 && dim>=2"); - //popupMgr()->insert( separator(), -1, 0 ); + popupMgr()->insert( separator(), -1, 0 ); - //popupMgr()->insert( separator(), -1, 0 ); + // Adaptation - begin + createPopupItem( SMESHOp::OpMGAdapt, OB, mesh ); + // Adaptation - end QString only_one_non_empty = QString( " && %1=1 && numberOfNodes>0" ).arg( dc ); QString multiple_non_empty = QString( " && %1>0 && numberOfNodes>0" ).arg( dc ); @@ -5139,7 +5162,7 @@ bool SMESHGUI::activateModule( SUIT_Study* study ) lab = lab + tr("INFO_COMPUTE") + "
"; lab = lab + tr("INFO_REFINE") + ":"; items << wrap(tr("INFO_REFINE_LOCAL_SIZE"), "li") - << wrap(tr("INFO_REFINE_SUBMESH"), "li"); + << wrap(tr("INFO_REFINE_SUBMESH"), "li"); lab = lab + wrap(items.join(""), "ul"); items.clear(); @@ -5147,26 +5170,26 @@ bool SMESHGUI::activateModule( SUIT_Study* study ) gb = app->infoPanel()->addGroup(tr("INFO_GRP_IMPORT_MESH")); items << wrap("UNV", "li") - << wrap("MED", "li") - << wrap("STL", "li") - << wrap("CGNS", "li") - << wrap("SAUV", "li") - << wrap("GMF", "li"); + << wrap("MED", "li") + << wrap("STL", "li") + << wrap("CGNS", "li") + << wrap("SAUV", "li") + << wrap("GMF", "li"); lab = tr("INFO_AVAILABLE_FORMATS") + ":" + wrap(items.join(""), "ul"); items.clear(); - + app->infoPanel()->addLabel(lab, gb); - + gb = app->infoPanel()->addGroup(tr("INFO_GRP_CHECK_MESH")); lab = tr("INFO_DISPLAY") + "
"; items << wrap(tr("INFO_QUALITY_AREA"), "li") - << wrap(tr("INFO_QUALITY_VOLUME"), "li") - << wrap(tr("INFO_QUALITY_ASPECT_RATION"), "li") - << wrap("...", "li"); + << wrap(tr("INFO_QUALITY_VOLUME"), "li") + << wrap(tr("INFO_QUALITY_ASPECT_RATION"), "li") + << wrap("...", "li"); lab = lab + tr("INFO_QUALITY_INFO") + ":" + wrap(items.join(""), "ul"); items.clear(); lab = lab + tr("INFO_CLIPPING"); - + app->infoPanel()->addLabel(lab, gb); // << Help Panel @@ -5374,7 +5397,7 @@ void SMESHGUI::createPreferences() setPreferenceProperty( dispgroup, "columns", 2 ); addPreference( tr( "PREF_FITALL_ON_DISPLAYONLY" ), dispgroup, LightApp_Preferences::Bool, "SMESH", "fitall_on_displayonly" ); - + int dispmode = addPreference( tr( "PREF_DISPLAY_MODE" ), dispgroup, LightApp_Preferences::Selector, "SMESH", "display_mode" ); QStringList modes; modes.append( tr("MEN_WIRE") ); @@ -5751,6 +5774,29 @@ void SMESHGUI::createPreferences() setPreferenceProperty( coloringType, "indexes", indices ); addPreference( tr( "SMESH_DISTRIBUTION_COLOR" ), distributionGr, LightApp_Preferences::Color, "SMESH", "distribution_color" ); + // Adaptation - begin + // Adaptation tab ------------------------------------------------------------------------ + int adaptTab = addPreference( tr( "ADAPT_PREF_TAB_GENERAL" ) ); + int bloc, pref ; + // MG-Adapt + bloc = addPreference( tr( "ADAPT_PREF_MG_ADAPT" ), adaptTab ); + setPreferenceProperty( bloc, "columns", 1 ); + pref = addPreference( tr( "ADAPT_PREF_MG_ADAPT_FILE_MAILLAGE_OUT" ), bloc, LightApp_Preferences::Bool, "HOMARD", "mg_adapt_file_mesh_out" ); + pref = addPreference( tr( "ADAPT_PREF_MG_ADAPT_PUBLICATION_MAILLAGE_OUT" ), bloc, LightApp_Preferences::Bool, "HOMARD", "mg_adapt_publish_mesh_out" ); + pref = addPreference( tr( "ADAPT_PREF_MG_ADAPT_SIZE_MAP" ), bloc, LightApp_Preferences::Selector, "HOMARD", "mg_adapt_size_map" ); + QStringList aListOfSizeMap; + aListOfSizeMap << tr( "ADAPT_PREF_MG_ADAPT_SIZE_MAP_LOCAL" ); + aListOfSizeMap << tr( "ADAPT_PREF_MG_ADAPT_SIZE_MAP_BACKGROUND" ); + aListOfSizeMap << tr( "ADAPT_PREF_NONE" );; + setPreferenceProperty( pref, "strings", aListOfSizeMap ); + pref = addPreference( tr( "ADAPT_PREF_MG_ADAPT_TIME_STEP" ), bloc, LightApp_Preferences::Selector, "HOMARD", "mg_adapt_time_step" ); + QStringList aListOfTimeStep; + aListOfTimeStep << tr( "ADAPT_PREF_NONE" ); + aListOfTimeStep << tr( "ADAPT_PREF_MG_ADAPT_TIME_STEP_LAST" ); + aListOfTimeStep << tr( "ADAPT_PREF_MG_ADAPT_TIME_STEP_C" );; + setPreferenceProperty( pref, "strings", aListOfTimeStep ); + // Adaptation - end + } void SMESHGUI::preferencesChanged( const QString& sect, const QString& name ) @@ -5964,6 +6010,10 @@ LightApp_Operation* SMESHGUI::createOperation( const int id ) const case SMESHOp::OpElem0DOnElemNodes: // Create 0D elements on all nodes op = new SMESHGUI_Add0DElemsOnAllNodesOp(); break; + // Adaptation - begin + case SMESHOp::OpMGAdapt: + break; + // Adaptation - end default: break; }