Group3Pnts->LineEdit2->setReadOnly( true );
Group3Pnts->LineEdit3->setReadOnly( true );
+ Group3Pnts->LineEdit1->setEnabled(true);
+ Group3Pnts->LineEdit2->setEnabled(false);
+ Group3Pnts->LineEdit3->setEnabled(false);
+
Group3Pnts->PushButton1->setIcon(image2);
Group3Pnts->PushButton2->setIcon(image2);
Group3Pnts->PushButton3->setIcon(image2);
Group3Pnts2->LineEdit2->setReadOnly( true );
Group3Pnts2->LineEdit3->setReadOnly( true );
+ Group3Pnts2->LineEdit1->setEnabled(true);
+ Group3Pnts2->LineEdit2->setEnabled(false);
+ Group3Pnts2->LineEdit3->setEnabled(false);
+
Group3Pnts2->PushButton1->setIcon( image2 );
Group3Pnts2->PushButton2->setIcon( image2 );
Group3Pnts2->PushButton3->setIcon( image2 );
myPoint1 = myPoint2 = myPoint3 = GEOM::GEOM_Object::_nil();
Group3Pnts2->CheckButton1->setChecked( false );
+ Group3Pnts->PushButton1->setDown(true);
/* signals and slots connections */
connect( myGeomGUI, SIGNAL( SignalDeactivateActiveDialog() ), this, SLOT( DeactivateActiveDialog() ) );
return false;
initName();
+ ConstructorsClicked( getConstructorId() );
return true;
}
myEditCurrentArgument->setText(aName);
+ if (!aSelectedObject->_is_nil()) { // clear selection if something selected
+ globalSelection();
+ localSelection( GEOM::GEOM_Object::_nil(), TopAbs_VERTEX );
+ }
+
switch ( getConstructorId() ) {
case 0:
- if ( myEditCurrentArgument == Group3Pnts->LineEdit1 ) myPoint1 = aSelectedObject;
- else if ( myEditCurrentArgument == Group3Pnts->LineEdit2 ) myPoint2 = aSelectedObject;
- else if ( myEditCurrentArgument == Group3Pnts->LineEdit3 ) myPoint3 = aSelectedObject;
+ 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();
+ }
break;
case 1:
- if ( myEditCurrentArgument == Group3Pnts2->LineEdit1 ) myPoint1 = aSelectedObject;
- else if ( myEditCurrentArgument == Group3Pnts2->LineEdit2 ) myPoint2 = aSelectedObject;
- else if ( myEditCurrentArgument == Group3Pnts2->LineEdit3 ) myPoint3 = aSelectedObject;
+ if ( myEditCurrentArgument == Group3Pnts2->LineEdit1 ) {
+ myPoint1 = aSelectedObject;
+ if ( !myPoint1->_is_nil() && myPoint2->_is_nil() )
+ Group3Pnts2->PushButton2->click();
+ }
+ else if ( myEditCurrentArgument == Group3Pnts2->LineEdit2 ) {
+ myPoint2 = aSelectedObject;
+ if ( !myPoint2->_is_nil() && myPoint3->_is_nil() )
+ Group3Pnts2->PushButton3->click();
+ }
+ else if ( myEditCurrentArgument == Group3Pnts2->LineEdit3 ) {
+ myPoint3 = aSelectedObject;
+ if ( !myPoint3->_is_nil() && myPoint1->_is_nil() )
+ Group3Pnts2->PushButton1->click();
+ }
break;
}
}
//=================================================================================
void BasicGUI_ArcDlg::SetEditCurrentArgument()
{
+ globalSelection(); // close local selection to clear it
+ localSelection( GEOM::GEOM_Object::_nil(), TopAbs_VERTEX );
+
QPushButton* send = (QPushButton*)sender();
switch ( getConstructorId() ) {
case 0:
- if ( send == Group3Pnts->PushButton1 ) myEditCurrentArgument = Group3Pnts->LineEdit1;
- else if ( send == Group3Pnts->PushButton2 ) myEditCurrentArgument = Group3Pnts->LineEdit2;
- else if ( send == Group3Pnts->PushButton3 ) myEditCurrentArgument = Group3Pnts->LineEdit3;
+ if ( send == Group3Pnts->PushButton1 ) {
+ myEditCurrentArgument = Group3Pnts->LineEdit1;
+ Group3Pnts->PushButton2->setDown(false);
+ Group3Pnts->PushButton3->setDown(false);
+ Group3Pnts->LineEdit1->setEnabled(true);
+ Group3Pnts->LineEdit2->setEnabled(false);
+ Group3Pnts->LineEdit3->setEnabled(false);
+ }
+ else if ( send == Group3Pnts->PushButton2 ) {
+ myEditCurrentArgument = Group3Pnts->LineEdit2;
+ Group3Pnts->PushButton1->setDown(false);
+ Group3Pnts->PushButton3->setDown(false);
+ Group3Pnts->LineEdit1->setEnabled(false);
+ Group3Pnts->LineEdit2->setEnabled(true);
+ Group3Pnts->LineEdit3->setEnabled(false);
+ }
+ else if ( send == Group3Pnts->PushButton3 ) {
+ myEditCurrentArgument = Group3Pnts->LineEdit3;
+ Group3Pnts->PushButton1->setDown(false);
+ Group3Pnts->PushButton2->setDown(false);
+ Group3Pnts->LineEdit1->setEnabled(false);
+ Group3Pnts->LineEdit2->setEnabled(false);
+ Group3Pnts->LineEdit3->setEnabled(true);
+ }
break;
case 1:
- if ( send == Group3Pnts2->PushButton1 ) myEditCurrentArgument = Group3Pnts2->LineEdit1;
- else if ( send == Group3Pnts2->PushButton2 ) myEditCurrentArgument = Group3Pnts2->LineEdit2;
- else if ( send == Group3Pnts2->PushButton3 ) myEditCurrentArgument = Group3Pnts2->LineEdit3;
+ if ( send == Group3Pnts2->PushButton1 ) {
+ myEditCurrentArgument = Group3Pnts2->LineEdit1;
+ Group3Pnts2->PushButton2->setDown(false);
+ Group3Pnts2->PushButton3->setDown(false);
+ Group3Pnts2->LineEdit1->setEnabled(true);
+ Group3Pnts2->LineEdit2->setEnabled(false);
+ Group3Pnts2->LineEdit3->setEnabled(false);
+ }
+ else if ( send == Group3Pnts2->PushButton2 ) {
+ myEditCurrentArgument = Group3Pnts2->LineEdit2;
+ Group3Pnts2->PushButton1->setDown(false);
+ Group3Pnts2->PushButton3->setDown(false);
+ Group3Pnts2->LineEdit1->setEnabled(false);
+ Group3Pnts2->LineEdit2->setEnabled(true);
+ Group3Pnts2->LineEdit3->setEnabled(false);
+ }
+ else if ( send == Group3Pnts2->PushButton3 ) {
+ myEditCurrentArgument = Group3Pnts2->LineEdit3;
+ Group3Pnts2->PushButton1->setDown(false);
+ Group3Pnts2->PushButton2->setDown(false);
+ Group3Pnts2->LineEdit1->setEnabled(false);
+ Group3Pnts2->LineEdit2->setEnabled(false);
+ Group3Pnts2->LineEdit3->setEnabled(true);
+ }
break;
}
myEditCurrentArgument->setFocus();
- SelectionIntoArgument();
+ // SelectionIntoArgument();
+ send->setDown(true);
+ displayPreview();
}
Group3Pnts2->hide();
Group3Pnts->show();
-
- Group3Pnts->LineEdit1->setText( Group3Pnts2->LineEdit1->text() );
- Group3Pnts->LineEdit2->setText( Group3Pnts2->LineEdit2->text() );
- Group3Pnts->LineEdit3->setText( Group3Pnts2->LineEdit3->text() );
+ Group3Pnts->PushButton1->setDown(true);
+ Group3Pnts->PushButton2->setDown(false);
+ Group3Pnts->PushButton3->setDown(false);
+ Group3Pnts->LineEdit1->setText( "" );
+ Group3Pnts->LineEdit2->setText( "" );
+ Group3Pnts->LineEdit3->setText( "" );
+ Group3Pnts->LineEdit1->setEnabled(true);
+ Group3Pnts->LineEdit2->setEnabled(false);
+ Group3Pnts->LineEdit3->setEnabled(false);
+ myPoint1 = myPoint2 = myPoint3 = GEOM::GEOM_Object::_nil();
myEditCurrentArgument = Group3Pnts->LineEdit1;
break;
Group3Pnts->hide();
Group3Pnts2->show();
-
- Group3Pnts2->LineEdit1->setText( Group3Pnts->LineEdit1->text() );
- Group3Pnts2->LineEdit2->setText( Group3Pnts->LineEdit2->text() );
- Group3Pnts2->LineEdit3->setText( Group3Pnts->LineEdit3->text() );
+ Group3Pnts2->PushButton1->setDown(true);
+ Group3Pnts2->PushButton2->setDown(false);
+ Group3Pnts2->PushButton3->setDown(false);
+ Group3Pnts2->LineEdit1->setText( "" );
+ Group3Pnts2->LineEdit2->setText( "" );
+ Group3Pnts2->LineEdit3->setText( "" );
+ Group3Pnts2->LineEdit1->setEnabled(true);
+ Group3Pnts2->LineEdit2->setEnabled(false);
+ Group3Pnts2->LineEdit3->setEnabled(false);
+ myPoint1 = myPoint2 = myPoint3 = GEOM::GEOM_Object::_nil();
myEditCurrentArgument = Group3Pnts2->LineEdit1;
break;
GroupPntVecR->TextLabel3->setText( tr( "GEOM_RADIUS" ) );
GroupPntVecR->PushButton1->setIcon( image1 );
GroupPntVecR->PushButton2->setIcon( image1 );
+ GroupPntVecR->PushButton1->setDown( true );
GroupPntVecR->LineEdit1->setReadOnly( true );
GroupPntVecR->LineEdit2->setReadOnly( true );
+ GroupPntVecR->LineEdit1->setEnabled( true );
+ GroupPntVecR->LineEdit2->setEnabled( false );
+
Group3Pnts = new DlgRef_3Sel( centralWidget() );
Group3Pnts->GroupBox1->setTitle( tr( "GEOM_3_POINTS" ) );
Group3Pnts->PushButton1->setIcon( image1 );
Group3Pnts->PushButton2->setIcon( image1 );
Group3Pnts->PushButton3->setIcon( image1 );
+ Group3Pnts->PushButton1->setDown( true );
Group3Pnts->LineEdit1->setReadOnly( true );
Group3Pnts->LineEdit2->setReadOnly( true );
Group3Pnts->LineEdit3->setReadOnly( true );
+ Group3Pnts->LineEdit1->setEnabled( true );
+ Group3Pnts->LineEdit2->setEnabled( false );
+ Group3Pnts->LineEdit3->setEnabled( false );
GroupCenter2Pnts = new DlgRef_3Sel( centralWidget() );
GroupCenter2Pnts->GroupBox1->setTitle( tr( "GEOM_CENTER_2POINTS" ) );
GroupCenter2Pnts->PushButton1->setIcon( image1 );
GroupCenter2Pnts->PushButton2->setIcon( image1 );
GroupCenter2Pnts->PushButton3->setIcon( image1 );
+ GroupCenter2Pnts->PushButton1->setDown( true );
GroupCenter2Pnts->LineEdit1->setReadOnly( true );
GroupCenter2Pnts->LineEdit2->setReadOnly( true );
GroupCenter2Pnts->LineEdit3->setReadOnly( true );
+ GroupCenter2Pnts->LineEdit1->setEnabled( true );
+ GroupCenter2Pnts->LineEdit2->setEnabled( false );
+ GroupCenter2Pnts->LineEdit3->setEnabled( false );
+
QVBoxLayout* layout = new QVBoxLayout( centralWidget() );
layout->setMargin( 0 ); layout->setSpacing( 6 );
layout->addWidget( GroupPntVecR );
myEditCurrentArgument = GroupPntVecR->LineEdit1;
GroupPntVecR->LineEdit1->setText( "" );
GroupPntVecR->LineEdit2->setText( "" );
+ GroupPntVecR->PushButton1->setDown( true );
+ GroupPntVecR->PushButton2->setDown( false );
+ GroupPntVecR->LineEdit1->setEnabled( true );
+ GroupPntVecR->LineEdit2->setEnabled( false );
break;
}
case 1:
Group3Pnts->LineEdit1->setText( "" );
Group3Pnts->LineEdit2->setText( "" );
Group3Pnts->LineEdit3->setText( "" );
+ Group3Pnts->PushButton1->setDown( true );
+ Group3Pnts->PushButton2->setDown( false );
+ Group3Pnts->PushButton3->setDown( false );
+ Group3Pnts->LineEdit1->setEnabled( true );
+ Group3Pnts->LineEdit2->setEnabled( false );
+ Group3Pnts->LineEdit3->setEnabled( false );
break;
}
case 2:
GroupCenter2Pnts->LineEdit1->setText( "" );
GroupCenter2Pnts->LineEdit2->setText( "" );
GroupCenter2Pnts->LineEdit3->setText( "" );
+ GroupCenter2Pnts->PushButton1->setDown( true );
+ GroupCenter2Pnts->PushButton2->setDown( false );
+ GroupCenter2Pnts->PushButton3->setDown( false );
+ GroupCenter2Pnts->LineEdit1->setEnabled( true );
+ GroupCenter2Pnts->LineEdit2->setEnabled( false );
+ GroupCenter2Pnts->LineEdit3->setEnabled( false );
break;
}
}
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() ) {
- TopAbs_ShapeEnum aNeedType = TopAbs_VERTEX;
- if ( myEditCurrentArgument == GroupPntVecR->LineEdit2 )
- aNeedType = TopAbs_EDGE;
-
TColStd_IndexedMapOfInteger aMap;
aSelMgr->GetIndexes(anIO, aMap);
if ( aMap.Extent() == 1 ) { // Local Selection
myEditCurrentArgument->setText( aName );
- if ( myEditCurrentArgument == GroupPntVecR->LineEdit1 ) myPoint = aSelectedObject;
- else if ( myEditCurrentArgument == GroupPntVecR->LineEdit2 ) myDir = aSelectedObject;
- else if ( myEditCurrentArgument == Group3Pnts->LineEdit1 ) myPoint1 = aSelectedObject;
- else if ( myEditCurrentArgument == Group3Pnts->LineEdit2 ) myPoint2 = aSelectedObject;
- else if ( myEditCurrentArgument == Group3Pnts->LineEdit3 ) myPoint3 = aSelectedObject;
- else if ( myEditCurrentArgument == GroupCenter2Pnts->LineEdit1 ) myPoint4 = aSelectedObject;
- else if ( myEditCurrentArgument == GroupCenter2Pnts->LineEdit2 ) myPoint5 = aSelectedObject;
- else if ( myEditCurrentArgument == GroupCenter2Pnts->LineEdit3 ) myPoint6 = aSelectedObject;
+ 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();
+ }
}
displayPreview();
{
QPushButton* send = (QPushButton*)sender();
- if ( send == GroupPntVecR->PushButton1 ) myEditCurrentArgument = GroupPntVecR->LineEdit1;
- else if ( send == GroupPntVecR->PushButton2 ) myEditCurrentArgument = GroupPntVecR->LineEdit2;
- else if ( send == Group3Pnts->PushButton1 ) myEditCurrentArgument = Group3Pnts->LineEdit1;
- else if ( send == Group3Pnts->PushButton2 ) myEditCurrentArgument = Group3Pnts->LineEdit2;
- else if ( send == Group3Pnts->PushButton3 ) myEditCurrentArgument = Group3Pnts->LineEdit3;
- else if ( send == GroupCenter2Pnts->PushButton1 ) myEditCurrentArgument = GroupCenter2Pnts->LineEdit1;
- else if ( send == GroupCenter2Pnts->PushButton2 ) myEditCurrentArgument = GroupCenter2Pnts->LineEdit2;
- else if ( send == GroupCenter2Pnts->PushButton3 ) myEditCurrentArgument = GroupCenter2Pnts->LineEdit3;
+ if ( send == GroupPntVecR->PushButton1 ) {
+ myEditCurrentArgument = GroupPntVecR->LineEdit1;
+ GroupPntVecR->PushButton2->setDown(false);
+ GroupPntVecR->LineEdit1->setEnabled( true );
+ GroupPntVecR->LineEdit2->setEnabled( false );
+ }
+ else if ( send == GroupPntVecR->PushButton2 ) {
+ myEditCurrentArgument = GroupPntVecR->LineEdit2;
+ GroupPntVecR->PushButton1->setDown(false);
+ GroupPntVecR->LineEdit1->setEnabled( false );
+ GroupPntVecR->LineEdit2->setEnabled( true );
+ }
+ else if ( send == Group3Pnts->PushButton1 ) {
+ myEditCurrentArgument = Group3Pnts->LineEdit1;
+ Group3Pnts->PushButton2->setDown( false );
+ Group3Pnts->PushButton3->setDown( false );
+ Group3Pnts->LineEdit1->setEnabled( true );
+ Group3Pnts->LineEdit2->setEnabled( false );
+ Group3Pnts->LineEdit3->setEnabled( false );
+ }
+ else if ( send == Group3Pnts->PushButton2 ) {
+ myEditCurrentArgument = Group3Pnts->LineEdit2;
+ Group3Pnts->PushButton1->setDown( false );
+ Group3Pnts->PushButton3->setDown( false );
+ Group3Pnts->LineEdit1->setEnabled( false );
+ Group3Pnts->LineEdit2->setEnabled( true );
+ Group3Pnts->LineEdit3->setEnabled( false );
+ }
+ else if ( send == Group3Pnts->PushButton3 ) {
+ myEditCurrentArgument = Group3Pnts->LineEdit3;
+ Group3Pnts->PushButton1->setDown( false );
+ Group3Pnts->PushButton2->setDown( false );
+ Group3Pnts->LineEdit1->setEnabled( false );
+ Group3Pnts->LineEdit2->setEnabled( false );
+ Group3Pnts->LineEdit3->setEnabled( true );
+ }
+ else if ( send == GroupCenter2Pnts->PushButton1 ) {
+ myEditCurrentArgument = GroupCenter2Pnts->LineEdit1;
+ GroupCenter2Pnts->PushButton2->setDown( false );
+ GroupCenter2Pnts->PushButton3->setDown( false );
+ GroupCenter2Pnts->LineEdit1->setEnabled( true );
+ GroupCenter2Pnts->LineEdit2->setEnabled( false );
+ GroupCenter2Pnts->LineEdit3->setEnabled( false );
+ }
+ else if ( send == GroupCenter2Pnts->PushButton2 ) {
+ myEditCurrentArgument = GroupCenter2Pnts->LineEdit2;
+ GroupCenter2Pnts->PushButton1->setDown( false );
+ GroupCenter2Pnts->PushButton3->setDown( false );
+ GroupCenter2Pnts->LineEdit1->setEnabled( false );
+ GroupCenter2Pnts->LineEdit2->setEnabled( true );
+ GroupCenter2Pnts->LineEdit3->setEnabled( false );
+
+ }
+ else if ( send == GroupCenter2Pnts->PushButton3 ) {
+ myEditCurrentArgument = GroupCenter2Pnts->LineEdit3;
+ GroupCenter2Pnts->PushButton1->setDown( false );
+ GroupCenter2Pnts->PushButton2->setDown( false );
+ GroupCenter2Pnts->LineEdit1->setEnabled( false );
+ GroupCenter2Pnts->LineEdit2->setEnabled( false );
+ GroupCenter2Pnts->LineEdit3->setEnabled( true );
+ }
myEditCurrentArgument->setFocus();
localSelection( GEOM::GEOM_Object::_nil(), TopAbs_VERTEX );
}
- SelectionIntoArgument();
+ myEditCurrentArgument->setFocus();
+ // SelectionIntoArgument();
+ send->setDown(true);
+ displayPreview();
}
//=================================================================================
GroupPoints->GroupBox1->setTitle( tr( "GEOM_NODES" ) );
GroupPoints->TextLabel1->setText( tr( "GEOM_POINTS" ) );
GroupPoints->PushButton1->setIcon( image1 );
+ GroupPoints->PushButton1->setDown( true );
GroupPoints->LineEdit1->setReadOnly( true );
GroupPoints->LineEdit1->setReadOnly( true );
GroupPoints->LineEdit2->setReadOnly( true );
+ GroupPoints->LineEdit1->setEnabled( true );
+ GroupPoints->LineEdit2->setEnabled( false );
QVBoxLayout* layout = new QVBoxLayout( centralWidget() );
layout->setMargin( 0 ); layout->setSpacing( 6 );
myEditCurrentArgument = GroupPoints->LineEdit1;
globalSelection(); // close local contexts, if any
localSelection( GEOM::GEOM_Object::_nil(), TopAbs_VERTEX );
+ GroupPoints->PushButton1->setDown(true);
myPoint = myDir = GEOM::GEOM_Object::_nil();
myPoint = myDir = GEOM::GEOM_Object::_nil();
GroupPoints->LineEdit1->setText( "" );
GroupPoints->LineEdit2->setText( "" );
+ GroupPoints->PushButton1->setDown(true);
+ GroupPoints->PushButton2->setDown(false);
+ GroupPoints->LineEdit1->setEnabled( true );
+ GroupPoints->LineEdit2->setEnabled( false );
myEditCurrentArgument = GroupPoints->LineEdit1;
- //globalSelection(GEOM_POINT);
+
globalSelection(); // close local contexts, if any
localSelection( GEOM::GEOM_Object::_nil(), TopAbs_VERTEX );
displayPreview();
// Get Selected object if selected subshape
TopoDS_Shape aShape;
+
+ TopAbs_ShapeEnum aNeedType = TopAbs_VERTEX;
+ if ( myEditCurrentArgument == GroupPoints->LineEdit2 )
+ aNeedType = TopAbs_EDGE;
if ( GEOMBase::GetShape( aSelectedObject, aShape, TopAbs_SHAPE ) && !aShape.IsNull() ) {
- TopAbs_ShapeEnum aNeedType = TopAbs_VERTEX;
- if ( myEditCurrentArgument == GroupPoints->LineEdit2 )
- aNeedType = TopAbs_EDGE;
-
LightApp_SelectionMgr* aSelMgr = myGeomGUI->getApp()->selectionMgr();
TColStd_IndexedMapOfInteger aMap;
aSelMgr->GetIndexes( anIO, aMap );
myEditCurrentArgument->setText( aName );
- if ( myEditCurrentArgument == GroupPoints->LineEdit1 ) myPoint = aSelectedObject;
- else if ( myEditCurrentArgument == GroupPoints->LineEdit2 ) myDir = aSelectedObject;
+ if (!aSelectedObject->_is_nil()) { // clear selection if something selected
+ globalSelection();
+ localSelection( GEOM::GEOM_Object::_nil(), aNeedType );
+ }
+
+ if ( myEditCurrentArgument == GroupPoints->LineEdit1 ) {
+ myPoint = aSelectedObject;
+ if ( !myPoint->_is_nil() && myDir->_is_nil() )
+ GroupPoints->PushButton2->click();
+ }
+ else if ( myEditCurrentArgument == GroupPoints->LineEdit2 ) {
+ myDir = aSelectedObject;
+ if ( !myDir->_is_nil() && myPoint->_is_nil() )
+ GroupPoints->PushButton1->click();
+ }
}
displayPreview();
void BasicGUI_EllipseDlg::SetEditCurrentArgument()
{
QPushButton* send = (QPushButton*)sender();
- globalSelection( GEOM_POINT );
- if ( send == GroupPoints->PushButton1 ) myEditCurrentArgument = GroupPoints->LineEdit1;
- else if ( send == GroupPoints->PushButton2 ) myEditCurrentArgument = GroupPoints->LineEdit2;
-
- myEditCurrentArgument->setFocus();
+ if ( send == GroupPoints->PushButton1 ) {
+ myEditCurrentArgument = GroupPoints->LineEdit1;
+ GroupPoints->PushButton2->setDown(false);
+ GroupPoints->LineEdit1->setEnabled( true );
+ GroupPoints->LineEdit2->setEnabled( false );
+ }
+ else if ( send == GroupPoints->PushButton2 ) {
+ myEditCurrentArgument = GroupPoints->LineEdit2;
+ GroupPoints->PushButton1->setDown(false);
+ GroupPoints->LineEdit1->setEnabled( false );
+ GroupPoints->LineEdit2->setEnabled( true );
+ }
+
globalSelection(); // close local contexts, if any
+ TopAbs_ShapeEnum aNeedType = TopAbs_VERTEX;
if ( myEditCurrentArgument == GroupPoints->LineEdit2 )
- localSelection( GEOM::GEOM_Object::_nil(), TopAbs_EDGE );
- else
- localSelection( GEOM::GEOM_Object::_nil(), TopAbs_VERTEX );
- SelectionIntoArgument();
+ aNeedType = TopAbs_EDGE;
+ localSelection( GEOM::GEOM_Object::_nil(), aNeedType );
+
+ myEditCurrentArgument->setFocus();
+ //SelectionIntoArgument();
+ send->setDown(true);
+ displayPreview();
}
//=================================================================================
//=================================================================================
void BasicGUI_LineDlg::SetEditCurrentArgument()
{
- if ( IObjectCount() != 0 ) {
- globalSelection(); // close local selection to clear it
- TopAbs_ShapeEnum aNeedType = TopAbs_VERTEX;
- if ( myEditCurrentArgument == GroupFaces->LineEdit1 || myEditCurrentArgument == GroupFaces->LineEdit2 )
- aNeedType = TopAbs_FACE;
- localSelection( GEOM::GEOM_Object::_nil(), aNeedType );
- }
-
QPushButton* send = (QPushButton*)sender();
if ( send == GroupPoints->PushButton1 ) {
myEditCurrentArgument = GroupPoints->LineEdit1;
GroupFaces->LineEdit1->setEnabled(false);
GroupFaces->LineEdit2->setEnabled(true);
}
+
+ globalSelection(); // close local selection to clear it
+ TopAbs_ShapeEnum aNeedType = TopAbs_VERTEX;
+ if ( myEditCurrentArgument == GroupFaces->LineEdit1 || myEditCurrentArgument == GroupFaces->LineEdit2 )
+ aNeedType = TopAbs_FACE;
+ localSelection( GEOM::GEOM_Object::_nil(), aNeedType );
+
myEditCurrentArgument->setFocus();
// SelectionIntoArgument();
send->setDown(true);
Group1->GroupBox1->setTitle( tr( "GEOM_ARGUMENTS" ) );
Group1->TextLabel1->setText( tr( "GEOM_OBJECT" ) );
Group1->PushButton1->setIcon( iconSelect );
+ Group1->PushButton1->setDown( true );
Group2 = new DlgRef_3Sel( centralWidget() );
Group2->PushButton1->setIcon( iconSelect );
Group2->PushButton2->setIcon( iconSelect );
Group2->PushButton3->setIcon( iconSelect );
+ Group2->PushButton1->setDown( true );
aMainGrp = new QFrame( centralWidget() );
aMainGrp->setFrameStyle( QFrame::NoFrame | QFrame::Plain );
Group2->LineEdit1->setReadOnly( true );
Group2->LineEdit2->setReadOnly( true );
Group2->LineEdit3->setReadOnly( true );
+ Group2->LineEdit1->setEnabled( true );
+ Group2->LineEdit2->setEnabled( false );
+ Group2->LineEdit3->setEnabled( false );
connect( this, SIGNAL( constructorsClicked( int ) ), this, SLOT( ConstructorsClicked( int ) ) );
aMainGrp->hide();
Group2->hide();
Group1->show();
-
+ Group1->PushButton1->setDown( true );
globalSelection( GEOM_ALLGEOM );
myEditCurrentArgument = Group1->LineEdit1;
Group1->LineEdit1->setText( "" );
case 2:
{
aMainGrp->hide();
- Group1->show();
+ Group1->hide();
Group2->show();
-
+ Group2->PushButton1->setDown( true );
+ Group2->PushButton2->setDown( false );
+ Group2->PushButton3->setDown( false );
globalSelection(); // close local contexts, if any
localSelection( GEOM::GEOM_Object::_nil(), TopAbs_VERTEX );
myEditCurrentArgument = Group2->LineEdit1;
Group2->LineEdit1->setText( "" );
Group2->LineEdit2->setText( "" );
Group2->LineEdit3->setText( "" );
+ Group2->LineEdit1->setEnabled( true );
+ Group2->LineEdit2->setEnabled( false );
+ Group2->LineEdit3->setEnabled( false );
break;
}
}
myData[ Y ]->setValue( aPnt.Y() );
myData[ Z ]->setValue( aPnt.Z() );
myEditCurrentArgument->setText( aName );
+ if (Group2->LineEdit2->text() == "")
+ Group2->PushButton2->click();
}
else {
myData[ X ]->setValue( 0 );
myData[ DY1 ]->setValue( aDir.Y() );
myData[ DZ1 ]->setValue( aDir.Z() );
myEditCurrentArgument->setText( aName );
+ if (Group2->LineEdit3->text() == "")
+ Group2->PushButton3->click();
}
else {
myData[ DX1 ]->setValue( 0 );
myData[ DY2 ]->setValue( aDir.Y() );
myData[ DZ2 ]->setValue( aDir.Z() );
myEditCurrentArgument->setText( aName );
+ if (Group2->LineEdit1->text() == "")
+ Group2->PushButton1->click();
}
else {
myData[ DX2 ]->setValue( 0 );
void BasicGUI_MarkerDlg::SetEditCurrentArgument()
{
QPushButton* send = (QPushButton*)sender();
+ globalSelection(); // close local contexts, if any
if ( send == Group1->PushButton1 ) {
myEditCurrentArgument = Group1->LineEdit1;
}
else if ( send == Group2->PushButton1 ) {
myEditCurrentArgument = Group2->LineEdit1;
- //globalSelection( GEOM_POINT );
- globalSelection(); // close local contexts, if any
localSelection( GEOM::GEOM_Object::_nil(), TopAbs_VERTEX );
+ Group2->PushButton2->setDown( false );
+ Group2->PushButton3->setDown( false );
+ Group2->LineEdit1->setEnabled( true );
+ Group2->LineEdit2->setEnabled( false );
+ Group2->LineEdit3->setEnabled( false );
}
else if ( send == Group2->PushButton2 ) {
myEditCurrentArgument = Group2->LineEdit2;
- //globalSelection( GEOM_LINE );
- globalSelection(); // close local contexts, if any
localSelection( GEOM::GEOM_Object::_nil(), TopAbs_EDGE );
+ Group2->PushButton1->setDown( false );
+ Group2->PushButton3->setDown( false );
+ Group2->LineEdit1->setEnabled( false );
+ Group2->LineEdit2->setEnabled( true );
+ Group2->LineEdit3->setEnabled( false );
}
else if ( send == Group2->PushButton3 ) {
myEditCurrentArgument = Group2->LineEdit3;
- globalSelection(); // close local contexts, if any
localSelection( GEOM::GEOM_Object::_nil(), TopAbs_EDGE );
+ Group2->PushButton1->setDown( false );
+ Group2->PushButton2->setDown( false );
+ Group2->LineEdit1->setEnabled( false );
+ Group2->LineEdit2->setEnabled( false );
+ Group2->LineEdit3->setEnabled( true );
}
myEditCurrentArgument->setFocus();
+ send->setDown(true);
onSelectionDone();
}
GroupPntDir->PushButton2->setIcon( image3 );
GroupPntDir->LineEdit1->setReadOnly( true );
GroupPntDir->LineEdit2->setReadOnly( true );
+ GroupPntDir->PushButton1->setDown( true );
+ GroupPntDir->LineEdit1->setEnabled( true );
+ GroupPntDir->LineEdit2->setEnabled( false );
Group3Pnts = new DlgRef_3Sel1Spin( centralWidget() );
Group3Pnts->GroupBox1->setTitle( tr( "GEOM_3_POINTS" ) );
Group3Pnts->PushButton1->setIcon( image3 );
Group3Pnts->PushButton2->setIcon( image3 );
Group3Pnts->PushButton3->setIcon( image3 );
+ Group3Pnts->PushButton1->setDown( true );
Group3Pnts->LineEdit1->setReadOnly( true );
Group3Pnts->LineEdit2->setReadOnly( true );
Group3Pnts->LineEdit3->setReadOnly( true );
+ Group3Pnts->LineEdit1->setEnabled( true );
+ Group3Pnts->LineEdit2->setEnabled( false );
+ Group3Pnts->LineEdit3->setEnabled( false );
GroupFace = new DlgRef_1Sel1Spin( centralWidget() );
GroupFace->GroupBox1->setTitle( tr( "GEOM_FACE_OR_LCS" ) );
GroupFace->TextLabel1->setText( tr( "GEOM_SELECTION" ) );
GroupFace->TextLabel2->setText( tr( "GEOM_PLANE_SIZE" ) );
GroupFace->PushButton1->setIcon( image3 );
+ GroupFace->PushButton1->setDown( true );
GroupFace->LineEdit1->setReadOnly( true );
myEditCurrentArgument = GroupPntDir->LineEdit1;
GroupPntDir->LineEdit1->setText( "" );
GroupPntDir->LineEdit2->setText( "" );
+ GroupPntDir->PushButton1->setDown( true );
+ GroupPntDir->PushButton2->setDown( false );
+ GroupPntDir->LineEdit1->setEnabled( true );
+ GroupPntDir->LineEdit2->setEnabled( false );
/* for the first argument */
globalSelection(); // close local contexts, if any
Group3Pnts->LineEdit1->setText( "" );
Group3Pnts->LineEdit2->setText( "" );
Group3Pnts->LineEdit3->setText( "" );
+ Group3Pnts->PushButton1->setDown( true );
+ Group3Pnts->PushButton2->setDown( false );
+ Group3Pnts->PushButton3->setDown( false );
+ Group3Pnts->LineEdit1->setEnabled( true );
+ Group3Pnts->LineEdit2->setEnabled( false );
+ Group3Pnts->LineEdit3->setEnabled( false );
/* for the first argument */
globalSelection(); // close local contexts, if any
myEditCurrentArgument = GroupFace->LineEdit1;
GroupFace->LineEdit1->setText( "" );
+ GroupFace->PushButton1->setDown( true );
/* for the first argument */
//globalSelection( GEOM_PLANE );
GEOM::GEOM_Object_var aSelectedObject = GEOMBase::ConvertIOinGEOMObject( firstIObject(), aRes );
if ( !CORBA::is_nil( aSelectedObject ) && aRes ) {
QString aName = GEOMBase::GetName( aSelectedObject );
+ TopAbs_ShapeEnum aNeedType = TopAbs_VERTEX;
+ if ( myEditCurrentArgument == GroupPntDir->LineEdit2 )
+ aNeedType = TopAbs_EDGE;
TopoDS_Shape aShape;
if ( GEOMBase::GetShape( aSelectedObject, aShape, TopAbs_SHAPE ) && !aShape.IsNull() ) {
- TopAbs_ShapeEnum aNeedType = TopAbs_VERTEX;
- if ( myEditCurrentArgument == GroupPntDir->LineEdit2 )
- aNeedType = TopAbs_EDGE;
- else if ( myEditCurrentArgument == GroupFace->LineEdit1 )
- aNeedType = TopAbs_FACE;
-
LightApp_SelectionMgr* aSelMgr = myGeomGUI->getApp()->selectionMgr();
TColStd_IndexedMapOfInteger aMap;
aSelMgr->GetIndexes( firstIObject(), aMap );
myEditCurrentArgument->setText( aName );
- if ( myEditCurrentArgument == GroupPntDir->LineEdit1 ) myPoint = aSelectedObject;
- else if ( myEditCurrentArgument == GroupPntDir->LineEdit2 ) myDir = aSelectedObject;
- else if ( myEditCurrentArgument == Group3Pnts->LineEdit1 ) myPoint1 = aSelectedObject;
- else if ( myEditCurrentArgument == Group3Pnts->LineEdit2 ) myPoint2 = aSelectedObject;
- else if ( myEditCurrentArgument == Group3Pnts->LineEdit3 ) myPoint3 = aSelectedObject;
- else if ( myEditCurrentArgument == GroupFace->LineEdit1 ) myFace = aSelectedObject;
+ if (!aSelectedObject->_is_nil()) { // clear selection if something selected
+ globalSelection();
+ if ( myEditCurrentArgument == GroupFace->LineEdit1 ) {
+ TColStd_MapOfInteger aMap;
+ aMap.Add( GEOM_PLANE );
+ aMap.Add( GEOM_MARKER );
+ globalSelection( aMap );
+ }
+ else
+ localSelection( GEOM::GEOM_Object::_nil(), aNeedType );
+ }
+
+ if ( myEditCurrentArgument == GroupPntDir->LineEdit1 ) {
+ myPoint = aSelectedObject;
+ if ( !myPoint->_is_nil() && myDir->_is_nil() )
+ GroupPntDir->PushButton2->click();
+ }
+ else if ( myEditCurrentArgument == GroupPntDir->LineEdit2 ) {
+ myDir = aSelectedObject;
+ if ( !myDir->_is_nil() && myPoint->_is_nil() )
+ GroupPntDir->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 == GroupFace->LineEdit1 )
+ myFace = aSelectedObject;
}
displayPreview();
QPushButton* send = (QPushButton*)sender();
globalSelection( GEOM_POINT );
- if ( send == GroupPntDir->PushButton1 ) myEditCurrentArgument = GroupPntDir->LineEdit1;
- else if ( send == GroupPntDir->PushButton2 ) myEditCurrentArgument = GroupPntDir->LineEdit2;
- else if ( send == Group3Pnts->PushButton1 ) myEditCurrentArgument = Group3Pnts->LineEdit1;
- else if ( send == Group3Pnts->PushButton2 ) myEditCurrentArgument = Group3Pnts->LineEdit2;
- else if ( send == Group3Pnts->PushButton3 ) myEditCurrentArgument = Group3Pnts->LineEdit3;
- else if ( send == GroupFace->PushButton1 ) myEditCurrentArgument = GroupFace->LineEdit1;
+ if ( send == GroupPntDir->PushButton1 ) {
+ myEditCurrentArgument = GroupPntDir->LineEdit1;
+ GroupPntDir->PushButton2->setDown( false );
+ GroupPntDir->LineEdit1->setEnabled( true );
+ GroupPntDir->LineEdit2->setEnabled( false );
+ }
+ else if ( send == GroupPntDir->PushButton2 ) {
+ myEditCurrentArgument = GroupPntDir->LineEdit2;
+ GroupPntDir->PushButton1->setDown( false );
+ GroupPntDir->LineEdit1->setEnabled( false );
+ GroupPntDir->LineEdit2->setEnabled( true );
+ }
+ else if ( send == Group3Pnts->PushButton1 ) {
+ myEditCurrentArgument = Group3Pnts->LineEdit1;
+ Group3Pnts->PushButton2->setDown( false );
+ Group3Pnts->PushButton3->setDown( false );
+ Group3Pnts->LineEdit1->setEnabled( true );
+ Group3Pnts->LineEdit2->setEnabled( false );
+ Group3Pnts->LineEdit3->setEnabled( false );
+ }
+ else if ( send == Group3Pnts->PushButton2 ) {
+ myEditCurrentArgument = Group3Pnts->LineEdit2;
+ Group3Pnts->PushButton1->setDown( false );
+ Group3Pnts->PushButton3->setDown( false );
+ Group3Pnts->LineEdit1->setEnabled( false );
+ Group3Pnts->LineEdit2->setEnabled( true );
+ Group3Pnts->LineEdit3->setEnabled( false );
+ }
+ else if ( send == Group3Pnts->PushButton3 ) {
+ myEditCurrentArgument = Group3Pnts->LineEdit3;
+ Group3Pnts->PushButton1->setDown( false );
+ Group3Pnts->PushButton2->setDown( false );
+ Group3Pnts->LineEdit1->setEnabled( false );
+ Group3Pnts->LineEdit2->setEnabled( false );
+ Group3Pnts->LineEdit3->setEnabled( true );
+ }
+ else if ( send == GroupFace->PushButton1 ) {
+ myEditCurrentArgument = GroupFace->LineEdit1;
+ GroupFace->PushButton1->setDown( true );
+ }
myEditCurrentArgument->setFocus();
if ( myEditCurrentArgument == GroupPntDir->LineEdit2 ) {
- globalSelection(); // close local contexts, if any
localSelection( GEOM::GEOM_Object::_nil(), TopAbs_EDGE );
}
else if ( myEditCurrentArgument == GroupFace->LineEdit1 ) {
globalSelection( aMap );
}
else { // 3 Pnts
- globalSelection(); // close local contexts, if any
localSelection( GEOM::GEOM_Object::_nil(), TopAbs_VERTEX );
}
- SelectionIntoArgument();
+ // SelectionIntoArgument();
+ myEditCurrentArgument->setFocus();
+ send->setDown(true);
+ displayPreview();
}
GroupLineIntersection->TextLabel2->setText( tr( "GEOM_LINE2" ) );
GroupLineIntersection->PushButton1->setIcon( image2 );
GroupLineIntersection->PushButton2->setIcon( image2 );
+ GroupLineIntersection->LineEdit2->setEnabled(false);
myCoordGrp = new QGroupBox( tr( "GEOM_COORDINATES" ), centralWidget() );
QGridLayout* myCoordGrpLayout = new QGridLayout( myCoordGrp );
GroupRefPoint->LineEdit1->setReadOnly( true );
GroupLineIntersection->LineEdit1->setReadOnly( true );
GroupLineIntersection->LineEdit2->setReadOnly( true );
+ GroupLineIntersection->LineEdit1->setEnabled( true );
+ GroupLineIntersection->LineEdit2->setEnabled( false );
myEdge = GEOM::GEOM_Object::_nil();
myRefPoint = GEOM::GEOM_Object::_nil();
myEditCurrentArgument = GroupRefPoint->LineEdit1;
myEditCurrentArgument->setText( "" );
myRefPoint = GEOM::GEOM_Object::_nil();
-
+ GroupRefPoint->PushButton1->setDown(true);
localSelection( GEOM::GEOM_Object::_nil(), TopAbs_VERTEX );
GroupXYZ->hide();
myEditCurrentArgument = GroupOnCurve->LineEdit1;
myEditCurrentArgument->setText( "" );
myEdge = GEOM::GEOM_Object::_nil();
-
+ GroupOnCurve->PushButton1->setDown(true);
localSelection( GEOM::GEOM_Object::_nil(), TopAbs_EDGE );
GroupXYZ->hide();
myEditCurrentArgument = GroupLineIntersection->LineEdit1;
GroupLineIntersection->LineEdit1->setText( "" );
GroupLineIntersection->LineEdit2->setText( "" );
+ GroupLineIntersection->LineEdit1->setEnabled( true );
+ GroupLineIntersection->LineEdit2->setEnabled( false );
myLine1 = GEOM::GEOM_Object::_nil();
myLine2 = GEOM::GEOM_Object::_nil();
+ GroupLineIntersection->PushButton1->setDown(true);
+ GroupLineIntersection->PushButton2->setDown(false);
localSelection( GEOM::GEOM_Object::_nil(), TopAbs_EDGE );
myEditCurrentArgument = GroupOnSurface->LineEdit1;
myEditCurrentArgument->setText( "" );
myFace = GEOM::GEOM_Object::_nil();
-
+ GroupOnSurface->PushButton1->setDown(true);
localSelection( GEOM::GEOM_Object::_nil(), TopAbs_FACE );
GroupXYZ->hide();
GroupOnCurve->LineEdit1->setText( aName );
}
else if ( id == 3 ) {
+ myEditCurrentArgument->setText( aName );
+ globalSelection();
+ localSelection( GEOM::GEOM_Object::_nil(), TopAbs_EDGE );
if ( myEditCurrentArgument == GroupLineIntersection->LineEdit1 ) {
myLine1 = aSelectedObject;
- myEditCurrentArgument->setText( aName );
+ if ( !myLine1->_is_nil() && myLine2->_is_nil() )
+ GroupLineIntersection->PushButton2->click();
}
else if ( myEditCurrentArgument == GroupLineIntersection->LineEdit2 ) {
myLine2 = aSelectedObject;
- myEditCurrentArgument->setText( aName );
+ if ( !myLine2->_is_nil() && myLine1->_is_nil() )
+ GroupLineIntersection->PushButton1->click();
}
}
else if ( id == 4 )
globalSelection(); // close local contexts, if any
QPushButton* send = (QPushButton*)sender();
- globalSelection( GEOM_POINT ); // to break previous local selection
if ( send == GroupRefPoint->PushButton1 ) {
GroupRefPoint->LineEdit1->setFocus();
else if ( send == GroupLineIntersection->PushButton1 ) {
GroupLineIntersection->LineEdit1->setFocus();
myEditCurrentArgument = GroupLineIntersection->LineEdit1;
-
+ GroupLineIntersection->PushButton2->setDown( false );
+ GroupLineIntersection->LineEdit1->setEnabled(true);
+ GroupLineIntersection->LineEdit2->setEnabled(false);
localSelection( GEOM::GEOM_Object::_nil(), TopAbs_EDGE );
}
else if ( send == GroupLineIntersection->PushButton2 ) {
GroupLineIntersection->LineEdit2->setFocus();
myEditCurrentArgument = GroupLineIntersection->LineEdit2;
-
+ GroupLineIntersection->PushButton1->setDown( false );
+ GroupLineIntersection->LineEdit1->setEnabled(false);
+ GroupLineIntersection->LineEdit2->setEnabled(true);
localSelection( GEOM::GEOM_Object::_nil(), TopAbs_EDGE );
}
+ send->setDown(true);
}
GroupPoints->TextLabel2->setText( tr( "GEOM_POINT_I" ).arg( 2 ) );
GroupPoints->PushButton1->setIcon( image2 );
GroupPoints->PushButton2->setIcon( image2 );
+ GroupPoints->PushButton1->setDown( true );
GroupPoints->LineEdit1->setReadOnly( true );
GroupPoints->LineEdit2->setReadOnly( true );
+ GroupPoints->LineEdit1->setEnabled( true );
+ GroupPoints->LineEdit2->setEnabled( false );
GroupDimensions = new DlgRef_3Spin1Check( centralWidget() );
GroupDimensions->GroupBox1->setTitle( tr( "GEOM_COORDINATES" ) );
myEditCurrentArgument = GroupPoints->LineEdit1;
GroupPoints->LineEdit1->setText( "" );
GroupPoints->LineEdit2->setText( "" );
+ GroupPoints->PushButton1->setDown( true );
+ GroupPoints->PushButton2->setDown( false );
+ GroupPoints->LineEdit1->setEnabled( true );
+ GroupPoints->LineEdit2->setEnabled( false );
globalSelection(); // close local contexts, if any
localSelection( GEOM::GEOM_Object::_nil(), TopAbs_VERTEX );
initName();
if ( getConstructorId() != 1 )
- ConstructorsClicked( getConstructorId() );
+ ConstructorsClicked( getConstructorId() );
return true;
}
myEditCurrentArgument->setText(aName);
- if ( myEditCurrentArgument == GroupPoints->LineEdit1 ) myPoint1 = aSelectedObject;
- else if ( myEditCurrentArgument == GroupPoints->LineEdit2 ) myPoint2 = aSelectedObject;
+ if (!aSelectedObject->_is_nil()) { // clear selection if something selected
+ globalSelection();
+ localSelection( GEOM::GEOM_Object::_nil(), TopAbs_VERTEX );
+ }
+
+ if ( myEditCurrentArgument == GroupPoints->LineEdit1 ) {
+ myPoint1 = aSelectedObject;
+ if ( !myPoint1->_is_nil() && myPoint2->_is_nil() )
+ GroupPoints->PushButton2->click();
+ }
+ else if ( myEditCurrentArgument == GroupPoints->LineEdit2 ) {
+ myPoint2 = aSelectedObject;
+ if ( !myPoint2->_is_nil() && myPoint1->_is_nil() )
+ GroupPoints->PushButton1->click();
+ }
}
displayPreview();
void BasicGUI_VectorDlg::SetEditCurrentArgument()
{
QPushButton* send = (QPushButton*)sender();
- if ( send == GroupPoints->PushButton1 ) myEditCurrentArgument = GroupPoints->LineEdit1;
- else if ( send == GroupPoints->PushButton2 ) myEditCurrentArgument = GroupPoints->LineEdit2;
+ if ( send == GroupPoints->PushButton1 ) {
+ myEditCurrentArgument = GroupPoints->LineEdit1;
+ GroupPoints->PushButton2->setDown(false);
+ GroupPoints->LineEdit1->setEnabled(true);
+ GroupPoints->LineEdit2->setEnabled(false);
+ }
+ else if ( send == GroupPoints->PushButton2 ) {
+ myEditCurrentArgument = GroupPoints->LineEdit2;
+ GroupPoints->PushButton1->setDown(false);
+ GroupPoints->LineEdit1->setEnabled(false);
+ GroupPoints->LineEdit2->setEnabled(true);
+ }
myEditCurrentArgument->setFocus();
- SelectionIntoArgument();
+ // SelectionIntoArgument();
+ globalSelection(); // close local selection to clear it
+ localSelection( GEOM::GEOM_Object::_nil(), TopAbs_VERTEX );
+ send->setDown(true);
+ displayPreview();
}
Group2->PushButton2->setIcon( image0 );
Group2->LineEdit1->setReadOnly( true );
Group2->LineEdit2->setReadOnly( true );
+ Group2->PushButton1->setDown( true );
+ Group2->LineEdit1->setEnabled( true );
+ Group2->LineEdit2->setEnabled( false );
Group3 = new DlgRef_3Check( centralWidget() );
switch ( constructorId ) {
case 0:
{
- //globalSelection( GEOM_PLANE );
TColStd_MapOfInteger aMap;
aMap.Add( GEOM_PLANE );
aMap.Add( GEOM_MARKER );
globalSelection( aMap );
-
Group2->hide();
Group3->hide();
Group1->show();
-
+ Group1->PushButton1->setDown(true);
myEditCurrentArgument = Group1->LineEdit1;
Group1->LineEdit1->setText( "" );
myFace = GEOM::GEOM_Object::_nil();
}
case 1:
{
- //globalSelection( GEOM_LINE );
- GEOM::GEOM_Object_var anObj;
- localSelection( anObj, TopAbs_EDGE );
-
+ globalSelection( GEOM_LINE );
Group1->hide();
Group3->hide();
Group2->show();
-
myEditCurrentArgument = Group2->LineEdit1;
Group2->LineEdit1->setText( "" );
Group2->LineEdit2->setText( "" );
+ Group2->PushButton1->setDown( true );
+ Group2->PushButton2->setDown( false );
+ Group2->LineEdit1->setEnabled( true );
+ Group2->LineEdit2->setEnabled( false );
myVectX = GEOM::GEOM_Object::_nil();
myVectZ = GEOM::GEOM_Object::_nil();
Group1->hide();
Group2->hide();
Group3->show();
-
Group3->RadioButton1->setChecked( true );
aOriginType = 1;
break;
myVectZ = aShapesOp->GetSubShape( aSelectedObject, anIndex );
}
else {
- if ( myEditCurrentArgument == Group2->LineEdit1 )
- myVectX = aSelectedObject;
- else
- myVectZ = aSelectedObject;
+ if ( aShape.ShapeType() != TopAbs_EDGE ) {
+ aSelectedObject = GEOM::GEOM_Object::_nil();
+ aName = "";
+ }
}
aSelMgr->clearSelected();
}
myEditCurrentArgument->setText( aName );
+ if ( myEditCurrentArgument == Group2->LineEdit1 ) {
+ myVectX = aSelectedObject;
+ if ( !myVectX->_is_nil() && myVectZ->_is_nil() )
+ Group2->PushButton2->click();
+ }
+ else {
+ myVectZ = aSelectedObject;
+ if ( !myVectZ->_is_nil() && myVectX->_is_nil() )
+ Group2->PushButton1->click();
+ }
+
updateWPlane();
}
else if ( send == Group2->PushButton1 ) {
myEditCurrentArgument = Group2->LineEdit1;
GEOM::GEOM_Object_var anObj;
- localSelection( anObj, TopAbs_EDGE );
+ // localSelection( anObj, TopAbs_EDGE );
+ globalSelection( GEOM_LINE );
+ Group2->PushButton2->setDown( false );
+ Group2->LineEdit1->setEnabled( true );
+ Group2->LineEdit2->setEnabled( false );
}
else if ( send == Group2->PushButton2 ) {
myEditCurrentArgument = Group2->LineEdit2;
GEOM::GEOM_Object_var anObj;
- localSelection( anObj, TopAbs_EDGE );
+ // localSelection( anObj, TopAbs_EDGE );
+ globalSelection( GEOM_LINE );
+ Group2->PushButton1->setDown( false );
+ Group2->LineEdit1->setEnabled( false );
+ Group2->LineEdit2->setEnabled( true );
}
myEditCurrentArgument->setFocus();
- SelectionIntoArgument();
+ // SelectionIntoArgument();
+ send->setDown(true);
+ displayPreview();
}
GroupPoints->LineEdit2->setEnabled(false);
}
else if ( send == GroupPoints->PushButton2 ) {
+ myGeomGUI->getApp()->selectionMgr()->clearSelected(); //clear prewious selection
myEditCurrentArgument = GroupPoints->LineEdit2;
GroupPoints->PushButton1->setDown(false);
GroupPoints->LineEdit1->setEnabled(false);
/***************************************************************/
- setHelpFileName( "create_face_page.html" );
+ setHelpFileName( "create_squareface_page.html" );
Init();
}