GroupPoints->ComboBox1->insertItem("Vertex");
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())
GroupPoints->CheckButton1->setEnabled(false);
connect(GroupPoints->ComboBox1, SIGNAL(activated(int)), this, SLOT(ComboTextChanged()));
connect(GroupPoints->CheckButton1, SIGNAL(stateChanged(int)), this, SLOT(SubShapeToggled()));
- connect(((SalomeApp_Application*)(SUIT_Session::session()->activeApplication()))->selectionMgr(),
- SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument())) ;
+ connect(myGeomGUI->getApp()->selectionMgr(),
+ SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument()));
updateButtonState();
bool EntityGUI_SubShapeDlg::ClickOnApply()
{
SUIT_Session::session()->activeApplication()->putInfo(tr(""));
-
+
/* Explode all sub shapes */
if( isAllSubShapes() ) {
/* More than 30 subshapes : ask confirmation */
}
}
- return onAccept();
+ bool isOk = onAccept();
+
+ // restore selection, corresponding to current selection mode
+ SubShapeToggled();
+
+ return isOk;
}
{
GroupPoints->LineEdit1->setFocus();
myEditCurrentArgument = GroupPoints->LineEdit1;
-
+
GroupPoints->CheckButton1->setChecked( FALSE );
SubShapeToggled();
SelectionIntoArgument();
// purpose :
//=================================================================================
void EntityGUI_SubShapeDlg::LineEditReturnPressed()
-{
+{
QLineEdit* send = (QLineEdit*)sender();
if(send == GroupPoints->LineEdit1)
SetEditCurrentArgument();
void EntityGUI_SubShapeDlg::ActivateThisDialog()
{
GEOMBase_Skeleton::ActivateThisDialog();
- connect(((SalomeApp_Application*)(SUIT_Session::session()->activeApplication()))->selectionMgr(),
- SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument())) ;
+ connect(myGeomGUI->getApp()->selectionMgr(),
+ SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument()));
SubShapeToggled();
updateButtonState();
}
GroupPoints->ComboBox1->insertItem("Edge");
GroupPoints->ComboBox1->insertItem("Vertex");
GroupPoints->ComboBox1->insertItem("Shape");
-
+
myWithShape = true;
-
+
GroupPoints->ComboBox1->setCurrentItem( 8 - count + SelectedShapeType );
ComboTextChanged();
//=================================================================================
// function : ComboTextChanged()
-// purpose :
+// purpose :
//=================================================================================
void EntityGUI_SubShapeDlg::ComboTextChanged()
{
/* Select sub shapes mode not checked */
updateButtonState();
- SubShapeToggled();
+ SubShapeToggled();
}
Standard_Boolean aResult = Standard_False;
GEOM::GEOM_Object_var anObj =
GEOMBase::ConvertIOinGEOMObject( firstIObject(), aResult );
-
+
if ( aResult && !anObj->_is_nil() ) {
TColStd_IndexedMapOfInteger aMapIndex;
- ((SalomeApp_Application*)(SUIT_Session::session()->activeApplication()))->selectionMgr()->GetIndexes( firstIObject(), aMapIndex );
+ myGeomGUI->getApp()->selectionMgr()->GetIndexes( firstIObject(), aMapIndex );
isOk = aMapIndex.Extent() > 0;
if ( !isOk )
msg += tr( "NO_SUBSHAPES_SELECTED" );
{
GEOM::ListOfGO_var aList = GEOM::GEOM_IShapesOperations::_narrow(
getOperation() )->MakeExplode( myObject, shapeType(), true );
-
+
if ( !aList->length() )
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
if ( !isAllSubShapes() )
{
if ( aResult && !anObj->_is_nil() ) {
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() );
for ( int i = 0, n = aList->length(); i < n; i++ )
else
for ( int i = 0, n = aList->length(); i < n; i++ )
objects.push_back( GEOM::GEOM_Object::_duplicate( aList[i] ) );
-
+
return objects.size();
}