From 7e4743151decb578ea7c385bb66666dadbe68808 Mon Sep 17 00:00:00 2001 From: dcq Date: Mon, 22 Mar 2004 16:36:41 +0000 Subject: [PATCH] DCQ : Add Multi-Wire for MakeFace --- idl/GEOM_Gen.idl | 5 +--- src/BuildGUI/BuildGUI.cxx | 5 ++-- src/BuildGUI/BuildGUI.h | 3 ++- src/BuildGUI/BuildGUI_FaceDlg.cxx | 44 +++++++------------------------ src/BuildGUI/BuildGUI_FaceDlg.h | 6 ++--- 5 files changed, 18 insertions(+), 45 deletions(-) diff --git a/idl/GEOM_Gen.idl b/idl/GEOM_Gen.idl index 12eff04d7..018f7f6a9 100644 --- a/idl/GEOM_Gen.idl +++ b/idl/GEOM_Gen.idl @@ -101,9 +101,6 @@ module GEOM GEOM_Shape MakePlacedBox(in double x1, in double y1, in double z1, in double delta1, in double delta2, in double delta3) raises (SALOME::SALOME_Exception) ; - GEOM_Shape MakePanel(in GEOM_Shape shape, - in short directiontype, - in double delta) raises (SALOME::SALOME_Exception) ; GEOM_Shape MakeGlueFaces(in GEOM_Shape shape, in double tol3d) raises (SALOME::SALOME_Exception) ; @@ -237,7 +234,7 @@ module GEOM in PointStruct pstruct2) raises (SALOME::SALOME_Exception) ; GEOM_Shape MakeWire (in ListOfIOR ListShape) raises (SALOME::SALOME_Exception) ; GEOM_Shape MakeCompound (in ListOfIOR ListShape) raises (SALOME::SALOME_Exception) ; - GEOM_Shape MakeFace (in GEOM_Shape shapeWire, + GEOM_Shape MakeFace (in ListOfIOR ListShape, in boolean wantplanarface ) raises (SALOME::SALOME_Exception) ; GEOM_Shape MakeShell (in ListOfIOR ListShape) raises (SALOME::SALOME_Exception) ; GEOM_Shape MakeSolid (in ListOfIOR ListShape) raises (SALOME::SALOME_Exception) ; diff --git a/src/BuildGUI/BuildGUI.cxx b/src/BuildGUI/BuildGUI.cxx index 4d404afc2..224b541a9 100644 --- a/src/BuildGUI/BuildGUI.cxx +++ b/src/BuildGUI/BuildGUI.cxx @@ -164,10 +164,11 @@ void BuildGUI::MakeWireAndDisplay(GEOM::GEOM_Gen::ListOfIOR& listShapesIOR) // function : MakeFaceAndDisplay() // purpose : //===================================================================================== -void BuildGUI::MakeFaceAndDisplay(GEOM::GEOM_Shape_ptr aWire, const Standard_Boolean wantPlanar) +void BuildGUI::MakeFaceAndDisplay(GEOM::GEOM_Gen::ListOfIOR& listShapesIOR, + const Standard_Boolean wantPlanar) { try { - GEOM::GEOM_Shape_var result = myGeom->MakeFace(aWire, wantPlanar); + GEOM::GEOM_Shape_var result = myGeom->MakeFace(listShapesIOR, wantPlanar); if(result->_is_nil()) { QAD_Application::getDesktop()->putInfo(tr("GEOM_PRP_NULLSHAPE")); return; diff --git a/src/BuildGUI/BuildGUI.h b/src/BuildGUI/BuildGUI.h index c8672d5ac..7d50e6967 100644 --- a/src/BuildGUI/BuildGUI.h +++ b/src/BuildGUI/BuildGUI.h @@ -48,7 +48,8 @@ public : void MakeLinearEdgeAndDisplay(const gp_Pnt P1, const gp_Pnt P2); void MakeWireAndDisplay(GEOM::GEOM_Gen::ListOfIOR& listShapesIOR); - void MakeFaceAndDisplay(GEOM::GEOM_Shape_ptr aWire, const Standard_Boolean wantPlanar); + void MakeFaceAndDisplay(GEOM::GEOM_Gen::ListOfIOR& listShapesIOR, + const Standard_Boolean wantPlanar); void MakeShellAndDisplay(GEOM::GEOM_Gen::ListOfIOR& listShapesIOR); void MakeSolidAndDisplay(GEOM::GEOM_Gen::ListOfIOR& listShapesIOR); void MakeCompoundAndDisplay(GEOM::GEOM_Gen::ListOfIOR& listShapesIOR); diff --git a/src/BuildGUI/BuildGUI_FaceDlg.cxx b/src/BuildGUI/BuildGUI_FaceDlg.cxx index 340519af3..2edaf57b9 100644 --- a/src/BuildGUI/BuildGUI_FaceDlg.cxx +++ b/src/BuildGUI/BuildGUI_FaceDlg.cxx @@ -85,7 +85,7 @@ void BuildGUI_FaceDlg::Init() myEditCurrentArgument = GroupPoints->LineEdit1; GroupPoints->CheckButton1->setChecked(TRUE); - myOkShape = false; + myOkListShapes = false; myWireFilter = new GEOM_ShapeTypeFilter(TopAbs_WIRE, myGeom); mySelection->AddFilter(myWireFilter); /* first filter used */ @@ -124,8 +124,8 @@ void BuildGUI_FaceDlg::ClickOnOk() void BuildGUI_FaceDlg::ClickOnApply() { QAD_Application::getDesktop()->putInfo(tr("")); - if(myOkShape) - myBuildGUI->MakeFaceAndDisplay(myGeomShape, GroupPoints->CheckButton1->isChecked()); + if(myOkListShapes) + myBuildGUI->MakeFaceAndDisplay(myListShapes, GroupPoints->CheckButton1->isChecked()); return; } @@ -139,24 +139,17 @@ void BuildGUI_FaceDlg::SelectionIntoArgument() myEditCurrentArgument->setText(""); QString aString = ""; /* name of selection */ - myOkShape = false; + myOkListShapes = false; int nbSel = myGeomBase->GetNameOfSelectedIObjects(mySelection, aString); - if(nbSel != 1) { - return; - } - - // nbSel == 1! - Standard_Boolean testResult; - Handle(SALOME_InteractiveObject) IO = mySelection->firstIObject(); - if(!myGeomBase->GetTopoFromSelection(mySelection, myShape)) - return; - - myGeomShape = myGeomBase->ConvertIOinGEOMShape(IO, testResult); - if(!testResult) + if(nbSel == 0) return; + if(nbSel != 1) + aString = tr("%1_objects").arg(nbSel); + myGeomBase->ConvertListOfIOInListOfIOR(mySelection->StoredIObjects(), myListShapes); + myEditCurrentArgument->setText(aString); - myOkShape = true; + myOkListShapes = true; /* no simulation */ return; } @@ -176,23 +169,6 @@ void BuildGUI_FaceDlg::SetEditCurrentArgument() } -//================================================================================= -// function : LineEditReturnPressed() -// purpose : -//================================================================================= -void BuildGUI_FaceDlg::LineEditReturnPressed() -{ - QLineEdit* send = (QLineEdit*)sender(); - if(send == GroupPoints->LineEdit1) - myEditCurrentArgument = GroupPoints->LineEdit1; - else - return; - - GEOMBase_Skeleton::LineEditReturnPressed(); - return; -} - - //================================================================================= // function : ActivateThisDialog() // purpose : diff --git a/src/BuildGUI/BuildGUI_FaceDlg.h b/src/BuildGUI/BuildGUI_FaceDlg.h index 43fd93b40..86ce40a13 100644 --- a/src/BuildGUI/BuildGUI_FaceDlg.h +++ b/src/BuildGUI/BuildGUI_FaceDlg.h @@ -57,9 +57,8 @@ private: /* Filter selection */ Handle(GEOM_ShapeTypeFilter) myWireFilter; - TopoDS_Shape myShape; /* topology used to fuse */ - GEOM::GEOM_Shape_var myGeomShape; /* is myShape */ - bool myOkShape; /* to check when arguments is defined */ + GEOM::GEOM_Gen::ListOfIOR myListShapes; + bool myOkListShapes; /* to check when arguments is defined */ DlgRef_1Sel1Check_QTD* GroupPoints; @@ -67,7 +66,6 @@ private slots: void ClickOnOk(); void ClickOnApply(); void ActivateThisDialog(); - void LineEditReturnPressed(); void SelectionIntoArgument(); void SetEditCurrentArgument(); -- 2.39.2