From 5ed5438bb9396e259a1dcc0b8c4bdc765ea3c645 Mon Sep 17 00:00:00 2001 From: mzn Date: Thu, 1 Dec 2005 12:55:30 +0000 Subject: [PATCH] Additional fix for IPAL10226. --- src/BasicGUI/BasicGUI_PointDlg.cxx | 35 +++++++++++++++++------------- 1 file changed, 20 insertions(+), 15 deletions(-) diff --git a/src/BasicGUI/BasicGUI_PointDlg.cxx b/src/BasicGUI/BasicGUI_PointDlg.cxx index da52b79f8..e21f745ec 100644 --- a/src/BasicGUI/BasicGUI_PointDlg.cxx +++ b/src/BasicGUI/BasicGUI_PointDlg.cxx @@ -343,26 +343,31 @@ void BasicGUI_PointDlg::SelectionIntoArgument() TopoDS_Shape aShape = myGeometryGUI->GetShapeReader().GetShape( myGeometryGUI->GetGeomGen(), aSelectedObject ); if ( aShape.IsNull() ) return; - - TColStd_IndexedMapOfInteger aMap; - ((SalomeApp_Application*)(SUIT_Session::session()->activeApplication()))->selectionMgr()->GetIndexes( anIO, aMap ); - - if ( aMap.Extent() == 1 ) + if ( aShape.ShapeType() != TopAbs_VERTEX ) { - int anIndex = aMap( 1 ); - TopTools_IndexedMapOfShape aShapes; - TopExp::MapShapes( aShape, aShapes ); - aShape = aShapes.FindKey( anIndex ); + TColStd_IndexedMapOfInteger aMap; - if ( aShape.IsNull() || aShape.ShapeType() != TopAbs_VERTEX ) - return; + ((SalomeApp_Application*)(SUIT_Session::session()->activeApplication()))->selectionMgr()->GetIndexes( anIO, aMap ); - gp_Pnt aPnt = BRep_Tool::Pnt( TopoDS::Vertex( aShape ) ); - GroupXYZ->SpinBox_DX->SetValue( aPnt.X() ); - GroupXYZ->SpinBox_DY->SetValue( aPnt.Y() ); - GroupXYZ->SpinBox_DZ->SetValue( aPnt.Z() ); + if ( aMap.Extent() == 1 ) + { + int anIndex = aMap( 1 ); + TopTools_IndexedMapOfShape aShapes; + TopExp::MapShapes( aShape, aShapes ); + aShape = aShapes.FindKey( anIndex ); + + if ( aShape.IsNull() || aShape.ShapeType() != TopAbs_VERTEX ) + return; + } + else + return; } + + gp_Pnt aPnt = BRep_Tool::Pnt( TopoDS::Vertex( aShape ) ); + GroupXYZ->SpinBox_DX->SetValue( aPnt.X() ); + GroupXYZ->SpinBox_DY->SetValue( aPnt.Y() ); + GroupXYZ->SpinBox_DZ->SetValue( aPnt.Z() ); } else if ( id == 1 ) { -- 2.39.2