]> SALOME platform Git repositories - modules/geom.git/commitdiff
Salome HOME
DCQ: Debug Selection in Sketcher
authordcq <dcq@opencascade.com>
Wed, 5 May 2004 09:59:29 +0000 (09:59 +0000)
committerdcq <dcq@opencascade.com>
Wed, 5 May 2004 09:59:29 +0000 (09:59 +0000)
src/EntityGUI/EntityGUI.cxx
src/EntityGUI/EntityGUI.h
src/EntityGUI/EntityGUI_SketcherDlg.cxx

index e302ca75bdb22f6c2714977586f78e558bab71f5..049b4fe00c5bc9305afa60815282996d62bdbe6b 100644 (file)
@@ -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();
     } 
   }
index 98b4fd3bab1b0cc41b7d13e07de3fe2dff4c8167..9ecb56744a70ece9df777705ed90a2ca1dccbc8f 100644 (file)
@@ -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);
index 9d006e0e97af4d362a34f133bd97b9a650b21d13..d91c2454401fbd51aaf2addb82b3349636bd2b2d 100644 (file)
@@ -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;
 }