NPAL18363: EDF635: We can now select any object in all window.

This commit is contained in:
jfa 2007-12-19 13:36:08 +00:00
parent 582aab65e3
commit 156fe6ad40
5 changed files with 274 additions and 246 deletions

View File

@ -152,27 +152,27 @@ void PrimitiveGUI_BoxDlg::Init()
connect(myGeomGUI, SIGNAL(SignalDefaultStepValueChanged(double)), GroupDimensions->SpinBox_DY, SLOT(SetStep(double)));
connect(myGeomGUI, SIGNAL(SignalDefaultStepValueChanged(double)), GroupDimensions->SpinBox_DZ, SLOT(SetStep(double)));
connect(((SalomeApp_Application*)(SUIT_Session::session()->activeApplication()))->selectionMgr(),
connect(myGeomGUI->getApp()->selectionMgr(),
SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument()));
initName( tr( "GEOM_BOX" ) );
ConstructorsClicked(0);
}
//=================================================================================
// function : ConstructorsClicked()
// purpose : Radio button management
//=================================================================================
void PrimitiveGUI_BoxDlg::ConstructorsClicked(int constructorId)
{
disconnect(((SalomeApp_Application*)(SUIT_Session::session()->activeApplication()))->selectionMgr(), 0, this, 0);
disconnect(myGeomGUI->getApp()->selectionMgr(), 0, this, 0);
switch (constructorId)
{
case 0:
{
// globalSelection( GEOM_POINT );
globalSelection(); // close local contexts, if any
localSelection( GEOM::GEOM_Object::_nil(), TopAbs_VERTEX );
GroupDimensions->hide();
@ -184,7 +184,7 @@ void PrimitiveGUI_BoxDlg::ConstructorsClicked(int constructorId)
GroupPoints->LineEdit2->setText("");
myPoint1 = myPoint2 = GEOM::GEOM_Object::_nil();
connect(((SalomeApp_Application*)(SUIT_Session::session()->activeApplication()))->selectionMgr(),
connect(myGeomGUI->getApp()->selectionMgr(),
SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument()));
break;
}
@ -200,7 +200,6 @@ void PrimitiveGUI_BoxDlg::ConstructorsClicked(int constructorId)
displayPreview();
}
//=================================================================================
// function : ClickOnOk()
// purpose :
@ -211,7 +210,6 @@ void PrimitiveGUI_BoxDlg::ClickOnOk()
ClickOnCancel();
}
//=================================================================================
// function : ClickOnApply()
// purpose :
@ -226,7 +224,6 @@ bool PrimitiveGUI_BoxDlg::ClickOnApply()
return true;
}
//=================================================================================
// function : SelectionIntoArgument()
// purpose : Called when selection as changed
@ -261,14 +258,21 @@ void PrimitiveGUI_BoxDlg::SelectionIntoArgument()
LightApp_SelectionMgr* aSelMgr = myGeomGUI->getApp()->selectionMgr();
TColStd_IndexedMapOfInteger aMap;
aSelMgr->GetIndexes(firstIObject(), aMap);
if ( aMap.Extent() == 1 )
if (aMap.Extent() == 1) // Local Selection
{
GEOM::GEOM_IShapesOperations_var aShapesOp =
getGeomEngine()->GetIShapesOperations( getStudyId() );
int anIndex = aMap( 1 );
aName.append( ":vertex_" + QString::number( anIndex ) );
aSelectedObject = aShapesOp->GetSubShape(aSelectedObject, anIndex);
aSelMgr->clearSelected();
aSelMgr->clearSelected(); // ???
}
else // Global Selection
{
if (aShape.ShapeType() != TopAbs_VERTEX) {
aSelectedObject = GEOM::GEOM_Object::_nil();
aName = "";
}
}
}
@ -282,7 +286,6 @@ void PrimitiveGUI_BoxDlg::SelectionIntoArgument()
displayPreview();
}
//=================================================================================
// function : SetEditCurrentArgument()
// purpose :
@ -297,13 +300,13 @@ void PrimitiveGUI_BoxDlg::SetEditCurrentArgument()
myEditCurrentArgument = GroupPoints->LineEdit2;
// globalSelection( GEOM_POINT );
globalSelection(); // close local contexts, if any
localSelection( GEOM::GEOM_Object::_nil(), TopAbs_VERTEX );
myEditCurrentArgument->setFocus();
SelectionIntoArgument();
}
//=================================================================================
// function : LineEditReturnPressed()
// purpose :
@ -326,8 +329,8 @@ void PrimitiveGUI_BoxDlg::LineEditReturnPressed()
void PrimitiveGUI_BoxDlg::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()));
ConstructorsClicked( getConstructorId() );
}

View File

@ -166,7 +166,7 @@ void PrimitiveGUI_ConeDlg::Init()
connect(myGeomGUI, SIGNAL(SignalDefaultStepValueChanged(double)), GroupDimensions->SpinBox_DY, SLOT(SetStep(double)));
connect(myGeomGUI, SIGNAL(SignalDefaultStepValueChanged(double)), GroupDimensions->SpinBox_DZ, SLOT(SetStep(double)));
connect(((SalomeApp_Application*)(SUIT_Session::session()->activeApplication()))->selectionMgr(),
connect(myGeomGUI->getApp()->selectionMgr(),
SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument())) ;
initName( tr( "GEOM_CONE" ) );
@ -180,13 +180,14 @@ void PrimitiveGUI_ConeDlg::Init()
//=================================================================================
void PrimitiveGUI_ConeDlg::ConstructorsClicked(int constructorId)
{
disconnect(((SalomeApp_Application*)(SUIT_Session::session()->activeApplication()))->selectionMgr(), 0, this, 0);
disconnect(myGeomGUI->getApp()->selectionMgr(), 0, this, 0);
switch(constructorId)
{
case 0 :
{
// globalSelection( GEOM_POINT );
globalSelection(); // to break prvious local selection
localSelection(GEOM::GEOM_Object::_nil(), TopAbs_VERTEX);
GroupDimensions->hide();
resize(0, 0);
@ -197,7 +198,7 @@ void PrimitiveGUI_ConeDlg::ConstructorsClicked(int constructorId)
GroupPoints->LineEdit2->setText(tr(""));
myPoint = myDir = GEOM::GEOM_Object::_nil();
connect(((SalomeApp_Application*)(SUIT_Session::session()->activeApplication()))->selectionMgr(),
connect(myGeomGUI->getApp()->selectionMgr(),
SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument()));
break;
}
@ -280,6 +281,10 @@ void PrimitiveGUI_ConeDlg::SelectionIntoArgument()
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( firstIObject(), aMap );
@ -288,14 +293,24 @@ void PrimitiveGUI_ConeDlg::SelectionIntoArgument()
GEOM::GEOM_IShapesOperations_var aShapesOp =
getGeomEngine()->GetIShapesOperations(getStudyId());
int anIndex = aMap(1);
if ( myEditCurrentArgument == GroupPoints->LineEdit2 )
aSelectedObject = aShapesOp->GetSubShape(aSelectedObject, anIndex);
aSelMgr->clearSelected(); // ???
if (aNeedType == TopAbs_EDGE)
aName.append(":edge_" + QString::number(anIndex));
else
aName.append(":vertex_" + QString::number(anIndex));
aSelectedObject = aShapesOp->GetSubShape(aSelectedObject, anIndex);
aSelMgr->clearSelected();
}
else
{
if (aShape.ShapeType() != aNeedType) {
aSelectedObject = GEOM::GEOM_Object::_nil();
aName = "";
}
}
}
myEditCurrentArgument->setText(aName);
if (myEditCurrentArgument == GroupPoints->LineEdit1)
@ -306,7 +321,6 @@ void PrimitiveGUI_ConeDlg::SelectionIntoArgument()
displayPreview();
}
//=================================================================================
// function : SetEditCurrentArgument()
// purpose :
@ -346,7 +360,6 @@ void PrimitiveGUI_ConeDlg::LineEditReturnPressed()
}
}
//=================================================================================
// function : ActivateThisDialog()
// purpose :
@ -354,13 +367,12 @@ void PrimitiveGUI_ConeDlg::LineEditReturnPressed()
void PrimitiveGUI_ConeDlg::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()));
ConstructorsClicked(getConstructorId());
}
//=================================================================================
// function : DeactivateActiveDialog()
// purpose : public slot to deactivate if active

View File

@ -159,7 +159,7 @@ void PrimitiveGUI_CylinderDlg::Init()
connect(myGeomGUI, SIGNAL(SignalDefaultStepValueChanged(double)), GroupDimensions->SpinBox_DX, SLOT(SetStep(double)));
connect(myGeomGUI, SIGNAL(SignalDefaultStepValueChanged(double)), GroupDimensions->SpinBox_DY, SLOT(SetStep(double)));
connect(((SalomeApp_Application*)(SUIT_Session::session()->activeApplication()))->selectionMgr(),
connect(myGeomGUI->getApp()->selectionMgr(),
SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument())) ;
initName( tr( "GEOM_CYLINDER" ) );
@ -173,13 +173,13 @@ void PrimitiveGUI_CylinderDlg::Init()
//=================================================================================
void PrimitiveGUI_CylinderDlg::ConstructorsClicked(int constructorId)
{
disconnect(((SalomeApp_Application*)(SUIT_Session::session()->activeApplication()))->selectionMgr(), 0, this, 0);
disconnect(myGeomGUI->getApp()->selectionMgr(), 0, this, 0);
switch (constructorId)
{
case 0 :
{
// globalSelection( GEOM_POINT );
globalSelection( GEOM_POINT ); // to break previous local selection
localSelection( GEOM::GEOM_Object::_nil(), TopAbs_VERTEX );
GroupDimensions->hide();
@ -191,7 +191,7 @@ void PrimitiveGUI_CylinderDlg::ConstructorsClicked(int constructorId)
GroupPoints->LineEdit2->setText(tr(""));
myPoint = myDir = GEOM::GEOM_Object::_nil();
connect(((SalomeApp_Application*)(SUIT_Session::session()->activeApplication()))->selectionMgr(),
connect(myGeomGUI->getApp()->selectionMgr(),
SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument()));
break;
}
@ -275,22 +275,35 @@ void PrimitiveGUI_CylinderDlg::SelectionIntoArgument()
TopoDS_Shape aShape;
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(firstIObject(), aMap);
if ( aMap.Extent() == 1 )
if (aMap.Extent() == 1) // Local Selection
{
GEOM::GEOM_IShapesOperations_var aShapesOp =
getGeomEngine()->GetIShapesOperations(getStudyId());
int anIndex = aMap(1);
if ( myEditCurrentArgument == GroupPoints->LineEdit2 )
aSelectedObject = aShapesOp->GetSubShape(aSelectedObject, anIndex);
aSelMgr->clearSelected(); // ???
if (aNeedType == TopAbs_EDGE)
aName.append(":edge_" + QString::number(anIndex));
else
aName.append(":vertex_" + QString::number(anIndex));
aSelectedObject = aShapesOp->GetSubShape(aSelectedObject, anIndex);
aSelMgr->clearSelected();
}
else // Global Selection
{
if (aShape.ShapeType() != aNeedType) {
aSelectedObject = GEOM::GEOM_Object::_nil();
aName = "";
}
}
}
myEditCurrentArgument->setText(aName);
if (myEditCurrentArgument == GroupPoints->LineEdit1)
@ -300,7 +313,6 @@ void PrimitiveGUI_CylinderDlg::SelectionIntoArgument()
displayPreview();
}
//=================================================================================
// function : SetEditCurrentArgument()
// purpose :
@ -340,7 +352,6 @@ void PrimitiveGUI_CylinderDlg::LineEditReturnPressed()
}
}
//=================================================================================
// function : ActivateThisDialog()
// purpose :
@ -348,13 +359,12 @@ void PrimitiveGUI_CylinderDlg::LineEditReturnPressed()
void PrimitiveGUI_CylinderDlg::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()));
ConstructorsClicked(getConstructorId());
}
//=================================================================================
// function : enterEvent()
// purpose :
@ -464,7 +474,6 @@ double PrimitiveGUI_CylinderDlg::getRadius() const
return 0;
}
//=================================================================================
// function : getHeight()
// purpose :

View File

@ -90,7 +90,6 @@ PrimitiveGUI_SphereDlg::PrimitiveGUI_SphereDlg(GeometryGUI* theGeometryGUI, QWid
Init();
}
//=================================================================================
// function : ~PrimitiveGUI_SphereDlg()
// purpose : Destroys the object and frees any allocated resources
@ -100,7 +99,6 @@ PrimitiveGUI_SphereDlg::~PrimitiveGUI_SphereDlg()
/* no need to delete child widgets, Qt does it all for us */
}
//=================================================================================
// function : Init()
// purpose :
@ -134,29 +132,31 @@ void PrimitiveGUI_SphereDlg::Init()
connect(GroupDimensions->SpinBox_DX, SIGNAL(valueChanged(double)), this, SLOT(ValueChangedInSpinBox()));
connect(GroupPoints->SpinBox_DX, SIGNAL(valueChanged(double)), this, SLOT(ValueChangedInSpinBox()));
connect(myGeomGUI, SIGNAL(SignalDefaultStepValueChanged(double)), GroupPoints->SpinBox_DX, SLOT(SetStep(double)));
connect(myGeomGUI, SIGNAL(SignalDefaultStepValueChanged(double)), GroupDimensions->SpinBox_DX, SLOT(SetStep(double)));
connect(myGeomGUI, SIGNAL(SignalDefaultStepValueChanged(double)),
GroupPoints->SpinBox_DX, SLOT(SetStep(double)));
connect(myGeomGUI, SIGNAL(SignalDefaultStepValueChanged(double)),
GroupDimensions->SpinBox_DX, SLOT(SetStep(double)));
connect(((SalomeApp_Application*)(SUIT_Session::session()->activeApplication()))->selectionMgr(),
SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument()));
connect(myGeomGUI->getApp()->selectionMgr(), SIGNAL(currentSelectionChanged()),
this, SLOT(SelectionIntoArgument()));
initName(tr("GEOM_SPHERE"));
ConstructorsClicked(0);
}
//=================================================================================
// function : ConstructorsClicked()
// purpose : Radio button management
//=================================================================================
void PrimitiveGUI_SphereDlg::ConstructorsClicked (int constructorId)
{
disconnect(((SalomeApp_Application*)(SUIT_Session::session()->activeApplication()))->selectionMgr(), 0, this, 0);
disconnect(myGeomGUI->getApp()->selectionMgr(), 0, this, 0);
switch (constructorId)
{
case 0:
{
globalSelection(); // close local contexts, if any
localSelection( GEOM::GEOM_Object::_nil(), TopAbs_VERTEX );
GroupDimensions->hide();
resize(0, 0);
@ -166,7 +166,7 @@ void PrimitiveGUI_SphereDlg::ConstructorsClicked(int constructorId)
GroupPoints->LineEdit1->setText("");
myPoint = GEOM::GEOM_Object::_nil();
connect(((SalomeApp_Application*)(SUIT_Session::session()->activeApplication()))->selectionMgr(),
connect(myGeomGUI->getApp()->selectionMgr(),
SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument()));
break;
}
@ -182,7 +182,6 @@ void PrimitiveGUI_SphereDlg::ConstructorsClicked(int constructorId)
displayPreview();
}
//=================================================================================
// function : ClickOnOk()
// purpose :
@ -193,7 +192,6 @@ void PrimitiveGUI_SphereDlg::ClickOnOk()
ClickOnCancel();
}
//=================================================================================
// function : ClickOnApply()
// purpose :
@ -208,18 +206,15 @@ bool PrimitiveGUI_SphereDlg::ClickOnApply()
return true;
}
//=======================================================================
//=================================================================================
// function : ClickOnCancel()
// purpose :
//=======================================================================
//=================================================================================
void PrimitiveGUI_SphereDlg::ClickOnCancel()
{
GEOMBase_Skeleton::ClickOnCancel();
}
//=================================================================================
// function : SelectionIntoArgument()
// purpose : Called when selection as changed or other case
@ -251,14 +246,22 @@ void PrimitiveGUI_SphereDlg::SelectionIntoArgument()
LightApp_SelectionMgr* aSelMgr = myGeomGUI->getApp()->selectionMgr();
TColStd_IndexedMapOfInteger aMap;
aSelMgr->GetIndexes(firstIObject(), aMap);
if ( aMap.Extent() == 1 )
if (aMap.Extent() == 1) // Local Selection
{
GEOM::GEOM_IShapesOperations_var aShapesOp =
getGeomEngine()->GetIShapesOperations( getStudyId() );
int anIndex = aMap( 1 );
aName.append( ":vertex_" + QString::number( anIndex ) );
aSelectedObject = aShapesOp->GetSubShape(aSelectedObject, anIndex);
aSelMgr->clearSelected();
aName.append( ":vertex_" + QString::number( anIndex ) );
}
else // Global Selection
{
if (aShape.ShapeType() != TopAbs_VERTEX) {
aSelectedObject = GEOM::GEOM_Object::_nil();
aName = "";
}
}
}
@ -268,7 +271,6 @@ void PrimitiveGUI_SphereDlg::SelectionIntoArgument()
displayPreview();
}
//=================================================================================
// function : LineEditReturnPressed()
// purpose :
@ -283,7 +285,6 @@ void PrimitiveGUI_SphereDlg::LineEditReturnPressed()
}
}
//=================================================================================
// function : SetEditCurrentArgument()
// purpose :
@ -295,12 +296,12 @@ void PrimitiveGUI_SphereDlg::SetEditCurrentArgument()
if (send == GroupPoints->PushButton1) {
GroupPoints->LineEdit1->setFocus();
myEditCurrentArgument = GroupPoints->LineEdit1;
globalSelection(); // close local contexts, if any
localSelection( GEOM::GEOM_Object::_nil(), TopAbs_VERTEX );
SelectionIntoArgument();
}
}
//=================================================================================
// function : ActivateThisDialog()
// purpose :
@ -308,13 +309,12 @@ void PrimitiveGUI_SphereDlg::SetEditCurrentArgument()
void PrimitiveGUI_SphereDlg::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()));
ConstructorsClicked(getConstructorId());
}
//=================================================================================
// function : DeactivateActiveDialog()
// purpose : public slot to deactivate if active
@ -324,7 +324,6 @@ void PrimitiveGUI_SphereDlg::DeactivateActiveDialog()
GEOMBase_Skeleton::DeactivateActiveDialog();
}
//=================================================================================
// function : enterEvent()
// purpose :
@ -335,7 +334,6 @@ void PrimitiveGUI_SphereDlg::enterEvent(QEvent* e)
ActivateThisDialog();
}
//=================================================================================
// function : ValueChangedInSpinBox()
// purpose :
@ -345,7 +343,6 @@ void PrimitiveGUI_SphereDlg::ValueChangedInSpinBox()
displayPreview();
}
//=================================================================================
// function : createOperation
// purpose :
@ -355,7 +352,6 @@ GEOM::GEOM_IOperations_ptr PrimitiveGUI_SphereDlg::createOperation()
return getGeomEngine()->GetI3DPrimOperations( getStudyId() );
}
//=================================================================================
// function : isValid
// purpose :
@ -380,14 +376,16 @@ bool PrimitiveGUI_SphereDlg::execute( ObjectList& objects )
case 0:
{
if (!CORBA::is_nil(myPoint)) {
anObj = GEOM::GEOM_I3DPrimOperations::_narrow( getOperation() )->MakeSpherePntR( myPoint, getRadius() );
anObj = GEOM::GEOM_I3DPrimOperations::_narrow( getOperation() )->
MakeSpherePntR(myPoint, getRadius());
res = true;
}
break;
}
case 1:
{
anObj = GEOM::GEOM_I3DPrimOperations::_narrow( getOperation() )->MakeSphereR( getRadius() );
anObj = GEOM::GEOM_I3DPrimOperations::_narrow( getOperation() )->
MakeSphereR(getRadius());
res = true;
break;
}
@ -405,12 +403,9 @@ bool PrimitiveGUI_SphereDlg::execute( ObjectList& objects )
//=================================================================================
void PrimitiveGUI_SphereDlg::closeEvent( QCloseEvent* e )
{
//myGeomGUI->SetState( -1 );
GEOMBase_Skeleton::closeEvent( e );
}
//=================================================================================
// function : getRadius()
// purpose :

View File

@ -159,14 +159,13 @@ void PrimitiveGUI_TorusDlg::Init()
connect(myGeomGUI, SIGNAL(SignalDefaultStepValueChanged(double)),
GroupDimensions->SpinBox_DY, SLOT(SetStep(double)));
connect(myGeomGUI->getApp()->selectionMgr(),
SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument()));
connect(myGeomGUI->getApp()->selectionMgr(), SIGNAL(currentSelectionChanged()),
this, SLOT(SelectionIntoArgument()));
initName( tr( "GEOM_TORUS" ) );
ConstructorsClicked(0);
}
//=================================================================================
// function : ConstructorsClicked()
// purpose : Radio button management
@ -179,6 +178,7 @@ void PrimitiveGUI_TorusDlg::ConstructorsClicked(int constructorId)
{
case 0:
{
globalSelection(); // close local contexts, if any
localSelection(GEOM::GEOM_Object::_nil(), TopAbs_VERTEX);
GroupDimensions->hide();
@ -266,22 +266,36 @@ void PrimitiveGUI_TorusDlg::SelectionIntoArgument()
TopoDS_Shape aShape;
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(firstIObject(), aMap);
if ( aMap.Extent() == 1 )
if (aMap.Extent() == 1) // Local Selection
{
GEOM::GEOM_IShapesOperations_var aShapesOp =
getGeomEngine()->GetIShapesOperations( getStudyId() );
int anIndex = aMap(1);
if ( myEditCurrentArgument == GroupPoints->LineEdit2 )
aSelectedObject = aShapesOp->GetSubShape(aSelectedObject, anIndex);
aSelMgr->clearSelected();
if (aNeedType == TopAbs_EDGE)
aName.append(":edge_" + QString::number(anIndex));
else
aName.append(":vertex_" + QString::number(anIndex));
aSelectedObject = aShapesOp->GetSubShape(aSelectedObject, anIndex);
aSelMgr->clearSelected();
}
else // Global Selection
{
if (aShape.ShapeType() != aNeedType) {
aSelectedObject = GEOM::GEOM_Object::_nil();
aName = "";
}
}
}
myEditCurrentArgument->setText(aName);
if (myEditCurrentArgument == GroupPoints->LineEdit1)
@ -292,7 +306,6 @@ void PrimitiveGUI_TorusDlg::SelectionIntoArgument()
displayPreview();
}
//=================================================================================
// function : LineEditReturnPressed()
// purpose :
@ -378,7 +391,6 @@ GEOM::GEOM_IOperations_ptr PrimitiveGUI_TorusDlg::createOperation()
return getGeomEngine()->GetI3DPrimOperations( getStudyId() );
}
//=================================================================================
// function : isValid
// purpose :
@ -388,7 +400,6 @@ bool PrimitiveGUI_TorusDlg::isValid( QString& msg )
return getConstructorId() == 0 ? !(myPoint->_is_nil() || myDir->_is_nil()) : true;
}
//=================================================================================
// function : execute
// purpose :
@ -426,7 +437,6 @@ bool PrimitiveGUI_TorusDlg::execute( ObjectList& objects )
return res;
}
//=================================================================================
// function : getRadius1()
// purpose :
@ -441,7 +451,6 @@ double PrimitiveGUI_TorusDlg::getRadius1() const
return 0;
}
//=================================================================================
// function : getRadius2()
// purpose :