From: dmv Date: Wed, 19 Nov 2008 13:32:45 +0000 (+0000) Subject: Fix problem with local selection in Create Point Dialog X-Git-Tag: V5_1_0rc2~29 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=2fe2f72c5a2680b22c22a465b3cd595ddfcbe6bd;p=modules%2Fgeom.git Fix problem with local selection in Create Point Dialog --- diff --git a/src/BasicGUI/BasicGUI_PointDlg.cxx b/src/BasicGUI/BasicGUI_PointDlg.cxx index b6ee03432..4c57336ab 100644 --- a/src/BasicGUI/BasicGUI_PointDlg.cxx +++ b/src/BasicGUI/BasicGUI_PointDlg.cxx @@ -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() );