]> SALOME platform Git repositories - modules/geom.git/commitdiff
Salome HOME
0014047: EDF PAL 334 : Problem to select merged face with Create group window
authoreap <eap@opencascade.com>
Fri, 16 Jan 2009 07:53:28 +0000 (07:53 +0000)
committereap <eap@opencascade.com>
Fri, 16 Jan 2009 07:53:28 +0000 (07:53 +0000)
   hide a previously invisivle second shape in case of "Only
   sub-shapes of the Second shape" restriction

src/GroupGUI/GroupGUI_GroupDlg.cxx
src/GroupGUI/GroupGUI_GroupDlg.h

index 7d5d8a8924a8097c99bf0bb55482de369c5cd2a4..5667fbdccfe849cea17a5225c59c578de65fdb7b 100644 (file)
@@ -48,7 +48,7 @@
 #include <TColStd_MapOfInteger.hxx>
 #include <TColStd_DataMapIteratorOfDataMapOfIntegerInteger.hxx>
 
-enum { ALL_SUBSHAPES = 0, GET_IN_PLACE, SUBSHAPES_OF_SHAPE2 };
+enum { ALL_SUBSHAPES = 0, GET_IN_PLACE, SUBSHAPES_OF_SHAPE2, SUBSHAPES_OF_INVISIBLE_SHAPE2 };
 
 GroupGUI_GroupDlg::GroupGUI_GroupDlg( Mode mode, GeometryGUI* theGeometryGUI, QWidget* parent )
   : GEOMBase_Skeleton( theGeometryGUI, parent, false ),
@@ -382,7 +382,10 @@ void GroupGUI_GroupDlg::onGetInPlace()
         setInPlaceObj( aGetInPlaceObj );
       }
       else {
-        setInPlaceObj( anObj );
+        bool isVisible = true;
+        if ( SALOME_View* view = GEOM_Displayer::GetActiveView() )
+          isVisible = view->isVisible( aSelList.First() );
+        setInPlaceObj( anObj, isVisible );
       }
       myEditCurrentArgument = 0;
       //myBusy = true; // just activate but do not select in the list
@@ -397,14 +400,16 @@ void GroupGUI_GroupDlg::onGetInPlace()
 //purpose  : temporarily add an object to study and remove old InPlaceObj
 //=======================================================================
 
-void GroupGUI_GroupDlg::setInPlaceObj( GEOM::GEOM_Object_var theObj )
+void GroupGUI_GroupDlg::setInPlaceObj( GEOM::GEOM_Object_var theObj, const bool isVisible )
 {
   if ( ! myInPlaceObj->_is_equivalent( theObj ) )
   {
     const char* tmpName = "__InPlaceObj__";
     // remove old InPlaceObj
     if ( !myInPlaceObj->_is_nil() ) {
-      if ( myInPlaceObjSelectWay == GET_IN_PLACE ) { // hide temporary object
+      if ( myInPlaceObjSelectState == GET_IN_PLACE ||
+           myInPlaceObjSelectState == SUBSHAPES_OF_INVISIBLE_SHAPE2 ) {
+        // hide temporary object or initially invisible shape 2 (issue 0014047)
         GEOM_Displayer aDisplayer(getStudy());
         aDisplayer.Erase( myInPlaceObj, true );
       }
@@ -436,7 +441,9 @@ void GroupGUI_GroupDlg::setInPlaceObj( GEOM::GEOM_Object_var theObj )
         myMain2InPlaceIndices.Bind( aMainIndex, aPlaceIndex );
     }
   }
-  myInPlaceObjSelectWay = subSelectionWay();
+  myInPlaceObjSelectState = subSelectionWay();
+  if ( myInPlaceObjSelectState == SUBSHAPES_OF_SHAPE2 && !isVisible )
+    myInPlaceObjSelectState = SUBSHAPES_OF_INVISIBLE_SHAPE2;
 }
 
 //=================================================================================
index 9abd834bf456f9acf56f013049ab26b1d269c50c..8a65fb7eca10e9d7fed30c76e3f6bca0ecaa043b 100644 (file)
@@ -86,7 +86,7 @@ private:
   void                                updateState();
   void                                highlightSubShapes();
   void                                onGetInPlace();
-  void                                setInPlaceObj( GEOM::GEOM_Object_var );
+  void                                setInPlaceObj( GEOM::GEOM_Object_var, const bool isVisible=1);
 
 private:
   Mode                                myMode;
@@ -94,7 +94,7 @@ private:
   GEOM::GEOM_Object_var               myMainObj;
   GEOM::GEOM_Object_var               myGroup;
   GEOM::GEOM_Object_var               myInPlaceObj;
-  int                                 myInPlaceObjSelectWay;
+  int                                 myInPlaceObjSelectState;
   TColStd_DataMapOfIntegerInteger     myMain2InPlaceIndices;
 
   QPushButton*                        mySelBtn;