]> SALOME platform Git repositories - modules/geom.git/commitdiff
Salome HOME
Fix problem with local selection in Create Point Dialog
authordmv <dmv@opencascade.com>
Wed, 19 Nov 2008 13:32:45 +0000 (13:32 +0000)
committerdmv <dmv@opencascade.com>
Wed, 19 Nov 2008 13:32:45 +0000 (13:32 +0000)
src/BasicGUI/BasicGUI_PointDlg.cxx

index b6ee0343277cd76d1b0d4ce4b00b3207d15e7d7d..4c57336ab69c3559f70578c81fc7d7436fa36452 100644 (file)
@@ -439,10 +439,9 @@ void BasicGUI_PointDlg::SelectionIntoArgument()
     GEOM::GEOM_Object_var aSelectedObject = GEOMBase::ConvertIOinGEOMObject( anIO, aRes );
     if ( !CORBA::is_nil( aSelectedObject ) && aRes ) {
       QString aName = GEOMBase::GetName(aSelectedObject);
-
+      TopAbs_ShapeEnum aNeedType = TopAbs_VERTEX;
       TopoDS_Shape aShape;
       if ( GEOMBase::GetShape( aSelectedObject, aShape, TopAbs_SHAPE ) && !aShape.IsNull() ) {
-        TopAbs_ShapeEnum aNeedType = TopAbs_VERTEX;
         if ( id == 2 || id == 3 )
           aNeedType = TopAbs_EDGE;
         else if ( id == 4 )
@@ -468,6 +467,7 @@ void BasicGUI_PointDlg::SelectionIntoArgument()
          else {
            aSelectedObject = aFindedObject; // get Object from study
          }
+         GEOMBase::GetShape( aSelectedObject, aShape, TopAbs_SHAPE );
         }
         else { // Global Selection
           if ( aShape.ShapeType() != aNeedType ) {
@@ -478,8 +478,10 @@ void BasicGUI_PointDlg::SelectionIntoArgument()
         }
       }
 
+      if ( aShape.IsNull() || aShape.ShapeType() != aNeedType)
+       return;
+
       if ( id == 0 ) {
-        if ( aShape.IsNull() ) return;
         gp_Pnt aPnt = BRep_Tool::Pnt( TopoDS::Vertex( aShape ) );
         GroupXYZ->SpinBox_DX->setValue( aPnt.X() );
         GroupXYZ->SpinBox_DY->setValue( aPnt.Y() );