Join modifications from V3_2_0_maintainance branch

This commit is contained in:
jfa 2007-08-31 08:09:54 +00:00
parent 588cdb9462
commit b46430fa97

View File

@ -116,7 +116,7 @@ void EntityGUI_SubShapeDlg::Init()
GroupPoints->ComboBox1->insertItem("Vertex"); GroupPoints->ComboBox1->insertItem("Vertex");
GroupPoints->ComboBox1->insertItem("Shape"); GroupPoints->ComboBox1->insertItem("Shape");
if (SUIT_Session::session()->activeApplication()->desktop()->activeWindow()->getViewManager()->getType() if (SUIT_Session::session()->activeApplication()->desktop()->activeWindow()->getViewManager()->getType()
!= OCCViewer_Viewer::Type()) != OCCViewer_Viewer::Type())
GroupPoints->CheckButton1->setEnabled(false); GroupPoints->CheckButton1->setEnabled(false);
@ -132,8 +132,8 @@ void EntityGUI_SubShapeDlg::Init()
connect(GroupPoints->ComboBox1, SIGNAL(activated(int)), this, SLOT(ComboTextChanged())); connect(GroupPoints->ComboBox1, SIGNAL(activated(int)), this, SLOT(ComboTextChanged()));
connect(GroupPoints->CheckButton1, SIGNAL(stateChanged(int)), this, SLOT(SubShapeToggled())); connect(GroupPoints->CheckButton1, SIGNAL(stateChanged(int)), this, SLOT(SubShapeToggled()));
connect(((SalomeApp_Application*)(SUIT_Session::session()->activeApplication()))->selectionMgr(), connect(myGeomGUI->getApp()->selectionMgr(),
SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument())) ; SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument()));
updateButtonState(); updateButtonState();
@ -159,7 +159,7 @@ void EntityGUI_SubShapeDlg::ClickOnOk()
bool EntityGUI_SubShapeDlg::ClickOnApply() bool EntityGUI_SubShapeDlg::ClickOnApply()
{ {
SUIT_Session::session()->activeApplication()->putInfo(tr("")); SUIT_Session::session()->activeApplication()->putInfo(tr(""));
/* Explode all sub shapes */ /* Explode all sub shapes */
if( isAllSubShapes() ) { if( isAllSubShapes() ) {
/* More than 30 subshapes : ask confirmation */ /* More than 30 subshapes : ask confirmation */
@ -175,7 +175,12 @@ bool EntityGUI_SubShapeDlg::ClickOnApply()
} }
} }
return onAccept(); bool isOk = onAccept();
// restore selection, corresponding to current selection mode
SubShapeToggled();
return isOk;
} }
@ -298,7 +303,7 @@ void EntityGUI_SubShapeDlg::SetEditCurrentArgument()
{ {
GroupPoints->LineEdit1->setFocus(); GroupPoints->LineEdit1->setFocus();
myEditCurrentArgument = GroupPoints->LineEdit1; myEditCurrentArgument = GroupPoints->LineEdit1;
GroupPoints->CheckButton1->setChecked( FALSE ); GroupPoints->CheckButton1->setChecked( FALSE );
SubShapeToggled(); SubShapeToggled();
SelectionIntoArgument(); SelectionIntoArgument();
@ -310,7 +315,7 @@ void EntityGUI_SubShapeDlg::SetEditCurrentArgument()
// purpose : // purpose :
//================================================================================= //=================================================================================
void EntityGUI_SubShapeDlg::LineEditReturnPressed() void EntityGUI_SubShapeDlg::LineEditReturnPressed()
{ {
QLineEdit* send = (QLineEdit*)sender(); QLineEdit* send = (QLineEdit*)sender();
if(send == GroupPoints->LineEdit1) if(send == GroupPoints->LineEdit1)
SetEditCurrentArgument(); SetEditCurrentArgument();
@ -340,8 +345,8 @@ void EntityGUI_SubShapeDlg::DeactivateActiveDialog()
void EntityGUI_SubShapeDlg::ActivateThisDialog() void EntityGUI_SubShapeDlg::ActivateThisDialog()
{ {
GEOMBase_Skeleton::ActivateThisDialog(); GEOMBase_Skeleton::ActivateThisDialog();
connect(((SalomeApp_Application*)(SUIT_Session::session()->activeApplication()))->selectionMgr(), connect(myGeomGUI->getApp()->selectionMgr(),
SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument())) ; SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument()));
SubShapeToggled(); SubShapeToggled();
updateButtonState(); updateButtonState();
} }
@ -383,9 +388,9 @@ void EntityGUI_SubShapeDlg::ResetStateOfDialog()
GroupPoints->ComboBox1->insertItem("Edge"); GroupPoints->ComboBox1->insertItem("Edge");
GroupPoints->ComboBox1->insertItem("Vertex"); GroupPoints->ComboBox1->insertItem("Vertex");
GroupPoints->ComboBox1->insertItem("Shape"); GroupPoints->ComboBox1->insertItem("Shape");
myWithShape = true; myWithShape = true;
GroupPoints->ComboBox1->setCurrentItem( 8 - count + SelectedShapeType ); GroupPoints->ComboBox1->setCurrentItem( 8 - count + SelectedShapeType );
ComboTextChanged(); ComboTextChanged();
@ -409,13 +414,13 @@ void EntityGUI_SubShapeDlg::SubShapeToggled()
//================================================================================= //=================================================================================
// function : ComboTextChanged() // function : ComboTextChanged()
// purpose : // purpose :
//================================================================================= //=================================================================================
void EntityGUI_SubShapeDlg::ComboTextChanged() void EntityGUI_SubShapeDlg::ComboTextChanged()
{ {
/* Select sub shapes mode not checked */ /* Select sub shapes mode not checked */
updateButtonState(); updateButtonState();
SubShapeToggled(); SubShapeToggled();
} }
@ -526,10 +531,10 @@ bool EntityGUI_SubShapeDlg::isValid( QString& msg )
Standard_Boolean aResult = Standard_False; Standard_Boolean aResult = Standard_False;
GEOM::GEOM_Object_var anObj = GEOM::GEOM_Object_var anObj =
GEOMBase::ConvertIOinGEOMObject( firstIObject(), aResult ); GEOMBase::ConvertIOinGEOMObject( firstIObject(), aResult );
if ( aResult && !anObj->_is_nil() ) { if ( aResult && !anObj->_is_nil() ) {
TColStd_IndexedMapOfInteger aMapIndex; TColStd_IndexedMapOfInteger aMapIndex;
((SalomeApp_Application*)(SUIT_Session::session()->activeApplication()))->selectionMgr()->GetIndexes( firstIObject(), aMapIndex ); myGeomGUI->getApp()->selectionMgr()->GetIndexes( firstIObject(), aMapIndex );
isOk = aMapIndex.Extent() > 0; isOk = aMapIndex.Extent() > 0;
if ( !isOk ) if ( !isOk )
msg += tr( "NO_SUBSHAPES_SELECTED" ); msg += tr( "NO_SUBSHAPES_SELECTED" );
@ -547,11 +552,11 @@ bool EntityGUI_SubShapeDlg::execute( ObjectList& objects )
{ {
GEOM::ListOfGO_var aList = GEOM::GEOM_IShapesOperations::_narrow( GEOM::ListOfGO_var aList = GEOM::GEOM_IShapesOperations::_narrow(
getOperation() )->MakeExplode( myObject, shapeType(), true ); getOperation() )->MakeExplode( myObject, shapeType(), true );
if ( !aList->length() ) if ( !aList->length() )
return false; return false;
// Throw away sub-shapes not selected by user if not in preview mode // Throw away sub-shapes not selected by user if not in preview mode
// and manual selection is active // and manual selection is active
if ( !isAllSubShapes() ) if ( !isAllSubShapes() )
{ {
@ -562,9 +567,9 @@ bool EntityGUI_SubShapeDlg::execute( ObjectList& objects )
if ( aResult && !anObj->_is_nil() ) { if ( aResult && !anObj->_is_nil() ) {
TColStd_IndexedMapOfInteger aMapIndex; TColStd_IndexedMapOfInteger aMapIndex;
((SalomeApp_Application*)(SUIT_Session::session()->activeApplication()))->selectionMgr()->GetIndexes( firstIObject(), aMapIndex ); myGeomGUI->getApp()->selectionMgr()->GetIndexes( firstIObject(), aMapIndex );
GEOM::GEOM_ILocalOperations_var aLocOp = GEOM::GEOM_ILocalOperations_var aLocOp =
getGeomEngine()->GetILocalOperations( getStudyId() ); getGeomEngine()->GetILocalOperations( getStudyId() );
for ( int i = 0, n = aList->length(); i < n; i++ ) for ( int i = 0, n = aList->length(); i < n; i++ )
@ -576,7 +581,7 @@ bool EntityGUI_SubShapeDlg::execute( ObjectList& objects )
else else
for ( int i = 0, n = aList->length(); i < n; i++ ) for ( int i = 0, n = aList->length(); i < n; i++ )
objects.push_back( GEOM::GEOM_Object::_duplicate( aList[i] ) ); objects.push_back( GEOM::GEOM_Object::_duplicate( aList[i] ) );
return objects.size(); return objects.size();
} }