X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FSMESHGUI%2FSMESHGUI.cxx;h=4b41c1d20a1b0765ea66e5f0d953f5c4c599996f;hb=e6a2527b2254b1931fa7aa7f55526cdf689c6229;hp=7cbec92d7acbae0ffd24009df625e73b4ebf266f;hpb=55510e5ccd337f72bb1caa755b131cf0916d91b3;p=modules%2Fsmesh.git diff --git a/src/SMESHGUI/SMESHGUI.cxx b/src/SMESHGUI/SMESHGUI.cxx index 7cbec92d7..4b41c1d20 100644 --- a/src/SMESHGUI/SMESHGUI.cxx +++ b/src/SMESHGUI/SMESHGUI.cxx @@ -67,6 +67,7 @@ #include "SMESHGUI_BuildCompoundDlg.h" #include "SMESHGUI_ComputeDlg.h" #include "SMESHGUI_FileInfoDlg.h" +#include "SMESHGUI_Make2DFrom3DOp.h" #include "SMESHGUI_Utils.h" #include "SMESHGUI_MeshUtils.h" @@ -96,6 +97,8 @@ #include #include +#include + #include #include #include @@ -1771,6 +1774,11 @@ bool SMESHGUI::OnGUIEvent( int theCommandID ) }*/ break; } + case 418: // create 2D mesh from 3D + { + startOperation( 418 ); + break; + } case 806: // CREATE GEO GROUP { startOperation( 806 ); @@ -2077,7 +2085,6 @@ bool SMESHGUI::OnGUIEvent( int theCommandID ) case 1100: // EDIT HYPOTHESIS { - cout<<"EDIT HYPOTHESIS"<GetName()); - SMESH::HypothesisCreatorPtr aCreator = SMESH::GetHypothesisCreator(aHypothesis->GetName()); + SMESHGUI_GenericHypothesisCreator* aCreator = SMESH::GetHypothesisCreator(aHypothesis->GetName()); if (aCreator) { - aCreator->edit( aHypothesis.in(), anIObject->getName(), desktop() ); + aCreator->edit( aHypothesis.in(), anIObject->getName(), desktop(), this, SLOT( onHypothesisEdit( int ) ) ); } else { @@ -2108,7 +2115,6 @@ bool SMESHGUI::OnGUIEvent( int theCommandID ) } } } - updateObjBrowser( true ); break; } @@ -2704,7 +2710,6 @@ void SMESHGUI::initialize( CAM_Application* app ) createSMESHAction( 704, "EDIT_MESHSUBMESH","ICON_DLG_EDIT_MESH" ); createSMESHAction( 710, "BUILD_COMPOUND", "ICON_BUILD_COMPOUND" ); createSMESHAction( 711, "PRECOMPUTE", "ICON_PRECOMPUTE" ); - //createSMESHAction( 712, "EVALUATE", "ICON_EVALUATE" ); createSMESHAction( 712, "EVALUATE", "ICON_COMPUTE" ); createSMESHAction( 806, "CREATE_GEO_GROUP","ICON_CREATE_GEO_GROUP" ); createSMESHAction( 801, "CREATE_GROUP", "ICON_CREATE_GROUP" ); @@ -2769,6 +2774,7 @@ void SMESHGUI::initialize( CAM_Application* app ) 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( 200, "RESET" ); createSMESHAction( 201, "SCALAR_BAR_PROP" ); createSMESHAction( 211, "WIRE", "ICON_WIRE", 0, true ); @@ -2938,6 +2944,7 @@ void SMESHGUI::initialize( CAM_Application* app ) createMenu( 414, modifyId, -1 ); createMenu( 415, modifyId, -1 ); createMenu( 417, modifyId, -1 ); + createMenu( 418, modifyId, -1 ); createMenu( 214, viewId, -1 ); @@ -3034,6 +3041,7 @@ void SMESHGUI::initialize( CAM_Application* app ) createTool( 414, modifyTb ); createTool( 415, modifyTb ); createTool( 417, modifyTb ); + createTool( 418, modifyTb ); createTool( 214, dispModeTb ); @@ -3060,6 +3068,19 @@ void SMESHGUI::initialize( CAM_Application* app ) 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)"), + 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 @@ -3072,6 +3093,7 @@ void SMESHGUI::initialize( CAM_Application* app ) popupMgr()->insert( separator(), -1, 0 ); createPopupItem( 701, OB, mesh, "&& isComputable" ); // COMPUTE createPopupItem( 711, OB, mesh, "&& isComputable && isPreComputable" ); // PRECOMPUTE + createPopupItem( 712, OB, mesh, "&& isComputable" ); // COMPUTE createPopupItem( 214, OB, mesh_group ); // UPDATE createPopupItem( 900, OB, mesh_group ); // ADV_INFO createPopupItem( 902, OB, mesh ); // STD_INFO @@ -3087,6 +3109,9 @@ void SMESHGUI::initialize( CAM_Application* app ) popupMgr()->insert( separator(), -1, 0 ); createPopupItem( 4043, OB, mesh ); // CLEAR_MESH popupMgr()->insert( separator(), -1, 0 ); + createPopupItem( 417, OB, mesh/*, "&& " + hasElems*/); // convert to quadratic + createPopupItem( 418, OB, mesh/*, "&& " + hasVolumes*/); // create 2D mesh on 3D + popupMgr()->insert( separator(), -1, 0 ); QString only_one_non_empty = QString( " && %1=1 && numberOfNodes>0" ).arg( dc ); @@ -3114,20 +3139,6 @@ void SMESHGUI::initialize( CAM_Application* app ) popupMgr()->insert( separator(), -1, 0 ); int anId; - 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)"), - hasElems0d("({'Elem0d'} in elemTypes)"), - hasEdges("({'Edge'} in elemTypes)"), - hasFaces("({'Face'} in elemTypes)"), - hasVolumes("({'Volume'} in elemTypes)"); - QString aClient = QString( "%1client in {%2}" ).arg( lc ).arg( "'VTKViewer'" ); QString aType = QString( "%1type in {%2}" ).arg( lc ); aType = aType.arg( mesh_group ); @@ -3900,6 +3911,9 @@ LightApp_Operation* SMESHGUI::createOperation( const int id ) const case 417: //convert to quadratic op = new SMESHGUI_ConvToQuadOp(); break; + case 418: // create 2D mesh as boundary on 3D + op = new SMESHGUI_Make2DFrom3DOp(); + break; case 4067: // make mesh pass through point op = new SMESHGUI_MakeNodeAtPointOp(); break; @@ -4038,7 +4052,8 @@ void SMESHGUI::storeVisualParameters (int savePoint) { if (SVTK_ViewWindow* vtkView = dynamic_cast(views[i])) { - vtkActorCollection* allActors = vtkView->getRenderer()->GetActors(); + VTK::ActorCollectionCopy aCopy(vtkView->getRenderer()->GetActors()); + vtkActorCollection* allActors = aCopy.GetActors(); allActors->InitTraversal(); while (vtkActor* actor = allActors->GetNextActor()) { @@ -4254,7 +4269,8 @@ void SMESHGUI::restoreVisualParameters (int savePoint) // access later when restoring other parameters SVTK_ViewWindow* vtkView = (SVTK_ViewWindow*) vman->getActiveView(); vtkRenderer* Renderer = vtkView->getRenderer(); - vtkActorCollection* theActors = Renderer->GetActors(); + VTK::ActorCollectionCopy aCopy(Renderer->GetActors()); + vtkActorCollection* theActors = aCopy.GetActors(); theActors->InitTraversal(); bool isFound = false; vtkActor *ac = theActors->GetNextActor(); @@ -4424,8 +4440,11 @@ int SMESHGUI::addVtkFontPref( const QString& label, const int pId, const QString return tfont; } - - - - - +/*! + \brief Actions after hypothesis edition + Updates object browser after hypothesis edition +*/ +void SMESHGUI::onHypothesisEdit( int result ) +{ + updateObjBrowser( true ); +}