+ 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;
+ if ( myEditCurrentArgument == GroupPntVecR->LineEdit2 )
+ aNeedType = TopAbs_EDGE;
+
+ // If selected Vertex or Edge on the some Shape Get selection Subshape
+ TopoDS_Shape aShape;
+ if ( GEOMBase::GetShape( aSelectedObject, aShape, TopAbs_SHAPE ) && !aShape.IsNull() ) {
+ TColStd_IndexedMapOfInteger aMap;
+ aSelMgr->GetIndexes(anIO, aMap);
+ if ( aMap.Extent() == 1 ) { // Local Selection
+ int anIndex = aMap(1);
+ if ( aNeedType == TopAbs_EDGE )
+ aName += QString( ":edge_%1" ).arg( anIndex );
+ else
+ aName += QString( ":vertex_%1" ).arg( anIndex );
+
+ //Find SubShape Object in Father
+ GEOM::GEOM_Object_var aFindedObject = GEOMBase_Helper::findObjectInFather( aSelectedObject, aName );
+
+ if ( aFindedObject == GEOM::GEOM_Object::_nil() ) { // Object not found in study
+ GEOM::GEOM_IShapesOperations_var aShapesOp = getGeomEngine()->GetIShapesOperations( getStudyId() );
+ aSelectedObject = aShapesOp->GetSubShape( aSelectedObject, anIndex );
+ }
+ else {
+ aSelectedObject = aFindedObject; // get Object from study
+ }
+ }
+ else { // Global Selection
+ if ( aShape.ShapeType() != aNeedType ) {
+ aSelectedObject = GEOM::GEOM_Object::_nil();
+ aName = "";
+ }
+ }
+ }
+
+ myEditCurrentArgument->setText( aName );
+
+ if (!aSelectedObject->_is_nil()) { // clear selection if something selected
+ globalSelection();
+ localSelection( GEOM::GEOM_Object::_nil(), aNeedType );
+ }
+
+ if ( myEditCurrentArgument == GroupPntVecR->LineEdit1 ) {
+ myPoint = aSelectedObject;
+ if ( !myPoint->_is_nil() && myDir->_is_nil() )
+ GroupPntVecR->PushButton2->click();
+ }
+ else if ( myEditCurrentArgument == GroupPntVecR->LineEdit2 ) {
+ myDir = aSelectedObject;
+ if ( !myDir->_is_nil() && myPoint->_is_nil() )
+ GroupPntVecR->PushButton1->click();
+ }
+ else if ( myEditCurrentArgument == Group3Pnts->LineEdit1 ) {
+ myPoint1 = aSelectedObject;
+ if ( !myPoint1->_is_nil() && myPoint2->_is_nil() )
+ Group3Pnts->PushButton2->click();
+ }
+ else if ( myEditCurrentArgument == Group3Pnts->LineEdit2 ) {
+ myPoint2 = aSelectedObject;
+ if ( !myPoint2->_is_nil() && myPoint3->_is_nil() )
+ Group3Pnts->PushButton3->click();
+ }
+ else if ( myEditCurrentArgument == Group3Pnts->LineEdit3 ) {
+ myPoint3 = aSelectedObject;
+ if ( !myPoint3->_is_nil() && myPoint1->_is_nil() )
+ Group3Pnts->PushButton1->click();
+ }
+ else if ( myEditCurrentArgument == GroupCenter2Pnts->LineEdit1 ) {
+ myPoint4 = aSelectedObject;
+ if ( !myPoint4->_is_nil() && myPoint5->_is_nil() )
+ GroupCenter2Pnts->PushButton2->click();
+ }
+ else if ( myEditCurrentArgument == GroupCenter2Pnts->LineEdit2 ) {
+ myPoint5 = aSelectedObject;
+ if ( !myPoint5->_is_nil() && myPoint6->_is_nil() )
+ GroupCenter2Pnts->PushButton3->click();
+ }
+ else if ( myEditCurrentArgument == GroupCenter2Pnts->LineEdit3 ) {
+ myPoint6 = aSelectedObject;
+ if ( !myPoint6->_is_nil() && myPoint4->_is_nil() )
+ GroupCenter2Pnts->PushButton1->click();
+ }