test integration for 0019050: EDF 521 GEOM SMESH : Improve selection process in the dialogs and 0016640: EDF 528 GEOM : Improve selection mechanism in GEOM dialog boxes Improvements

This commit is contained in:
dmv 2008-09-03 15:22:54 +00:00
parent 4231cc0faa
commit 8c3c6ae133

View File

@ -114,10 +114,12 @@ BasicGUI_LineDlg::~BasicGUI_LineDlg()
void BasicGUI_LineDlg::Init() void BasicGUI_LineDlg::Init()
{ {
/* init variables */ /* init variables */
//myEditCurrentArgument = GroupPoints->LineEdit1; myEditCurrentArgument = GroupPoints->LineEdit1;
//myPoint1 = myPoint2 = GEOM::GEOM_Object::_nil(); myPoint1 = myPoint2 = GEOM::GEOM_Object::_nil();
//globalSelection(); // close local contexts, if any globalSelection(); // close local contexts, if any
//localSelection( GEOM::GEOM_Object::_nil(), TopAbs_VERTEX ); localSelection( GEOM::GEOM_Object::_nil(), TopAbs_VERTEX );
GroupPoints->PushButton1->setDown(true);
/* signals and slots connections */ /* signals and slots connections */
connect( myGeomGUI, SIGNAL( SignalDeactivateActiveDialog() ), this, SLOT( DeactivateActiveDialog() ) ); connect( myGeomGUI, SIGNAL( SignalDeactivateActiveDialog() ), this, SLOT( DeactivateActiveDialog() ) );
@ -190,7 +192,8 @@ void BasicGUI_LineDlg::ConstructorsClicked( int constructorId )
myEditCurrentArgument->setText( "" ); myEditCurrentArgument->setText( "" );
myPoint1 = GEOM::GEOM_Object::_nil(); myPoint1 = GEOM::GEOM_Object::_nil();
myPoint2 = GEOM::GEOM_Object::_nil(); myPoint2 = GEOM::GEOM_Object::_nil();
GroupPoints->PushButton1->setDown(true);
GroupPoints->PushButton2->setDown(false);
GroupPoints->show(); GroupPoints->show();
GroupFaces->hide(); GroupFaces->hide();
break; break;
@ -204,6 +207,8 @@ void BasicGUI_LineDlg::ConstructorsClicked( int constructorId )
myEditCurrentArgument->setText(""); myEditCurrentArgument->setText("");
myFace1 = GEOM::GEOM_Object::_nil(); myFace1 = GEOM::GEOM_Object::_nil();
myFace2 = GEOM::GEOM_Object::_nil(); myFace2 = GEOM::GEOM_Object::_nil();
GroupFaces->PushButton1->setDown(true);
GroupFaces->PushButton2->setDown(false);
GroupPoints->hide(); GroupPoints->hide();
GroupFaces->show(); GroupFaces->show();
break; break;
@ -226,13 +231,15 @@ void BasicGUI_LineDlg::SelectionIntoArgument()
myEditCurrentArgument->setText( "" ); myEditCurrentArgument->setText( "" );
if ( IObjectCount() != 1 ) { if ( IObjectCount() != 1 ) {
// printf ( "IObjectCount() != 1 \n" );
if ( myEditCurrentArgument == GroupPoints->LineEdit1 ) myPoint1 = GEOM::GEOM_Object::_nil(); if ( myEditCurrentArgument == GroupPoints->LineEdit1 ) myPoint1 = GEOM::GEOM_Object::_nil();
else if ( myEditCurrentArgument == GroupPoints->LineEdit2 ) myPoint2 = GEOM::GEOM_Object::_nil(); else if ( myEditCurrentArgument == GroupPoints->LineEdit2 ) myPoint2 = GEOM::GEOM_Object::_nil();
else if ( myEditCurrentArgument == GroupFaces->LineEdit1 ) myFace1 = GEOM::GEOM_Object::_nil(); else if ( myEditCurrentArgument == GroupFaces->LineEdit1 ) myFace1 = GEOM::GEOM_Object::_nil();
else if ( myEditCurrentArgument == GroupFaces->LineEdit2 ) myFace2 = GEOM::GEOM_Object::_nil(); else if ( myEditCurrentArgument == GroupFaces->LineEdit2 ) myFace2 = GEOM::GEOM_Object::_nil();
displayPreview();
return; return;
} }
// printf ( "IObjectCount() == 1 \n" );
// nbSel == 1 // nbSel == 1
Standard_Boolean aRes = Standard_False; Standard_Boolean aRes = Standard_False;
GEOM::GEOM_Object_var aSelectedObject = GEOMBase::ConvertIOinGEOMObject( firstIObject(), aRes ); GEOM::GEOM_Object_var aSelectedObject = GEOMBase::ConvertIOinGEOMObject( firstIObject(), aRes );
@ -277,8 +284,22 @@ void BasicGUI_LineDlg::SelectionIntoArgument()
myEditCurrentArgument->setText( aName ); myEditCurrentArgument->setText( aName );
if ( myEditCurrentArgument == GroupPoints->LineEdit1 ) myPoint1 = aSelectedObject; if ( myEditCurrentArgument == GroupPoints->LineEdit1 ) {
else if ( myEditCurrentArgument == GroupPoints->LineEdit2 ) myPoint2 = aSelectedObject; myPoint1 = aSelectedObject;
if ( !myPoint1->_is_nil() && myPoint2->_is_nil() ) {
globalSelection(); // close local selection to clear it
localSelection( GEOM::GEOM_Object::_nil(), TopAbs_VERTEX );
GroupPoints->PushButton2->click();
}
}
else if ( myEditCurrentArgument == GroupPoints->LineEdit2 ) {
myPoint2 = aSelectedObject;
if ( !myPoint2->_is_nil() && myPoint1->_is_nil() ) {
globalSelection(); // close local selection to clear it
localSelection( GEOM::GEOM_Object::_nil(), TopAbs_VERTEX );
GroupPoints->PushButton1->click();
}
}
else if ( myEditCurrentArgument == GroupFaces->LineEdit1 ) myFace1 = aSelectedObject; else if ( myEditCurrentArgument == GroupFaces->LineEdit1 ) myFace1 = aSelectedObject;
else if ( myEditCurrentArgument == GroupFaces->LineEdit2 ) myFace2 = aSelectedObject; else if ( myEditCurrentArgument == GroupFaces->LineEdit2 ) myFace2 = aSelectedObject;
} }
@ -294,12 +315,25 @@ void BasicGUI_LineDlg::SelectionIntoArgument()
void BasicGUI_LineDlg::SetEditCurrentArgument() void BasicGUI_LineDlg::SetEditCurrentArgument()
{ {
QPushButton* send = (QPushButton*)sender(); QPushButton* send = (QPushButton*)sender();
if ( send == GroupPoints->PushButton1 ) myEditCurrentArgument = GroupPoints->LineEdit1; if ( send == GroupPoints->PushButton1 ) {
else if ( send == GroupPoints->PushButton2 ) myEditCurrentArgument = GroupPoints->LineEdit2; myEditCurrentArgument = GroupPoints->LineEdit1;
else if ( send == GroupFaces->PushButton1 ) myEditCurrentArgument = GroupFaces->LineEdit1; GroupPoints->PushButton2->setDown(false);
else if ( send == GroupFaces->PushButton2 ) myEditCurrentArgument = GroupFaces->LineEdit2; }
else if ( send == GroupPoints->PushButton2 ) {
myEditCurrentArgument = GroupPoints->LineEdit2;
GroupPoints->PushButton1->setDown(false);
}
else if ( send == GroupFaces->PushButton1 ) {
myEditCurrentArgument = GroupFaces->LineEdit1;
GroupFaces->PushButton2->setDown(false);
}
else if ( send == GroupFaces->PushButton2 ) {
myEditCurrentArgument = GroupFaces->LineEdit2;
GroupFaces->PushButton1->setDown(false);
}
myEditCurrentArgument->setFocus(); myEditCurrentArgument->setFocus();
SelectionIntoArgument(); SelectionIntoArgument();
send->setDown(true);
} }