From: dcq Date: Wed, 5 May 2004 09:59:29 +0000 (+0000) Subject: DCQ: Debug Selection in Sketcher X-Git-Tag: Ecole_Ete_a4~1 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=edcd9dae04c18b1bf87ca12b08c1abe59c7020bd;p=modules%2Fgeom.git DCQ: Debug Selection in Sketcher --- diff --git a/src/EntityGUI/EntityGUI.cxx b/src/EntityGUI/EntityGUI.cxx index e302ca75b..049b4fe00 100644 --- a/src/EntityGUI/EntityGUI.cxx +++ b/src/EntityGUI/EntityGUI.cxx @@ -185,17 +185,21 @@ void EntityGUI::DisplaySimulationShape(const TopoDS_Shape& S1, const TopoDS_Shap // function : EraseSimulationShape() // purpose : Clears the display of 'mySimulationShape' a pure graphical shape //================================================================================== -void EntityGUI::EraseSimulationShape() +void EntityGUI::EraseSimulationShape(int Sh) { int count = QAD_Application::getDesktop()->getActiveStudy()->getStudyFramesCount(); for(int i = 0; i < count; i++) { if(QAD_Application::getDesktop()->getActiveStudy()->getStudyFrame(i)->getTypeView() == VIEW_OCC) { OCCViewer_Viewer3d* v3d = ((OCCViewer_ViewFrame*)QAD_Application::getDesktop()->getActiveStudy()->getStudyFrame(i)->getRightFrame()->getViewFrame())->getViewer(); Handle(AIS_InteractiveContext) ic = v3d->getAISContext(); - ic->Erase(mySimulationShape1, Standard_True, Standard_False); - ic->ClearPrs(mySimulationShape1); - ic->Erase(mySimulationShape2, Standard_True, Standard_False); - ic->ClearPrs(mySimulationShape2); + if(Sh < 1) { + ic->Erase(mySimulationShape1, Standard_True, Standard_False); + ic->ClearPrs(mySimulationShape1); + } + if(Sh <= 1) { + ic->Erase(mySimulationShape2, Standard_True, Standard_False); + ic->ClearPrs(mySimulationShape2); + } ic->UpdateCurrentViewer(); } } diff --git a/src/EntityGUI/EntityGUI.h b/src/EntityGUI/EntityGUI.h index 98b4fd3ba..9ecb56744 100644 --- a/src/EntityGUI/EntityGUI.h +++ b/src/EntityGUI/EntityGUI.h @@ -48,7 +48,7 @@ public : void OnSketchEnd(const char *Cmd); void DisplaySimulationShape(const TopoDS_Shape& S1, const TopoDS_Shape& S2); - void EraseSimulationShape(); + void EraseSimulationShape(int Sh = 0); /* Methods for sub shapes explode */ bool SObjectExist(SALOMEDS::SObject_ptr theFatherObject, const char* IOR); diff --git a/src/EntityGUI/EntityGUI_SketcherDlg.cxx b/src/EntityGUI/EntityGUI_SketcherDlg.cxx index 9d006e0e9..d91c24544 100644 --- a/src/EntityGUI/EntityGUI_SketcherDlg.cxx +++ b/src/EntityGUI/EntityGUI_SketcherDlg.cxx @@ -694,7 +694,7 @@ void EntityGUI_SketcherDlg::ClickOnUndo() //================================================================================= void EntityGUI_SketcherDlg::SelectionIntoArgument() { - myEntityGUI->EraseSimulationShape(); + myEntityGUI->EraseSimulationShape(1); //Juste Shape2!! Group1Sel->buttonApply->setEnabled(false); Group1Sel->buttonApply->setFocus(); @@ -706,19 +706,16 @@ void EntityGUI_SketcherDlg::SelectionIntoArgument() myY = 0.0; int nbSel = myGeomBase->GetNameOfSelectedIObjects(mySelection, aString); - if(nbSel != 1) { + if(nbSel != 1) return; - } /* nbSel == 1 */ TopoDS_Shape S; gp_Pnt myPoint1; Handle(SALOME_InteractiveObject) IO = mySelection->firstIObject(); - if(!myGeomBase->GetTopoFromSelection(mySelection, S)) { - // this->MakeSimulationAndDisplay(); + if(!myGeomBase->GetTopoFromSelection(mySelection, S)) return; - } if(myEditCurrentArgument == Group1Sel->LineEdit1 && myGeomBase->VertexToPoint(S, myPoint1)) { myX = myPoint1.X(); @@ -730,7 +727,6 @@ void EntityGUI_SketcherDlg::SelectionIntoArgument() this->MakeSimulationAndDisplay(); } - return; }