NPAL 18363

This commit is contained in:
dmv 2007-12-19 14:52:13 +00:00
parent 0d45320fe4
commit b51d7706d2
3 changed files with 51 additions and 24 deletions

View File

@ -207,12 +207,14 @@ void GenerationGUI_PipeDlg::SelectionIntoArgument()
if( !GEOMBase::GetShape(aSelectedObject, S) ) if( !GEOMBase::GetShape(aSelectedObject, S) )
return; return;
QString aName = GEOMBase::GetName( aSelectedObject );
if ( testResult && !aSelectedObject->_is_nil() && aSelectedObject != myBase) if ( testResult && !aSelectedObject->_is_nil() && aSelectedObject != myBase)
{ {
LightApp_SelectionMgr* aSelMgr = myGeomGUI->getApp()->selectionMgr(); LightApp_SelectionMgr* aSelMgr = myGeomGUI->getApp()->selectionMgr();
TColStd_IndexedMapOfInteger aMap; TColStd_IndexedMapOfInteger aMap;
QString aName = GEOMBase::GetName( aSelectedObject );
aSelMgr->GetIndexes( firstIObject(), aMap ); aSelMgr->GetIndexes( firstIObject(), aMap );
if ( aMap.Extent() == 1 ) if ( aMap.Extent() == 1 )
{ {
@ -225,11 +227,16 @@ void GenerationGUI_PipeDlg::SelectionIntoArgument()
aSelMgr->clearSelected(); aSelMgr->clearSelected();
} }
else { else {
myPath = aSelectedObject; myOkPath = true;
myOkPath = true; if (S.ShapeType() != TopAbs_EDGE) {
aSelectedObject = GEOM::GEOM_Object::_nil();
aName = "";
myOkPath = false;
} }
myEditCurrentArgument->setText( aName ); myPath = aSelectedObject;
}
} }
myEditCurrentArgument->setText( aName );
} }
displayPreview(); displayPreview();
@ -243,17 +250,18 @@ void GenerationGUI_PipeDlg::SelectionIntoArgument()
void GenerationGUI_PipeDlg::SetEditCurrentArgument() void GenerationGUI_PipeDlg::SetEditCurrentArgument()
{ {
QPushButton* send = (QPushButton*)sender(); QPushButton* send = (QPushButton*)sender();
globalSelection();
if(send == GroupPoints->PushButton1) { if(send == GroupPoints->PushButton1) {
GroupPoints->LineEdit1->setFocus(); GroupPoints->LineEdit1->setFocus();
myEditCurrentArgument = GroupPoints->LineEdit1;
globalSelection( GEOM_ALLSHAPES ); globalSelection( GEOM_ALLSHAPES );
myEditCurrentArgument = GroupPoints->LineEdit1;
} }
else if(send == GroupPoints->PushButton2) { else if(send == GroupPoints->PushButton2) {
GroupPoints->LineEdit2->setFocus(); GroupPoints->LineEdit2->setFocus();
myEditCurrentArgument = GroupPoints->LineEdit2; myEditCurrentArgument = GroupPoints->LineEdit2;
GEOM::GEOM_Object_var anObj; globalSelection();
localSelection( anObj, TopAbs_EDGE ); localSelection(GEOM::GEOM_Object::_nil(), TopAbs_EDGE);
} }
SelectionIntoArgument(); SelectionIntoArgument();
} }

View File

@ -289,6 +289,7 @@ void GenerationGUI_PrismDlg::SelectionIntoArgument()
if (!testResult) if (!testResult)
return; return;
bool myOk = true;
TopoDS_Shape aShape; TopoDS_Shape aShape;
QString aName = GEOMBase::GetName( aSelectedObject ); QString aName = GEOMBase::GetName( aSelectedObject );
if ( GEOMBase::GetShape( aSelectedObject, aShape, TopAbs_SHAPE ) && !aShape.IsNull() ) if ( GEOMBase::GetShape( aSelectedObject, aShape, TopAbs_SHAPE ) && !aShape.IsNull() )
@ -305,15 +306,22 @@ void GenerationGUI_PrismDlg::SelectionIntoArgument()
aName.append( ":edge_" + QString::number( anIndex ) ); aName.append( ":edge_" + QString::number( anIndex ) );
aSelMgr->clearSelected(); aSelMgr->clearSelected();
} }
else {
if (aShape.ShapeType() != TopAbs_EDGE && myEditCurrentArgument == GroupPoints->LineEdit2) {
aSelectedObject = GEOM::GEOM_Object::_nil();
aName = "";
myOk = false;
}
}
} }
if (myEditCurrentArgument == GroupPoints->LineEdit1) { if (myEditCurrentArgument == GroupPoints->LineEdit1) {
myBase = aSelectedObject; myBase = aSelectedObject;
myOkBase = true; myOkBase = true;
} }
else if (myEditCurrentArgument == GroupPoints->LineEdit2) { else if (myEditCurrentArgument == GroupPoints->LineEdit2 && myOk) {
myOkVec = true;
myVec = aSelectedObject; myVec = aSelectedObject;
myOkVec = true;
} }
myEditCurrentArgument->setText( aName ); myEditCurrentArgument->setText( aName );
} }
@ -343,9 +351,10 @@ void GenerationGUI_PrismDlg::SelectionIntoArgument()
QString aName = GEOMBase::GetName( aSelectedObject ); QString aName = GEOMBase::GetName( aSelectedObject );
TopoDS_Shape aShape; TopoDS_Shape aShape;
bool myOk = true;
if ( GEOMBase::GetShape( aSelectedObject, aShape, TopAbs_SHAPE ) && !aShape.IsNull() ) if ( GEOMBase::GetShape( aSelectedObject, aShape, TopAbs_SHAPE ) && !aShape.IsNull() )
{ {
LightApp_SelectionMgr* aSelMgr = myGeomGUI->getApp()->selectionMgr(); LightApp_SelectionMgr* aSelMgr = myGeomGUI->getApp()->selectionMgr();
TColStd_IndexedMapOfInteger aMap; TColStd_IndexedMapOfInteger aMap;
aSelMgr->GetIndexes( firstIObject(), aMap ); aSelMgr->GetIndexes( firstIObject(), aMap );
@ -358,21 +367,29 @@ void GenerationGUI_PrismDlg::SelectionIntoArgument()
aName.append( ":vertex_" + QString::number( anIndex ) ); aName.append( ":vertex_" + QString::number( anIndex ) );
aSelMgr->clearSelected(); aSelMgr->clearSelected();
} }
else {
if ( (aShape.ShapeType() != TopAbs_EDGE && myEditCurrentArgument == GroupPoints2->LineEdit2 ) ||
(aShape.ShapeType() != TopAbs_EDGE && myEditCurrentArgument == GroupPoints2->LineEdit3 )) {
aSelectedObject = GEOM::GEOM_Object::_nil();
aName = "";
myOk = false;
}
}
} }
myEditCurrentArgument->setText( aName ); myEditCurrentArgument->setText( aName );
if (myEditCurrentArgument == GroupPoints2->LineEdit1) { if (myEditCurrentArgument == GroupPoints2->LineEdit1) {
myBase = aSelectedObject; myBase = aSelectedObject;
myOkBase = true; myOkBase = true;
} }
else if (myEditCurrentArgument == GroupPoints2->LineEdit2) { else if (myEditCurrentArgument == GroupPoints2->LineEdit2 && myOk) {
myPoint1 = aSelectedObject;
myOkPnt1 = true; myOkPnt1 = true;
myPoint1 = aSelectedObject;
} }
else if (myEditCurrentArgument == GroupPoints2->LineEdit3) { else if (myEditCurrentArgument == GroupPoints2->LineEdit3 && myOk) {
myPoint2 = aSelectedObject;
myOkPnt2 = true; myOkPnt2 = true;
myPoint2 = aSelectedObject;
} }
} }
@ -407,12 +424,11 @@ void GenerationGUI_PrismDlg::LineEditReturnPressed()
void GenerationGUI_PrismDlg::SetEditCurrentArgument() void GenerationGUI_PrismDlg::SetEditCurrentArgument()
{ {
QPushButton* send = (QPushButton*)sender(); QPushButton* send = (QPushButton*)sender();
globalSelection( GEOM_POINT ); // to break previous local selection globalSelection( GEOM_ALLSHAPES );
if (send == GroupPoints->PushButton1) { if (send == GroupPoints->PushButton1) {
GroupPoints->LineEdit1->setFocus(); GroupPoints->LineEdit1->setFocus();
myEditCurrentArgument = GroupPoints->LineEdit1; myEditCurrentArgument = GroupPoints->LineEdit1;
globalSelection( GEOM_ALLSHAPES );
} }
else if (send == GroupPoints->PushButton2) { else if (send == GroupPoints->PushButton2) {
GroupPoints->LineEdit2->setFocus(); GroupPoints->LineEdit2->setFocus();
@ -422,7 +438,6 @@ void GenerationGUI_PrismDlg::SetEditCurrentArgument()
else if (send == GroupPoints2->PushButton1) { else if (send == GroupPoints2->PushButton1) {
GroupPoints2->LineEdit1->setFocus(); GroupPoints2->LineEdit1->setFocus();
myEditCurrentArgument = GroupPoints2->LineEdit1; myEditCurrentArgument = GroupPoints2->LineEdit1;
globalSelection( GEOM_ALLSHAPES );
} }
else if (send == GroupPoints2->PushButton2) { else if (send == GroupPoints2->PushButton2) {
GroupPoints2->LineEdit2->setFocus(); GroupPoints2->LineEdit2->setFocus();

View File

@ -253,12 +253,17 @@ void GenerationGUI_RevolDlg::SelectionIntoArgument()
int anIndex = aMap( 1 ); int anIndex = aMap( 1 );
aName.append( ":edge_" + QString::number( anIndex ) ); aName.append( ":edge_" + QString::number( anIndex ) );
myAxis = aShapesOp->GetSubShape(aSelectedObject, anIndex); myAxis = aShapesOp->GetSubShape(aSelectedObject, anIndex);
aSelMgr->clearSelected(); myOkAxis = true;
}
else {
myOkAxis = true;
if (aShape.ShapeType() != TopAbs_EDGE) {
aSelectedObject = GEOM::GEOM_Object::_nil();
aName = "";
myOkAxis = false;
} }
else
myAxis = aSelectedObject; myAxis = aSelectedObject;
}
myOkAxis = true;
} }
} }
} }
@ -284,7 +289,6 @@ void GenerationGUI_RevolDlg::SetEditCurrentArgument()
else if(send == GroupPoints->PushButton2) { else if(send == GroupPoints->PushButton2) {
GroupPoints->LineEdit2->setFocus(); GroupPoints->LineEdit2->setFocus();
myEditCurrentArgument = GroupPoints->LineEdit2; myEditCurrentArgument = GroupPoints->LineEdit2;
//globalSelection( GEOM_LINE );
localSelection(GEOM::GEOM_Object::_nil(), TopAbs_EDGE); localSelection(GEOM::GEOM_Object::_nil(), TopAbs_EDGE);
} }
SelectionIntoArgument(); SelectionIntoArgument();