mirror of
https://git.salome-platform.org/gitpub/modules/geom.git
synced 2025-01-01 04:10:34 +05:00
Bugs 16640, 19050: Improve selection mechanism in GEOM dialog boxes.
This commit is contained in:
parent
54666ebd00
commit
0dd54298d5
@ -29,17 +29,18 @@
|
|||||||
#include <GeometryGUI.h>
|
#include <GeometryGUI.h>
|
||||||
#include <GEOMBase.h>
|
#include <GEOMBase.h>
|
||||||
|
|
||||||
#include <SalomeApp_Application.h>
|
|
||||||
#include <LightApp_SelectionMgr.h>
|
|
||||||
#include <SUIT_Session.h>
|
#include <SUIT_Session.h>
|
||||||
#include <SUIT_ResourceMgr.h>
|
#include <SUIT_ResourceMgr.h>
|
||||||
|
#include <SalomeApp_Application.h>
|
||||||
|
#include <LightApp_SelectionMgr.h>
|
||||||
|
|
||||||
|
// OCCT Includes
|
||||||
|
#include <TopAbs.hxx>
|
||||||
|
#include <TColStd_MapOfInteger.hxx>
|
||||||
|
#include <TColStd_IndexedMapOfInteger.hxx>
|
||||||
|
|
||||||
#include <GEOMImpl_Types.hxx>
|
#include <GEOMImpl_Types.hxx>
|
||||||
|
|
||||||
#include <TopAbs.hxx>
|
|
||||||
#include <TColStd_IndexedMapOfInteger.hxx>
|
|
||||||
#include <TColStd_MapOfInteger.hxx>
|
|
||||||
|
|
||||||
//=================================================================================
|
//=================================================================================
|
||||||
// class : RepairGUI_CloseContourDlg()
|
// class : RepairGUI_CloseContourDlg()
|
||||||
// purpose : Constructs a RepairGUI_CloseContourDlg which is a child of 'parent', with the
|
// purpose : Constructs a RepairGUI_CloseContourDlg which is a child of 'parent', with the
|
||||||
@ -90,7 +91,6 @@ RepairGUI_CloseContourDlg::RepairGUI_CloseContourDlg( GeometryGUI* theGeometryGU
|
|||||||
QVBoxLayout* layout = new QVBoxLayout(centralWidget());
|
QVBoxLayout* layout = new QVBoxLayout(centralWidget());
|
||||||
layout->setMargin(0); layout->setSpacing(6);
|
layout->setMargin(0); layout->setSpacing(6);
|
||||||
layout->addWidget(GroupPoints);
|
layout->addWidget(GroupPoints);
|
||||||
|
|
||||||
/***************************************************************/
|
/***************************************************************/
|
||||||
|
|
||||||
setHelpFileName("close_contour_operation_page.html");
|
setHelpFileName("close_contour_operation_page.html");
|
||||||
@ -98,7 +98,6 @@ RepairGUI_CloseContourDlg::RepairGUI_CloseContourDlg( GeometryGUI* theGeometryGU
|
|||||||
Init();
|
Init();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
//=================================================================================
|
//=================================================================================
|
||||||
// function : ~RepairGUI_CloseContourDlg()
|
// function : ~RepairGUI_CloseContourDlg()
|
||||||
// purpose : Destroys the object and frees any allocated resources
|
// purpose : Destroys the object and frees any allocated resources
|
||||||
@ -107,38 +106,34 @@ RepairGUI_CloseContourDlg::~RepairGUI_CloseContourDlg()
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
//=================================================================================
|
//=================================================================================
|
||||||
// function : Init()
|
// function : Init()
|
||||||
// purpose :
|
// purpose :
|
||||||
//=================================================================================
|
//=================================================================================
|
||||||
void RepairGUI_CloseContourDlg::Init()
|
void RepairGUI_CloseContourDlg::Init()
|
||||||
{
|
{
|
||||||
/* init variables */
|
// init variables
|
||||||
myEditCurrentArgument = GroupPoints->LineEdit1;
|
GroupPoints->LineEdit1->clear();
|
||||||
|
GroupPoints->LineEdit2->clear();
|
||||||
myObject = GEOM::GEOM_Object::_nil();
|
myObject = GEOM::GEOM_Object::_nil();
|
||||||
myWiresInd = new GEOM::short_array();
|
myWiresInd = new GEOM::short_array();
|
||||||
myWiresInd->length(0);
|
myWiresInd->length(0);
|
||||||
|
|
||||||
//myGeomGUI->SetState( 0 );
|
// signals and slots connections
|
||||||
initSelection();
|
|
||||||
|
|
||||||
/* signals and slots connections */
|
|
||||||
connect(buttonOk(), SIGNAL(clicked()), this, SLOT(ClickOnOk()));
|
connect(buttonOk(), SIGNAL(clicked()), this, SLOT(ClickOnOk()));
|
||||||
connect(buttonApply(), SIGNAL(clicked()), this, SLOT(ClickOnApply()));
|
connect(buttonApply(), SIGNAL(clicked()), this, SLOT(ClickOnApply()));
|
||||||
|
|
||||||
connect(GroupPoints->PushButton1, SIGNAL(clicked()), this, SLOT(SetEditCurrentArgument()));
|
connect(GroupPoints->PushButton1, SIGNAL(clicked()), this, SLOT(SetEditCurrentArgument()));
|
||||||
connect(GroupPoints->PushButton2, SIGNAL(clicked()), this, SLOT(SetEditCurrentArgument()));
|
connect(GroupPoints->PushButton2, SIGNAL(clicked()), this, SLOT(SetEditCurrentArgument()));
|
||||||
|
|
||||||
connect(GroupPoints->LineEdit1, SIGNAL(returnPressed()), this, SLOT(LineEditReturnPressed()));
|
connect(GroupPoints->LineEdit1, SIGNAL(returnPressed()), this, SLOT(LineEditReturnPressed()));
|
||||||
connect(GroupPoints->LineEdit2, SIGNAL(returnPressed()), this, SLOT(LineEditReturnPressed()));
|
connect(GroupPoints->LineEdit2, SIGNAL(returnPressed()), this, SLOT(LineEditReturnPressed()));
|
||||||
|
|
||||||
connect( myGeomGUI->getApp()->selectionMgr(),
|
|
||||||
SIGNAL( currentSelectionChanged() ), this, SLOT( SelectionIntoArgument() ) );
|
|
||||||
|
|
||||||
initName(tr("CLOSE_CONTOUR_NEW_OBJ_NAME"));
|
initName(tr("CLOSE_CONTOUR_NEW_OBJ_NAME"));
|
||||||
}
|
|
||||||
|
|
||||||
|
GroupPoints->PushButton1->click();
|
||||||
|
SelectionIntoArgument();
|
||||||
|
}
|
||||||
|
|
||||||
//=================================================================================
|
//=================================================================================
|
||||||
// function : ClickOnOk()
|
// function : ClickOnOk()
|
||||||
@ -150,8 +145,6 @@ void RepairGUI_CloseContourDlg::ClickOnOk()
|
|||||||
ClickOnCancel();
|
ClickOnCancel();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//=================================================================================
|
//=================================================================================
|
||||||
// function : ClickOnApply()
|
// function : ClickOnApply()
|
||||||
// purpose :
|
// purpose :
|
||||||
@ -162,32 +155,24 @@ bool RepairGUI_CloseContourDlg::ClickOnApply()
|
|||||||
return false;
|
return false;
|
||||||
|
|
||||||
initName();
|
initName();
|
||||||
|
// activate first line edit
|
||||||
myEditCurrentArgument = GroupPoints->LineEdit1;
|
GroupPoints->PushButton1->click();
|
||||||
myEditCurrentArgument->setText( "" );
|
|
||||||
myObject = GEOM::GEOM_Object::_nil();
|
|
||||||
myWiresInd->length( 0 );
|
|
||||||
|
|
||||||
initSelection();
|
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
//=================================================================================
|
//=================================================================================
|
||||||
// function : SelectionIntoArgument()
|
// function : SelectionIntoArgument()
|
||||||
// purpose : Called when selection as changed or other case
|
// purpose : Called when selection is changed or on dialog initialization or activation
|
||||||
// : used only by SelectButtonC1A1 (LineEditC1A1)
|
|
||||||
//=================================================================================
|
//=================================================================================
|
||||||
void RepairGUI_CloseContourDlg::SelectionIntoArgument()
|
void RepairGUI_CloseContourDlg::SelectionIntoArgument()
|
||||||
{
|
{
|
||||||
erasePreview();
|
|
||||||
myEditCurrentArgument->setText("");
|
myEditCurrentArgument->setText("");
|
||||||
|
// the second argument depends on the first one
|
||||||
GroupPoints->LineEdit2->setText("");
|
GroupPoints->LineEdit2->setText("");
|
||||||
|
myWiresInd->length(0);
|
||||||
|
|
||||||
if (myEditCurrentArgument == GroupPoints->LineEdit1)
|
if (myEditCurrentArgument == GroupPoints->LineEdit1)
|
||||||
myObject = GEOM::GEOM_Object::_nil();
|
myObject = GEOM::GEOM_Object::_nil();
|
||||||
else if ( myEditCurrentArgument == GroupPoints->LineEdit2 )
|
|
||||||
myWiresInd->length( 0 );
|
|
||||||
|
|
||||||
LightApp_SelectionMgr* aSelMgr = myGeomGUI->getApp()->selectionMgr();
|
LightApp_SelectionMgr* aSelMgr = myGeomGUI->getApp()->selectionMgr();
|
||||||
SALOME_ListIO aSelList;
|
SALOME_ListIO aSelList;
|
||||||
@ -204,6 +189,14 @@ void RepairGUI_CloseContourDlg::SelectionIntoArgument()
|
|||||||
TopoDS_Shape aShape;
|
TopoDS_Shape aShape;
|
||||||
if (GEOMBase::GetShape(myObject, aShape, TopAbs_WIRE))
|
if (GEOMBase::GetShape(myObject, aShape, TopAbs_WIRE))
|
||||||
GroupPoints->LineEdit2->setText(myEditCurrentArgument->text());
|
GroupPoints->LineEdit2->setText(myEditCurrentArgument->text());
|
||||||
|
|
||||||
|
// clear selection
|
||||||
|
disconnect(myGeomGUI->getApp()->selectionMgr(), 0, this, 0);
|
||||||
|
myGeomGUI->getApp()->selectionMgr()->clearSelected();
|
||||||
|
connect(myGeomGUI->getApp()->selectionMgr(), SIGNAL(currentSelectionChanged()),
|
||||||
|
this, SLOT(SelectionIntoArgument()));
|
||||||
|
|
||||||
|
GroupPoints->PushButton2->click();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
myObject = GEOM::GEOM_Object::_nil();
|
myObject = GEOM::GEOM_Object::_nil();
|
||||||
@ -227,18 +220,35 @@ void RepairGUI_CloseContourDlg::SelectionIntoArgument()
|
|||||||
//=================================================================================
|
//=================================================================================
|
||||||
void RepairGUI_CloseContourDlg::SetEditCurrentArgument()
|
void RepairGUI_CloseContourDlg::SetEditCurrentArgument()
|
||||||
{
|
{
|
||||||
const QObject* send = sender();
|
QPushButton* send = (QPushButton*)sender();
|
||||||
if ( send == GroupPoints->PushButton1 )
|
|
||||||
|
bool isEffective = false;
|
||||||
|
|
||||||
|
if (send == GroupPoints->PushButton1) {
|
||||||
|
isEffective = true;
|
||||||
myEditCurrentArgument = GroupPoints->LineEdit1;
|
myEditCurrentArgument = GroupPoints->LineEdit1;
|
||||||
else if ( send == GroupPoints->PushButton2 && !myObject->_is_nil() )
|
|
||||||
myEditCurrentArgument = GroupPoints->LineEdit2;
|
GroupPoints->PushButton2->setDown(false);
|
||||||
if ( myEditCurrentArgument ) {
|
GroupPoints->LineEdit2->setEnabled(false);
|
||||||
initSelection();
|
|
||||||
myEditCurrentArgument->setFocus();
|
|
||||||
SelectionIntoArgument();
|
|
||||||
}
|
}
|
||||||
|
else if (send == GroupPoints->PushButton2 && !myObject->_is_nil()) {
|
||||||
|
isEffective = true;
|
||||||
|
myEditCurrentArgument = GroupPoints->LineEdit2;
|
||||||
|
|
||||||
|
GroupPoints->PushButton1->setDown(false);
|
||||||
|
GroupPoints->LineEdit1->setEnabled(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (isEffective) {
|
||||||
|
initSelection();
|
||||||
|
|
||||||
|
// enable line edit
|
||||||
|
myEditCurrentArgument->setEnabled(true);
|
||||||
|
myEditCurrentArgument->setFocus();
|
||||||
|
// after setFocus(), because it will be setDown(false) when loses focus
|
||||||
|
send->setDown(true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
//=================================================================================
|
//=================================================================================
|
||||||
// function : LineEditReturnPressed()
|
// function : LineEditReturnPressed()
|
||||||
@ -253,7 +263,6 @@ void RepairGUI_CloseContourDlg::LineEditReturnPressed()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
//=================================================================================
|
//=================================================================================
|
||||||
// function : ActivateThisDialog()
|
// function : ActivateThisDialog()
|
||||||
// purpose :
|
// purpose :
|
||||||
@ -261,20 +270,11 @@ void RepairGUI_CloseContourDlg::LineEditReturnPressed()
|
|||||||
void RepairGUI_CloseContourDlg::ActivateThisDialog()
|
void RepairGUI_CloseContourDlg::ActivateThisDialog()
|
||||||
{
|
{
|
||||||
GEOMBase_Skeleton::ActivateThisDialog();
|
GEOMBase_Skeleton::ActivateThisDialog();
|
||||||
connect( myGeomGUI->getApp()->selectionMgr(),
|
|
||||||
SIGNAL( currentSelectionChanged() ), this, SLOT( SelectionIntoArgument() ) );
|
|
||||||
|
|
||||||
myEditCurrentArgument = GroupPoints->LineEdit1;
|
// reinit, because some selected objects could be removed
|
||||||
myEditCurrentArgument->setText( "" );
|
Init();
|
||||||
GroupPoints->LineEdit2->setText( "" );
|
|
||||||
myObject = GEOM::GEOM_Object::_nil();
|
|
||||||
myWiresInd->length( 0 );
|
|
||||||
|
|
||||||
//myGeomGUI->SetState( 0 );
|
|
||||||
initSelection();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
//=================================================================================
|
//=================================================================================
|
||||||
// function : enterEvent()
|
// function : enterEvent()
|
||||||
// purpose : Mouse enter onto the dialog to activate it
|
// purpose : Mouse enter onto the dialog to activate it
|
||||||
@ -285,7 +285,6 @@ void RepairGUI_CloseContourDlg::enterEvent( QEvent* )
|
|||||||
ActivateThisDialog();
|
ActivateThisDialog();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
//=================================================================================
|
//=================================================================================
|
||||||
// function : createOperation
|
// function : createOperation
|
||||||
// purpose :
|
// purpose :
|
||||||
@ -302,7 +301,8 @@ GEOM::GEOM_IOperations_ptr RepairGUI_CloseContourDlg::createOperation()
|
|||||||
bool RepairGUI_CloseContourDlg::isValid (QString&)
|
bool RepairGUI_CloseContourDlg::isValid (QString&)
|
||||||
{
|
{
|
||||||
TopoDS_Shape aTmpShape;
|
TopoDS_Shape aTmpShape;
|
||||||
return !myObject->_is_nil() && ( myWiresInd->length() || GEOMBase::GetShape( myObject, aTmpShape, TopAbs_WIRE ) );
|
return !myObject->_is_nil() && (myWiresInd->length() ||
|
||||||
|
GEOMBase::GetShape(myObject, aTmpShape, TopAbs_WIRE));
|
||||||
}
|
}
|
||||||
|
|
||||||
//=================================================================================
|
//=================================================================================
|
||||||
@ -311,7 +311,9 @@ bool RepairGUI_CloseContourDlg::isValid( QString& )
|
|||||||
//=================================================================================
|
//=================================================================================
|
||||||
bool RepairGUI_CloseContourDlg::execute (ObjectList& objects)
|
bool RepairGUI_CloseContourDlg::execute (ObjectList& objects)
|
||||||
{
|
{
|
||||||
GEOM::GEOM_Object_var anObj = GEOM::GEOM_IHealingOperations::_narrow( getOperation() )->CloseContour( myObject, myWiresInd, getIsByVertex() );
|
GEOM::GEOM_Object_var anObj = GEOM::GEOM_IHealingOperations::_narrow(getOperation())->
|
||||||
|
CloseContour(myObject, myWiresInd, getIsByVertex());
|
||||||
|
|
||||||
bool aResult = !anObj->_is_nil();
|
bool aResult = !anObj->_is_nil();
|
||||||
if (aResult)
|
if (aResult)
|
||||||
objects.push_back(anObj._retn());
|
objects.push_back(anObj._retn());
|
||||||
@ -334,6 +336,8 @@ bool RepairGUI_CloseContourDlg::getIsByVertex() const
|
|||||||
//=================================================================================
|
//=================================================================================
|
||||||
void RepairGUI_CloseContourDlg::initSelection()
|
void RepairGUI_CloseContourDlg::initSelection()
|
||||||
{
|
{
|
||||||
|
disconnect(myGeomGUI->getApp()->selectionMgr(), 0, this, 0);
|
||||||
|
|
||||||
if (myEditCurrentArgument == GroupPoints->LineEdit1) {
|
if (myEditCurrentArgument == GroupPoints->LineEdit1) {
|
||||||
TColStd_MapOfInteger aTypes;
|
TColStd_MapOfInteger aTypes;
|
||||||
aTypes.Add(GEOM_COMPOUND);
|
aTypes.Add(GEOM_COMPOUND);
|
||||||
@ -348,4 +352,7 @@ void RepairGUI_CloseContourDlg::initSelection()
|
|||||||
localSelection(myObject, TopAbs_EDGE);
|
localSelection(myObject, TopAbs_EDGE);
|
||||||
localSelection(myObject, TopAbs_WIRE);
|
localSelection(myObject, TopAbs_WIRE);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
connect(myGeomGUI->getApp()->selectionMgr(), SIGNAL(currentSelectionChanged()),
|
||||||
|
this, SLOT(SelectionIntoArgument()));
|
||||||
}
|
}
|
||||||
|
@ -29,18 +29,19 @@
|
|||||||
#include <GeometryGUI.h>
|
#include <GeometryGUI.h>
|
||||||
#include <GEOMBase.h>
|
#include <GEOMBase.h>
|
||||||
|
|
||||||
#include <SalomeApp_Application.h>
|
|
||||||
#include <LightApp_SelectionMgr.h>
|
|
||||||
#include <SUIT_MessageBox.h>
|
|
||||||
#include <SUIT_Session.h>
|
#include <SUIT_Session.h>
|
||||||
#include <SUIT_ResourceMgr.h>
|
#include <SUIT_ResourceMgr.h>
|
||||||
|
#include <SUIT_MessageBox.h>
|
||||||
|
#include <SalomeApp_Application.h>
|
||||||
|
#include <LightApp_SelectionMgr.h>
|
||||||
|
|
||||||
#include <GEOMImpl_Types.hxx>
|
// OCCT Includes
|
||||||
|
|
||||||
#include <TopAbs.hxx>
|
#include <TopAbs.hxx>
|
||||||
#include <TColStd_MapOfInteger.hxx>
|
#include <TColStd_MapOfInteger.hxx>
|
||||||
#include <TColStd_IndexedMapOfInteger.hxx>
|
#include <TColStd_IndexedMapOfInteger.hxx>
|
||||||
|
|
||||||
|
#include <GEOMImpl_Types.hxx>
|
||||||
|
|
||||||
//=================================================================================
|
//=================================================================================
|
||||||
// class : RepairGUI_RemoveHolesDlg()
|
// class : RepairGUI_RemoveHolesDlg()
|
||||||
// purpose : Constructs a RepairGUI_RemoveHolesDlg which is a child of 'parent', with the
|
// purpose : Constructs a RepairGUI_RemoveHolesDlg which is a child of 'parent', with the
|
||||||
@ -84,7 +85,6 @@ RepairGUI_RemoveHolesDlg::RepairGUI_RemoveHolesDlg( GeometryGUI* theGeometryGUI,
|
|||||||
QVBoxLayout* layout = new QVBoxLayout(centralWidget());
|
QVBoxLayout* layout = new QVBoxLayout(centralWidget());
|
||||||
layout->setMargin(0); layout->setSpacing(6);
|
layout->setMargin(0); layout->setSpacing(6);
|
||||||
layout->addWidget(GroupPoints);
|
layout->addWidget(GroupPoints);
|
||||||
|
|
||||||
/***************************************************************/
|
/***************************************************************/
|
||||||
|
|
||||||
setHelpFileName("suppress_holes_operation_page.html");
|
setHelpFileName("suppress_holes_operation_page.html");
|
||||||
@ -92,7 +92,6 @@ RepairGUI_RemoveHolesDlg::RepairGUI_RemoveHolesDlg( GeometryGUI* theGeometryGUI,
|
|||||||
Init();
|
Init();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
//=================================================================================
|
//=================================================================================
|
||||||
// function : ~RepairGUI_RemoveHolesDlg()
|
// function : ~RepairGUI_RemoveHolesDlg()
|
||||||
// purpose : Destroys the object and frees any allocated resources
|
// purpose : Destroys the object and frees any allocated resources
|
||||||
@ -101,44 +100,41 @@ RepairGUI_RemoveHolesDlg::~RepairGUI_RemoveHolesDlg()
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
//=================================================================================
|
//=================================================================================
|
||||||
// function : Init()
|
// function : Init()
|
||||||
// purpose :
|
// purpose :
|
||||||
//=================================================================================
|
//=================================================================================
|
||||||
void RepairGUI_RemoveHolesDlg::Init()
|
void RepairGUI_RemoveHolesDlg::Init()
|
||||||
{
|
{
|
||||||
/* init variables */
|
// init variables
|
||||||
myEditCurrentArgument = GroupPoints->LineEdit1;
|
GroupPoints->LineEdit1->clear();
|
||||||
|
GroupPoints->LineEdit2->clear();
|
||||||
myObject = GEOM::GEOM_Object::_nil();
|
myObject = GEOM::GEOM_Object::_nil();
|
||||||
myWiresInd = new GEOM::short_array();
|
myWiresInd = new GEOM::short_array();
|
||||||
myWiresInd->length(0);
|
myWiresInd->length(0);
|
||||||
|
|
||||||
//myGeomGUI->SetState( 0 );
|
|
||||||
initSelection();
|
|
||||||
|
|
||||||
myClosed = -1;
|
myClosed = -1;
|
||||||
myOpen = -1;
|
myOpen = -1;
|
||||||
|
|
||||||
/* signals and slots connections */
|
// signals and slots connections
|
||||||
connect(buttonOk(), SIGNAL(clicked()), this, SLOT(ClickOnOk()));
|
connect(buttonOk(), SIGNAL(clicked()), this, SLOT(ClickOnOk()));
|
||||||
connect(buttonApply(), SIGNAL(clicked()), this, SLOT(ClickOnApply()));
|
connect(buttonApply(), SIGNAL(clicked()), this, SLOT(ClickOnApply()));
|
||||||
|
|
||||||
connect(GroupPoints->PushButton1, SIGNAL(clicked()), this, SLOT(SetEditCurrentArgument()));
|
connect(GroupPoints->PushButton1, SIGNAL(clicked()), this, SLOT(SetEditCurrentArgument()));
|
||||||
connect(GroupPoints->PushButton2, SIGNAL(clicked()), this, SLOT(SetEditCurrentArgument()));
|
connect(GroupPoints->PushButton2, SIGNAL(clicked()), this, SLOT(SetEditCurrentArgument()));
|
||||||
|
|
||||||
connect(GroupPoints->LineEdit1, SIGNAL(returnPressed()), this, SLOT(LineEditReturnPressed()));
|
connect(GroupPoints->LineEdit1, SIGNAL(returnPressed()), this, SLOT(LineEditReturnPressed()));
|
||||||
connect(GroupPoints->LineEdit2, SIGNAL(returnPressed()), this, SLOT(LineEditReturnPressed()));
|
connect(GroupPoints->LineEdit2, SIGNAL(returnPressed()), this, SLOT(LineEditReturnPressed()));
|
||||||
|
|
||||||
connect( ( (SalomeApp_Application*)( SUIT_Session::session()->activeApplication() ) )->selectionMgr(),
|
|
||||||
SIGNAL( currentSelectionChanged() ), this, SLOT( SelectionIntoArgument() ) );
|
|
||||||
|
|
||||||
connect(GroupPoints->CheckButton1, SIGNAL(clicked()), this, SLOT(onRemoveAllClicked()));
|
connect(GroupPoints->CheckButton1, SIGNAL(clicked()), this, SLOT(onRemoveAllClicked()));
|
||||||
|
|
||||||
connect(myFreeBoundBtn, SIGNAL(clicked()), this, SLOT(onDetect()));
|
connect(myFreeBoundBtn, SIGNAL(clicked()), this, SLOT(onDetect()));
|
||||||
|
|
||||||
initName(tr("REMOVE_HOLES_NEW_OBJ_NAME"));
|
initName(tr("REMOVE_HOLES_NEW_OBJ_NAME"));
|
||||||
}
|
|
||||||
|
|
||||||
|
GroupPoints->PushButton1->click();
|
||||||
|
SelectionIntoArgument();
|
||||||
|
}
|
||||||
|
|
||||||
//=================================================================================
|
//=================================================================================
|
||||||
// function : ClickOnOk()
|
// function : ClickOnOk()
|
||||||
@ -160,29 +156,25 @@ bool RepairGUI_RemoveHolesDlg::ClickOnApply()
|
|||||||
return false;
|
return false;
|
||||||
|
|
||||||
initName();
|
initName();
|
||||||
|
// activate first line edit
|
||||||
myEditCurrentArgument = GroupPoints->LineEdit1;
|
GroupPoints->PushButton1->click();
|
||||||
myEditCurrentArgument->setText( "" );
|
|
||||||
GroupPoints->LineEdit2->setText( "" );
|
|
||||||
myObject = GEOM::GEOM_Object::_nil();
|
|
||||||
myWiresInd->length( 0 );
|
|
||||||
|
|
||||||
initSelection();
|
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
//=================================================================================
|
//=================================================================================
|
||||||
// function : SelectionIntoArgument()
|
// function : SelectionIntoArgument()
|
||||||
// purpose : Called when selection
|
// purpose : Called when selection is changed or on dialog initialization or activation
|
||||||
//=================================================================================
|
//=================================================================================
|
||||||
void RepairGUI_RemoveHolesDlg::SelectionIntoArgument()
|
void RepairGUI_RemoveHolesDlg::SelectionIntoArgument()
|
||||||
{
|
{
|
||||||
erasePreview();
|
erasePreview();
|
||||||
myEditCurrentArgument->setText("");
|
myEditCurrentArgument->setText("");
|
||||||
if ( myEditCurrentArgument == GroupPoints->LineEdit1 ) myObject = GEOM::GEOM_Object::_nil();
|
// the second argument depends on the first one
|
||||||
else if ( myEditCurrentArgument == GroupPoints->LineEdit2 ) myWiresInd->length( 0 );
|
GroupPoints->LineEdit2->setText("");
|
||||||
|
myWiresInd->length(0);
|
||||||
|
|
||||||
|
if (myEditCurrentArgument == GroupPoints->LineEdit1)
|
||||||
|
myObject = GEOM::GEOM_Object::_nil();
|
||||||
|
|
||||||
LightApp_SelectionMgr* aSelMgr = myGeomGUI->getApp()->selectionMgr();
|
LightApp_SelectionMgr* aSelMgr = myGeomGUI->getApp()->selectionMgr();
|
||||||
SALOME_ListIO aSelList;
|
SALOME_ListIO aSelList;
|
||||||
@ -194,8 +186,18 @@ void RepairGUI_RemoveHolesDlg::SelectionIntoArgument()
|
|||||||
if (myEditCurrentArgument == GroupPoints->LineEdit1) { // face selection
|
if (myEditCurrentArgument == GroupPoints->LineEdit1) { // face selection
|
||||||
Standard_Boolean aRes;
|
Standard_Boolean aRes;
|
||||||
myObject = GEOMBase::ConvertIOinGEOMObject(anIO, aRes);
|
myObject = GEOMBase::ConvertIOinGEOMObject(anIO, aRes);
|
||||||
if ( aRes && GEOMBase::IsShape( myObject ) )
|
if (aRes && GEOMBase::IsShape(myObject)) {
|
||||||
myEditCurrentArgument->setText(GEOMBase::GetName(myObject));
|
myEditCurrentArgument->setText(GEOMBase::GetName(myObject));
|
||||||
|
|
||||||
|
// clear selection
|
||||||
|
disconnect(myGeomGUI->getApp()->selectionMgr(), 0, this, 0);
|
||||||
|
myGeomGUI->getApp()->selectionMgr()->clearSelected();
|
||||||
|
connect(myGeomGUI->getApp()->selectionMgr(), SIGNAL(currentSelectionChanged()),
|
||||||
|
this, SLOT(SelectionIntoArgument()));
|
||||||
|
|
||||||
|
if (!GroupPoints->CheckButton1->isChecked())
|
||||||
|
GroupPoints->PushButton2->click();
|
||||||
|
}
|
||||||
else
|
else
|
||||||
myObject = GEOM::GEOM_Object::_nil();
|
myObject = GEOM::GEOM_Object::_nil();
|
||||||
}
|
}
|
||||||
@ -219,18 +221,35 @@ void RepairGUI_RemoveHolesDlg::SelectionIntoArgument()
|
|||||||
//=================================================================================
|
//=================================================================================
|
||||||
void RepairGUI_RemoveHolesDlg::SetEditCurrentArgument()
|
void RepairGUI_RemoveHolesDlg::SetEditCurrentArgument()
|
||||||
{
|
{
|
||||||
const QObject* send = sender();
|
QPushButton* send = (QPushButton*)sender();
|
||||||
if ( send == GroupPoints->PushButton1 )
|
|
||||||
|
bool isEffective = false;
|
||||||
|
|
||||||
|
if (send == GroupPoints->PushButton1) {
|
||||||
|
isEffective = true;
|
||||||
myEditCurrentArgument = GroupPoints->LineEdit1;
|
myEditCurrentArgument = GroupPoints->LineEdit1;
|
||||||
else if ( send == GroupPoints->PushButton2 && !myObject->_is_nil() )
|
|
||||||
myEditCurrentArgument = GroupPoints->LineEdit2;
|
GroupPoints->PushButton2->setDown(false);
|
||||||
if ( myEditCurrentArgument ) {
|
GroupPoints->LineEdit2->setEnabled(false);
|
||||||
initSelection();
|
|
||||||
myEditCurrentArgument->setFocus();
|
|
||||||
SelectionIntoArgument();
|
|
||||||
}
|
}
|
||||||
|
else if (send == GroupPoints->PushButton2 && !myObject->_is_nil()) {
|
||||||
|
isEffective = true;
|
||||||
|
myEditCurrentArgument = GroupPoints->LineEdit2;
|
||||||
|
|
||||||
|
GroupPoints->PushButton1->setDown(false);
|
||||||
|
GroupPoints->LineEdit1->setEnabled(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (isEffective) {
|
||||||
|
initSelection();
|
||||||
|
|
||||||
|
// enable line edit
|
||||||
|
myEditCurrentArgument->setEnabled(true);
|
||||||
|
myEditCurrentArgument->setFocus();
|
||||||
|
// after setFocus(), because it will be setDown(false) when loses focus
|
||||||
|
send->setDown(true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
//=================================================================================
|
//=================================================================================
|
||||||
// function : LineEditReturnPressed()
|
// function : LineEditReturnPressed()
|
||||||
@ -245,7 +264,6 @@ void RepairGUI_RemoveHolesDlg::LineEditReturnPressed()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
//=================================================================================
|
//=================================================================================
|
||||||
// function : ActivateThisDialog()
|
// function : ActivateThisDialog()
|
||||||
// purpose :
|
// purpose :
|
||||||
@ -253,23 +271,11 @@ void RepairGUI_RemoveHolesDlg::LineEditReturnPressed()
|
|||||||
void RepairGUI_RemoveHolesDlg::ActivateThisDialog()
|
void RepairGUI_RemoveHolesDlg::ActivateThisDialog()
|
||||||
{
|
{
|
||||||
GEOMBase_Skeleton::ActivateThisDialog();
|
GEOMBase_Skeleton::ActivateThisDialog();
|
||||||
connect( ( (SalomeApp_Application*)( SUIT_Session::session()->activeApplication() ) )->selectionMgr(),
|
|
||||||
SIGNAL( currentSelectionChanged() ), this, SLOT( SelectionIntoArgument() ) );
|
|
||||||
|
|
||||||
myEditCurrentArgument = GroupPoints->LineEdit1;
|
// reinit, because some selected objects could be removed
|
||||||
myEditCurrentArgument->setText( "" );
|
Init();
|
||||||
GroupPoints->LineEdit2->setText( "" );
|
|
||||||
myObject = GEOM::GEOM_Object::_nil();
|
|
||||||
myWiresInd->length( 0 );
|
|
||||||
|
|
||||||
myClosed = -1;
|
|
||||||
myOpen = -1;
|
|
||||||
|
|
||||||
//myGeomGUI->SetState( 0 );
|
|
||||||
initSelection();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
//=================================================================================
|
//=================================================================================
|
||||||
// function : enterEvent()
|
// function : enterEvent()
|
||||||
// purpose : Mouse enter onto the dialog to activate it
|
// purpose : Mouse enter onto the dialog to activate it
|
||||||
@ -280,7 +286,6 @@ void RepairGUI_RemoveHolesDlg::enterEvent( QEvent* )
|
|||||||
ActivateThisDialog();
|
ActivateThisDialog();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
//=================================================================================
|
//=================================================================================
|
||||||
// function : createOperation
|
// function : createOperation
|
||||||
// purpose :
|
// purpose :
|
||||||
@ -307,10 +312,14 @@ bool RepairGUI_RemoveHolesDlg::isValid( QString& )
|
|||||||
bool RepairGUI_RemoveHolesDlg::execute (ObjectList& objects)
|
bool RepairGUI_RemoveHolesDlg::execute (ObjectList& objects)
|
||||||
{
|
{
|
||||||
bool aResult = false;
|
bool aResult = false;
|
||||||
if ( IsPreview() ) { // called from onDetect(): detect free boundary edges, highlight them (add to objects), display message dialog
|
|
||||||
|
if (IsPreview()) {
|
||||||
|
// called from onDetect(): detect free boundary edges,
|
||||||
|
// highlight them (add to objects), display message dialog
|
||||||
GEOM::ListOfGO_var aClosed, anOpen;
|
GEOM::ListOfGO_var aClosed, anOpen;
|
||||||
|
|
||||||
aResult = GEOM::GEOM_IHealingOperations::_narrow( getOperation() )->GetFreeBoundary( myObject, aClosed, anOpen );
|
aResult = GEOM::GEOM_IHealingOperations::_narrow(getOperation())->
|
||||||
|
GetFreeBoundary(myObject, aClosed, anOpen);
|
||||||
|
|
||||||
if (aResult) {
|
if (aResult) {
|
||||||
myClosed = aClosed->length();
|
myClosed = aClosed->length();
|
||||||
@ -325,7 +334,8 @@ bool RepairGUI_RemoveHolesDlg::execute( ObjectList& objects )
|
|||||||
myClosed = -1;
|
myClosed = -1;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
GEOM::GEOM_Object_var anObj = GEOM::GEOM_IHealingOperations::_narrow( getOperation() )->FillHoles( myObject, myWiresInd );
|
GEOM::GEOM_Object_var anObj = GEOM::GEOM_IHealingOperations::_narrow(getOperation())->
|
||||||
|
FillHoles(myObject, myWiresInd);
|
||||||
aResult = !anObj->_is_nil();
|
aResult = !anObj->_is_nil();
|
||||||
if (aResult)
|
if (aResult)
|
||||||
objects.push_back(anObj._retn());
|
objects.push_back(anObj._retn());
|
||||||
@ -356,6 +366,8 @@ void RepairGUI_RemoveHolesDlg::onRemoveAllClicked()
|
|||||||
//=================================================================================
|
//=================================================================================
|
||||||
void RepairGUI_RemoveHolesDlg::initSelection()
|
void RepairGUI_RemoveHolesDlg::initSelection()
|
||||||
{
|
{
|
||||||
|
disconnect(myGeomGUI->getApp()->selectionMgr(), 0, this, 0);
|
||||||
|
|
||||||
if (myEditCurrentArgument == GroupPoints->LineEdit1) {
|
if (myEditCurrentArgument == GroupPoints->LineEdit1) {
|
||||||
TColStd_MapOfInteger aTypes;
|
TColStd_MapOfInteger aTypes;
|
||||||
aTypes.Add(GEOM_COMPOUND);
|
aTypes.Add(GEOM_COMPOUND);
|
||||||
@ -369,8 +381,10 @@ void RepairGUI_RemoveHolesDlg::initSelection()
|
|||||||
localSelection(myObject, TopAbs_EDGE);
|
localSelection(myObject, TopAbs_EDGE);
|
||||||
localSelection(myObject, TopAbs_WIRE);
|
localSelection(myObject, TopAbs_WIRE);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
|
connect(myGeomGUI->getApp()->selectionMgr(), SIGNAL(currentSelectionChanged()),
|
||||||
|
this, SLOT(SelectionIntoArgument()));
|
||||||
|
}
|
||||||
|
|
||||||
//=================================================================================
|
//=================================================================================
|
||||||
// function : onDetect
|
// function : onDetect
|
||||||
@ -388,4 +402,3 @@ void RepairGUI_RemoveHolesDlg::onDetect()
|
|||||||
msg = tr("GEOM_FREE_BOUNDS_ERROR");
|
msg = tr("GEOM_FREE_BOUNDS_ERROR");
|
||||||
SUIT_MessageBox::information(this, tr("GEOM_FREE_BOUNDS_TLT"), msg);
|
SUIT_MessageBox::information(this, tr("GEOM_FREE_BOUNDS_TLT"), msg);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -29,17 +29,18 @@
|
|||||||
#include <GeometryGUI.h>
|
#include <GeometryGUI.h>
|
||||||
#include <GEOMBase.h>
|
#include <GEOMBase.h>
|
||||||
|
|
||||||
#include <SalomeApp_Application.h>
|
|
||||||
#include <LightApp_SelectionMgr.h>
|
|
||||||
#include <SUIT_Session.h>
|
#include <SUIT_Session.h>
|
||||||
#include <SUIT_ResourceMgr.h>
|
#include <SUIT_ResourceMgr.h>
|
||||||
|
#include <SalomeApp_Application.h>
|
||||||
|
#include <LightApp_SelectionMgr.h>
|
||||||
|
|
||||||
#include <GEOMImpl_Types.hxx>
|
// OCCT Includes
|
||||||
|
|
||||||
#include <TopAbs.hxx>
|
#include <TopAbs.hxx>
|
||||||
#include <TColStd_MapOfInteger.hxx>
|
#include <TColStd_MapOfInteger.hxx>
|
||||||
#include <TColStd_IndexedMapOfInteger.hxx>
|
#include <TColStd_IndexedMapOfInteger.hxx>
|
||||||
|
|
||||||
|
#include <GEOMImpl_Types.hxx>
|
||||||
|
|
||||||
//=================================================================================
|
//=================================================================================
|
||||||
// class : RepairGUI_RemoveIntWiresDlg()
|
// class : RepairGUI_RemoveIntWiresDlg()
|
||||||
// purpose : Constructs a RepairGUI_RemoveIntWiresDlg which is a child of 'parent', with the
|
// purpose : Constructs a RepairGUI_RemoveIntWiresDlg which is a child of 'parent', with the
|
||||||
@ -77,7 +78,6 @@ RepairGUI_RemoveIntWiresDlg::RepairGUI_RemoveIntWiresDlg( GeometryGUI* theGeomet
|
|||||||
QVBoxLayout* layout = new QVBoxLayout(centralWidget());
|
QVBoxLayout* layout = new QVBoxLayout(centralWidget());
|
||||||
layout->setMargin(0); layout->setSpacing(6);
|
layout->setMargin(0); layout->setSpacing(6);
|
||||||
layout->addWidget(GroupPoints);
|
layout->addWidget(GroupPoints);
|
||||||
|
|
||||||
/***************************************************************/
|
/***************************************************************/
|
||||||
|
|
||||||
setHelpFileName("suppress_internal_wires_operation_page.html");
|
setHelpFileName("suppress_internal_wires_operation_page.html");
|
||||||
@ -85,7 +85,6 @@ RepairGUI_RemoveIntWiresDlg::RepairGUI_RemoveIntWiresDlg( GeometryGUI* theGeomet
|
|||||||
Init();
|
Init();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
//=================================================================================
|
//=================================================================================
|
||||||
// function : ~RepairGUI_RemoveIntWiresDlg()
|
// function : ~RepairGUI_RemoveIntWiresDlg()
|
||||||
// purpose : Destroys the object and frees any allocated resources
|
// purpose : Destroys the object and frees any allocated resources
|
||||||
@ -94,40 +93,36 @@ RepairGUI_RemoveIntWiresDlg::~RepairGUI_RemoveIntWiresDlg()
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
//=================================================================================
|
//=================================================================================
|
||||||
// function : Init()
|
// function : Init()
|
||||||
// purpose :
|
// purpose :
|
||||||
//=================================================================================
|
//=================================================================================
|
||||||
void RepairGUI_RemoveIntWiresDlg::Init()
|
void RepairGUI_RemoveIntWiresDlg::Init()
|
||||||
{
|
{
|
||||||
/* init variables */
|
// init variables
|
||||||
myEditCurrentArgument = GroupPoints->LineEdit1;
|
GroupPoints->LineEdit1->clear();
|
||||||
|
GroupPoints->LineEdit2->clear();
|
||||||
myObject = GEOM::GEOM_Object::_nil();
|
myObject = GEOM::GEOM_Object::_nil();
|
||||||
myWiresInd = new GEOM::short_array();
|
myWiresInd = new GEOM::short_array();
|
||||||
myWiresInd->length(0);
|
myWiresInd->length(0);
|
||||||
|
|
||||||
//myGeomGUI->SetState( 0 );
|
// signals and slots connections
|
||||||
initSelection();
|
|
||||||
|
|
||||||
/* signals and slots connections */
|
|
||||||
connect(buttonOk(), SIGNAL(clicked()), this, SLOT(ClickOnOk()));
|
connect(buttonOk(), SIGNAL(clicked()), this, SLOT(ClickOnOk()));
|
||||||
connect(buttonApply(), SIGNAL(clicked()), this, SLOT(ClickOnApply()));
|
connect(buttonApply(), SIGNAL(clicked()), this, SLOT(ClickOnApply()));
|
||||||
|
|
||||||
connect(GroupPoints->PushButton1, SIGNAL(clicked()), this, SLOT(SetEditCurrentArgument()));
|
connect(GroupPoints->PushButton1, SIGNAL(clicked()), this, SLOT(SetEditCurrentArgument()));
|
||||||
connect(GroupPoints->PushButton2, SIGNAL(clicked()), this, SLOT(SetEditCurrentArgument()));
|
connect(GroupPoints->PushButton2, SIGNAL(clicked()), this, SLOT(SetEditCurrentArgument()));
|
||||||
|
|
||||||
connect(GroupPoints->LineEdit1, SIGNAL(returnPressed()), this, SLOT(LineEditReturnPressed()));
|
connect(GroupPoints->LineEdit1, SIGNAL(returnPressed()), this, SLOT(LineEditReturnPressed()));
|
||||||
connect(GroupPoints->LineEdit2, SIGNAL(returnPressed()), this, SLOT(LineEditReturnPressed()));
|
connect(GroupPoints->LineEdit2, SIGNAL(returnPressed()), this, SLOT(LineEditReturnPressed()));
|
||||||
|
|
||||||
connect( ( (SalomeApp_Application*)( SUIT_Session::session()->activeApplication() ) )->selectionMgr(),
|
|
||||||
SIGNAL( currentSelectionChanged() ), this, SLOT( SelectionIntoArgument() ) );
|
|
||||||
|
|
||||||
connect(GroupPoints->CheckButton1, SIGNAL(clicked()), this, SLOT(onRemoveAllClicked()));
|
connect(GroupPoints->CheckButton1, SIGNAL(clicked()), this, SLOT(onRemoveAllClicked()));
|
||||||
|
|
||||||
initName(tr("REMOVE_INT_WIRES_NEW_OBJ_NAME"));
|
initName(tr("REMOVE_INT_WIRES_NEW_OBJ_NAME"));
|
||||||
}
|
|
||||||
|
|
||||||
|
GroupPoints->PushButton1->click();
|
||||||
|
SelectionIntoArgument();
|
||||||
|
}
|
||||||
|
|
||||||
//=================================================================================
|
//=================================================================================
|
||||||
// function : ClickOnOk()
|
// function : ClickOnOk()
|
||||||
@ -149,28 +144,24 @@ bool RepairGUI_RemoveIntWiresDlg::ClickOnApply()
|
|||||||
return false;
|
return false;
|
||||||
|
|
||||||
initName();
|
initName();
|
||||||
|
// activate first line edit
|
||||||
myEditCurrentArgument = GroupPoints->LineEdit1;
|
GroupPoints->PushButton1->click();
|
||||||
myEditCurrentArgument->setText( "" );
|
|
||||||
GroupPoints->LineEdit2->setText( "" );
|
|
||||||
myObject = GEOM::GEOM_Object::_nil();
|
|
||||||
myWiresInd->length( 0 );
|
|
||||||
|
|
||||||
initSelection();
|
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
//=================================================================================
|
//=================================================================================
|
||||||
// function : SelectionIntoArgument()
|
// function : SelectionIntoArgument()
|
||||||
// purpose : Called when selection
|
// purpose : Called when selection is changed or on dialog initialization or activation
|
||||||
//=================================================================================
|
//=================================================================================
|
||||||
void RepairGUI_RemoveIntWiresDlg::SelectionIntoArgument()
|
void RepairGUI_RemoveIntWiresDlg::SelectionIntoArgument()
|
||||||
{
|
{
|
||||||
myEditCurrentArgument->setText("");
|
myEditCurrentArgument->setText("");
|
||||||
if ( myEditCurrentArgument == GroupPoints->LineEdit1 ) myObject = GEOM::GEOM_Object::_nil();
|
// the second argument depends on the first one
|
||||||
else if ( myEditCurrentArgument == GroupPoints->LineEdit2 ) myWiresInd->length( 0 );
|
GroupPoints->LineEdit2->setText("");
|
||||||
|
myWiresInd->length(0);
|
||||||
|
|
||||||
|
if (myEditCurrentArgument == GroupPoints->LineEdit1)
|
||||||
|
myObject = GEOM::GEOM_Object::_nil();
|
||||||
|
|
||||||
LightApp_SelectionMgr* aSelMgr = myGeomGUI->getApp()->selectionMgr();
|
LightApp_SelectionMgr* aSelMgr = myGeomGUI->getApp()->selectionMgr();
|
||||||
SALOME_ListIO aSelList;
|
SALOME_ListIO aSelList;
|
||||||
@ -182,8 +173,18 @@ void RepairGUI_RemoveIntWiresDlg::SelectionIntoArgument()
|
|||||||
if (myEditCurrentArgument == GroupPoints->LineEdit1) { // face selection
|
if (myEditCurrentArgument == GroupPoints->LineEdit1) { // face selection
|
||||||
Standard_Boolean aRes;
|
Standard_Boolean aRes;
|
||||||
myObject = GEOMBase::ConvertIOinGEOMObject(anIO, aRes);
|
myObject = GEOMBase::ConvertIOinGEOMObject(anIO, aRes);
|
||||||
if ( aRes && GEOMBase::IsShape( myObject ) )
|
if (aRes && GEOMBase::IsShape(myObject)) {
|
||||||
myEditCurrentArgument->setText(GEOMBase::GetName(myObject));
|
myEditCurrentArgument->setText(GEOMBase::GetName(myObject));
|
||||||
|
|
||||||
|
// clear selection
|
||||||
|
disconnect(myGeomGUI->getApp()->selectionMgr(), 0, this, 0);
|
||||||
|
myGeomGUI->getApp()->selectionMgr()->clearSelected();
|
||||||
|
connect(myGeomGUI->getApp()->selectionMgr(), SIGNAL(currentSelectionChanged()),
|
||||||
|
this, SLOT(SelectionIntoArgument()));
|
||||||
|
|
||||||
|
if (!GroupPoints->CheckButton1->isChecked())
|
||||||
|
GroupPoints->PushButton2->click();
|
||||||
|
}
|
||||||
else
|
else
|
||||||
myObject = GEOM::GEOM_Object::_nil();
|
myObject = GEOM::GEOM_Object::_nil();
|
||||||
}
|
}
|
||||||
@ -207,19 +208,35 @@ void RepairGUI_RemoveIntWiresDlg::SelectionIntoArgument()
|
|||||||
//=================================================================================
|
//=================================================================================
|
||||||
void RepairGUI_RemoveIntWiresDlg::SetEditCurrentArgument()
|
void RepairGUI_RemoveIntWiresDlg::SetEditCurrentArgument()
|
||||||
{
|
{
|
||||||
const QObject* send = sender();
|
QPushButton* send = (QPushButton*)sender();
|
||||||
if ( send == GroupPoints->PushButton1 )
|
|
||||||
|
bool isEffective = false;
|
||||||
|
|
||||||
|
if (send == GroupPoints->PushButton1) {
|
||||||
|
isEffective = true;
|
||||||
myEditCurrentArgument = GroupPoints->LineEdit1;
|
myEditCurrentArgument = GroupPoints->LineEdit1;
|
||||||
else if ( send == GroupPoints->PushButton2 && !myObject->_is_nil() )
|
|
||||||
|
GroupPoints->PushButton2->setDown(false);
|
||||||
|
GroupPoints->LineEdit2->setEnabled(false);
|
||||||
|
}
|
||||||
|
else if (send == GroupPoints->PushButton2 && !myObject->_is_nil()) {
|
||||||
|
isEffective = true;
|
||||||
myEditCurrentArgument = GroupPoints->LineEdit2;
|
myEditCurrentArgument = GroupPoints->LineEdit2;
|
||||||
|
|
||||||
if ( myEditCurrentArgument ) {
|
GroupPoints->PushButton1->setDown(false);
|
||||||
initSelection();
|
GroupPoints->LineEdit1->setEnabled(false);
|
||||||
myEditCurrentArgument->setFocus();
|
|
||||||
SelectionIntoArgument();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (isEffective) {
|
||||||
|
initSelection();
|
||||||
|
|
||||||
|
// enable line edit
|
||||||
|
myEditCurrentArgument->setEnabled(true);
|
||||||
|
myEditCurrentArgument->setFocus();
|
||||||
|
// after setFocus(), because it will be setDown(false) when loses focus
|
||||||
|
send->setDown(true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
//=================================================================================
|
//=================================================================================
|
||||||
// function : LineEditReturnPressed()
|
// function : LineEditReturnPressed()
|
||||||
@ -234,7 +251,6 @@ void RepairGUI_RemoveIntWiresDlg::LineEditReturnPressed()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
//=================================================================================
|
//=================================================================================
|
||||||
// function : ActivateThisDialog()
|
// function : ActivateThisDialog()
|
||||||
// purpose :
|
// purpose :
|
||||||
@ -242,17 +258,9 @@ void RepairGUI_RemoveIntWiresDlg::LineEditReturnPressed()
|
|||||||
void RepairGUI_RemoveIntWiresDlg::ActivateThisDialog()
|
void RepairGUI_RemoveIntWiresDlg::ActivateThisDialog()
|
||||||
{
|
{
|
||||||
GEOMBase_Skeleton::ActivateThisDialog();
|
GEOMBase_Skeleton::ActivateThisDialog();
|
||||||
connect( ( (SalomeApp_Application*)( SUIT_Session::session()->activeApplication() ) )->selectionMgr(),
|
|
||||||
SIGNAL( currentSelectionChanged() ), this, SLOT( SelectionIntoArgument() ) );
|
|
||||||
|
|
||||||
myEditCurrentArgument = GroupPoints->LineEdit1;
|
// reinit, because some selected objects could be removed
|
||||||
myEditCurrentArgument->setText( "" );
|
Init();
|
||||||
GroupPoints->LineEdit2->setText( "" );
|
|
||||||
myObject = GEOM::GEOM_Object::_nil();
|
|
||||||
myWiresInd->length( 0 );
|
|
||||||
|
|
||||||
//myGeomGUI->SetState( 0 );
|
|
||||||
initSelection();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//=================================================================================
|
//=================================================================================
|
||||||
@ -291,6 +299,7 @@ bool RepairGUI_RemoveIntWiresDlg::execute( ObjectList& objects )
|
|||||||
{
|
{
|
||||||
GEOM::GEOM_Object_var anObj = GEOM::GEOM_IHealingOperations::_narrow(getOperation())->
|
GEOM::GEOM_Object_var anObj = GEOM::GEOM_IHealingOperations::_narrow(getOperation())->
|
||||||
RemoveIntWires(myObject, myWiresInd);
|
RemoveIntWires(myObject, myWiresInd);
|
||||||
|
|
||||||
bool aResult = !anObj->_is_nil();
|
bool aResult = !anObj->_is_nil();
|
||||||
if (aResult)
|
if (aResult)
|
||||||
objects.push_back(anObj._retn());
|
objects.push_back(anObj._retn());
|
||||||
@ -320,6 +329,8 @@ void RepairGUI_RemoveIntWiresDlg::onRemoveAllClicked()
|
|||||||
//=================================================================================
|
//=================================================================================
|
||||||
void RepairGUI_RemoveIntWiresDlg::initSelection()
|
void RepairGUI_RemoveIntWiresDlg::initSelection()
|
||||||
{
|
{
|
||||||
|
disconnect(myGeomGUI->getApp()->selectionMgr(), 0, this, 0);
|
||||||
|
|
||||||
if (myEditCurrentArgument == GroupPoints->LineEdit1) {
|
if (myEditCurrentArgument == GroupPoints->LineEdit1) {
|
||||||
TColStd_MapOfInteger aTypes;
|
TColStd_MapOfInteger aTypes;
|
||||||
aTypes.Add(GEOM_COMPOUND);
|
aTypes.Add(GEOM_COMPOUND);
|
||||||
@ -333,4 +344,7 @@ void RepairGUI_RemoveIntWiresDlg::initSelection()
|
|||||||
//localSelection(myObject, TopAbs_EDGE);
|
//localSelection(myObject, TopAbs_EDGE);
|
||||||
localSelection(myObject, TopAbs_WIRE);
|
localSelection(myObject, TopAbs_WIRE);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
connect(myGeomGUI->getApp()->selectionMgr(), SIGNAL(currentSelectionChanged()),
|
||||||
|
this, SLOT(SelectionIntoArgument()));
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user