mirror of
https://git.salome-platform.org/gitpub/modules/geom.git
synced 2025-01-01 04:10:34 +05:00
Remove some methods of GEOMBase_Helper (IObjectCount(), firstIObject(), lastIObject(), selectObjects()) to prevent incorrect usage of selection manager (time loss on multiple calls to method selected()).
This commit is contained in:
parent
0f6567722e
commit
8b5f1c1915
@ -215,7 +215,12 @@ void BasicGUI_ArcDlg::SelectionIntoArgument()
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
myEditCurrentArgument->setText( "" );
|
myEditCurrentArgument->setText( "" );
|
||||||
if ( IObjectCount() != 1 ) {
|
|
||||||
|
LightApp_SelectionMgr* aSelMgr = myGeomGUI->getApp()->selectionMgr();
|
||||||
|
SALOME_ListIO aSelList;
|
||||||
|
aSelMgr->selectedObjects(aSelList);
|
||||||
|
|
||||||
|
if (aSelList.Extent() != 1) {
|
||||||
switch (getConstructorId()) {
|
switch (getConstructorId()) {
|
||||||
case 0:
|
case 0:
|
||||||
if ( myEditCurrentArgument == Group3Pnts->LineEdit1 ) myPoint1 = GEOM::GEOM_Object::_nil();
|
if ( myEditCurrentArgument == Group3Pnts->LineEdit1 ) myPoint1 = GEOM::GEOM_Object::_nil();
|
||||||
@ -233,7 +238,7 @@ void BasicGUI_ArcDlg::SelectionIntoArgument()
|
|||||||
}
|
}
|
||||||
// nbSel == 1
|
// nbSel == 1
|
||||||
Standard_Boolean aRes = Standard_False;
|
Standard_Boolean aRes = Standard_False;
|
||||||
GEOM::GEOM_Object_var aSelectedObject = GEOMBase::ConvertIOinGEOMObject( firstIObject(), aRes );
|
GEOM::GEOM_Object_var aSelectedObject = GEOMBase::ConvertIOinGEOMObject(aSelList.First(), aRes);
|
||||||
if ( !CORBA::is_nil( aSelectedObject ) && aRes ) {
|
if ( !CORBA::is_nil( aSelectedObject ) && aRes ) {
|
||||||
QString aName = GEOMBase::GetName(aSelectedObject);
|
QString aName = GEOMBase::GetName(aSelectedObject);
|
||||||
|
|
||||||
@ -241,9 +246,8 @@ void BasicGUI_ArcDlg::SelectionIntoArgument()
|
|||||||
TopoDS_Shape aShape;
|
TopoDS_Shape aShape;
|
||||||
if (GEOMBase::GetShape(aSelectedObject, aShape, TopAbs_SHAPE) && !aShape.IsNull())
|
if (GEOMBase::GetShape(aSelectedObject, aShape, TopAbs_SHAPE) && !aShape.IsNull())
|
||||||
{
|
{
|
||||||
LightApp_SelectionMgr* aSelMgr = myGeomGUI->getApp()->selectionMgr();
|
|
||||||
TColStd_IndexedMapOfInteger aMap;
|
TColStd_IndexedMapOfInteger aMap;
|
||||||
aSelMgr->GetIndexes(firstIObject(), aMap);
|
aSelMgr->GetIndexes(aSelList.First(), aMap);
|
||||||
if (aMap.Extent() == 1) // Local Selection
|
if (aMap.Extent() == 1) // Local Selection
|
||||||
{
|
{
|
||||||
int anIndex = aMap(1);
|
int anIndex = aMap(1);
|
||||||
|
@ -261,14 +261,7 @@ void BasicGUI_CurveDlg::SelectionIntoArgument()
|
|||||||
|
|
||||||
Standard_Boolean aRes = Standard_False;
|
Standard_Boolean aRes = Standard_False;
|
||||||
|
|
||||||
int IOC = IObjectCount();
|
SalomeApp_Application* app = myGeomGUI->getApp();
|
||||||
// bool is_append = myPoints->length() < IOC; // if true - add point, else remove
|
|
||||||
// myPoints->length( IOC ); // this length may be greater than number of objects,
|
|
||||||
// that will actually be put into myPoints
|
|
||||||
|
|
||||||
LightApp_SelectionMgr* aSelMgr = myGeomGUI->getApp()->selectionMgr();
|
|
||||||
SalomeApp_Application* app =
|
|
||||||
dynamic_cast< SalomeApp_Application* >( SUIT_Session::session()->activeApplication() );
|
|
||||||
SalomeApp_Study* appStudy = dynamic_cast<SalomeApp_Study*>(app->activeStudy());
|
SalomeApp_Study* appStudy = dynamic_cast<SalomeApp_Study*>(app->activeStudy());
|
||||||
_PTR(Study) aDStudy = appStudy->studyDS();
|
_PTR(Study) aDStudy = appStudy->studyDS();
|
||||||
GEOM::GEOM_IShapesOperations_var aShapesOp = getGeomEngine()->GetIShapesOperations(getStudyId());
|
GEOM::GEOM_IShapesOperations_var aShapesOp = getGeomEngine()->GetIShapesOperations(getStudyId());
|
||||||
@ -278,9 +271,15 @@ void BasicGUI_CurveDlg::SelectionIntoArgument()
|
|||||||
TColStd_IndexedMapOfInteger aMapIndexes;
|
TColStd_IndexedMapOfInteger aMapIndexes;
|
||||||
GEOM::GEOM_Object_var anObject;
|
GEOM::GEOM_Object_var anObject;
|
||||||
std::list<GEOM::GEOM_Object_var> aList;
|
std::list<GEOM::GEOM_Object_var> aList;
|
||||||
|
LightApp_SelectionMgr* aSelMgr = app->selectionMgr();
|
||||||
SALOME_ListIO selected;
|
SALOME_ListIO selected;
|
||||||
aSelMgr->selectedObjects(selected, QString::null, false);
|
aSelMgr->selectedObjects(selected, QString::null, false);
|
||||||
|
|
||||||
|
int IOC = selected.Extent();
|
||||||
|
// bool is_append = myPoints->length() < IOC; // if true - add point, else remove
|
||||||
|
// myPoints->length( IOC ); // this length may be greater than number of objects,
|
||||||
|
// that will actually be put into myPoints
|
||||||
|
|
||||||
for (SALOME_ListIteratorOfListIO anIt (selected); anIt.More(); anIt.Next()) {
|
for (SALOME_ListIteratorOfListIO anIt (selected); anIt.More(); anIt.Next()) {
|
||||||
GEOM::GEOM_Object_var aSelectedObject = GEOMBase::ConvertIOinGEOMObject(anIt.Value(), aRes);
|
GEOM::GEOM_Object_var aSelectedObject = GEOMBase::ConvertIOinGEOMObject(anIt.Value(), aRes);
|
||||||
if (!CORBA::is_nil(aSelectedObject) && aRes) {
|
if (!CORBA::is_nil(aSelectedObject) && aRes) {
|
||||||
|
@ -211,15 +211,19 @@ void BasicGUI_EllipseDlg::SelectionIntoArgument()
|
|||||||
{
|
{
|
||||||
myEditCurrentArgument->setText( "" );
|
myEditCurrentArgument->setText( "" );
|
||||||
|
|
||||||
if ( IObjectCount() != 1 ) {
|
LightApp_SelectionMgr* aSelMgr = myGeomGUI->getApp()->selectionMgr();
|
||||||
|
SALOME_ListIO aSelList;
|
||||||
|
aSelMgr->selectedObjects(aSelList);
|
||||||
|
|
||||||
|
if (aSelList.Extent() != 1) {
|
||||||
if (myEditCurrentArgument == GroupPoints->LineEdit1) myPoint = GEOM::GEOM_Object::_nil();
|
if (myEditCurrentArgument == GroupPoints->LineEdit1) myPoint = GEOM::GEOM_Object::_nil();
|
||||||
else if (myEditCurrentArgument == GroupPoints->LineEdit2) myDir = GEOM::GEOM_Object::_nil();
|
else if (myEditCurrentArgument == GroupPoints->LineEdit2) myDir = GEOM::GEOM_Object::_nil();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
Standard_Boolean aRes = Standard_False;
|
Standard_Boolean aRes = Standard_False;
|
||||||
Handle(SALOME_InteractiveObject) anIO = firstIObject();
|
Handle(SALOME_InteractiveObject) anIO = aSelList.First();
|
||||||
GEOM::GEOM_Object_var aSelectedObject = GEOMBase::ConvertIOinGEOMObject( firstIObject(), aRes );
|
GEOM::GEOM_Object_var aSelectedObject = GEOMBase::ConvertIOinGEOMObject(anIO, aRes);
|
||||||
if (!CORBA::is_nil(aSelectedObject) && aRes) {
|
if (!CORBA::is_nil(aSelectedObject) && aRes) {
|
||||||
QString aName = GEOMBase::GetName(aSelectedObject);
|
QString aName = GEOMBase::GetName(aSelectedObject);
|
||||||
|
|
||||||
@ -231,7 +235,6 @@ void BasicGUI_EllipseDlg::SelectionIntoArgument()
|
|||||||
aNeedType = TopAbs_EDGE;
|
aNeedType = TopAbs_EDGE;
|
||||||
|
|
||||||
if ( GEOMBase::GetShape( aSelectedObject, aShape, TopAbs_SHAPE ) && !aShape.IsNull() ) {
|
if ( GEOMBase::GetShape( aSelectedObject, aShape, TopAbs_SHAPE ) && !aShape.IsNull() ) {
|
||||||
LightApp_SelectionMgr* aSelMgr = myGeomGUI->getApp()->selectionMgr();
|
|
||||||
TColStd_IndexedMapOfInteger aMap;
|
TColStd_IndexedMapOfInteger aMap;
|
||||||
aSelMgr->GetIndexes(anIO, aMap);
|
aSelMgr->GetIndexes(anIO, aMap);
|
||||||
if (aMap.Extent() == 1) {
|
if (aMap.Extent() == 1) {
|
||||||
|
@ -239,7 +239,11 @@ void BasicGUI_LineDlg::SelectionIntoArgument()
|
|||||||
{
|
{
|
||||||
myEditCurrentArgument->setText( "" );
|
myEditCurrentArgument->setText( "" );
|
||||||
|
|
||||||
if ( IObjectCount() != 1 ) {
|
LightApp_SelectionMgr* aSelMgr = myGeomGUI->getApp()->selectionMgr();
|
||||||
|
SALOME_ListIO aSelList;
|
||||||
|
aSelMgr->selectedObjects(aSelList);
|
||||||
|
|
||||||
|
if (aSelList.Extent() != 1) {
|
||||||
if (myEditCurrentArgument == GroupPoints->LineEdit1) myPoint1 = GEOM::GEOM_Object::_nil();
|
if (myEditCurrentArgument == GroupPoints->LineEdit1) myPoint1 = GEOM::GEOM_Object::_nil();
|
||||||
else if (myEditCurrentArgument == GroupPoints->LineEdit2) myPoint2 = GEOM::GEOM_Object::_nil();
|
else if (myEditCurrentArgument == GroupPoints->LineEdit2) myPoint2 = GEOM::GEOM_Object::_nil();
|
||||||
else if (myEditCurrentArgument == GroupFaces->LineEdit1) myFace1 = GEOM::GEOM_Object::_nil();
|
else if (myEditCurrentArgument == GroupFaces->LineEdit1) myFace1 = GEOM::GEOM_Object::_nil();
|
||||||
@ -249,7 +253,7 @@ void BasicGUI_LineDlg::SelectionIntoArgument()
|
|||||||
}
|
}
|
||||||
|
|
||||||
Standard_Boolean aRes = Standard_False;
|
Standard_Boolean aRes = Standard_False;
|
||||||
GEOM::GEOM_Object_var aSelectedObject = GEOMBase::ConvertIOinGEOMObject( firstIObject(), aRes );
|
GEOM::GEOM_Object_var aSelectedObject = GEOMBase::ConvertIOinGEOMObject(aSelList.First(), aRes);
|
||||||
if ( !CORBA::is_nil( aSelectedObject ) && aRes ) {
|
if ( !CORBA::is_nil( aSelectedObject ) && aRes ) {
|
||||||
QString aName = GEOMBase::GetName( aSelectedObject );
|
QString aName = GEOMBase::GetName( aSelectedObject );
|
||||||
TopAbs_ShapeEnum aNeedType = TopAbs_VERTEX;
|
TopAbs_ShapeEnum aNeedType = TopAbs_VERTEX;
|
||||||
@ -259,9 +263,8 @@ void BasicGUI_LineDlg::SelectionIntoArgument()
|
|||||||
|
|
||||||
TopoDS_Shape aShape;
|
TopoDS_Shape aShape;
|
||||||
if ( GEOMBase::GetShape( aSelectedObject, aShape, TopAbs_SHAPE ) && !aShape.IsNull() ) {
|
if ( GEOMBase::GetShape( aSelectedObject, aShape, TopAbs_SHAPE ) && !aShape.IsNull() ) {
|
||||||
LightApp_SelectionMgr* aSelMgr = myGeomGUI->getApp()->selectionMgr();
|
|
||||||
TColStd_IndexedMapOfInteger aMap;
|
TColStd_IndexedMapOfInteger aMap;
|
||||||
aSelMgr->GetIndexes( firstIObject(), aMap );
|
aSelMgr->GetIndexes(aSelList.First(), aMap);
|
||||||
if ( aMap.Extent() == 1 ) { // Local Selection
|
if ( aMap.Extent() == 1 ) { // Local Selection
|
||||||
int anIndex = aMap( 1 );
|
int anIndex = aMap( 1 );
|
||||||
if ( aNeedType == TopAbs_FACE )
|
if ( aNeedType == TopAbs_FACE )
|
||||||
|
@ -339,12 +339,14 @@ bool BasicGUI_MarkerDlg::onApply()
|
|||||||
//=================================================================================
|
//=================================================================================
|
||||||
void BasicGUI_MarkerDlg::onSelectionDone0()
|
void BasicGUI_MarkerDlg::onSelectionDone0()
|
||||||
{
|
{
|
||||||
if ( IObjectCount() == 1 ) {
|
|
||||||
Standard_Boolean aRes = Standard_False;
|
|
||||||
Handle(SALOME_InteractiveObject) anIO = firstIObject();
|
|
||||||
GEOM::GEOM_Object_var aSelectedObj = GEOMBase::ConvertIOinGEOMObject( anIO, aRes );
|
|
||||||
|
|
||||||
LightApp_SelectionMgr* aSelMgr = myGeomGUI->getApp()->selectionMgr();
|
LightApp_SelectionMgr* aSelMgr = myGeomGUI->getApp()->selectionMgr();
|
||||||
|
SALOME_ListIO aSelList;
|
||||||
|
aSelMgr->selectedObjects(aSelList);
|
||||||
|
|
||||||
|
if (aSelList.Extent() == 1) {
|
||||||
|
Standard_Boolean aRes = Standard_False;
|
||||||
|
Handle(SALOME_InteractiveObject) anIO = aSelList.First();
|
||||||
|
GEOM::GEOM_Object_var aSelectedObj = GEOMBase::ConvertIOinGEOMObject(anIO, aRes);
|
||||||
|
|
||||||
if ( aRes && !aSelectedObj->_is_nil() ) {
|
if ( aRes && !aSelectedObj->_is_nil() ) {
|
||||||
TopoDS_Shape aShape;
|
TopoDS_Shape aShape;
|
||||||
@ -413,9 +415,13 @@ void BasicGUI_MarkerDlg::onSelectionDone()
|
|||||||
|
|
||||||
myEditCurrentArgument->setText( "" );
|
myEditCurrentArgument->setText( "" );
|
||||||
|
|
||||||
if ( IObjectCount() == 1 ) {
|
LightApp_SelectionMgr* aSelMgr = myGeomGUI->getApp()->selectionMgr();
|
||||||
|
SALOME_ListIO aSelList;
|
||||||
|
aSelMgr->selectedObjects(aSelList);
|
||||||
|
|
||||||
|
if (aSelList.Extent() == 1) {
|
||||||
Standard_Boolean aRes = Standard_False;
|
Standard_Boolean aRes = Standard_False;
|
||||||
Handle(SALOME_InteractiveObject) anIO = firstIObject();
|
Handle(SALOME_InteractiveObject) anIO = aSelList.First();
|
||||||
GEOM::GEOM_Object_var aSelectedObj = GEOMBase::ConvertIOinGEOMObject( anIO, aRes );
|
GEOM::GEOM_Object_var aSelectedObj = GEOMBase::ConvertIOinGEOMObject( anIO, aRes );
|
||||||
|
|
||||||
if ( !CORBA::is_nil( aSelectedObj ) && aRes ) {
|
if ( !CORBA::is_nil( aSelectedObj ) && aRes ) {
|
||||||
@ -465,7 +471,6 @@ void BasicGUI_MarkerDlg::onSelectionDone()
|
|||||||
aNeedType = TopAbs_VERTEX;
|
aNeedType = TopAbs_VERTEX;
|
||||||
|
|
||||||
TColStd_IndexedMapOfInteger aMap;
|
TColStd_IndexedMapOfInteger aMap;
|
||||||
LightApp_SelectionMgr* aSelMgr = myGeomGUI->getApp()->selectionMgr();
|
|
||||||
aSelMgr->GetIndexes( anIO, aMap );
|
aSelMgr->GetIndexes( anIO, aMap );
|
||||||
|
|
||||||
if ( !aMap.IsEmpty() ) {
|
if ( !aMap.IsEmpty() ) {
|
||||||
|
@ -320,7 +320,11 @@ void BasicGUI_PlaneDlg::SelectionIntoArgument()
|
|||||||
{
|
{
|
||||||
myEditCurrentArgument->setText("");
|
myEditCurrentArgument->setText("");
|
||||||
|
|
||||||
if ( IObjectCount() != 1 ) {
|
LightApp_SelectionMgr* aSelMgr = myGeomGUI->getApp()->selectionMgr();
|
||||||
|
SALOME_ListIO aSelList;
|
||||||
|
aSelMgr->selectedObjects(aSelList);
|
||||||
|
|
||||||
|
if (aSelList.Extent() != 1) {
|
||||||
if ( myEditCurrentArgument == GroupPntDir->LineEdit1 ) myPoint = GEOM::GEOM_Object::_nil();
|
if ( myEditCurrentArgument == GroupPntDir->LineEdit1 ) myPoint = GEOM::GEOM_Object::_nil();
|
||||||
else if ( myEditCurrentArgument == GroupPntDir->LineEdit2 ) myDir = GEOM::GEOM_Object::_nil();
|
else if ( myEditCurrentArgument == GroupPntDir->LineEdit2 ) myDir = GEOM::GEOM_Object::_nil();
|
||||||
else if ( myEditCurrentArgument == Group3Pnts->LineEdit1 ) myPoint1 = GEOM::GEOM_Object::_nil();
|
else if ( myEditCurrentArgument == Group3Pnts->LineEdit1 ) myPoint1 = GEOM::GEOM_Object::_nil();
|
||||||
@ -332,7 +336,7 @@ void BasicGUI_PlaneDlg::SelectionIntoArgument()
|
|||||||
|
|
||||||
// nbSel == 1
|
// nbSel == 1
|
||||||
Standard_Boolean aRes = Standard_False;
|
Standard_Boolean aRes = Standard_False;
|
||||||
GEOM::GEOM_Object_var aSelectedObject = GEOMBase::ConvertIOinGEOMObject( firstIObject(), aRes );
|
GEOM::GEOM_Object_var aSelectedObject = GEOMBase::ConvertIOinGEOMObject(aSelList.First(), aRes);
|
||||||
if ( !CORBA::is_nil( aSelectedObject ) && aRes ) {
|
if ( !CORBA::is_nil( aSelectedObject ) && aRes ) {
|
||||||
QString aName = GEOMBase::GetName( aSelectedObject );
|
QString aName = GEOMBase::GetName( aSelectedObject );
|
||||||
TopAbs_ShapeEnum aNeedType = TopAbs_VERTEX;
|
TopAbs_ShapeEnum aNeedType = TopAbs_VERTEX;
|
||||||
@ -341,9 +345,8 @@ void BasicGUI_PlaneDlg::SelectionIntoArgument()
|
|||||||
|
|
||||||
TopoDS_Shape aShape;
|
TopoDS_Shape aShape;
|
||||||
if ( GEOMBase::GetShape( aSelectedObject, aShape, TopAbs_SHAPE ) && !aShape.IsNull() ) {
|
if ( GEOMBase::GetShape( aSelectedObject, aShape, TopAbs_SHAPE ) && !aShape.IsNull() ) {
|
||||||
LightApp_SelectionMgr* aSelMgr = myGeomGUI->getApp()->selectionMgr();
|
|
||||||
TColStd_IndexedMapOfInteger aMap;
|
TColStd_IndexedMapOfInteger aMap;
|
||||||
aSelMgr->GetIndexes( firstIObject(), aMap );
|
aSelMgr->GetIndexes(aSelList.First(), aMap);
|
||||||
if ( aMap.Extent() == 1 ) { // Local Selection
|
if ( aMap.Extent() == 1 ) { // Local Selection
|
||||||
int anIndex = aMap( 1 );
|
int anIndex = aMap( 1 );
|
||||||
if ( aNeedType == TopAbs_EDGE )
|
if ( aNeedType == TopAbs_EDGE )
|
||||||
|
@ -429,9 +429,13 @@ void BasicGUI_PointDlg::SelectionIntoArgument()
|
|||||||
myRefPoint = myEdge = myFace = GEOM::GEOM_Object::_nil();
|
myRefPoint = myEdge = myFace = GEOM::GEOM_Object::_nil();
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( IObjectCount() == 1 ) {
|
LightApp_SelectionMgr* aSelMgr = myGeomGUI->getApp()->selectionMgr();
|
||||||
|
SALOME_ListIO aSelList;
|
||||||
|
aSelMgr->selectedObjects(aSelList);
|
||||||
|
|
||||||
|
if (aSelList.Extent() == 1) {
|
||||||
Standard_Boolean aRes = Standard_False;
|
Standard_Boolean aRes = Standard_False;
|
||||||
Handle(SALOME_InteractiveObject) anIO = firstIObject();
|
Handle(SALOME_InteractiveObject) anIO = aSelList.First();
|
||||||
GEOM::GEOM_Object_var aSelectedObject = GEOMBase::ConvertIOinGEOMObject( anIO, aRes );
|
GEOM::GEOM_Object_var aSelectedObject = GEOMBase::ConvertIOinGEOMObject( anIO, aRes );
|
||||||
if ( !CORBA::is_nil( aSelectedObject ) && aRes ) {
|
if ( !CORBA::is_nil( aSelectedObject ) && aRes ) {
|
||||||
QString aName = GEOMBase::GetName(aSelectedObject);
|
QString aName = GEOMBase::GetName(aSelectedObject);
|
||||||
@ -444,9 +448,8 @@ void BasicGUI_PointDlg::SelectionIntoArgument()
|
|||||||
else if ( id == 4 )
|
else if ( id == 4 )
|
||||||
aNeedType = TopAbs_FACE;
|
aNeedType = TopAbs_FACE;
|
||||||
|
|
||||||
LightApp_SelectionMgr* aSelMgr = myGeomGUI->getApp()->selectionMgr();
|
|
||||||
TColStd_IndexedMapOfInteger aMap;
|
TColStd_IndexedMapOfInteger aMap;
|
||||||
aSelMgr->GetIndexes(firstIObject(), aMap);
|
aSelMgr->GetIndexes(anIO, aMap);
|
||||||
if ( aMap.Extent() == 1 ) { // Local Selection
|
if ( aMap.Extent() == 1 ) { // Local Selection
|
||||||
int anIndex = aMap( 1 );
|
int anIndex = aMap( 1 );
|
||||||
if ( aNeedType == TopAbs_EDGE )
|
if ( aNeedType == TopAbs_EDGE )
|
||||||
@ -458,7 +461,8 @@ void BasicGUI_PointDlg::SelectionIntoArgument()
|
|||||||
GEOM::GEOM_Object_var aFindedObject = GEOMBase_Helper::findObjectInFather(aSelectedObject, aName);
|
GEOM::GEOM_Object_var aFindedObject = GEOMBase_Helper::findObjectInFather(aSelectedObject, aName);
|
||||||
|
|
||||||
if ( aFindedObject == GEOM::GEOM_Object::_nil() ) { // Object not found in study
|
if ( aFindedObject == GEOM::GEOM_Object::_nil() ) { // Object not found in study
|
||||||
GEOM::GEOM_IShapesOperations_var aShapesOp = getGeomEngine()->GetIShapesOperations( getStudyId() );
|
GEOM::GEOM_IShapesOperations_var aShapesOp =
|
||||||
|
getGeomEngine()->GetIShapesOperations(getStudyId());
|
||||||
aSelectedObject = aShapesOp->GetSubShape(aSelectedObject, anIndex);
|
aSelectedObject = aShapesOp->GetSubShape(aSelectedObject, anIndex);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
@ -271,7 +271,11 @@ void BasicGUI_VectorDlg::SelectionIntoArgument()
|
|||||||
{
|
{
|
||||||
myEditCurrentArgument->setText( "" );
|
myEditCurrentArgument->setText( "" );
|
||||||
|
|
||||||
if ( IObjectCount() != 1 ) {
|
LightApp_SelectionMgr* aSelMgr = myGeomGUI->getApp()->selectionMgr();
|
||||||
|
SALOME_ListIO aSelList;
|
||||||
|
aSelMgr->selectedObjects(aSelList);
|
||||||
|
|
||||||
|
if (aSelList.Extent() != 1) {
|
||||||
if (myEditCurrentArgument == GroupPoints->LineEdit1)
|
if (myEditCurrentArgument == GroupPoints->LineEdit1)
|
||||||
myPoint1 = GEOM::GEOM_Object::_nil();
|
myPoint1 = GEOM::GEOM_Object::_nil();
|
||||||
else if (myEditCurrentArgument == GroupPoints->LineEdit2)
|
else if (myEditCurrentArgument == GroupPoints->LineEdit2)
|
||||||
@ -281,15 +285,14 @@ void BasicGUI_VectorDlg::SelectionIntoArgument()
|
|||||||
|
|
||||||
// nbSel == 1
|
// nbSel == 1
|
||||||
Standard_Boolean aRes = Standard_False;
|
Standard_Boolean aRes = Standard_False;
|
||||||
GEOM::GEOM_Object_var aSelectedObject = GEOMBase::ConvertIOinGEOMObject( firstIObject(), aRes );
|
GEOM::GEOM_Object_var aSelectedObject = GEOMBase::ConvertIOinGEOMObject(aSelList.First(), aRes);
|
||||||
if (!CORBA::is_nil(aSelectedObject) && aRes) {
|
if (!CORBA::is_nil(aSelectedObject) && aRes) {
|
||||||
QString aName = GEOMBase::GetName(aSelectedObject);
|
QString aName = GEOMBase::GetName(aSelectedObject);
|
||||||
|
|
||||||
TopoDS_Shape aShape;
|
TopoDS_Shape aShape;
|
||||||
if (GEOMBase::GetShape(aSelectedObject, aShape, TopAbs_SHAPE) && !aShape.IsNull()) {
|
if (GEOMBase::GetShape(aSelectedObject, aShape, TopAbs_SHAPE) && !aShape.IsNull()) {
|
||||||
LightApp_SelectionMgr* aSelMgr = myGeomGUI->getApp()->selectionMgr();
|
|
||||||
TColStd_IndexedMapOfInteger aMap;
|
TColStd_IndexedMapOfInteger aMap;
|
||||||
aSelMgr->GetIndexes( firstIObject(), aMap );
|
aSelMgr->GetIndexes(aSelList.First(), aMap);
|
||||||
if (aMap.Extent() == 1) { // Local Selection
|
if (aMap.Extent() == 1) { // Local Selection
|
||||||
int anIndex = aMap(1);
|
int anIndex = aMap(1);
|
||||||
aName += QString(":vertex_%1").arg(anIndex);
|
aName += QString(":vertex_%1").arg(anIndex);
|
||||||
@ -335,7 +338,6 @@ void BasicGUI_VectorDlg::SelectionIntoArgument()
|
|||||||
displayPreview();
|
displayPreview();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
//=================================================================================
|
//=================================================================================
|
||||||
// function : SetEditCurrentArgument()
|
// function : SetEditCurrentArgument()
|
||||||
// purpose :
|
// purpose :
|
||||||
|
@ -293,8 +293,12 @@ void BasicGUI_WorkingPlaneDlg::SelectionIntoArgument()
|
|||||||
myEditCurrentArgument->setText( "" );
|
myEditCurrentArgument->setText( "" );
|
||||||
QString aName;
|
QString aName;
|
||||||
|
|
||||||
|
LightApp_SelectionMgr* aSelMgr = myGeomGUI->getApp()->selectionMgr();
|
||||||
|
SALOME_ListIO aSelList;
|
||||||
|
aSelMgr->selectedObjects(aSelList);
|
||||||
|
|
||||||
const int id = getConstructorId();
|
const int id = getConstructorId();
|
||||||
if ( IObjectCount() != 1 ) {
|
if (aSelList.Extent() != 1) {
|
||||||
if ( id == 0 )
|
if ( id == 0 )
|
||||||
myFace = GEOM::GEOM_Object::_nil();
|
myFace = GEOM::GEOM_Object::_nil();
|
||||||
else if ( id == 1 ) {
|
else if ( id == 1 ) {
|
||||||
@ -308,7 +312,7 @@ void BasicGUI_WorkingPlaneDlg::SelectionIntoArgument()
|
|||||||
|
|
||||||
// nbSel == 1
|
// nbSel == 1
|
||||||
Standard_Boolean aRes = Standard_False;
|
Standard_Boolean aRes = Standard_False;
|
||||||
GEOM::GEOM_Object_var aSelectedObject = GEOMBase::ConvertIOinGEOMObject( firstIObject(), aRes );
|
GEOM::GEOM_Object_var aSelectedObject = GEOMBase::ConvertIOinGEOMObject(aSelList.First(), aRes);
|
||||||
|
|
||||||
if ( !aRes || CORBA::is_nil( aSelectedObject ) )
|
if ( !aRes || CORBA::is_nil( aSelectedObject ) )
|
||||||
return;
|
return;
|
||||||
@ -322,9 +326,8 @@ void BasicGUI_WorkingPlaneDlg::SelectionIntoArgument()
|
|||||||
if ( aRes && !aSelectedObject->_is_nil() ) {
|
if ( aRes && !aSelectedObject->_is_nil() ) {
|
||||||
TopoDS_Shape aShape;
|
TopoDS_Shape aShape;
|
||||||
if ( GEOMBase::GetShape( aSelectedObject, aShape, TopAbs_SHAPE ) && !aShape.IsNull() ) {
|
if ( GEOMBase::GetShape( aSelectedObject, aShape, TopAbs_SHAPE ) && !aShape.IsNull() ) {
|
||||||
LightApp_SelectionMgr* aSelMgr = myGeomGUI->getApp()->selectionMgr();
|
|
||||||
TColStd_IndexedMapOfInteger aMap;
|
TColStd_IndexedMapOfInteger aMap;
|
||||||
aSelMgr->GetIndexes( firstIObject(), aMap );
|
aSelMgr->GetIndexes(aSelList.First(), aMap);
|
||||||
if ( aMap.Extent() == 1 ) {
|
if ( aMap.Extent() == 1 ) {
|
||||||
int anIndex = aMap( 1 );
|
int anIndex = aMap( 1 );
|
||||||
aName = aName + ":edge_" + QString::number( anIndex );
|
aName = aName + ":edge_" + QString::number( anIndex );
|
||||||
|
@ -206,10 +206,13 @@ void BlocksGUI_ExplodeDlg::SelectionIntoArgument()
|
|||||||
myObject = GEOM::GEOM_Object::_nil();
|
myObject = GEOM::GEOM_Object::_nil();
|
||||||
myGrp1->LineEdit1->setText("");
|
myGrp1->LineEdit1->setText("");
|
||||||
|
|
||||||
if ( IObjectCount() == 1 ) {
|
LightApp_SelectionMgr* aSelMgr = myGeomGUI->getApp()->selectionMgr();
|
||||||
|
SALOME_ListIO aSelList;
|
||||||
|
aSelMgr->selectedObjects(aSelList);
|
||||||
|
|
||||||
|
if (aSelList.Extent() == 1) {
|
||||||
Standard_Boolean aResult = Standard_False;
|
Standard_Boolean aResult = Standard_False;
|
||||||
GEOM::GEOM_Object_var anObj =
|
GEOM::GEOM_Object_var anObj = GEOMBase::ConvertIOinGEOMObject(aSelList.First(), aResult);
|
||||||
GEOMBase::ConvertIOinGEOMObject( firstIObject(), aResult );
|
|
||||||
|
|
||||||
if (aResult && !anObj->_is_nil() && GEOMBase::IsShape(anObj)) {
|
if (aResult && !anObj->_is_nil() && GEOMBase::IsShape(anObj)) {
|
||||||
myObject = anObj;
|
myObject = anObj;
|
||||||
@ -367,10 +370,16 @@ bool BlocksGUI_ExplodeDlg::isValid( QString& )
|
|||||||
bool ok = false;
|
bool ok = false;
|
||||||
switch ( getConstructorId() ) {
|
switch ( getConstructorId() ) {
|
||||||
case 0:
|
case 0:
|
||||||
if ( IsPreview() )
|
if ( IsPreview() ) {
|
||||||
ok = !myObject->_is_nil();
|
ok = !myObject->_is_nil();
|
||||||
else
|
}
|
||||||
ok = !myObject->_is_nil() && ( isAllSubShapes() || IObjectCount() );
|
else {
|
||||||
|
LightApp_SelectionMgr* aSelMgr = myGeomGUI->getApp()->selectionMgr();
|
||||||
|
SALOME_ListIO aSelList;
|
||||||
|
aSelMgr->selectedObjects(aSelList);
|
||||||
|
|
||||||
|
ok = !myObject->_is_nil() && (isAllSubShapes() || aSelList.Extent());
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
@ -416,26 +425,30 @@ bool BlocksGUI_ExplodeDlg::execute( ObjectList& objects )
|
|||||||
if ( !isAllSubShapes() ) {
|
if ( !isAllSubShapes() ) {
|
||||||
QMap<QString, char> selected;
|
QMap<QString, char> selected;
|
||||||
|
|
||||||
|
LightApp_SelectionMgr* aSelMgr = myGeomGUI->getApp()->selectionMgr();
|
||||||
|
SALOME_ListIO aSelList;
|
||||||
|
aSelMgr->selectedObjects(aSelList);
|
||||||
|
|
||||||
// Get names of selected objects
|
// Get names of selected objects
|
||||||
SALOME_ListIteratorOfListIO it ( selectedIO() );
|
SALOME_ListIteratorOfListIO it (aSelList);
|
||||||
for ( ; it.More(); it.Next() ) {
|
for ( ; it.More(); it.Next() ) {
|
||||||
selected.insert( it.Value()->getName(), 0 );
|
selected.insert( it.Value()->getName(), 0 );
|
||||||
}
|
}
|
||||||
|
|
||||||
// Iterate through result and select objects with names from selection
|
// Iterate through result and select objects with names from selection
|
||||||
ObjectList toRemoveFromEnggine;
|
ObjectList toRemoveFromEngine;
|
||||||
ObjectList::iterator anIter;
|
ObjectList::iterator anIter;
|
||||||
for ( anIter = myTmpObjs.begin(); anIter != myTmpObjs.end(); ++anIter ) {
|
for ( anIter = myTmpObjs.begin(); anIter != myTmpObjs.end(); ++anIter ) {
|
||||||
CORBA::String_var objStr = myGeomGUI->getApp()->orb()->object_to_string( *anIter );
|
CORBA::String_var objStr = myGeomGUI->getApp()->orb()->object_to_string( *anIter );
|
||||||
if ( selected.contains( QString( objStr.in() ) ) )
|
if ( selected.contains( QString( objStr.in() ) ) )
|
||||||
objects.push_back( *anIter );
|
objects.push_back( *anIter );
|
||||||
else
|
else
|
||||||
toRemoveFromEnggine.push_back( *anIter );
|
toRemoveFromEngine.push_back( *anIter );
|
||||||
}
|
}
|
||||||
|
|
||||||
// Remove from engine useless objects
|
// Remove from engine useless objects
|
||||||
ObjectList::iterator anIter2 = toRemoveFromEnggine.begin();
|
ObjectList::iterator anIter2 = toRemoveFromEngine.begin();
|
||||||
for ( ; anIter2 != toRemoveFromEnggine.end(); ++anIter2 )
|
for ( ; anIter2 != toRemoveFromEngine.end(); ++anIter2 )
|
||||||
getGeomEngine()->RemoveObject( *anIter2 );
|
getGeomEngine()->RemoveObject( *anIter2 );
|
||||||
|
|
||||||
myTmpObjs.clear();
|
myTmpObjs.clear();
|
||||||
|
@ -149,8 +149,12 @@ void BlocksGUI_PropagateDlg::SelectionIntoArgument()
|
|||||||
myGrp->LineEdit1->setText( "" );
|
myGrp->LineEdit1->setText( "" );
|
||||||
myObject = GEOM::GEOM_Object::_nil();
|
myObject = GEOM::GEOM_Object::_nil();
|
||||||
|
|
||||||
if ( IObjectCount() == 1 ) {
|
LightApp_SelectionMgr* aSelMgr = myGeomGUI->getApp()->selectionMgr();
|
||||||
Handle(SALOME_InteractiveObject) anIO = firstIObject();
|
SALOME_ListIO aSelList;
|
||||||
|
aSelMgr->selectedObjects(aSelList);
|
||||||
|
|
||||||
|
if (aSelList.Extent() == 1) {
|
||||||
|
Handle(SALOME_InteractiveObject) anIO = aSelList.First();
|
||||||
Standard_Boolean aRes;
|
Standard_Boolean aRes;
|
||||||
myObject = GEOMBase::ConvertIOinGEOMObject( anIO, aRes );
|
myObject = GEOMBase::ConvertIOinGEOMObject( anIO, aRes );
|
||||||
if ( aRes )
|
if ( aRes )
|
||||||
|
@ -222,10 +222,14 @@ void BlocksGUI_QuadFaceDlg::SelectionIntoArgument()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
LightApp_SelectionMgr* aSelMgr = myGeomGUI->getApp()->selectionMgr();
|
||||||
|
SALOME_ListIO aSelList;
|
||||||
|
aSelMgr->selectedObjects(aSelList);
|
||||||
|
|
||||||
GEOM::GEOM_Object_var anObj;
|
GEOM::GEOM_Object_var anObj;
|
||||||
|
if (aSelList.Extent() == 1) {
|
||||||
Standard_Boolean aResult = Standard_False;
|
Standard_Boolean aResult = Standard_False;
|
||||||
if ( IObjectCount() == 1 ) {
|
anObj = GEOMBase::ConvertIOinGEOMObject(aSelList.First(), aResult);
|
||||||
anObj = GEOMBase::ConvertIOinGEOMObject( firstIObject(), aResult );
|
|
||||||
if ( aResult ) {
|
if ( aResult ) {
|
||||||
if (anObj->_is_nil()) {
|
if (anObj->_is_nil()) {
|
||||||
aResult = Standard_False;
|
aResult = Standard_False;
|
||||||
|
@ -234,12 +234,16 @@ void BlocksGUI_TrsfDlg::SelectionIntoArgument()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
LightApp_SelectionMgr* aSelMgr = myGeomGUI->getApp()->selectionMgr();
|
||||||
|
SALOME_ListIO aSelList;
|
||||||
|
aSelMgr->selectedObjects(aSelList);
|
||||||
|
|
||||||
// If selection of main object is activated
|
// If selection of main object is activated
|
||||||
if ( aCurrFocus == MainObj1 || aCurrFocus == MainObj2 ) {
|
if ( aCurrFocus == MainObj1 || aCurrFocus == MainObj2 ) {
|
||||||
if ( IObjectCount() == 1 ) {
|
if (aSelList.Extent() == 1) {
|
||||||
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(aSelList.First(), aResult);
|
||||||
|
|
||||||
if ( aResult && !anObj->_is_nil() && GEOMBase::IsShape( anObj ) ) {
|
if ( aResult && !anObj->_is_nil() && GEOMBase::IsShape( anObj ) ) {
|
||||||
myShape = anObj;
|
myShape = anObj;
|
||||||
@ -256,14 +260,14 @@ void BlocksGUI_TrsfDlg::SelectionIntoArgument()
|
|||||||
else if ( aCurrFocus == Face1 || aCurrFocus == Face2 ||
|
else if ( aCurrFocus == Face1 || aCurrFocus == Face2 ||
|
||||||
aCurrFocus == Face1U || aCurrFocus == Face2U ||
|
aCurrFocus == Face1U || aCurrFocus == Face2U ||
|
||||||
aCurrFocus == Face1V || aCurrFocus == Face2V ) {
|
aCurrFocus == Face1V || aCurrFocus == Face2V ) {
|
||||||
if ( IObjectCount() == 1 ) {
|
if (aSelList.Extent() == 1) {
|
||||||
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(aSelList.First(), aResult);
|
||||||
|
|
||||||
if ( aResult && !anObj->_is_nil() && GEOMBase::IsShape( anObj ) ) {
|
if ( aResult && !anObj->_is_nil() && GEOMBase::IsShape( anObj ) ) {
|
||||||
TColStd_IndexedMapOfInteger anIndexes;
|
TColStd_IndexedMapOfInteger anIndexes;
|
||||||
( (SalomeApp_Application*)( SUIT_Session::session()->activeApplication() ) )->selectionMgr()->GetIndexes( firstIObject(), anIndexes );
|
myGeomGUI->getApp()->selectionMgr()->GetIndexes(aSelList.First(), anIndexes);
|
||||||
|
|
||||||
if ( anIndexes.Extent() == 1 ) {
|
if ( anIndexes.Extent() == 1 ) {
|
||||||
int anIndex = anIndexes( 1 );
|
int anIndex = anIndexes( 1 );
|
||||||
|
@ -183,7 +183,6 @@ bool BooleanGUI_Dialog::ClickOnApply()
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
//=================================================================================
|
//=================================================================================
|
||||||
// function : SelectionIntoArgument()
|
// function : SelectionIntoArgument()
|
||||||
// purpose : Called when selection has changed
|
// purpose : Called when selection has changed
|
||||||
@ -192,7 +191,11 @@ void BooleanGUI_Dialog::SelectionIntoArgument()
|
|||||||
{
|
{
|
||||||
myEditCurrentArgument->setText( "" );
|
myEditCurrentArgument->setText( "" );
|
||||||
|
|
||||||
if ( IObjectCount() != 1 ) {
|
LightApp_SelectionMgr* aSelMgr = myGeomGUI->getApp()->selectionMgr();
|
||||||
|
SALOME_ListIO aSelList;
|
||||||
|
aSelMgr->selectedObjects(aSelList);
|
||||||
|
|
||||||
|
if (aSelList.Extent() != 1) {
|
||||||
if (myEditCurrentArgument == myGroup->LineEdit1) myObject1 = GEOM::GEOM_Object::_nil();
|
if (myEditCurrentArgument == myGroup->LineEdit1) myObject1 = GEOM::GEOM_Object::_nil();
|
||||||
else if (myEditCurrentArgument == myGroup->LineEdit2) myObject2 = GEOM::GEOM_Object::_nil();
|
else if (myEditCurrentArgument == myGroup->LineEdit2) myObject2 = GEOM::GEOM_Object::_nil();
|
||||||
return;
|
return;
|
||||||
@ -200,7 +203,7 @@ void BooleanGUI_Dialog::SelectionIntoArgument()
|
|||||||
|
|
||||||
// nbSel == 1
|
// nbSel == 1
|
||||||
Standard_Boolean aRes = Standard_False;
|
Standard_Boolean aRes = Standard_False;
|
||||||
GEOM::GEOM_Object_var aSelectedObject = GEOMBase::ConvertIOinGEOMObject( firstIObject(), aRes );
|
GEOM::GEOM_Object_var aSelectedObject = GEOMBase::ConvertIOinGEOMObject(aSelList.First(), aRes);
|
||||||
if (!CORBA::is_nil(aSelectedObject) && aRes && GEOMBase::IsShape(aSelectedObject)) {
|
if (!CORBA::is_nil(aSelectedObject) && aRes && GEOMBase::IsShape(aSelectedObject)) {
|
||||||
myEditCurrentArgument->setText(GEOMBase::GetName(aSelectedObject));
|
myEditCurrentArgument->setText(GEOMBase::GetName(aSelectedObject));
|
||||||
if (myEditCurrentArgument == myGroup->LineEdit1) myObject1 = aSelectedObject;
|
if (myEditCurrentArgument == myGroup->LineEdit1) myObject1 = aSelectedObject;
|
||||||
@ -208,7 +211,6 @@ void BooleanGUI_Dialog::SelectionIntoArgument()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
//=================================================================================
|
//=================================================================================
|
||||||
// function : SetEditCurrentArgument()
|
// function : SetEditCurrentArgument()
|
||||||
// purpose :
|
// purpose :
|
||||||
@ -277,11 +279,11 @@ GEOM::GEOM_IOperations_ptr BooleanGUI_Dialog::createOperation()
|
|||||||
//=================================================================================
|
//=================================================================================
|
||||||
bool BooleanGUI_Dialog::isValid (QString& msg)
|
bool BooleanGUI_Dialog::isValid (QString& msg)
|
||||||
{
|
{
|
||||||
Handle(SALOME_InteractiveObject) IO = firstIObject();
|
//Handle(SALOME_InteractiveObject) IO = firstIObject();
|
||||||
Standard_Boolean testResult;
|
//Standard_Boolean testResult;
|
||||||
GEOM::GEOM_Object_var anObject = GEOMBase::ConvertIOinGEOMObject( IO, testResult );
|
//GEOM::GEOM_Object_var anObject = GEOMBase::ConvertIOinGEOMObject(IO, testResult);
|
||||||
if ( !testResult || anObject->_is_nil() )
|
//if (!testResult || anObject->_is_nil())
|
||||||
return false;
|
// return false;
|
||||||
|
|
||||||
return !CORBA::is_nil(myObject1) && !CORBA::is_nil(myObject2);
|
return !CORBA::is_nil(myObject1) && !CORBA::is_nil(myObject2);
|
||||||
}
|
}
|
||||||
|
@ -149,14 +149,18 @@ void BuildGUI_CompoundDlg::SelectionIntoArgument()
|
|||||||
myEditCurrentArgument->setText( "" );
|
myEditCurrentArgument->setText( "" );
|
||||||
QString aString = ""; /* name of selection */
|
QString aString = ""; /* name of selection */
|
||||||
|
|
||||||
|
LightApp_SelectionMgr* aSelMgr = myGeomGUI->getApp()->selectionMgr();
|
||||||
|
SALOME_ListIO aSelList;
|
||||||
|
aSelMgr->selectedObjects(aSelList);
|
||||||
|
|
||||||
myOkShapes = false;
|
myOkShapes = false;
|
||||||
int nbSel = GEOMBase::GetNameOfSelectedIObjects( selectedIO(), aString, true );
|
int nbSel = GEOMBase::GetNameOfSelectedIObjects(aSelList, aString, true);
|
||||||
if ( nbSel == 0 )
|
if ( nbSel == 0 )
|
||||||
return;
|
return;
|
||||||
if ( nbSel != 1 )
|
if ( nbSel != 1 )
|
||||||
aString = QString( "%1_objects").arg( nbSel );
|
aString = QString( "%1_objects").arg( nbSel );
|
||||||
|
|
||||||
GEOMBase::ConvertListOfIOInListOfGO( selectedIO(), myShapes, true );
|
GEOMBase::ConvertListOfIOInListOfGO(aSelList, myShapes, true);
|
||||||
myEditCurrentArgument->setText( aString );
|
myEditCurrentArgument->setText( aString );
|
||||||
myOkShapes = true;
|
myOkShapes = true;
|
||||||
}
|
}
|
||||||
|
@ -148,7 +148,6 @@ bool BuildGUI_EdgeDlg::ClickOnApply()
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
//=================================================================================
|
//=================================================================================
|
||||||
// function : SelectionIntoArgument()
|
// function : SelectionIntoArgument()
|
||||||
// purpose : Called when selection as changed or other case
|
// purpose : Called when selection as changed or other case
|
||||||
@ -158,7 +157,11 @@ void BuildGUI_EdgeDlg::SelectionIntoArgument()
|
|||||||
erasePreview();
|
erasePreview();
|
||||||
myEditCurrentArgument->setText("");
|
myEditCurrentArgument->setText("");
|
||||||
|
|
||||||
if ( IObjectCount() != 1 ) {
|
LightApp_SelectionMgr* aSelMgr = myGeomGUI->getApp()->selectionMgr();
|
||||||
|
SALOME_ListIO aSelList;
|
||||||
|
aSelMgr->selectedObjects(aSelList);
|
||||||
|
|
||||||
|
if (aSelList.Extent() != 1) {
|
||||||
if (myEditCurrentArgument == GroupPoints->LineEdit1)
|
if (myEditCurrentArgument == GroupPoints->LineEdit1)
|
||||||
myOkPoint1 = false;
|
myOkPoint1 = false;
|
||||||
else if (myEditCurrentArgument == GroupPoints->LineEdit2)
|
else if (myEditCurrentArgument == GroupPoints->LineEdit2)
|
||||||
@ -168,8 +171,7 @@ void BuildGUI_EdgeDlg::SelectionIntoArgument()
|
|||||||
|
|
||||||
// nbSel == 1
|
// nbSel == 1
|
||||||
Standard_Boolean testResult = Standard_False;
|
Standard_Boolean testResult = Standard_False;
|
||||||
GEOM::GEOM_Object_var aSelectedObject = GEOMBase::ConvertIOinGEOMObject( firstIObject(), testResult );
|
GEOM::GEOM_Object_var aSelectedObject = GEOMBase::ConvertIOinGEOMObject(aSelList.First(), testResult);
|
||||||
|
|
||||||
if (!testResult)
|
if (!testResult)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
@ -187,7 +189,6 @@ void BuildGUI_EdgeDlg::SelectionIntoArgument()
|
|||||||
displayPreview();
|
displayPreview();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
//=================================================================================
|
//=================================================================================
|
||||||
// function : LineEditReturnPressed()
|
// function : LineEditReturnPressed()
|
||||||
// purpose :
|
// purpose :
|
||||||
|
@ -152,14 +152,18 @@ void BuildGUI_FaceDlg::SelectionIntoArgument()
|
|||||||
myEditCurrentArgument->setText( "" );
|
myEditCurrentArgument->setText( "" );
|
||||||
QString aName;
|
QString aName;
|
||||||
|
|
||||||
int aNbSel = GEOMBase::GetNameOfSelectedIObjects( selectedIO(), aName );
|
LightApp_SelectionMgr* aSelMgr = myGeomGUI->getApp()->selectionMgr();
|
||||||
|
SALOME_ListIO aSelList;
|
||||||
|
aSelMgr->selectedObjects(aSelList);
|
||||||
|
|
||||||
|
int aNbSel = GEOMBase::GetNameOfSelectedIObjects(aSelList, aName);
|
||||||
|
|
||||||
if ( aNbSel < 1) {
|
if ( aNbSel < 1) {
|
||||||
myWires.length(0);
|
myWires.length(0);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
GEOMBase::ConvertListOfIOInListOfGO( selectedIO(), myWires );
|
GEOMBase::ConvertListOfIOInListOfGO(aSelList, myWires);
|
||||||
if ( !myWires.length() )
|
if ( !myWires.length() )
|
||||||
return;
|
return;
|
||||||
if ( aNbSel != 1 )
|
if ( aNbSel != 1 )
|
||||||
|
@ -159,14 +159,18 @@ void BuildGUI_ShellDlg::SelectionIntoArgument()
|
|||||||
myEditCurrentArgument->setText( "" );
|
myEditCurrentArgument->setText( "" );
|
||||||
QString aString;
|
QString aString;
|
||||||
|
|
||||||
|
LightApp_SelectionMgr* aSelMgr = myGeomGUI->getApp()->selectionMgr();
|
||||||
|
SALOME_ListIO aSelList;
|
||||||
|
aSelMgr->selectedObjects(aSelList);
|
||||||
|
|
||||||
myOkFacesAndShells = false;
|
myOkFacesAndShells = false;
|
||||||
int nbSel = GEOMBase::GetNameOfSelectedIObjects( selectedIO(), aString, true );
|
int nbSel = GEOMBase::GetNameOfSelectedIObjects(aSelList, aString, true);
|
||||||
if ( nbSel == 0 )
|
if ( nbSel == 0 )
|
||||||
return;
|
return;
|
||||||
if ( nbSel != 1 )
|
if ( nbSel != 1 )
|
||||||
aString = QString( "%1_objects ").arg( nbSel );
|
aString = QString( "%1_objects ").arg( nbSel );
|
||||||
|
|
||||||
GEOMBase::ConvertListOfIOInListOfGO( selectedIO(), myFacesAndShells, true );
|
GEOMBase::ConvertListOfIOInListOfGO(aSelList, myFacesAndShells, true);
|
||||||
if ( !myFacesAndShells.length() )
|
if ( !myFacesAndShells.length() )
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
@ -163,14 +163,18 @@ void BuildGUI_SolidDlg::SelectionIntoArgument()
|
|||||||
myEditCurrentArgument->setText( "" );
|
myEditCurrentArgument->setText( "" );
|
||||||
QString aString = "";
|
QString aString = "";
|
||||||
|
|
||||||
|
LightApp_SelectionMgr* aSelMgr = myGeomGUI->getApp()->selectionMgr();
|
||||||
|
SALOME_ListIO aSelList;
|
||||||
|
aSelMgr->selectedObjects(aSelList);
|
||||||
|
|
||||||
myOkShells = false;
|
myOkShells = false;
|
||||||
int nbSel = GEOMBase::GetNameOfSelectedIObjects( selectedIO(), aString );
|
int nbSel = GEOMBase::GetNameOfSelectedIObjects(aSelList, aString);
|
||||||
if ( nbSel == 0 )
|
if ( nbSel == 0 )
|
||||||
return;
|
return;
|
||||||
if ( nbSel != 1 )
|
if ( nbSel != 1 )
|
||||||
aString = tr( "%1_objects" ).arg( nbSel );
|
aString = tr( "%1_objects" ).arg( nbSel );
|
||||||
|
|
||||||
GEOMBase::ConvertListOfIOInListOfGO( selectedIO(), myShells );
|
GEOMBase::ConvertListOfIOInListOfGO(aSelList, myShells);
|
||||||
if ( !myShells.length() )
|
if ( !myShells.length() )
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
@ -152,15 +152,19 @@ void BuildGUI_WireDlg::SelectionIntoArgument()
|
|||||||
myEditCurrentArgument->setText( "" );
|
myEditCurrentArgument->setText( "" );
|
||||||
QString aString = ""; /* name of selection */
|
QString aString = ""; /* name of selection */
|
||||||
|
|
||||||
|
LightApp_SelectionMgr* aSelMgr = myGeomGUI->getApp()->selectionMgr();
|
||||||
|
SALOME_ListIO aSelList;
|
||||||
|
aSelMgr->selectedObjects(aSelList);
|
||||||
|
|
||||||
myOkEdgesAndWires = false;
|
myOkEdgesAndWires = false;
|
||||||
int nbSel = GEOMBase::GetNameOfSelectedIObjects( selectedIO(), aString );
|
int nbSel = GEOMBase::GetNameOfSelectedIObjects(aSelList, aString);
|
||||||
|
|
||||||
if ( nbSel == 0 )
|
if ( nbSel == 0 )
|
||||||
return;
|
return;
|
||||||
if ( nbSel != 1 )
|
if ( nbSel != 1 )
|
||||||
aString = tr( "%1_objects" ).arg( nbSel );
|
aString = tr( "%1_objects" ).arg( nbSel );
|
||||||
|
|
||||||
GEOMBase::ConvertListOfIOInListOfGO( selectedIO(), myEdgesAndWires );
|
GEOMBase::ConvertListOfIOInListOfGO(aSelList, myEdgesAndWires);
|
||||||
if ( !myEdgesAndWires.length() )
|
if ( !myEdgesAndWires.length() )
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
@ -858,10 +858,14 @@ void EntityGUI_SketcherDlg::SelectionIntoArgument()
|
|||||||
myX = myLastX1;
|
myX = myLastX1;
|
||||||
myY = myLastY1;
|
myY = myLastY1;
|
||||||
|
|
||||||
int nbSel = IObjectCount();
|
LightApp_SelectionMgr* aSelMgr = myGeometryGUI->getApp()->selectionMgr();
|
||||||
|
SALOME_ListIO aSelList;
|
||||||
|
aSelMgr->selectedObjects(aSelList);
|
||||||
|
|
||||||
|
int nbSel = aSelList.Extent();
|
||||||
if (nbSel == 1 && myEditCurrentArgument == Group1Sel->LineEdit1) {
|
if (nbSel == 1 && myEditCurrentArgument == Group1Sel->LineEdit1) {
|
||||||
Standard_Boolean aRes = Standard_False;
|
Standard_Boolean aRes = Standard_False;
|
||||||
GEOM::GEOM_Object_var aSelectedObject = GEOMBase::ConvertIOinGEOMObject( firstIObject(), aRes );
|
GEOM::GEOM_Object_var aSelectedObject = GEOMBase::ConvertIOinGEOMObject(aSelList.First(), aRes);
|
||||||
if (!CORBA::is_nil(aSelectedObject) && aRes) {
|
if (!CORBA::is_nil(aSelectedObject) && aRes) {
|
||||||
TopoDS_Shape aShape;
|
TopoDS_Shape aShape;
|
||||||
if (GEOMBase::GetShape(aSelectedObject, aShape, TopAbs_VERTEX)) {
|
if (GEOMBase::GetShape(aSelectedObject, aShape, TopAbs_VERTEX)) {
|
||||||
@ -914,7 +918,12 @@ void EntityGUI_SketcherDlg::LineEditReturnPressed()
|
|||||||
/* so SelectionIntoArgument() is automatically called. */
|
/* so SelectionIntoArgument() is automatically called. */
|
||||||
const QString objectUserName = myEditCurrentArgument->text();
|
const QString objectUserName = myEditCurrentArgument->text();
|
||||||
QWidget* thisWidget = (QWidget*)this;
|
QWidget* thisWidget = (QWidget*)this;
|
||||||
if ( GEOMBase::SelectionByNameInDialogs( thisWidget, objectUserName, selectedIO() ) )
|
|
||||||
|
LightApp_SelectionMgr* aSelMgr = myGeometryGUI->getApp()->selectionMgr();
|
||||||
|
SALOME_ListIO aSelList;
|
||||||
|
aSelMgr->selectedObjects(aSelList);
|
||||||
|
|
||||||
|
if (GEOMBase::SelectionByNameInDialogs(thisWidget, objectUserName, aSelList))
|
||||||
myEditCurrentArgument->setText( objectUserName );
|
myEditCurrentArgument->setText( objectUserName );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -205,19 +205,23 @@ void EntityGUI_SubShapeDlg::SelectionIntoArgument()
|
|||||||
|
|
||||||
QString aString = ""; /* name of selection */
|
QString aString = ""; /* name of selection */
|
||||||
|
|
||||||
int nbSel = GEOMBase::GetNameOfSelectedIObjects( selectedIO(), aString, true );
|
LightApp_SelectionMgr* aSelMgr = myGeomGUI->getApp()->selectionMgr();
|
||||||
|
SALOME_ListIO aSelList;
|
||||||
|
aSelMgr->selectedObjects(aSelList);
|
||||||
|
|
||||||
|
int nbSel = GEOMBase::GetNameOfSelectedIObjects(aSelList, aString, true);
|
||||||
if (nbSel != 1)
|
if (nbSel != 1)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
TopoDS_Shape S;
|
TopoDS_Shape S;
|
||||||
Handle(SALOME_InteractiveObject) IO = firstIObject();
|
Handle(SALOME_InteractiveObject) IO = aSelList.First();
|
||||||
if ( !IO->hasEntry() ) {
|
if ( !IO->hasEntry() ) {
|
||||||
SUIT_Session::session()->activeApplication()->putInfo( tr( "GEOM_PRP_SHAPE_IN_STUDY" ) );
|
SUIT_Session::session()->activeApplication()->putInfo( tr( "GEOM_PRP_SHAPE_IN_STUDY" ) );
|
||||||
updateButtonState();
|
updateButtonState();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( !GEOMBase::GetTopoFromSelection( selectedIO(), S ) ||
|
if (!GEOMBase::GetTopoFromSelection(aSelList, S) ||
|
||||||
S.IsNull() ||
|
S.IsNull() ||
|
||||||
S.ShapeType() == TopAbs_VERTEX) {
|
S.ShapeType() == TopAbs_VERTEX) {
|
||||||
myObject = GEOM::GEOM_Object::_nil();
|
myObject = GEOM::GEOM_Object::_nil();
|
||||||
@ -225,7 +229,6 @@ void EntityGUI_SubShapeDlg::SelectionIntoArgument()
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
Standard_Boolean testResult;
|
Standard_Boolean testResult;
|
||||||
myObject = GEOMBase::ConvertIOinGEOMObject(IO, testResult);
|
myObject = GEOMBase::ConvertIOinGEOMObject(IO, testResult);
|
||||||
if (!testResult || myObject->_is_nil()) {
|
if (!testResult || myObject->_is_nil()) {
|
||||||
@ -236,7 +239,6 @@ void EntityGUI_SubShapeDlg::SelectionIntoArgument()
|
|||||||
myShape = S;
|
myShape = S;
|
||||||
GroupPoints->LineEdit1->setText(aString);
|
GroupPoints->LineEdit1->setText(aString);
|
||||||
|
|
||||||
|
|
||||||
int SelectedShapeType = GroupPoints->ComboBox1->currentIndex();
|
int SelectedShapeType = GroupPoints->ComboBox1->currentIndex();
|
||||||
int count = GroupPoints->ComboBox1->count();
|
int count = GroupPoints->ComboBox1->count();
|
||||||
|
|
||||||
@ -521,25 +523,32 @@ GEOM::GEOM_IOperations_ptr EntityGUI_SubShapeDlg::createOperation()
|
|||||||
bool EntityGUI_SubShapeDlg::isValid (QString& msg)
|
bool EntityGUI_SubShapeDlg::isValid (QString& msg)
|
||||||
{
|
{
|
||||||
bool isOk = false;
|
bool isOk = false;
|
||||||
Standard_Boolean testResult;
|
|
||||||
GEOM::GEOM_Object_var anObj = GEOMBase::ConvertIOinGEOMObject( firstIObject(), testResult );
|
if (myObject->_is_nil()) {
|
||||||
if ( !testResult || myObject->_is_nil() ) {
|
|
||||||
updateButtonState();
|
updateButtonState();
|
||||||
return isOk;
|
return isOk;
|
||||||
}
|
}
|
||||||
if ( !myObject->_is_nil() ) {
|
|
||||||
if (isAllSubShapes())
|
if (isAllSubShapes())
|
||||||
isOk = true;
|
isOk = true;
|
||||||
else if ( IObjectCount() == 1 ) {
|
else {
|
||||||
|
LightApp_SelectionMgr* aSelMgr = myGeomGUI->getApp()->selectionMgr();
|
||||||
|
SALOME_ListIO aSelList;
|
||||||
|
aSelMgr->selectedObjects(aSelList);
|
||||||
|
|
||||||
|
if (aSelList.Extent() == 1) {
|
||||||
|
Standard_Boolean testResult;
|
||||||
|
GEOM::GEOM_Object_var anObj = GEOMBase::ConvertIOinGEOMObject(aSelList.First(), testResult);
|
||||||
if (testResult && !anObj->_is_nil()) {
|
if (testResult && !anObj->_is_nil()) {
|
||||||
TColStd_IndexedMapOfInteger aMapIndex;
|
TColStd_IndexedMapOfInteger aMapIndex;
|
||||||
myGeomGUI->getApp()->selectionMgr()->GetIndexes( firstIObject(), aMapIndex );
|
aSelMgr->GetIndexes(aSelList.First(), aMapIndex);
|
||||||
isOk = aMapIndex.Extent() > 0;
|
isOk = aMapIndex.Extent() > 0;
|
||||||
if (!isOk)
|
if (!isOk)
|
||||||
msg += tr("NO_SUBSHAPES_SELECTED");
|
msg += tr("NO_SUBSHAPES_SELECTED");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return isOk;
|
return isOk;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -549,8 +558,8 @@ bool EntityGUI_SubShapeDlg::isValid( QString& msg )
|
|||||||
//=================================================================================
|
//=================================================================================
|
||||||
bool EntityGUI_SubShapeDlg::execute (ObjectList& objects)
|
bool EntityGUI_SubShapeDlg::execute (ObjectList& objects)
|
||||||
{
|
{
|
||||||
GEOM::ListOfGO_var aList = GEOM::GEOM_IShapesOperations::_narrow(
|
GEOM::ListOfGO_var aList = GEOM::GEOM_IShapesOperations::_narrow(getOperation())->
|
||||||
getOperation() )->MakeExplode( myObject, shapeType(), true );
|
MakeExplode(myObject, shapeType(), true);
|
||||||
|
|
||||||
if (!aList->length())
|
if (!aList->length())
|
||||||
return false;
|
return false;
|
||||||
@ -558,14 +567,18 @@ bool EntityGUI_SubShapeDlg::execute( ObjectList& objects )
|
|||||||
// 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()) {
|
||||||
if ( IObjectCount() == 1 ) {
|
LightApp_SelectionMgr* aSelMgr = myGeomGUI->getApp()->selectionMgr();
|
||||||
|
SALOME_ListIO aSelList;
|
||||||
|
aSelMgr->selectedObjects(aSelList);
|
||||||
|
|
||||||
|
if (aSelList.Extent() == 1) {
|
||||||
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(aSelList.First(), aResult);
|
||||||
|
|
||||||
if (aResult && !anObj->_is_nil()) {
|
if (aResult && !anObj->_is_nil()) {
|
||||||
TColStd_IndexedMapOfInteger aMapIndex;
|
TColStd_IndexedMapOfInteger aMapIndex;
|
||||||
myGeomGUI->getApp()->selectionMgr()->GetIndexes( firstIObject(), aMapIndex );
|
aSelMgr->GetIndexes(aSelList.First(), aMapIndex);
|
||||||
|
|
||||||
GEOM::GEOM_ILocalOperations_var aLocOp =
|
GEOM::GEOM_ILocalOperations_var aLocOp =
|
||||||
getGeomEngine()->GetILocalOperations(getStudyId());
|
getGeomEngine()->GetILocalOperations(getStudyId());
|
||||||
|
@ -972,56 +972,10 @@ QString GEOMBase_Helper::getPrefix( GEOM::GEOM_Object_ptr theObj ) const
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//================================================================
|
|
||||||
// Function : selectedIO
|
|
||||||
// Purpose : Return the list of selected SALOME_InteractiveObject's
|
|
||||||
//================================================================
|
|
||||||
const SALOME_ListIO& GEOMBase_Helper::selectedIO()
|
|
||||||
{
|
|
||||||
mySelected.Clear();
|
|
||||||
|
|
||||||
SalomeApp_Application* app = dynamic_cast< SalomeApp_Application* >( SUIT_Session::session()->activeApplication() );
|
|
||||||
if ( app ) {
|
|
||||||
LightApp_SelectionMgr* aSelMgr = app->selectionMgr();
|
|
||||||
if ( aSelMgr )
|
|
||||||
aSelMgr->selectedObjects( mySelected );
|
|
||||||
}
|
|
||||||
|
|
||||||
return mySelected;
|
|
||||||
}
|
|
||||||
|
|
||||||
//================================================================
|
|
||||||
// Function : IObjectCount
|
|
||||||
// Purpose : Return the number of selected objects
|
|
||||||
//================================================================
|
|
||||||
int GEOMBase_Helper::IObjectCount()
|
|
||||||
{
|
|
||||||
return selectedIO().Extent();
|
|
||||||
}
|
|
||||||
|
|
||||||
//================================================================
|
|
||||||
// Function : firstIObject
|
|
||||||
// Purpose : Return the first selected object in the selected object list
|
|
||||||
//================================================================
|
|
||||||
Handle(SALOME_InteractiveObject) GEOMBase_Helper::firstIObject()
|
|
||||||
{
|
|
||||||
const SALOME_ListIO& aList = selectedIO();
|
|
||||||
return aList.Extent() > 0 ? aList.First() : Handle(SALOME_InteractiveObject)();
|
|
||||||
}
|
|
||||||
|
|
||||||
//================================================================
|
|
||||||
// Function : lastIObject
|
|
||||||
// Purpose : Return the last selected object in the selected object list
|
|
||||||
//================================================================
|
|
||||||
Handle(SALOME_InteractiveObject) GEOMBase_Helper::lastIObject()
|
|
||||||
{
|
|
||||||
const SALOME_ListIO& aList = selectedIO();
|
|
||||||
return aList.Extent() > 0 ? aList.Last() : Handle(SALOME_InteractiveObject)();
|
|
||||||
}
|
|
||||||
|
|
||||||
//================================================================
|
//================================================================
|
||||||
// Function : getDesktop
|
// Function : getDesktop
|
||||||
// Purpose : Returns myDesktop field. Initialized in constructor, usually as dynamic_cast<SUIT_Desktop*>(parentWidget())
|
// Purpose : Returns myDesktop field. Initialized in constructor,
|
||||||
|
// usually as dynamic_cast<SUIT_Desktop*>(parentWidget())
|
||||||
//================================================================
|
//================================================================
|
||||||
SUIT_Desktop* GEOMBase_Helper::getDesktop() const
|
SUIT_Desktop* GEOMBase_Helper::getDesktop() const
|
||||||
{
|
{
|
||||||
@ -1063,7 +1017,8 @@ bool GEOMBase_Helper::selectObjects( ObjectList& objects )
|
|||||||
// Purpose : It should return an object if its founded in study or
|
// Purpose : It should return an object if its founded in study or
|
||||||
// return Null object if the object is not founded
|
// return Null object if the object is not founded
|
||||||
//================================================================
|
//================================================================
|
||||||
GEOM::GEOM_Object_ptr GEOMBase_Helper::findObjectInFather( GEOM::GEOM_Object_ptr theFather, const QString& theName)
|
GEOM::GEOM_Object_ptr GEOMBase_Helper::findObjectInFather (GEOM::GEOM_Object_ptr theFather,
|
||||||
|
const QString& theName)
|
||||||
{
|
{
|
||||||
SalomeApp_Application* app =
|
SalomeApp_Application* app =
|
||||||
dynamic_cast< SalomeApp_Application* >( SUIT_Session::session()->activeApplication() );
|
dynamic_cast< SalomeApp_Application* >( SUIT_Session::session()->activeApplication() );
|
||||||
|
@ -132,21 +132,6 @@ protected:
|
|||||||
inline void setPrefix( const QString& prefix ) { myPrefix = prefix; }
|
inline void setPrefix( const QString& prefix ) { myPrefix = prefix; }
|
||||||
QString getPrefix( GEOM::GEOM_Object_ptr = GEOM::GEOM_Object::_nil() ) const;
|
QString getPrefix( GEOM::GEOM_Object_ptr = GEOM::GEOM_Object::_nil() ) const;
|
||||||
|
|
||||||
const SALOME_ListIO& selectedIO();
|
|
||||||
// Function returns a list of SALOME_InteractiveObject's from
|
|
||||||
// selection manager in GUI
|
|
||||||
|
|
||||||
int IObjectCount() ;
|
|
||||||
// Function returns the number of selected objects
|
|
||||||
|
|
||||||
Handle(SALOME_InteractiveObject) firstIObject() ;
|
|
||||||
// Function returns the first selected object in the list
|
|
||||||
// of selected objects
|
|
||||||
|
|
||||||
Handle(SALOME_InteractiveObject) lastIObject() ;
|
|
||||||
// Function returns the last selected object in the list
|
|
||||||
// of selected objects
|
|
||||||
|
|
||||||
bool selectObjects( ObjectList& objects );
|
bool selectObjects( ObjectList& objects );
|
||||||
// Selects list of objects
|
// Selects list of objects
|
||||||
|
|
||||||
|
@ -171,7 +171,11 @@ void GEOMBase_Skeleton::LineEditReturnPressed()
|
|||||||
const QString objectUserName = myEditCurrentArgument->text();
|
const QString objectUserName = myEditCurrentArgument->text();
|
||||||
QWidget* thisWidget = (QWidget*)this;
|
QWidget* thisWidget = (QWidget*)this;
|
||||||
|
|
||||||
if ( GEOMBase::SelectionByNameInDialogs( thisWidget, objectUserName, selectedIO() ) )
|
SALOME_ListIO aList;
|
||||||
|
LightApp_SelectionMgr* aSelMgr = myGeomGUI->getApp()->selectionMgr();
|
||||||
|
if (aSelMgr)
|
||||||
|
aSelMgr->selectedObjects(aList);
|
||||||
|
if (GEOMBase::SelectionByNameInDialogs(thisWidget, objectUserName, aList))
|
||||||
myEditCurrentArgument->setText(objectUserName);
|
myEditCurrentArgument->setText(objectUserName);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -199,7 +199,11 @@ void GenerationGUI_FillingDlg::SelectionIntoArgument()
|
|||||||
erasePreview();
|
erasePreview();
|
||||||
myEditCurrentArgument->setText("");
|
myEditCurrentArgument->setText("");
|
||||||
|
|
||||||
if ( IObjectCount() != 1 ) {
|
LightApp_SelectionMgr* aSelMgr = myGeomGUI->getApp()->selectionMgr();
|
||||||
|
SALOME_ListIO aSelList;
|
||||||
|
aSelMgr->selectedObjects(aSelList);
|
||||||
|
|
||||||
|
if (aSelList.Extent() != 1) {
|
||||||
if (myEditCurrentArgument == GroupPoints->LineEdit1)
|
if (myEditCurrentArgument == GroupPoints->LineEdit1)
|
||||||
myOkCompound = false;
|
myOkCompound = false;
|
||||||
return;
|
return;
|
||||||
@ -207,7 +211,7 @@ void GenerationGUI_FillingDlg::SelectionIntoArgument()
|
|||||||
|
|
||||||
// nbSel == 1
|
// nbSel == 1
|
||||||
Standard_Boolean testResult = Standard_False;
|
Standard_Boolean testResult = Standard_False;
|
||||||
GEOM::GEOM_Object_ptr aSelectedObject = GEOMBase::ConvertIOinGEOMObject( firstIObject(), testResult );
|
GEOM::GEOM_Object_ptr aSelectedObject = GEOMBase::ConvertIOinGEOMObject(aSelList.First(), testResult);
|
||||||
|
|
||||||
if (!testResult)
|
if (!testResult)
|
||||||
return;
|
return;
|
||||||
@ -216,8 +220,7 @@ void GenerationGUI_FillingDlg::SelectionIntoArgument()
|
|||||||
TopoDS_Shape S;
|
TopoDS_Shape S;
|
||||||
myOkCompound = false;
|
myOkCompound = false;
|
||||||
|
|
||||||
if ( GEOMBase::GetShape(aSelectedObject, S) &&
|
if (GEOMBase::GetShape(aSelectedObject, S) && S.ShapeType() == TopAbs_COMPOUND) {
|
||||||
S.ShapeType() == TopAbs_COMPOUND ) {
|
|
||||||
// myCompound should be a compound of edges
|
// myCompound should be a compound of edges
|
||||||
for (TopoDS_Iterator it (S); it.More(); it.Next())
|
for (TopoDS_Iterator it (S); it.More(); it.Next())
|
||||||
if (it.Value().ShapeType() != TopAbs_EDGE)
|
if (it.Value().ShapeType() != TopAbs_EDGE)
|
||||||
@ -231,7 +234,6 @@ void GenerationGUI_FillingDlg::SelectionIntoArgument()
|
|||||||
displayPreview();
|
displayPreview();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
//=================================================================================
|
//=================================================================================
|
||||||
// function : SetEditCurrentArgument()
|
// function : SetEditCurrentArgument()
|
||||||
// purpose :
|
// purpose :
|
||||||
|
@ -164,17 +164,19 @@ void GenerationGUI_PipeDlg::SelectionIntoArgument()
|
|||||||
erasePreview();
|
erasePreview();
|
||||||
myEditCurrentArgument->setText( "" );
|
myEditCurrentArgument->setText( "" );
|
||||||
|
|
||||||
if ( IObjectCount() != 1 ) {
|
LightApp_SelectionMgr* aSelMgr = myGeomGUI->getApp()->selectionMgr();
|
||||||
if ( myEditCurrentArgument == GroupPoints->LineEdit1 )
|
SALOME_ListIO aSelList;
|
||||||
myOkBase = false;
|
aSelMgr->selectedObjects(aSelList);
|
||||||
else if ( myEditCurrentArgument == GroupPoints->LineEdit2 )
|
|
||||||
myOkPath = false;
|
if (aSelList.Extent() != 1) {
|
||||||
|
if (myEditCurrentArgument == GroupPoints->LineEdit1) myOkBase = false;
|
||||||
|
else if (myEditCurrentArgument == GroupPoints->LineEdit2) myOkPath = false;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// nbSel == 1
|
// nbSel == 1
|
||||||
Standard_Boolean testResult = Standard_False;
|
Standard_Boolean testResult = Standard_False;
|
||||||
GEOM::GEOM_Object_ptr aSelectedObject = GEOMBase::ConvertIOinGEOMObject( firstIObject(), testResult );
|
GEOM::GEOM_Object_ptr aSelectedObject = GEOMBase::ConvertIOinGEOMObject(aSelList.First(), testResult);
|
||||||
|
|
||||||
if (!testResult)
|
if (!testResult)
|
||||||
return;
|
return;
|
||||||
@ -204,10 +206,8 @@ void GenerationGUI_PipeDlg::SelectionIntoArgument()
|
|||||||
QString aName = GEOMBase::GetName(aSelectedObject);
|
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();
|
|
||||||
TColStd_IndexedMapOfInteger aMap;
|
TColStd_IndexedMapOfInteger aMap;
|
||||||
|
aSelMgr->GetIndexes(aSelList.First(), aMap);
|
||||||
aSelMgr->GetIndexes( firstIObject(), aMap );
|
|
||||||
if (aMap.Extent() == 1) {
|
if (aMap.Extent() == 1) {
|
||||||
int anIndex = aMap(1);
|
int anIndex = aMap(1);
|
||||||
aName.append(":edge_" + QString::number(anIndex));
|
aName.append(":edge_" + QString::number(anIndex));
|
||||||
@ -242,7 +242,6 @@ void GenerationGUI_PipeDlg::SelectionIntoArgument()
|
|||||||
displayPreview();
|
displayPreview();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
//=================================================================================
|
//=================================================================================
|
||||||
// function : SetEditCurrentArgument()
|
// function : SetEditCurrentArgument()
|
||||||
// purpose :
|
// purpose :
|
||||||
|
@ -321,9 +321,13 @@ void GenerationGUI_PrismDlg::SelectionIntoArgument()
|
|||||||
erasePreview();
|
erasePreview();
|
||||||
myEditCurrentArgument->setText( "" );
|
myEditCurrentArgument->setText( "" );
|
||||||
|
|
||||||
if ( getConstructorId() == 0 ) {
|
LightApp_SelectionMgr* aSelMgr = myGeomGUI->getApp()->selectionMgr();
|
||||||
|
SALOME_ListIO aSelList;
|
||||||
|
aSelMgr->selectedObjects(aSelList);
|
||||||
|
|
||||||
if ( IObjectCount() != 1 ) {
|
if (getConstructorId() == 0)
|
||||||
|
{
|
||||||
|
if (aSelList.Extent() != 1) {
|
||||||
if (myEditCurrentArgument == GroupPoints->LineEdit1)
|
if (myEditCurrentArgument == GroupPoints->LineEdit1)
|
||||||
myOkBase = false;
|
myOkBase = false;
|
||||||
else if (myEditCurrentArgument == GroupPoints->LineEdit2)
|
else if (myEditCurrentArgument == GroupPoints->LineEdit2)
|
||||||
@ -334,8 +338,7 @@ void GenerationGUI_PrismDlg::SelectionIntoArgument()
|
|||||||
// nbSel == 1
|
// nbSel == 1
|
||||||
Standard_Boolean testResult = Standard_False;
|
Standard_Boolean testResult = Standard_False;
|
||||||
GEOM::GEOM_Object_var aSelectedObject =
|
GEOM::GEOM_Object_var aSelectedObject =
|
||||||
GEOMBase::ConvertIOinGEOMObject( firstIObject(), testResult );
|
GEOMBase::ConvertIOinGEOMObject(aSelList.First(), testResult);
|
||||||
|
|
||||||
if (!testResult)
|
if (!testResult)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
@ -343,9 +346,8 @@ void GenerationGUI_PrismDlg::SelectionIntoArgument()
|
|||||||
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() ) {
|
||||||
LightApp_SelectionMgr* aSelMgr = myGeomGUI->getApp()->selectionMgr();
|
|
||||||
TColStd_IndexedMapOfInteger aMap;
|
TColStd_IndexedMapOfInteger aMap;
|
||||||
aSelMgr->GetIndexes( firstIObject(), aMap );
|
aSelMgr->GetIndexes(aSelList.First(), aMap);
|
||||||
if (aMap.Extent() == 1) {
|
if (aMap.Extent() == 1) {
|
||||||
int anIndex = aMap(1);
|
int anIndex = aMap(1);
|
||||||
aName.append( ":edge_" + QString::number( anIndex ) );
|
aName.append( ":edge_" + QString::number( anIndex ) );
|
||||||
@ -382,7 +384,7 @@ void GenerationGUI_PrismDlg::SelectionIntoArgument()
|
|||||||
myEditCurrentArgument->setText( aName );
|
myEditCurrentArgument->setText( aName );
|
||||||
}
|
}
|
||||||
else if (getConstructorId() == 1) { // getConstructorId()==1 - extrusion using 2 points
|
else if (getConstructorId() == 1) { // getConstructorId()==1 - extrusion using 2 points
|
||||||
if ( IObjectCount() != 1 ) {
|
if (aSelList.Extent() != 1) {
|
||||||
if (myEditCurrentArgument == GroupPoints2->LineEdit1)
|
if (myEditCurrentArgument == GroupPoints2->LineEdit1)
|
||||||
myOkBase = false;
|
myOkBase = false;
|
||||||
else if (myEditCurrentArgument == GroupPoints2->LineEdit2) {
|
else if (myEditCurrentArgument == GroupPoints2->LineEdit2) {
|
||||||
@ -399,7 +401,7 @@ void GenerationGUI_PrismDlg::SelectionIntoArgument()
|
|||||||
// nbSel == 1
|
// nbSel == 1
|
||||||
Standard_Boolean testResult = Standard_False;
|
Standard_Boolean testResult = Standard_False;
|
||||||
GEOM::GEOM_Object_var aSelectedObject =
|
GEOM::GEOM_Object_var aSelectedObject =
|
||||||
GEOMBase::ConvertIOinGEOMObject( firstIObject(), testResult );
|
GEOMBase::ConvertIOinGEOMObject(aSelList.First(), testResult);
|
||||||
|
|
||||||
if (!testResult || CORBA::is_nil(aSelectedObject))
|
if (!testResult || CORBA::is_nil(aSelectedObject))
|
||||||
return;
|
return;
|
||||||
@ -408,9 +410,8 @@ void GenerationGUI_PrismDlg::SelectionIntoArgument()
|
|||||||
TopoDS_Shape aShape;
|
TopoDS_Shape aShape;
|
||||||
bool myOk = true;
|
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();
|
|
||||||
TColStd_IndexedMapOfInteger aMap;
|
TColStd_IndexedMapOfInteger aMap;
|
||||||
aSelMgr->GetIndexes( firstIObject(), aMap );
|
aSelMgr->GetIndexes(aSelList.First(), aMap );
|
||||||
if (aMap.Extent() == 1) {
|
if (aMap.Extent() == 1) {
|
||||||
int anIndex = aMap(1);
|
int anIndex = aMap(1);
|
||||||
aName.append( ":vertex_" + QString::number( anIndex ) );
|
aName.append( ":vertex_" + QString::number( anIndex ) );
|
||||||
@ -454,7 +455,7 @@ void GenerationGUI_PrismDlg::SelectionIntoArgument()
|
|||||||
else if (getConstructorId() == 2) { // extrusion using dx dy dz
|
else if (getConstructorId() == 2) { // extrusion using dx dy dz
|
||||||
Standard_Boolean testResult = Standard_False;
|
Standard_Boolean testResult = Standard_False;
|
||||||
GEOM::GEOM_Object_var aSelectedObject =
|
GEOM::GEOM_Object_var aSelectedObject =
|
||||||
GEOMBase::ConvertIOinGEOMObject( firstIObject(), testResult );
|
GEOMBase::ConvertIOinGEOMObject(aSelList.First(), testResult);
|
||||||
|
|
||||||
if (!testResult || CORBA::is_nil(aSelectedObject))
|
if (!testResult || CORBA::is_nil(aSelectedObject))
|
||||||
return;
|
return;
|
||||||
@ -467,7 +468,6 @@ void GenerationGUI_PrismDlg::SelectionIntoArgument()
|
|||||||
displayPreview();
|
displayPreview();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
//=================================================================================
|
//=================================================================================
|
||||||
// function : SetEditCurrentArgument()
|
// function : SetEditCurrentArgument()
|
||||||
// purpose :
|
// purpose :
|
||||||
|
@ -218,7 +218,11 @@ void GenerationGUI_RevolDlg::SelectionIntoArgument()
|
|||||||
erasePreview();
|
erasePreview();
|
||||||
myEditCurrentArgument->setText( "" );
|
myEditCurrentArgument->setText( "" );
|
||||||
|
|
||||||
if ( IObjectCount() != 1 ) {
|
LightApp_SelectionMgr* aSelMgr = myGeomGUI->getApp()->selectionMgr();
|
||||||
|
SALOME_ListIO aSelList;
|
||||||
|
aSelMgr->selectedObjects(aSelList);
|
||||||
|
|
||||||
|
if (aSelList.Extent() != 1) {
|
||||||
if ( myEditCurrentArgument == GroupPoints->LineEdit1 )
|
if ( myEditCurrentArgument == GroupPoints->LineEdit1 )
|
||||||
myOkBase = false;
|
myOkBase = false;
|
||||||
else if ( myEditCurrentArgument == GroupPoints->LineEdit2 )
|
else if ( myEditCurrentArgument == GroupPoints->LineEdit2 )
|
||||||
@ -228,7 +232,7 @@ void GenerationGUI_RevolDlg::SelectionIntoArgument()
|
|||||||
|
|
||||||
// nbSel == 1
|
// nbSel == 1
|
||||||
Standard_Boolean testResult = Standard_False;
|
Standard_Boolean testResult = Standard_False;
|
||||||
GEOM::GEOM_Object_ptr aSelectedObject = GEOMBase::ConvertIOinGEOMObject( firstIObject(), testResult );
|
GEOM::GEOM_Object_ptr aSelectedObject = GEOMBase::ConvertIOinGEOMObject(aSelList.First(), testResult);
|
||||||
QString aName = GEOMBase::GetName( aSelectedObject );
|
QString aName = GEOMBase::GetName( aSelectedObject );
|
||||||
|
|
||||||
if ( !testResult )
|
if ( !testResult )
|
||||||
@ -249,9 +253,8 @@ void GenerationGUI_RevolDlg::SelectionIntoArgument()
|
|||||||
TopoDS_Shape aShape;
|
TopoDS_Shape aShape;
|
||||||
|
|
||||||
if ( GEOMBase::GetShape( aSelectedObject, aShape, TopAbs_SHAPE ) && !aShape.IsNull() ) {
|
if ( GEOMBase::GetShape( aSelectedObject, aShape, TopAbs_SHAPE ) && !aShape.IsNull() ) {
|
||||||
LightApp_SelectionMgr* aSelMgr = myGeomGUI->getApp()->selectionMgr();
|
|
||||||
TColStd_IndexedMapOfInteger aMap;
|
TColStd_IndexedMapOfInteger aMap;
|
||||||
aSelMgr->GetIndexes( firstIObject(), aMap );
|
aSelMgr->GetIndexes(aSelList.First(), aMap);
|
||||||
if ( aMap.Extent() == 1 ) {
|
if ( aMap.Extent() == 1 ) {
|
||||||
|
|
||||||
int anIndex = aMap( 1 );
|
int anIndex = aMap( 1 );
|
||||||
@ -289,7 +292,6 @@ void GenerationGUI_RevolDlg::SelectionIntoArgument()
|
|||||||
displayPreview();
|
displayPreview();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
//=================================================================================
|
//=================================================================================
|
||||||
// function : SetEditCurrentArgument()
|
// function : SetEditCurrentArgument()
|
||||||
// purpose :
|
// purpose :
|
||||||
|
@ -161,6 +161,8 @@ void GroupGUI_GroupDlg::Init()
|
|||||||
{
|
{
|
||||||
// san -- TODO: clear selected sub-shapes...
|
// san -- TODO: clear selected sub-shapes...
|
||||||
//mySelSubBtn->setChecked( true );
|
//mySelSubBtn->setChecked( true );
|
||||||
|
LightApp_SelectionMgr* aSelMgr = myGeomGUI->getApp()->selectionMgr();
|
||||||
|
|
||||||
if ( myMode == CreateGroup ) {
|
if ( myMode == CreateGroup ) {
|
||||||
initName( tr( "GROUP_PREFIX" ) );
|
initName( tr( "GROUP_PREFIX" ) );
|
||||||
|
|
||||||
@ -171,10 +173,14 @@ void GroupGUI_GroupDlg::Init()
|
|||||||
connect( mySelBtn, SIGNAL( clicked() ), this, SLOT( SetEditCurrentArgument() ) );
|
connect( mySelBtn, SIGNAL( clicked() ), this, SLOT( SetEditCurrentArgument() ) );
|
||||||
connect( mySelBtn2, SIGNAL( clicked() ), this, SLOT( SetEditCurrentArgument() ) );
|
connect( mySelBtn2, SIGNAL( clicked() ), this, SLOT( SetEditCurrentArgument() ) );
|
||||||
}
|
}
|
||||||
else if ( myMode == EditGroup && IObjectCount() ) {
|
else if (myMode == EditGroup) {
|
||||||
|
SALOME_ListIO aSelList;
|
||||||
|
aSelMgr->selectedObjects(aSelList);
|
||||||
|
|
||||||
|
if (aSelList.Extent()) {
|
||||||
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(aSelList.First(), aResult);
|
||||||
|
|
||||||
if ( aResult && !CORBA::is_nil( anObj ) && anObj->GetType() == GEOM_GROUP ) {
|
if ( aResult && !CORBA::is_nil( anObj ) && anObj->GetType() == GEOM_GROUP ) {
|
||||||
myGroup = anObj;
|
myGroup = anObj;
|
||||||
@ -196,9 +202,9 @@ void GroupGUI_GroupDlg::Init()
|
|||||||
}
|
}
|
||||||
connect( mySelBtn2, SIGNAL( clicked() ), this, SLOT( SetEditCurrentArgument() ) );
|
connect( mySelBtn2, SIGNAL( clicked() ), this, SLOT( SetEditCurrentArgument() ) );
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
connect( myGeomGUI->getApp()->selectionMgr(), SIGNAL( currentSelectionChanged() ),
|
connect( aSelMgr, SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument()) );
|
||||||
this, SLOT( SelectionIntoArgument() ) );
|
|
||||||
|
|
||||||
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() ) );
|
||||||
@ -354,12 +360,16 @@ void GroupGUI_GroupDlg::onGetInPlace()
|
|||||||
myIdList->clearSelection();
|
myIdList->clearSelection();
|
||||||
myIdList->blockSignals( isBlocked );
|
myIdList->blockSignals( isBlocked );
|
||||||
|
|
||||||
if (IObjectCount() != 1 )
|
LightApp_SelectionMgr* aSelMgr = myGeomGUI->getApp()->selectionMgr();
|
||||||
|
SALOME_ListIO aSelList;
|
||||||
|
aSelMgr->selectedObjects(aSelList);
|
||||||
|
|
||||||
|
if (aSelList.Extent() != 1)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
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(aSelList.First(), aResult);
|
||||||
if (aResult && !anObj->_is_nil() && GEOMBase::IsShape(anObj)) {
|
if (aResult && !anObj->_is_nil() && GEOMBase::IsShape(anObj)) {
|
||||||
if (!anObj->_is_equivalent(myMainObj) && !anObj->_is_equivalent(myGroup)) {
|
if (!anObj->_is_equivalent(myMainObj) && !anObj->_is_equivalent(myGroup)) {
|
||||||
SUIT_OverrideCursor wc;
|
SUIT_OverrideCursor wc;
|
||||||
@ -435,14 +445,18 @@ void GroupGUI_GroupDlg::SelectionIntoArgument()
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
LightApp_SelectionMgr* aSelMgr = myGeomGUI->getApp()->selectionMgr();
|
||||||
|
SALOME_ListIO aSelList;
|
||||||
|
aSelMgr->selectedObjects(aSelList);
|
||||||
|
|
||||||
if (myEditCurrentArgument == myMainName) { // Selection of a main shape is active
|
if (myEditCurrentArgument == myMainName) { // Selection of a main shape is active
|
||||||
myEditCurrentArgument->setText("");
|
myEditCurrentArgument->setText("");
|
||||||
myIdList->clear();
|
myIdList->clear();
|
||||||
|
|
||||||
if ( IObjectCount() == 1 ) {
|
if (aSelList.Extent() == 1) {
|
||||||
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(aSelList.First(), aResult);
|
||||||
|
|
||||||
if ( aResult && !anObj->_is_nil() && GEOMBase::IsShape( anObj ) ) {
|
if ( aResult && !anObj->_is_nil() && GEOMBase::IsShape( anObj ) ) {
|
||||||
myMainObj = anObj;
|
myMainObj = anObj;
|
||||||
@ -468,17 +482,10 @@ void GroupGUI_GroupDlg::SelectionIntoArgument()
|
|||||||
|
|
||||||
TColStd_IndexedMapOfInteger aMapIndex;
|
TColStd_IndexedMapOfInteger aMapIndex;
|
||||||
|
|
||||||
SALOME_ListIO aSelIOs;
|
|
||||||
SalomeApp_Application* app = myGeomGUI->getApp();
|
|
||||||
if ( app ) {
|
|
||||||
LightApp_SelectionMgr* aSelMgr = app->selectionMgr();
|
|
||||||
if ( aSelMgr ) {
|
|
||||||
LightApp_SelectionMgr::MapEntryOfMapOfInteger aMap;
|
LightApp_SelectionMgr::MapEntryOfMapOfInteger aMap;
|
||||||
aSelMgr->selectedSubOwners( aMap );
|
aSelMgr->selectedSubOwners( aMap );
|
||||||
if ( aMap.Size() == 1 )
|
if ( aMap.Size() == 1 )
|
||||||
aMapIndex = LightApp_SelectionMgr::MapEntryOfMapOfInteger::Iterator( aMap ).Value();
|
aMapIndex = LightApp_SelectionMgr::MapEntryOfMapOfInteger::Iterator( aMap ).Value();
|
||||||
}
|
|
||||||
}
|
|
||||||
bool subselected = aMapIndex.Extent();
|
bool subselected = aMapIndex.Extent();
|
||||||
|
|
||||||
// convert inPlace indices to main indices
|
// convert inPlace indices to main indices
|
||||||
@ -502,7 +509,7 @@ void GroupGUI_GroupDlg::SelectionIntoArgument()
|
|||||||
globalSelection( GEOM_ALLSHAPES );
|
globalSelection( GEOM_ALLSHAPES );
|
||||||
|
|
||||||
GEOM::ListOfGO anObjects;
|
GEOM::ListOfGO anObjects;
|
||||||
GEOMBase::ConvertListOfIOInListOfGO(selectedIO(), anObjects);
|
GEOMBase::ConvertListOfIOInListOfGO(aSelList, anObjects);
|
||||||
|
|
||||||
GEOM::GEOM_ILocalOperations_var aLocOp = getGeomEngine()->GetILocalOperations( getStudyId() );
|
GEOM::GEOM_ILocalOperations_var aLocOp = getGeomEngine()->GetILocalOperations( getStudyId() );
|
||||||
GEOM::GEOM_IShapesOperations_var aShapesOp = getGeomEngine()->GetIShapesOperations( getStudyId() );
|
GEOM::GEOM_IShapesOperations_var aShapesOp = getGeomEngine()->GetIShapesOperations( getStudyId() );
|
||||||
|
@ -29,6 +29,8 @@
|
|||||||
#include <GEOMBase.h>
|
#include <GEOMBase.h>
|
||||||
#include <DlgRef.h>
|
#include <DlgRef.h>
|
||||||
|
|
||||||
|
#include <GeometryGUI.h>
|
||||||
|
|
||||||
#include <SUIT_Desktop.h>
|
#include <SUIT_Desktop.h>
|
||||||
#include <SUIT_Session.h>
|
#include <SUIT_Session.h>
|
||||||
#include <SUIT_ResourceMgr.h>
|
#include <SUIT_ResourceMgr.h>
|
||||||
@ -38,7 +40,8 @@
|
|||||||
#include <SUIT_ViewManager.h>
|
#include <SUIT_ViewManager.h>
|
||||||
#include <SOCC_Prs.h>
|
#include <SOCC_Prs.h>
|
||||||
#include <SOCC_ViewModel.h>
|
#include <SOCC_ViewModel.h>
|
||||||
//#include "SalomeApp_Application.h"
|
#include <SalomeApp_Application.h>
|
||||||
|
#include <LightApp_SelectionMgr.h>
|
||||||
|
|
||||||
// OCCT Includes
|
// OCCT Includes
|
||||||
#include <AIS_AngleDimension.hxx>
|
#include <AIS_AngleDimension.hxx>
|
||||||
@ -146,9 +149,13 @@ void MeasureGUI_AngleDlg::Init()
|
|||||||
//=================================================================================
|
//=================================================================================
|
||||||
void MeasureGUI_AngleDlg::SelectionIntoArgument()
|
void MeasureGUI_AngleDlg::SelectionIntoArgument()
|
||||||
{
|
{
|
||||||
|
LightApp_SelectionMgr* aSelMgr = myGeomGUI->getApp()->selectionMgr();
|
||||||
|
SALOME_ListIO aSelList;
|
||||||
|
aSelMgr->selectedObjects(aSelList);
|
||||||
|
|
||||||
Standard_Boolean testResult = Standard_False;
|
Standard_Boolean testResult = Standard_False;
|
||||||
GEOM::GEOM_Object_var aSelectedObject =
|
GEOM::GEOM_Object_var aSelectedObject =
|
||||||
GEOMBase::ConvertIOinGEOMObject( firstIObject(), testResult );
|
GEOMBase::ConvertIOinGEOMObject(aSelList.First(), testResult);
|
||||||
|
|
||||||
if ( !testResult )
|
if ( !testResult )
|
||||||
aSelectedObject = GEOM::GEOM_Object::_nil();
|
aSelectedObject = GEOM::GEOM_Object::_nil();
|
||||||
@ -244,7 +251,11 @@ void MeasureGUI_AngleDlg::LineEditReturnPressed()
|
|||||||
else
|
else
|
||||||
myEditCurrentArgument = mySelEdit2;
|
myEditCurrentArgument = mySelEdit2;
|
||||||
|
|
||||||
if ( GEOMBase::SelectionByNameInDialogs( this, mySelEdit->text(), selectedIO() ) )
|
LightApp_SelectionMgr* aSelMgr = myGeomGUI->getApp()->selectionMgr();
|
||||||
|
SALOME_ListIO aSelList;
|
||||||
|
aSelMgr->selectedObjects(aSelList);
|
||||||
|
|
||||||
|
if (GEOMBase::SelectionByNameInDialogs(this, mySelEdit->text(), aSelList))
|
||||||
mySelEdit->setText(mySelEdit->text());
|
mySelEdit->setText(mySelEdit->text());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -29,6 +29,8 @@
|
|||||||
#include <DlgRef.h>
|
#include <DlgRef.h>
|
||||||
#include <GEOMBase.h>
|
#include <GEOMBase.h>
|
||||||
|
|
||||||
|
#include <GeometryGUI.h>
|
||||||
|
|
||||||
#include <SUIT_Session.h>
|
#include <SUIT_Session.h>
|
||||||
#include <SUIT_ResourceMgr.h>
|
#include <SUIT_ResourceMgr.h>
|
||||||
#include <SalomeApp_Application.h>
|
#include <SalomeApp_Application.h>
|
||||||
@ -158,14 +160,18 @@ void MeasureGUI_CenterMassDlg::SelectionIntoArgument()
|
|||||||
erasePreview();
|
erasePreview();
|
||||||
myObj = GEOM::GEOM_Object::_nil();
|
myObj = GEOM::GEOM_Object::_nil();
|
||||||
|
|
||||||
if ( IObjectCount() != 1 ) {
|
LightApp_SelectionMgr* aSelMgr = myGeomGUI->getApp()->selectionMgr();
|
||||||
|
SALOME_ListIO aSelList;
|
||||||
|
aSelMgr->selectedObjects(aSelList);
|
||||||
|
|
||||||
|
if (aSelList.Extent() != 1) {
|
||||||
processObject();
|
processObject();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
Standard_Boolean testResult = Standard_False;
|
Standard_Boolean testResult = Standard_False;
|
||||||
GEOM::GEOM_Object_var aSelectedObject =
|
GEOM::GEOM_Object_var aSelectedObject =
|
||||||
GEOMBase::ConvertIOinGEOMObject( firstIObject(), testResult );
|
GEOMBase::ConvertIOinGEOMObject(aSelList.First(), testResult);
|
||||||
|
|
||||||
if (!testResult || aSelectedObject->_is_nil()) {
|
if (!testResult || aSelectedObject->_is_nil()) {
|
||||||
processObject();
|
processObject();
|
||||||
@ -177,7 +183,6 @@ void MeasureGUI_CenterMassDlg::SelectionIntoArgument()
|
|||||||
displayPreview();
|
displayPreview();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
//=================================================================================
|
//=================================================================================
|
||||||
// function : SetEditCurrentArgument()
|
// function : SetEditCurrentArgument()
|
||||||
// purpose :
|
// purpose :
|
||||||
|
@ -165,7 +165,11 @@ void MeasureGUI_CheckCompoundOfBlocksDlg::SelectionIntoArgument()
|
|||||||
erasePreview();
|
erasePreview();
|
||||||
myObj = GEOM::GEOM_Object::_nil();
|
myObj = GEOM::GEOM_Object::_nil();
|
||||||
|
|
||||||
if ( IObjectCount() != 1 ) {
|
LightApp_SelectionMgr* aSelMgr = myGeomGUI->getApp()->selectionMgr();
|
||||||
|
SALOME_ListIO aSelList;
|
||||||
|
aSelMgr->selectedObjects(aSelList);
|
||||||
|
|
||||||
|
if (aSelList.Extent() != 1) {
|
||||||
myGrp->LineEdit1->setText( "" );
|
myGrp->LineEdit1->setText( "" );
|
||||||
processObject();
|
processObject();
|
||||||
return;
|
return;
|
||||||
@ -173,7 +177,7 @@ void MeasureGUI_CheckCompoundOfBlocksDlg::SelectionIntoArgument()
|
|||||||
|
|
||||||
Standard_Boolean testResult = Standard_False;
|
Standard_Boolean testResult = Standard_False;
|
||||||
GEOM::GEOM_Object_var aSelectedObject =
|
GEOM::GEOM_Object_var aSelectedObject =
|
||||||
GEOMBase::ConvertIOinGEOMObject( firstIObject(), testResult );
|
GEOMBase::ConvertIOinGEOMObject(aSelList.First(), testResult);
|
||||||
|
|
||||||
if ( !testResult || aSelectedObject->_is_nil() ) {
|
if ( !testResult || aSelectedObject->_is_nil() ) {
|
||||||
myGrp->LineEdit1->setText( "" );
|
myGrp->LineEdit1->setText( "" );
|
||||||
|
@ -29,6 +29,8 @@
|
|||||||
#include <GEOMBase.h>
|
#include <GEOMBase.h>
|
||||||
#include <DlgRef.h>
|
#include <DlgRef.h>
|
||||||
|
|
||||||
|
#include <GeometryGUI.h>
|
||||||
|
|
||||||
#include <SUIT_Session.h>
|
#include <SUIT_Session.h>
|
||||||
#include <SUIT_Desktop.h>
|
#include <SUIT_Desktop.h>
|
||||||
#include <SUIT_ResourceMgr.h>
|
#include <SUIT_ResourceMgr.h>
|
||||||
@ -37,6 +39,8 @@
|
|||||||
#include <SOCC_Prs.h>
|
#include <SOCC_Prs.h>
|
||||||
#include <SOCC_ViewModel.h>
|
#include <SOCC_ViewModel.h>
|
||||||
#include <SalomeApp_Tools.h>
|
#include <SalomeApp_Tools.h>
|
||||||
|
#include <SalomeApp_Application.h>
|
||||||
|
#include <LightApp_SelectionMgr.h>
|
||||||
|
|
||||||
#include <Geom_Plane.hxx>
|
#include <Geom_Plane.hxx>
|
||||||
#include <AIS_LengthDimension.hxx>
|
#include <AIS_LengthDimension.hxx>
|
||||||
@ -132,9 +136,13 @@ void MeasureGUI_DistanceDlg::Init()
|
|||||||
//=================================================================================
|
//=================================================================================
|
||||||
void MeasureGUI_DistanceDlg::SelectionIntoArgument()
|
void MeasureGUI_DistanceDlg::SelectionIntoArgument()
|
||||||
{
|
{
|
||||||
|
LightApp_SelectionMgr* aSelMgr = myGeomGUI->getApp()->selectionMgr();
|
||||||
|
SALOME_ListIO aSelList;
|
||||||
|
aSelMgr->selectedObjects(aSelList);
|
||||||
|
|
||||||
Standard_Boolean testResult = Standard_False;
|
Standard_Boolean testResult = Standard_False;
|
||||||
GEOM::GEOM_Object_var aSelectedObject =
|
GEOM::GEOM_Object_var aSelectedObject =
|
||||||
GEOMBase::ConvertIOinGEOMObject( firstIObject(), testResult );
|
GEOMBase::ConvertIOinGEOMObject(aSelList.First(), testResult);
|
||||||
|
|
||||||
if ( !testResult )
|
if ( !testResult )
|
||||||
aSelectedObject = GEOM::GEOM_Object::_nil();
|
aSelectedObject = GEOM::GEOM_Object::_nil();
|
||||||
@ -241,7 +249,11 @@ void MeasureGUI_DistanceDlg::LineEditReturnPressed()
|
|||||||
else
|
else
|
||||||
myEditCurrentArgument = mySelEdit2;
|
myEditCurrentArgument = mySelEdit2;
|
||||||
|
|
||||||
if ( GEOMBase::SelectionByNameInDialogs( this, mySelEdit->text(), selectedIO() ) )
|
LightApp_SelectionMgr* aSelMgr = myGeomGUI->getApp()->selectionMgr();
|
||||||
|
SALOME_ListIO aSelList;
|
||||||
|
aSelMgr->selectedObjects(aSelList);
|
||||||
|
|
||||||
|
if (GEOMBase::SelectionByNameInDialogs(this, mySelEdit->text(), aSelList))
|
||||||
mySelEdit->setText(mySelEdit->text());
|
mySelEdit->setText(mySelEdit->text());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -168,13 +168,17 @@ void MeasureGUI_NormaleDlg::SelectionIntoArgument()
|
|||||||
myPoint = GEOM::GEOM_Object::_nil();
|
myPoint = GEOM::GEOM_Object::_nil();
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( IObjectCount() != 1 )
|
LightApp_SelectionMgr* aSelMgr = myGeomGUI->getApp()->selectionMgr();
|
||||||
|
SALOME_ListIO aSelList;
|
||||||
|
aSelMgr->selectedObjects(aSelList);
|
||||||
|
|
||||||
|
if (aSelList.Extent() != 1)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
// nbSel == 1
|
// nbSel == 1
|
||||||
Standard_Boolean testResult = Standard_False;
|
Standard_Boolean testResult = Standard_False;
|
||||||
GEOM::GEOM_Object_var aSelectedObject =
|
GEOM::GEOM_Object_var aSelectedObject =
|
||||||
GEOMBase::ConvertIOinGEOMObject( firstIObject(), testResult );
|
GEOMBase::ConvertIOinGEOMObject(aSelList.First(), testResult);
|
||||||
|
|
||||||
if ( !testResult )
|
if ( !testResult )
|
||||||
return;
|
return;
|
||||||
@ -185,9 +189,8 @@ void MeasureGUI_NormaleDlg::SelectionIntoArgument()
|
|||||||
TopoDS_Shape aShape;
|
TopoDS_Shape aShape;
|
||||||
if ( GEOMBase::GetShape( aSelectedObject, aShape, TopAbs_SHAPE ) && !aShape.IsNull() )
|
if ( GEOMBase::GetShape( aSelectedObject, aShape, TopAbs_SHAPE ) && !aShape.IsNull() )
|
||||||
{
|
{
|
||||||
LightApp_SelectionMgr* aSelMgr = myGeomGUI->getApp()->selectionMgr();
|
|
||||||
TColStd_IndexedMapOfInteger aMap;
|
TColStd_IndexedMapOfInteger aMap;
|
||||||
aSelMgr->GetIndexes( firstIObject(), aMap );
|
aSelMgr->GetIndexes(aSelList.First(), aMap);
|
||||||
if ( aMap.Extent() == 1 ) // Local Selection
|
if ( aMap.Extent() == 1 ) // Local Selection
|
||||||
{
|
{
|
||||||
GEOM::GEOM_IShapesOperations_var aShapesOp = getGeomEngine()->GetIShapesOperations( getStudyId() );
|
GEOM::GEOM_IShapesOperations_var aShapesOp = getGeomEngine()->GetIShapesOperations( getStudyId() );
|
||||||
@ -209,9 +212,8 @@ void MeasureGUI_NormaleDlg::SelectionIntoArgument()
|
|||||||
TopoDS_Shape aShape;
|
TopoDS_Shape aShape;
|
||||||
if ( GEOMBase::GetShape( aSelectedObject, aShape, TopAbs_SHAPE ) && !aShape.IsNull() )
|
if ( GEOMBase::GetShape( aSelectedObject, aShape, TopAbs_SHAPE ) && !aShape.IsNull() )
|
||||||
{
|
{
|
||||||
LightApp_SelectionMgr* aSelMgr = myGeomGUI->getApp()->selectionMgr();
|
|
||||||
TColStd_IndexedMapOfInteger aMap;
|
TColStd_IndexedMapOfInteger aMap;
|
||||||
aSelMgr->GetIndexes( firstIObject(), aMap );
|
aSelMgr->GetIndexes(aSelList.First(), aMap);
|
||||||
if ( aMap.Extent() == 1 ) // Local Selection
|
if ( aMap.Extent() == 1 ) // Local Selection
|
||||||
{
|
{
|
||||||
GEOM::GEOM_IShapesOperations_var aShapesOp = getGeomEngine()->GetIShapesOperations( getStudyId() );
|
GEOM::GEOM_IShapesOperations_var aShapesOp = getGeomEngine()->GetIShapesOperations( getStudyId() );
|
||||||
|
@ -29,6 +29,8 @@
|
|||||||
#include <GEOMBase.h>
|
#include <GEOMBase.h>
|
||||||
#include <DlgRef.h>
|
#include <DlgRef.h>
|
||||||
|
|
||||||
|
#include <GeometryGUI.h>
|
||||||
|
|
||||||
#include <SUIT_Session.h>
|
#include <SUIT_Session.h>
|
||||||
#include <SUIT_ResourceMgr.h>
|
#include <SUIT_ResourceMgr.h>
|
||||||
#include <SalomeApp_Application.h>
|
#include <SalomeApp_Application.h>
|
||||||
@ -125,9 +127,13 @@ void MeasureGUI_PointDlg::SelectionIntoArgument()
|
|||||||
myGrp->LineEdit3->setText( "" );
|
myGrp->LineEdit3->setText( "" );
|
||||||
myGrp->LineEdit4->setText( "" );
|
myGrp->LineEdit4->setText( "" );
|
||||||
|
|
||||||
|
LightApp_SelectionMgr* aSelMgr = myGeomGUI->getApp()->selectionMgr();
|
||||||
|
SALOME_ListIO aSelList;
|
||||||
|
aSelMgr->selectedObjects(aSelList);
|
||||||
|
|
||||||
Standard_Boolean testResult = Standard_False;
|
Standard_Boolean testResult = Standard_False;
|
||||||
GEOM::GEOM_Object_var aSelectedObject =
|
GEOM::GEOM_Object_var aSelectedObject =
|
||||||
GEOMBase::ConvertIOinGEOMObject( firstIObject(), testResult );
|
GEOMBase::ConvertIOinGEOMObject(aSelList.First(), testResult);
|
||||||
|
|
||||||
if ( !testResult || aSelectedObject->_is_nil() )
|
if ( !testResult || aSelectedObject->_is_nil() )
|
||||||
return;
|
return;
|
||||||
@ -135,8 +141,7 @@ void MeasureGUI_PointDlg::SelectionIntoArgument()
|
|||||||
myObj = aSelectedObject;
|
myObj = aSelectedObject;
|
||||||
|
|
||||||
TColStd_IndexedMapOfInteger anIndexes;
|
TColStd_IndexedMapOfInteger anIndexes;
|
||||||
( (SalomeApp_Application*)( SUIT_Session::session()->activeApplication() ) )->
|
aSelMgr->GetIndexes(aSelList.First(), anIndexes);
|
||||||
selectionMgr()->GetIndexes( firstIObject(), anIndexes );
|
|
||||||
|
|
||||||
TopoDS_Shape aShape;
|
TopoDS_Shape aShape;
|
||||||
if ( anIndexes.Extent() > 1 || !GEOMBase::GetShape( myObj, aShape ) || aShape.IsNull() )
|
if ( anIndexes.Extent() > 1 || !GEOMBase::GetShape( myObj, aShape ) || aShape.IsNull() )
|
||||||
|
@ -179,7 +179,11 @@ void MeasureGUI_Skeleton::LineEditReturnPressed()
|
|||||||
const QString objectUserName = mySelEdit->text();
|
const QString objectUserName = mySelEdit->text();
|
||||||
QWidget* thisWidget = ( QWidget* )this;
|
QWidget* thisWidget = ( QWidget* )this;
|
||||||
|
|
||||||
if ( GEOMBase::SelectionByNameInDialogs( thisWidget, objectUserName, selectedIO() ) )
|
LightApp_SelectionMgr* aSelMgr = myGeomGUI->getApp()->selectionMgr();
|
||||||
|
SALOME_ListIO aSelList;
|
||||||
|
aSelMgr->selectedObjects(aSelList);
|
||||||
|
|
||||||
|
if (GEOMBase::SelectionByNameInDialogs(thisWidget, objectUserName, aSelList))
|
||||||
mySelEdit->setText(objectUserName);
|
mySelEdit->setText(objectUserName);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -242,9 +246,13 @@ void MeasureGUI_Skeleton::SelectionIntoArgument()
|
|||||||
{
|
{
|
||||||
myObj = GEOM::GEOM_Object::_nil();
|
myObj = GEOM::GEOM_Object::_nil();
|
||||||
|
|
||||||
|
LightApp_SelectionMgr* aSelMgr = myGeomGUI->getApp()->selectionMgr();
|
||||||
|
SALOME_ListIO aSelList;
|
||||||
|
aSelMgr->selectedObjects(aSelList);
|
||||||
|
|
||||||
Standard_Boolean testResult = Standard_False;
|
Standard_Boolean testResult = Standard_False;
|
||||||
GEOM::GEOM_Object_var aSelectedObject =
|
GEOM::GEOM_Object_var aSelectedObject =
|
||||||
GEOMBase::ConvertIOinGEOMObject( firstIObject(), testResult );
|
GEOMBase::ConvertIOinGEOMObject(aSelList.First(), testResult);
|
||||||
|
|
||||||
if (!testResult || aSelectedObject->_is_nil()) {
|
if (!testResult || aSelectedObject->_is_nil()) {
|
||||||
mySelEdit->setText("");
|
mySelEdit->setText("");
|
||||||
|
@ -168,7 +168,6 @@ bool OperationGUI_ArchimedeDlg::ClickOnApply()
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
//=================================================================================
|
//=================================================================================
|
||||||
// function : SelectionIntoArgument()
|
// function : SelectionIntoArgument()
|
||||||
// purpose : Called when selection as changed or other case
|
// purpose : Called when selection as changed or other case
|
||||||
@ -178,11 +177,15 @@ void OperationGUI_ArchimedeDlg::SelectionIntoArgument()
|
|||||||
myEditCurrentArgument->setText("");
|
myEditCurrentArgument->setText("");
|
||||||
myShape = GEOM::GEOM_Object::_nil();
|
myShape = GEOM::GEOM_Object::_nil();
|
||||||
|
|
||||||
if ( IObjectCount() != 1 )
|
LightApp_SelectionMgr* aSelMgr = myGeomGUI->getApp()->selectionMgr();
|
||||||
|
SALOME_ListIO aSelList;
|
||||||
|
aSelMgr->selectedObjects(aSelList);
|
||||||
|
|
||||||
|
if (aSelList.Extent() != 1)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
Standard_Boolean testResult = Standard_False;
|
Standard_Boolean testResult = Standard_False;
|
||||||
myShape = GEOMBase::ConvertIOinGEOMObject( firstIObject(), testResult );
|
myShape = GEOMBase::ConvertIOinGEOMObject(aSelList.First(), testResult);
|
||||||
|
|
||||||
if (!testResult || myShape->_is_nil() || !GEOMBase::IsShape(myShape)) {
|
if (!testResult || myShape->_is_nil() || !GEOMBase::IsShape(myShape)) {
|
||||||
myShape = GEOM::GEOM_Object::_nil();
|
myShape = GEOM::GEOM_Object::_nil();
|
||||||
@ -192,7 +195,6 @@ void OperationGUI_ArchimedeDlg::SelectionIntoArgument()
|
|||||||
myEditCurrentArgument->setText(GEOMBase::GetName(myShape));
|
myEditCurrentArgument->setText(GEOMBase::GetName(myShape));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
//=================================================================================
|
//=================================================================================
|
||||||
// function : LineEditReturnPressed()
|
// function : LineEditReturnPressed()
|
||||||
// purpose :
|
// purpose :
|
||||||
|
@ -348,7 +348,6 @@ bool OperationGUI_ChamferDlg::ClickOnApply()
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
//=================================================================================
|
//=================================================================================
|
||||||
// function : SelectionIntoArgument()
|
// function : SelectionIntoArgument()
|
||||||
// purpose : Called when selection has changed
|
// purpose : Called when selection has changed
|
||||||
@ -368,12 +367,17 @@ void OperationGUI_ChamferDlg::SelectionIntoArgument()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
LightApp_SelectionMgr* aSelMgr = myGeomGUI->getApp()->selectionMgr();
|
||||||
|
SALOME_ListIO aSelList;
|
||||||
|
aSelMgr->selectedObjects(aSelList);
|
||||||
|
|
||||||
// If selection of main object is activated
|
// If selection of main object is activated
|
||||||
if ( aCurrFocus == MainObj1 || aCurrFocus == MainObj2 || aCurrFocus == MainObj3 || aCurrFocus == MainObj4) {
|
if (aCurrFocus == MainObj1 || aCurrFocus == MainObj2 || aCurrFocus == MainObj3 || aCurrFocus == MainObj4)
|
||||||
if ( IObjectCount() == 1 ) {
|
{
|
||||||
|
if (aSelList.Extent() == 1) {
|
||||||
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(aSelList.First(), aResult);
|
||||||
|
|
||||||
if ( aResult && !anObj->_is_nil() ) {
|
if ( aResult && !anObj->_is_nil() ) {
|
||||||
myShape = anObj;
|
myShape = anObj;
|
||||||
@ -388,15 +392,16 @@ void OperationGUI_ChamferDlg::SelectionIntoArgument()
|
|||||||
enableWidgets();
|
enableWidgets();
|
||||||
}
|
}
|
||||||
// If face selection of second tab is activated
|
// If face selection of second tab is activated
|
||||||
else if ( aCurrFocus == Face1 || aCurrFocus == Face2 ) {
|
else if (aCurrFocus == Face1 || aCurrFocus == Face2)
|
||||||
if ( IObjectCount() == 1 ) {
|
{
|
||||||
|
if (aSelList.Extent() == 1) {
|
||||||
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(aSelList.First(), aResult);
|
||||||
|
|
||||||
if ( aResult && !anObj->_is_nil() ) {
|
if ( aResult && !anObj->_is_nil() ) {
|
||||||
TColStd_IndexedMapOfInteger anIndexes;
|
TColStd_IndexedMapOfInteger anIndexes;
|
||||||
( (SalomeApp_Application*)( SUIT_Session::session()->activeApplication() ) )->selectionMgr()->GetIndexes( firstIObject(), anIndexes );
|
aSelMgr->GetIndexes(aSelList.First(), anIndexes);
|
||||||
|
|
||||||
if (anIndexes.Extent() == 1) {
|
if (anIndexes.Extent() == 1) {
|
||||||
int anIndex = anIndexes(1);
|
int anIndex = anIndexes(1);
|
||||||
@ -413,14 +418,14 @@ void OperationGUI_ChamferDlg::SelectionIntoArgument()
|
|||||||
}
|
}
|
||||||
// If face selection of third or fourth tab is activated
|
// If face selection of third or fourth tab is activated
|
||||||
else if (aCurrFocus == Faces || aCurrFocus == Edges) {
|
else if (aCurrFocus == Faces || aCurrFocus == Edges) {
|
||||||
if ( IObjectCount() == 1 ) {
|
if (aSelList.Extent() == 1) {
|
||||||
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(aSelList.First(), aResult);
|
||||||
|
|
||||||
if ( aResult && !anObj->_is_nil() ) {
|
if ( aResult && !anObj->_is_nil() ) {
|
||||||
TColStd_IndexedMapOfInteger anIndexes;
|
TColStd_IndexedMapOfInteger anIndexes;
|
||||||
( (SalomeApp_Application*)( SUIT_Session::session()->activeApplication() ) )->selectionMgr()->GetIndexes( firstIObject(), anIndexes );
|
aSelMgr->GetIndexes(aSelList.First(), anIndexes);
|
||||||
|
|
||||||
if (anIndexes.Extent() > 0) {
|
if (anIndexes.Extent() > 0) {
|
||||||
QString aName;
|
QString aName;
|
||||||
|
@ -299,14 +299,19 @@ void OperationGUI_FilletDlg::SelectionIntoArgument()
|
|||||||
erasePreview();
|
erasePreview();
|
||||||
myEditCurrentArgument->setText( "" );
|
myEditCurrentArgument->setText( "" );
|
||||||
|
|
||||||
|
LightApp_SelectionMgr* aSelMgr = myGeomGUI->getApp()->selectionMgr();
|
||||||
|
SALOME_ListIO aSelList;
|
||||||
|
aSelMgr->selectedObjects(aSelList);
|
||||||
|
|
||||||
// If selection of main object is activated
|
// If selection of main object is activated
|
||||||
if (myEditCurrentArgument == Group1->LineEdit1 ||
|
if (myEditCurrentArgument == Group1->LineEdit1 ||
|
||||||
myEditCurrentArgument == Group2->LineEdit1 ||
|
myEditCurrentArgument == Group2->LineEdit1 ||
|
||||||
myEditCurrentArgument == Group3->LineEdit1 ) {
|
myEditCurrentArgument == Group3->LineEdit1)
|
||||||
if ( IObjectCount() == 1 ) {
|
{
|
||||||
|
if (aSelList.Extent() == 1) {
|
||||||
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(aSelList.First(), aResult);
|
||||||
|
|
||||||
if (aResult && !anObj->_is_nil()) {
|
if (aResult && !anObj->_is_nil()) {
|
||||||
myShape = anObj;
|
myShape = anObj;
|
||||||
@ -322,15 +327,16 @@ void OperationGUI_FilletDlg::SelectionIntoArgument()
|
|||||||
}
|
}
|
||||||
// If face or edge selection is activated
|
// If face or edge selection is activated
|
||||||
else if (myEditCurrentArgument == Group2->LineEdit2 ||
|
else if (myEditCurrentArgument == Group2->LineEdit2 ||
|
||||||
myEditCurrentArgument == Group3->LineEdit2 ) {
|
myEditCurrentArgument == Group3->LineEdit2)
|
||||||
if ( IObjectCount() == 1 ) {
|
{
|
||||||
|
if (aSelList.Extent() == 1) {
|
||||||
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(aSelList.First(), aResult);
|
||||||
|
|
||||||
if (aResult && !anObj->_is_nil()) {
|
if (aResult && !anObj->_is_nil()) {
|
||||||
TColStd_IndexedMapOfInteger anIndexes;
|
TColStd_IndexedMapOfInteger anIndexes;
|
||||||
myGeomGUI->getApp()->selectionMgr()->GetIndexes( firstIObject(), anIndexes );
|
aSelMgr->GetIndexes(aSelList.First(), anIndexes);
|
||||||
|
|
||||||
if (anIndexes.Extent() > 0) {
|
if (anIndexes.Extent() > 0) {
|
||||||
QString aName;
|
QString aName;
|
||||||
@ -358,7 +364,6 @@ void OperationGUI_FilletDlg::SelectionIntoArgument()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
//=================================================================================
|
//=================================================================================
|
||||||
// function : LineEditReturnPressed()
|
// function : LineEditReturnPressed()
|
||||||
// purpose :
|
// purpose :
|
||||||
|
@ -175,11 +175,15 @@ void OperationGUI_GetShapesOnShapeDlg::SelectionIntoArgument()
|
|||||||
myEditCurrentArgument->setText( "" );
|
myEditCurrentArgument->setText( "" );
|
||||||
QString aString = "";
|
QString aString = "";
|
||||||
|
|
||||||
int nbSel = GEOMBase::GetNameOfSelectedIObjects( selectedIO(), aString, true );
|
LightApp_SelectionMgr* aSelMgr = myGeomGUI->getApp()->selectionMgr();
|
||||||
|
SALOME_ListIO aSelList;
|
||||||
|
aSelMgr->selectedObjects(aSelList);
|
||||||
|
|
||||||
|
int nbSel = GEOMBase::GetNameOfSelectedIObjects(aSelList, aString, true);
|
||||||
|
|
||||||
if (nbSel > 0) {
|
if (nbSel > 0) {
|
||||||
Standard_Boolean aRes = Standard_False;
|
Standard_Boolean aRes = Standard_False;
|
||||||
GEOM::GEOM_Object_var aSelectedObject = GEOMBase::ConvertIOinGEOMObject( firstIObject(), aRes );
|
GEOM::GEOM_Object_var aSelectedObject = GEOMBase::ConvertIOinGEOMObject(aSelList.First(), aRes);
|
||||||
if (!CORBA::is_nil(aSelectedObject) && aRes && GEOMBase::IsShape(aSelectedObject)) {
|
if (!CORBA::is_nil(aSelectedObject) && aRes && GEOMBase::IsShape(aSelectedObject)) {
|
||||||
{
|
{
|
||||||
myEditCurrentArgument->setText(GEOMBase::GetName(aSelectedObject));
|
myEditCurrentArgument->setText(GEOMBase::GetName(aSelectedObject));
|
||||||
@ -258,11 +262,11 @@ GEOM::GEOM_IOperations_ptr OperationGUI_GetShapesOnShapeDlg::createOperation()
|
|||||||
//=================================================================================
|
//=================================================================================
|
||||||
bool OperationGUI_GetShapesOnShapeDlg::isValid( QString& msg )
|
bool OperationGUI_GetShapesOnShapeDlg::isValid( QString& msg )
|
||||||
{
|
{
|
||||||
Handle(SALOME_InteractiveObject) IO = firstIObject();
|
//Handle(SALOME_InteractiveObject) IO = firstIObject();
|
||||||
Standard_Boolean testResult;
|
//Standard_Boolean testResult;
|
||||||
GEOM::GEOM_Object_var anObject = GEOMBase::ConvertIOinGEOMObject( IO, testResult );
|
//GEOM::GEOM_Object_var anObject = GEOMBase::ConvertIOinGEOMObject( IO, testResult );
|
||||||
if ( !testResult || anObject->_is_nil() )
|
//if ( !testResult || anObject->_is_nil() )
|
||||||
return false;
|
// return false;
|
||||||
|
|
||||||
return !CORBA::is_nil( myObject1 ) && !CORBA::is_nil( myObject2 );
|
return !CORBA::is_nil( myObject1 ) && !CORBA::is_nil( myObject2 );
|
||||||
}
|
}
|
||||||
|
@ -235,7 +235,11 @@ void OperationGUI_PartitionDlg::SelectionIntoArgument()
|
|||||||
myEditCurrentArgument->setText( "" );
|
myEditCurrentArgument->setText( "" );
|
||||||
QString aString = "";
|
QString aString = "";
|
||||||
|
|
||||||
int nbSel = GEOMBase::GetNameOfSelectedIObjects( selectedIO(), aString, true );
|
LightApp_SelectionMgr* aSelMgr = myGeomGUI->getApp()->selectionMgr();
|
||||||
|
SALOME_ListIO aSelList;
|
||||||
|
aSelMgr->selectedObjects(aSelList);
|
||||||
|
|
||||||
|
int nbSel = GEOMBase::GetNameOfSelectedIObjects(aSelList, aString, true);
|
||||||
|
|
||||||
if ( nbSel < 1 ) {
|
if ( nbSel < 1 ) {
|
||||||
if ( myEditCurrentArgument == GroupPoints->LineEdit1 ) {
|
if ( myEditCurrentArgument == GroupPoints->LineEdit1 ) {
|
||||||
@ -256,13 +260,13 @@ void OperationGUI_PartitionDlg::SelectionIntoArgument()
|
|||||||
}
|
}
|
||||||
|
|
||||||
if ( myEditCurrentArgument == GroupPoints->LineEdit1 ) {
|
if ( myEditCurrentArgument == GroupPoints->LineEdit1 ) {
|
||||||
GEOMBase::ConvertListOfIOInListOfGO( selectedIO(), myListShapes, true );
|
GEOMBase::ConvertListOfIOInListOfGO(aSelList, myListShapes, true);
|
||||||
myListMaterials.length( 0 );
|
myListMaterials.length( 0 );
|
||||||
if ( !myListShapes.length() )
|
if ( !myListShapes.length() )
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
else if ( myEditCurrentArgument == GroupPoints->LineEdit2 ) {
|
else if ( myEditCurrentArgument == GroupPoints->LineEdit2 ) {
|
||||||
GEOMBase::ConvertListOfIOInListOfGO( selectedIO(), myListTools, true );
|
GEOMBase::ConvertListOfIOInListOfGO(aSelList, myListTools, true);
|
||||||
if ( !myListTools.length() )
|
if ( !myListTools.length() )
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -249,7 +249,11 @@ void PrimitiveGUI_BoxDlg::SelectionIntoArgument()
|
|||||||
|
|
||||||
myEditCurrentArgument->setText( "" );
|
myEditCurrentArgument->setText( "" );
|
||||||
|
|
||||||
if ( IObjectCount() != 1 ) {
|
LightApp_SelectionMgr* aSelMgr = myGeomGUI->getApp()->selectionMgr();
|
||||||
|
SALOME_ListIO aSelList;
|
||||||
|
aSelMgr->selectedObjects(aSelList);
|
||||||
|
|
||||||
|
if ( aSelList.Extent() != 1 ) {
|
||||||
if ( myEditCurrentArgument == GroupPoints->LineEdit1 )
|
if ( myEditCurrentArgument == GroupPoints->LineEdit1 )
|
||||||
myPoint1 = GEOM::GEOM_Object::_nil();
|
myPoint1 = GEOM::GEOM_Object::_nil();
|
||||||
else if ( myEditCurrentArgument == GroupPoints->LineEdit2 )
|
else if ( myEditCurrentArgument == GroupPoints->LineEdit2 )
|
||||||
@ -259,7 +263,7 @@ void PrimitiveGUI_BoxDlg::SelectionIntoArgument()
|
|||||||
|
|
||||||
// nbSel == 1
|
// nbSel == 1
|
||||||
Standard_Boolean testResult = Standard_False;
|
Standard_Boolean testResult = Standard_False;
|
||||||
GEOM::GEOM_Object_var aSelectedObject = GEOMBase::ConvertIOinGEOMObject( firstIObject(), testResult );
|
GEOM::GEOM_Object_var aSelectedObject = GEOMBase::ConvertIOinGEOMObject( aSelList.First(), testResult );
|
||||||
|
|
||||||
if ( !testResult || CORBA::is_nil( aSelectedObject ) )
|
if ( !testResult || CORBA::is_nil( aSelectedObject ) )
|
||||||
return;
|
return;
|
||||||
@ -267,9 +271,8 @@ void PrimitiveGUI_BoxDlg::SelectionIntoArgument()
|
|||||||
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() ) {
|
||||||
LightApp_SelectionMgr* aSelMgr = myGeomGUI->getApp()->selectionMgr();
|
|
||||||
TColStd_IndexedMapOfInteger aMap;
|
TColStd_IndexedMapOfInteger aMap;
|
||||||
aSelMgr->GetIndexes( firstIObject(), aMap );
|
aSelMgr->GetIndexes( aSelList.First(), aMap );
|
||||||
if ( aMap.Extent() == 1) { // Local Selection
|
if ( aMap.Extent() == 1) { // Local Selection
|
||||||
int anIndex = aMap( 1 );
|
int anIndex = aMap( 1 );
|
||||||
aName.append( ":vertex_" + QString::number( anIndex ) );
|
aName.append( ":vertex_" + QString::number( anIndex ) );
|
||||||
|
@ -254,7 +254,6 @@ bool PrimitiveGUI_ConeDlg::ClickOnApply()
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
//=================================================================================
|
//=================================================================================
|
||||||
// function : SelectionIntoArgument()
|
// function : SelectionIntoArgument()
|
||||||
// purpose : Called when selection as changed or other case
|
// purpose : Called when selection as changed or other case
|
||||||
@ -264,7 +263,11 @@ void PrimitiveGUI_ConeDlg::SelectionIntoArgument()
|
|||||||
if (getConstructorId() != 0)
|
if (getConstructorId() != 0)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if ( IObjectCount() != 1 ) {
|
LightApp_SelectionMgr* aSelMgr = myGeomGUI->getApp()->selectionMgr();
|
||||||
|
SALOME_ListIO aSelList;
|
||||||
|
aSelMgr->selectedObjects(aSelList);
|
||||||
|
|
||||||
|
if (aSelList.Extent() != 1) {
|
||||||
if (myEditCurrentArgument == GroupPoints->LineEdit1)
|
if (myEditCurrentArgument == GroupPoints->LineEdit1)
|
||||||
myPoint = GEOM::GEOM_Object::_nil();
|
myPoint = GEOM::GEOM_Object::_nil();
|
||||||
else if (myEditCurrentArgument == GroupPoints->LineEdit2)
|
else if (myEditCurrentArgument == GroupPoints->LineEdit2)
|
||||||
@ -274,7 +277,7 @@ void PrimitiveGUI_ConeDlg::SelectionIntoArgument()
|
|||||||
|
|
||||||
/* nbSel == 1 */
|
/* nbSel == 1 */
|
||||||
Standard_Boolean testResult = Standard_False;
|
Standard_Boolean testResult = Standard_False;
|
||||||
GEOM::GEOM_Object_var aSelectedObject = GEOMBase::ConvertIOinGEOMObject( firstIObject(), testResult );
|
GEOM::GEOM_Object_var aSelectedObject = GEOMBase::ConvertIOinGEOMObject(aSelList.First(), testResult);
|
||||||
|
|
||||||
if ( !testResult || CORBA::is_nil( aSelectedObject ) )
|
if ( !testResult || CORBA::is_nil( aSelectedObject ) )
|
||||||
return;
|
return;
|
||||||
@ -287,9 +290,8 @@ void PrimitiveGUI_ConeDlg::SelectionIntoArgument()
|
|||||||
if ( myEditCurrentArgument == GroupPoints->LineEdit2 )
|
if ( myEditCurrentArgument == GroupPoints->LineEdit2 )
|
||||||
aNeedType = TopAbs_EDGE;
|
aNeedType = TopAbs_EDGE;
|
||||||
|
|
||||||
LightApp_SelectionMgr* aSelMgr = myGeomGUI->getApp()->selectionMgr();
|
|
||||||
TColStd_IndexedMapOfInteger aMap;
|
TColStd_IndexedMapOfInteger aMap;
|
||||||
aSelMgr->GetIndexes( firstIObject(), aMap );
|
aSelMgr->GetIndexes(aSelList.First(), aMap);
|
||||||
if ( aMap.Extent() == 1 ) {
|
if ( aMap.Extent() == 1 ) {
|
||||||
int anIndex = aMap(1);
|
int anIndex = aMap(1);
|
||||||
if ( aNeedType == TopAbs_EDGE )
|
if ( aNeedType == TopAbs_EDGE )
|
||||||
@ -327,7 +329,6 @@ void PrimitiveGUI_ConeDlg::SelectionIntoArgument()
|
|||||||
displayPreview();
|
displayPreview();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
//=================================================================================
|
//=================================================================================
|
||||||
// function : SetEditCurrentArgument()
|
// function : SetEditCurrentArgument()
|
||||||
// purpose :
|
// purpose :
|
||||||
|
@ -259,7 +259,11 @@ void PrimitiveGUI_CylinderDlg::SelectionIntoArgument()
|
|||||||
|
|
||||||
myEditCurrentArgument->setText( "" );
|
myEditCurrentArgument->setText( "" );
|
||||||
|
|
||||||
if ( IObjectCount() != 1 ) {
|
LightApp_SelectionMgr* aSelMgr = myGeomGUI->getApp()->selectionMgr();
|
||||||
|
SALOME_ListIO aSelList;
|
||||||
|
aSelMgr->selectedObjects(aSelList);
|
||||||
|
|
||||||
|
if (aSelList.Extent() != 1) {
|
||||||
if (myEditCurrentArgument == GroupPoints->LineEdit1)
|
if (myEditCurrentArgument == GroupPoints->LineEdit1)
|
||||||
myPoint = GEOM::GEOM_Object::_nil();
|
myPoint = GEOM::GEOM_Object::_nil();
|
||||||
else if (myEditCurrentArgument == GroupPoints->LineEdit2)
|
else if (myEditCurrentArgument == GroupPoints->LineEdit2)
|
||||||
@ -269,12 +273,11 @@ void PrimitiveGUI_CylinderDlg::SelectionIntoArgument()
|
|||||||
|
|
||||||
/* nbSel == 1 */
|
/* nbSel == 1 */
|
||||||
Standard_Boolean testResult = Standard_False;
|
Standard_Boolean testResult = Standard_False;
|
||||||
GEOM::GEOM_Object_var aSelectedObject = GEOMBase::ConvertIOinGEOMObject( firstIObject(), testResult );
|
GEOM::GEOM_Object_var aSelectedObject = GEOMBase::ConvertIOinGEOMObject(aSelList.First(), testResult);
|
||||||
|
|
||||||
if (!testResult || CORBA::is_nil(aSelectedObject))
|
if (!testResult || CORBA::is_nil(aSelectedObject))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
|
||||||
QString aName = GEOMBase::GetName(aSelectedObject);
|
QString aName = GEOMBase::GetName(aSelectedObject);
|
||||||
TopoDS_Shape aShape;
|
TopoDS_Shape aShape;
|
||||||
if ( GEOMBase::GetShape( aSelectedObject, aShape, TopAbs_SHAPE ) && !aShape.IsNull() ) {
|
if ( GEOMBase::GetShape( aSelectedObject, aShape, TopAbs_SHAPE ) && !aShape.IsNull() ) {
|
||||||
@ -282,9 +285,8 @@ void PrimitiveGUI_CylinderDlg::SelectionIntoArgument()
|
|||||||
if ( myEditCurrentArgument == GroupPoints->LineEdit2 )
|
if ( myEditCurrentArgument == GroupPoints->LineEdit2 )
|
||||||
aNeedType = TopAbs_EDGE;
|
aNeedType = TopAbs_EDGE;
|
||||||
|
|
||||||
LightApp_SelectionMgr* aSelMgr = myGeomGUI->getApp()->selectionMgr();
|
|
||||||
TColStd_IndexedMapOfInteger aMap;
|
TColStd_IndexedMapOfInteger aMap;
|
||||||
aSelMgr->GetIndexes( firstIObject(), aMap );
|
aSelMgr->GetIndexes(aSelList.First(), aMap);
|
||||||
if ( aMap.Extent() == 1 ) { // Local Selection
|
if ( aMap.Extent() == 1 ) { // Local Selection
|
||||||
int anIndex = aMap( 1 );
|
int anIndex = aMap( 1 );
|
||||||
if ( aNeedType == TopAbs_EDGE )
|
if ( aNeedType == TopAbs_EDGE )
|
||||||
|
@ -318,7 +318,11 @@ void PrimitiveGUI_FaceDlg::SelectionIntoArgument()
|
|||||||
|
|
||||||
myEditCurrentArgument->setText( "" );
|
myEditCurrentArgument->setText( "" );
|
||||||
|
|
||||||
if ( IObjectCount() != 1 ) {
|
LightApp_SelectionMgr* aSelMgr = myGeomGUI->getApp()->selectionMgr();
|
||||||
|
SALOME_ListIO aSelList;
|
||||||
|
aSelMgr->selectedObjects(aSelList);
|
||||||
|
|
||||||
|
if ( aSelList.Extent() != 1 ) {
|
||||||
if ( myEditCurrentArgument == GroupPlane->LineEdit1 ) myEdge = GEOM::GEOM_Object::_nil();
|
if ( myEditCurrentArgument == GroupPlane->LineEdit1 ) myEdge = GEOM::GEOM_Object::_nil();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -326,7 +330,7 @@ void PrimitiveGUI_FaceDlg::SelectionIntoArgument()
|
|||||||
// nbSel == 1
|
// nbSel == 1
|
||||||
Standard_Boolean aRes = Standard_False;
|
Standard_Boolean aRes = Standard_False;
|
||||||
TopAbs_ShapeEnum aNeedType = TopAbs_EDGE;
|
TopAbs_ShapeEnum aNeedType = TopAbs_EDGE;
|
||||||
GEOM::GEOM_Object_var aSelectedObject = GEOMBase::ConvertIOinGEOMObject( firstIObject(), aRes );
|
GEOM::GEOM_Object_var aSelectedObject = GEOMBase::ConvertIOinGEOMObject( aSelList.First(), aRes );
|
||||||
if ( !CORBA::is_nil( aSelectedObject ) && aRes ) {
|
if ( !CORBA::is_nil( aSelectedObject ) && aRes ) {
|
||||||
QString aName = GEOMBase::GetName( aSelectedObject );
|
QString aName = GEOMBase::GetName( aSelectedObject );
|
||||||
|
|
||||||
@ -335,9 +339,8 @@ void PrimitiveGUI_FaceDlg::SelectionIntoArgument()
|
|||||||
if (GroupType->RadioButton2->isChecked())
|
if (GroupType->RadioButton2->isChecked())
|
||||||
aNeedType = TopAbs_FACE;
|
aNeedType = TopAbs_FACE;
|
||||||
|
|
||||||
LightApp_SelectionMgr* aSelMgr = myGeomGUI->getApp()->selectionMgr();
|
|
||||||
TColStd_IndexedMapOfInteger aMap;
|
TColStd_IndexedMapOfInteger aMap;
|
||||||
aSelMgr->GetIndexes( firstIObject(), aMap );
|
aSelMgr->GetIndexes( aSelList.First(), aMap );
|
||||||
if ( aMap.Extent() == 1 ) { // Local Selection
|
if ( aMap.Extent() == 1 ) { // Local Selection
|
||||||
int anIndex = aMap( 1 );
|
int anIndex = aMap( 1 );
|
||||||
if ( aNeedType == TopAbs_EDGE )
|
if ( aNeedType == TopAbs_EDGE )
|
||||||
|
@ -234,14 +234,18 @@ void PrimitiveGUI_SphereDlg::SelectionIntoArgument()
|
|||||||
|
|
||||||
myEditCurrentArgument->setText( "" );
|
myEditCurrentArgument->setText( "" );
|
||||||
|
|
||||||
if ( IObjectCount() != 1 ) {
|
LightApp_SelectionMgr* aSelMgr = myGeomGUI->getApp()->selectionMgr();
|
||||||
|
SALOME_ListIO aSelList;
|
||||||
|
aSelMgr->selectedObjects(aSelList);
|
||||||
|
|
||||||
|
if (aSelList.Extent() != 1) {
|
||||||
myPoint = GEOM::GEOM_Object::_nil();
|
myPoint = GEOM::GEOM_Object::_nil();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* nbSel == 1 ! */
|
/* nbSel == 1 ! */
|
||||||
Standard_Boolean testResult = Standard_False;
|
Standard_Boolean testResult = Standard_False;
|
||||||
GEOM::GEOM_Object_ptr aSelectedObject = GEOMBase::ConvertIOinGEOMObject( firstIObject(), testResult );
|
GEOM::GEOM_Object_ptr aSelectedObject = GEOMBase::ConvertIOinGEOMObject(aSelList.First(), testResult);
|
||||||
|
|
||||||
if ( !testResult || CORBA::is_nil( aSelectedObject ) )
|
if ( !testResult || CORBA::is_nil( aSelectedObject ) )
|
||||||
return;
|
return;
|
||||||
@ -249,9 +253,8 @@ void PrimitiveGUI_SphereDlg::SelectionIntoArgument()
|
|||||||
QString aName = GEOMBase::GetName( aSelectedObject );
|
QString aName = GEOMBase::GetName( aSelectedObject );
|
||||||
TopoDS_Shape aShape;
|
TopoDS_Shape aShape;
|
||||||
if ( GEOMBase::GetShape( aSelectedObject, aShape, TopAbs_SHAPE) && !aShape.IsNull() ) {
|
if ( GEOMBase::GetShape( aSelectedObject, aShape, TopAbs_SHAPE) && !aShape.IsNull() ) {
|
||||||
LightApp_SelectionMgr* aSelMgr = myGeomGUI->getApp()->selectionMgr();
|
|
||||||
TColStd_IndexedMapOfInteger aMap;
|
TColStd_IndexedMapOfInteger aMap;
|
||||||
aSelMgr->GetIndexes( firstIObject(), aMap );
|
aSelMgr->GetIndexes(aSelList.First(), aMap);
|
||||||
if ( aMap.Extent() == 1 ) { // Local Selection
|
if ( aMap.Extent() == 1 ) { // Local Selection
|
||||||
int anIndex = aMap( 1 );
|
int anIndex = aMap( 1 );
|
||||||
aName.append( ":vertex_" + QString::number( anIndex ) );
|
aName.append( ":vertex_" + QString::number( anIndex ) );
|
||||||
@ -282,7 +285,6 @@ void PrimitiveGUI_SphereDlg::SelectionIntoArgument()
|
|||||||
displayPreview();
|
displayPreview();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
//=================================================================================
|
//=================================================================================
|
||||||
// function : LineEditReturnPressed()
|
// function : LineEditReturnPressed()
|
||||||
// purpose :
|
// purpose :
|
||||||
|
@ -255,7 +255,11 @@ void PrimitiveGUI_TorusDlg::SelectionIntoArgument()
|
|||||||
|
|
||||||
myEditCurrentArgument->setText( "" );
|
myEditCurrentArgument->setText( "" );
|
||||||
|
|
||||||
if ( IObjectCount() != 1 ) {
|
LightApp_SelectionMgr* aSelMgr = myGeomGUI->getApp()->selectionMgr();
|
||||||
|
SALOME_ListIO aSelList;
|
||||||
|
aSelMgr->selectedObjects(aSelList);
|
||||||
|
|
||||||
|
if ( aSelList.Extent() != 1 ) {
|
||||||
if ( myEditCurrentArgument == GroupPoints->LineEdit1 )
|
if ( myEditCurrentArgument == GroupPoints->LineEdit1 )
|
||||||
myPoint = GEOM::GEOM_Object::_nil();
|
myPoint = GEOM::GEOM_Object::_nil();
|
||||||
else if ( myEditCurrentArgument == GroupPoints->LineEdit2 )
|
else if ( myEditCurrentArgument == GroupPoints->LineEdit2 )
|
||||||
@ -265,7 +269,7 @@ void PrimitiveGUI_TorusDlg::SelectionIntoArgument()
|
|||||||
|
|
||||||
/* nbSel == 1 */
|
/* nbSel == 1 */
|
||||||
Standard_Boolean testResult = Standard_False;
|
Standard_Boolean testResult = Standard_False;
|
||||||
GEOM::GEOM_Object_var aSelectedObject = GEOMBase::ConvertIOinGEOMObject( firstIObject(), testResult );
|
GEOM::GEOM_Object_var aSelectedObject = GEOMBase::ConvertIOinGEOMObject( aSelList.First(), testResult );
|
||||||
|
|
||||||
if ( !testResult || CORBA::is_nil( aSelectedObject ) )
|
if ( !testResult || CORBA::is_nil( aSelectedObject ) )
|
||||||
return;
|
return;
|
||||||
@ -278,9 +282,8 @@ void PrimitiveGUI_TorusDlg::SelectionIntoArgument()
|
|||||||
if ( myEditCurrentArgument == GroupPoints->LineEdit2 )
|
if ( myEditCurrentArgument == GroupPoints->LineEdit2 )
|
||||||
aNeedType = TopAbs_EDGE;
|
aNeedType = TopAbs_EDGE;
|
||||||
|
|
||||||
LightApp_SelectionMgr* aSelMgr = myGeomGUI->getApp()->selectionMgr();
|
|
||||||
TColStd_IndexedMapOfInteger aMap;
|
TColStd_IndexedMapOfInteger aMap;
|
||||||
aSelMgr->GetIndexes( firstIObject(), aMap );
|
aSelMgr->GetIndexes( aSelList.First(), aMap );
|
||||||
if ( aMap.Extent() == 1 ) { // Local Selection
|
if ( aMap.Extent() == 1 ) { // Local Selection
|
||||||
int anIndex = aMap( 1 );
|
int anIndex = aMap( 1 );
|
||||||
if ( aNeedType == TopAbs_EDGE )
|
if ( aNeedType == TopAbs_EDGE )
|
||||||
|
@ -157,8 +157,12 @@ void RepairGUI_ChangeOrientationDlg::SelectionIntoArgument()
|
|||||||
myEditCurrentArgument->setText( "" );
|
myEditCurrentArgument->setText( "" );
|
||||||
QString aName;
|
QString aName;
|
||||||
|
|
||||||
|
LightApp_SelectionMgr* aSelMgr = myGeomGUI->getApp()->selectionMgr();
|
||||||
|
SALOME_ListIO aSelList;
|
||||||
|
aSelMgr->selectedObjects(aSelList);
|
||||||
|
|
||||||
if ( myEditCurrentArgument == GroupPoints->LineEdit1 ) {
|
if ( myEditCurrentArgument == GroupPoints->LineEdit1 ) {
|
||||||
if ( IObjectCount() != 1 ) {
|
if ( aSelList.Extent() != 1 ) {
|
||||||
if ( myEditCurrentArgument == GroupPoints->LineEdit1 )
|
if ( myEditCurrentArgument == GroupPoints->LineEdit1 )
|
||||||
myOkObject = false;
|
myOkObject = false;
|
||||||
return;
|
return;
|
||||||
@ -168,7 +172,7 @@ void RepairGUI_ChangeOrientationDlg::SelectionIntoArgument()
|
|||||||
// nbSel == 1
|
// nbSel == 1
|
||||||
Standard_Boolean testResult = Standard_False;
|
Standard_Boolean testResult = Standard_False;
|
||||||
GEOM::GEOM_Object_ptr aSelectedObject =
|
GEOM::GEOM_Object_ptr aSelectedObject =
|
||||||
GEOMBase::ConvertIOinGEOMObject( firstIObject(), testResult );
|
GEOMBase::ConvertIOinGEOMObject( aSelList.First(), testResult );
|
||||||
|
|
||||||
if ( !testResult )
|
if ( !testResult )
|
||||||
return;
|
return;
|
||||||
|
@ -189,8 +189,12 @@ void RepairGUI_CloseContourDlg::SelectionIntoArgument()
|
|||||||
else if ( myEditCurrentArgument == GroupPoints->LineEdit2 )
|
else if ( myEditCurrentArgument == GroupPoints->LineEdit2 )
|
||||||
myWiresInd->length( 0 );
|
myWiresInd->length( 0 );
|
||||||
|
|
||||||
if ( IObjectCount() == 1 ) {
|
LightApp_SelectionMgr* aSelMgr = myGeomGUI->getApp()->selectionMgr();
|
||||||
Handle(SALOME_InteractiveObject) anIO = firstIObject();
|
SALOME_ListIO aSelList;
|
||||||
|
aSelMgr->selectedObjects(aSelList);
|
||||||
|
|
||||||
|
if ( aSelList.Extent() == 1 ) {
|
||||||
|
Handle(SALOME_InteractiveObject) anIO = aSelList.First();
|
||||||
|
|
||||||
if ( myEditCurrentArgument == GroupPoints->LineEdit1 ) { // face selection
|
if ( myEditCurrentArgument == GroupPoints->LineEdit1 ) { // face selection
|
||||||
Standard_Boolean aRes;
|
Standard_Boolean aRes;
|
||||||
@ -206,7 +210,7 @@ void RepairGUI_CloseContourDlg::SelectionIntoArgument()
|
|||||||
}
|
}
|
||||||
else if ( myEditCurrentArgument == GroupPoints->LineEdit2 ) {
|
else if ( myEditCurrentArgument == GroupPoints->LineEdit2 ) {
|
||||||
TColStd_IndexedMapOfInteger aMap;
|
TColStd_IndexedMapOfInteger aMap;
|
||||||
myGeomGUI->getApp()->selectionMgr()->GetIndexes( anIO, aMap );
|
aSelMgr->GetIndexes( anIO, aMap );
|
||||||
const int n = aMap.Extent();
|
const int n = aMap.Extent();
|
||||||
myWiresInd->length( n );
|
myWiresInd->length( n );
|
||||||
for ( int i = 1; i <= n; i++ )
|
for ( int i = 1; i <= n; i++ )
|
||||||
|
@ -221,8 +221,12 @@ void RepairGUI_DivideEdgeDlg::SelectionIntoArgument()
|
|||||||
|
|
||||||
myObject = GEOM::GEOM_Object::_nil();
|
myObject = GEOM::GEOM_Object::_nil();
|
||||||
|
|
||||||
if ( IObjectCount() == 1 ) {
|
LightApp_SelectionMgr* aSelMgr = myGeomGUI->getApp()->selectionMgr();
|
||||||
Handle(SALOME_InteractiveObject) anIO = firstIObject();
|
SALOME_ListIO aSelList;
|
||||||
|
aSelMgr->selectedObjects(aSelList);
|
||||||
|
|
||||||
|
if ( aSelList.Extent() == 1 ) {
|
||||||
|
Handle(SALOME_InteractiveObject) anIO = aSelList.First();
|
||||||
Standard_Boolean aRes;
|
Standard_Boolean aRes;
|
||||||
GEOM::GEOM_Object_var aSelectedObject = GEOMBase::ConvertIOinGEOMObject( anIO, aRes );
|
GEOM::GEOM_Object_var aSelectedObject = GEOMBase::ConvertIOinGEOMObject( anIO, aRes );
|
||||||
if ( !CORBA::is_nil( aSelectedObject ) && aRes ) {
|
if ( !CORBA::is_nil( aSelectedObject ) && aRes ) {
|
||||||
@ -235,9 +239,7 @@ void RepairGUI_DivideEdgeDlg::SelectionIntoArgument()
|
|||||||
GEOM::short_array anIndexes;
|
GEOM::short_array anIndexes;
|
||||||
|
|
||||||
TColStd_IndexedMapOfInteger aMap;
|
TColStd_IndexedMapOfInteger aMap;
|
||||||
SalomeApp_Application* anApp =
|
aSelMgr->GetIndexes( anIO, aMap );
|
||||||
(SalomeApp_Application*)(SUIT_Session::session()->activeApplication());
|
|
||||||
anApp->selectionMgr()->GetIndexes( anIO, aMap );
|
|
||||||
|
|
||||||
if ( aMap.Extent() == 1 ) { // local selection
|
if ( aMap.Extent() == 1 ) { // local selection
|
||||||
int anIndex = aMap( 1 );
|
int anIndex = aMap( 1 );
|
||||||
|
@ -196,12 +196,16 @@ void RepairGUI_FreeBoundDlg::onActivate()
|
|||||||
//=================================================================================
|
//=================================================================================
|
||||||
void RepairGUI_FreeBoundDlg::onSelectionDone()
|
void RepairGUI_FreeBoundDlg::onSelectionDone()
|
||||||
{
|
{
|
||||||
if ( IObjectCount() != 1 )
|
LightApp_SelectionMgr* aSelMgr = myGeomGUI->getApp()->selectionMgr();
|
||||||
|
SALOME_ListIO aSelList;
|
||||||
|
aSelMgr->selectedObjects(aSelList);
|
||||||
|
|
||||||
|
if ( aSelList.Extent() != 1 )
|
||||||
return;
|
return;
|
||||||
|
|
||||||
Standard_Boolean isOk = Standard_False;
|
Standard_Boolean isOk = Standard_False;
|
||||||
GEOM::GEOM_Object_var anObj =
|
GEOM::GEOM_Object_var anObj =
|
||||||
GEOMBase::ConvertIOinGEOMObject( firstIObject(), isOk );
|
GEOMBase::ConvertIOinGEOMObject( aSelList.First(), isOk );
|
||||||
|
|
||||||
if ( !isOk || anObj->_is_nil() || !GEOMBase::IsShape( anObj ) )
|
if ( !isOk || anObj->_is_nil() || !GEOMBase::IsShape( anObj ) )
|
||||||
return;
|
return;
|
||||||
|
@ -228,14 +228,19 @@ void RepairGUI_FreeFacesDlg::Init()
|
|||||||
void RepairGUI_FreeFacesDlg::onSelectionDone()
|
void RepairGUI_FreeFacesDlg::onSelectionDone()
|
||||||
{
|
{
|
||||||
erasePreview();
|
erasePreview();
|
||||||
if ( IObjectCount() != 1 ) {
|
|
||||||
|
LightApp_SelectionMgr* aSelMgr = myGeomGUI->getApp()->selectionMgr();
|
||||||
|
SALOME_ListIO aSelList;
|
||||||
|
aSelMgr->selectedObjects(aSelList);
|
||||||
|
|
||||||
|
if ( aSelList.Extent() != 1 ) {
|
||||||
myEdit->setText( "" );
|
myEdit->setText( "" );
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
Standard_Boolean isOk = Standard_False;
|
Standard_Boolean isOk = Standard_False;
|
||||||
GEOM::GEOM_Object_var anObj =
|
GEOM::GEOM_Object_var anObj =
|
||||||
GEOMBase::ConvertIOinGEOMObject( firstIObject(), isOk );
|
GEOMBase::ConvertIOinGEOMObject( aSelList.First(), isOk );
|
||||||
|
|
||||||
if ( !isOk || anObj->_is_nil() || !GEOMBase::IsShape( anObj ) ) {
|
if ( !isOk || anObj->_is_nil() || !GEOMBase::IsShape( anObj ) ) {
|
||||||
myEdit->setText( "" );
|
myEdit->setText( "" );
|
||||||
|
@ -290,8 +290,12 @@ void RepairGUI_GlueDlg::SelectionIntoArgument()
|
|||||||
myEditCurrentArgument->setText( "" );
|
myEditCurrentArgument->setText( "" );
|
||||||
myObject = GEOM::GEOM_Object::_nil();
|
myObject = GEOM::GEOM_Object::_nil();
|
||||||
|
|
||||||
if ( IObjectCount() == 1 ) {
|
LightApp_SelectionMgr* aSelMgr = myGeomGUI->getApp()->selectionMgr();
|
||||||
Handle(SALOME_InteractiveObject) anIO = firstIObject();
|
SALOME_ListIO aSelList;
|
||||||
|
aSelMgr->selectedObjects(aSelList);
|
||||||
|
|
||||||
|
if ( aSelList.Extent() == 1 ) {
|
||||||
|
Handle(SALOME_InteractiveObject) anIO = aSelList.First();
|
||||||
Standard_Boolean aRes;
|
Standard_Boolean aRes;
|
||||||
myObject = GEOMBase::ConvertIOinGEOMObject( anIO, aRes );
|
myObject = GEOMBase::ConvertIOinGEOMObject( anIO, aRes );
|
||||||
if ( aRes )
|
if ( aRes )
|
||||||
@ -423,7 +427,11 @@ bool RepairGUI_GlueDlg::execute( ObjectList& objects )
|
|||||||
QMap<QString, char> selected;
|
QMap<QString, char> selected;
|
||||||
|
|
||||||
// Get names of selected objects
|
// Get names of selected objects
|
||||||
SALOME_ListIteratorOfListIO it ( selectedIO() );
|
LightApp_SelectionMgr* aSelMgr = myGeomGUI->getApp()->selectionMgr();
|
||||||
|
SALOME_ListIO aSelList;
|
||||||
|
aSelMgr->selectedObjects(aSelList);
|
||||||
|
|
||||||
|
SALOME_ListIteratorOfListIO it (aSelList);
|
||||||
for (; it.More(); it.Next())
|
for (; it.More(); it.Next())
|
||||||
selected.insert(it.Value()->getName(), 0);
|
selected.insert(it.Value()->getName(), 0);
|
||||||
|
|
||||||
@ -693,8 +701,12 @@ void RepairGUI_GlueDlg::updateButtonState()
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
LightApp_SelectionMgr* aSelMgr = myGeomGUI->getApp()->selectionMgr();
|
||||||
|
SALOME_ListIO aSelList;
|
||||||
|
aSelMgr->selectedObjects(aSelList);
|
||||||
|
|
||||||
bool wasSelected = false;
|
bool wasSelected = false;
|
||||||
SALOME_ListIteratorOfListIO it ( selectedIO() );
|
SALOME_ListIteratorOfListIO it (aSelList);
|
||||||
if (it.More() > 0)
|
if (it.More() > 0)
|
||||||
wasSelected = true;
|
wasSelected = true;
|
||||||
bool wasDetected = myTmpObjs.size() ? true : false;
|
bool wasDetected = myTmpObjs.size() ? true : false;
|
||||||
|
@ -161,8 +161,12 @@ void RepairGUI_RemoveExtraEdgesDlg::SelectionIntoArgument()
|
|||||||
myEditCurrentArgument->setText( "" );
|
myEditCurrentArgument->setText( "" );
|
||||||
QString aName;
|
QString aName;
|
||||||
|
|
||||||
|
LightApp_SelectionMgr* aSelMgr = myGeomGUI->getApp()->selectionMgr();
|
||||||
|
SALOME_ListIO aSelList;
|
||||||
|
aSelMgr->selectedObjects(aSelList);
|
||||||
|
|
||||||
if ( myEditCurrentArgument == GroupPoints->LineEdit1 ) {
|
if ( myEditCurrentArgument == GroupPoints->LineEdit1 ) {
|
||||||
if ( IObjectCount() != 1 ) {
|
if ( aSelList.Extent() != 1 ) {
|
||||||
if ( myEditCurrentArgument == GroupPoints->LineEdit1 )
|
if ( myEditCurrentArgument == GroupPoints->LineEdit1 )
|
||||||
myOkObject = false;
|
myOkObject = false;
|
||||||
return;
|
return;
|
||||||
@ -172,7 +176,7 @@ void RepairGUI_RemoveExtraEdgesDlg::SelectionIntoArgument()
|
|||||||
// nbSel == 1
|
// nbSel == 1
|
||||||
Standard_Boolean testResult = Standard_False;
|
Standard_Boolean testResult = Standard_False;
|
||||||
GEOM::GEOM_Object_ptr aSelectedObject =
|
GEOM::GEOM_Object_ptr aSelectedObject =
|
||||||
GEOMBase::ConvertIOinGEOMObject( firstIObject(), testResult );
|
GEOMBase::ConvertIOinGEOMObject( aSelList.First(), testResult );
|
||||||
|
|
||||||
if ( !testResult )
|
if ( !testResult )
|
||||||
return;
|
return;
|
||||||
|
@ -184,8 +184,12 @@ void RepairGUI_RemoveHolesDlg::SelectionIntoArgument()
|
|||||||
if ( myEditCurrentArgument == GroupPoints->LineEdit1 ) myObject = GEOM::GEOM_Object::_nil();
|
if ( myEditCurrentArgument == GroupPoints->LineEdit1 ) myObject = GEOM::GEOM_Object::_nil();
|
||||||
else if ( myEditCurrentArgument == GroupPoints->LineEdit2 ) myWiresInd->length( 0 );
|
else if ( myEditCurrentArgument == GroupPoints->LineEdit2 ) myWiresInd->length( 0 );
|
||||||
|
|
||||||
if ( IObjectCount() == 1 ) {
|
LightApp_SelectionMgr* aSelMgr = myGeomGUI->getApp()->selectionMgr();
|
||||||
Handle(SALOME_InteractiveObject) anIO = firstIObject();
|
SALOME_ListIO aSelList;
|
||||||
|
aSelMgr->selectedObjects(aSelList);
|
||||||
|
|
||||||
|
if ( aSelList.Extent() == 1 ) {
|
||||||
|
Handle(SALOME_InteractiveObject) anIO = aSelList.First();
|
||||||
|
|
||||||
if ( myEditCurrentArgument == GroupPoints->LineEdit1 ) { // face selection
|
if ( myEditCurrentArgument == GroupPoints->LineEdit1 ) { // face selection
|
||||||
Standard_Boolean aRes;
|
Standard_Boolean aRes;
|
||||||
@ -198,7 +202,7 @@ void RepairGUI_RemoveHolesDlg::SelectionIntoArgument()
|
|||||||
else if ( myEditCurrentArgument == GroupPoints->LineEdit2 &&
|
else if ( myEditCurrentArgument == GroupPoints->LineEdit2 &&
|
||||||
!GroupPoints->CheckButton1->isChecked() ) {
|
!GroupPoints->CheckButton1->isChecked() ) {
|
||||||
TColStd_IndexedMapOfInteger aMap;
|
TColStd_IndexedMapOfInteger aMap;
|
||||||
( (SalomeApp_Application*)( SUIT_Session::session()->activeApplication() ) )->selectionMgr()->GetIndexes( anIO, aMap );
|
aSelMgr->GetIndexes( anIO, aMap );
|
||||||
const int n = aMap.Extent();
|
const int n = aMap.Extent();
|
||||||
myWiresInd->length( n );
|
myWiresInd->length( n );
|
||||||
for ( int i = 1; i <= n; i++ )
|
for ( int i = 1; i <= n; i++ )
|
||||||
|
@ -172,8 +172,12 @@ void RepairGUI_RemoveIntWiresDlg::SelectionIntoArgument()
|
|||||||
if ( myEditCurrentArgument == GroupPoints->LineEdit1 ) myObject = GEOM::GEOM_Object::_nil();
|
if ( myEditCurrentArgument == GroupPoints->LineEdit1 ) myObject = GEOM::GEOM_Object::_nil();
|
||||||
else if ( myEditCurrentArgument == GroupPoints->LineEdit2 ) myWiresInd->length( 0 );
|
else if ( myEditCurrentArgument == GroupPoints->LineEdit2 ) myWiresInd->length( 0 );
|
||||||
|
|
||||||
if ( IObjectCount() == 1 ) {
|
LightApp_SelectionMgr* aSelMgr = myGeomGUI->getApp()->selectionMgr();
|
||||||
Handle(SALOME_InteractiveObject) anIO = firstIObject();
|
SALOME_ListIO aSelList;
|
||||||
|
aSelMgr->selectedObjects(aSelList);
|
||||||
|
|
||||||
|
if ( aSelList.Extent() == 1 ) {
|
||||||
|
Handle(SALOME_InteractiveObject) anIO = aSelList.First();
|
||||||
|
|
||||||
if ( myEditCurrentArgument == GroupPoints->LineEdit1 ) { // face selection
|
if ( myEditCurrentArgument == GroupPoints->LineEdit1 ) { // face selection
|
||||||
Standard_Boolean aRes;
|
Standard_Boolean aRes;
|
||||||
@ -186,7 +190,7 @@ void RepairGUI_RemoveIntWiresDlg::SelectionIntoArgument()
|
|||||||
else if ( myEditCurrentArgument == GroupPoints->LineEdit2 &&
|
else if ( myEditCurrentArgument == GroupPoints->LineEdit2 &&
|
||||||
!GroupPoints->CheckButton1->isChecked() ) {
|
!GroupPoints->CheckButton1->isChecked() ) {
|
||||||
TColStd_IndexedMapOfInteger aMap;
|
TColStd_IndexedMapOfInteger aMap;
|
||||||
( (SalomeApp_Application*)( SUIT_Session::session()->activeApplication() ) )->selectionMgr()->GetIndexes( anIO, aMap );
|
aSelMgr->GetIndexes( anIO, aMap );
|
||||||
const int n = aMap.Extent();
|
const int n = aMap.Extent();
|
||||||
myWiresInd->length( n );
|
myWiresInd->length( n );
|
||||||
for ( int i = 1; i <= n; i++ )
|
for ( int i = 1; i <= n; i++ )
|
||||||
|
@ -177,8 +177,12 @@ void RepairGUI_SewingDlg::SelectionIntoArgument()
|
|||||||
myEditCurrentArgument->setText( "" );
|
myEditCurrentArgument->setText( "" );
|
||||||
myObject = GEOM::GEOM_Object::_nil();
|
myObject = GEOM::GEOM_Object::_nil();
|
||||||
|
|
||||||
if ( IObjectCount() == 1 ) {
|
LightApp_SelectionMgr* aSelMgr = myGeomGUI->getApp()->selectionMgr();
|
||||||
Handle(SALOME_InteractiveObject) anIO = firstIObject();
|
SALOME_ListIO aSelList;
|
||||||
|
aSelMgr->selectedObjects(aSelList);
|
||||||
|
|
||||||
|
if ( aSelList.Extent() == 1 ) {
|
||||||
|
Handle(SALOME_InteractiveObject) anIO = aSelList.First();
|
||||||
Standard_Boolean aRes;
|
Standard_Boolean aRes;
|
||||||
myObject = GEOMBase::ConvertIOinGEOMObject( anIO, aRes );
|
myObject = GEOMBase::ConvertIOinGEOMObject( anIO, aRes );
|
||||||
if ( aRes )
|
if ( aRes )
|
||||||
|
@ -358,10 +358,14 @@ void RepairGUI_ShapeProcessDlg::selectionChanged()
|
|||||||
{
|
{
|
||||||
reset();
|
reset();
|
||||||
|
|
||||||
|
LightApp_SelectionMgr* aSelMgr = myGeomGUI->getApp()->selectionMgr();
|
||||||
|
SALOME_ListIO aSelList;
|
||||||
|
aSelMgr->selectedObjects(aSelList);
|
||||||
|
|
||||||
Standard_Boolean aRes = Standard_False;
|
Standard_Boolean aRes = Standard_False;
|
||||||
int i = 0;
|
int i = 0;
|
||||||
myObjects->length( IObjectCount() );
|
myObjects->length(aSelList.Extent());
|
||||||
for ( SALOME_ListIteratorOfListIO anIt( selectedIO() ); anIt.More(); anIt.Next() ) {
|
for (SALOME_ListIteratorOfListIO anIt (aSelList); anIt.More(); anIt.Next()) {
|
||||||
GEOM::GEOM_Object_var aSelectedObject = GEOMBase::ConvertIOinGEOMObject( anIt.Value(), aRes );
|
GEOM::GEOM_Object_var aSelectedObject = GEOMBase::ConvertIOinGEOMObject( anIt.Value(), aRes );
|
||||||
if ( !CORBA::is_nil( aSelectedObject ) && aRes )
|
if ( !CORBA::is_nil( aSelectedObject ) && aRes )
|
||||||
myObjects[i++] = aSelectedObject;
|
myObjects[i++] = aSelectedObject;
|
||||||
|
@ -164,9 +164,15 @@ void RepairGUI_SuppressFacesDlg::SelectionIntoArgument()
|
|||||||
Standard_Boolean aRes = Standard_False;
|
Standard_Boolean aRes = Standard_False;
|
||||||
int i = 0;
|
int i = 0;
|
||||||
int numFaces = 0;
|
int numFaces = 0;
|
||||||
myObjects->length( IObjectCount() );
|
|
||||||
|
LightApp_SelectionMgr* aSelMgr = myGeomGUI->getApp()->selectionMgr();
|
||||||
|
SALOME_ListIO aSelList;
|
||||||
|
aSelMgr->selectedObjects(aSelList);
|
||||||
|
|
||||||
|
myObjects->length( aSelList.Extent() );
|
||||||
myFaces.clear();
|
myFaces.clear();
|
||||||
for ( SALOME_ListIteratorOfListIO anIt( selectedIO() ); anIt.More(); anIt.Next() ) {
|
|
||||||
|
for (SALOME_ListIteratorOfListIO anIt (aSelList); anIt.More(); anIt.Next()) {
|
||||||
Handle(SALOME_InteractiveObject) anIO = anIt.Value();
|
Handle(SALOME_InteractiveObject) anIO = anIt.Value();
|
||||||
GEOM::GEOM_Object_var aSelectedObject = GEOMBase::ConvertIOinGEOMObject( anIO, aRes );
|
GEOM::GEOM_Object_var aSelectedObject = GEOMBase::ConvertIOinGEOMObject( anIO, aRes );
|
||||||
if ( !CORBA::is_nil( aSelectedObject ) && aRes ) {
|
if ( !CORBA::is_nil( aSelectedObject ) && aRes ) {
|
||||||
@ -176,7 +182,7 @@ void RepairGUI_SuppressFacesDlg::SelectionIntoArgument()
|
|||||||
GEOM::short_array anIndexes;
|
GEOM::short_array anIndexes;
|
||||||
|
|
||||||
TColStd_IndexedMapOfInteger aMap;
|
TColStd_IndexedMapOfInteger aMap;
|
||||||
myGeomGUI->getApp()->selectionMgr()->GetIndexes( anIO, aMap );
|
aSelMgr->GetIndexes( anIO, aMap );
|
||||||
|
|
||||||
if ( !aMap.IsEmpty() ) {
|
if ( !aMap.IsEmpty() ) {
|
||||||
Convert( aMap, anIndexes );
|
Convert( aMap, anIndexes );
|
||||||
|
@ -208,25 +208,29 @@ void TransformationGUI_MirrorDlg::SelectionIntoArgument()
|
|||||||
myEditCurrentArgument->setText( "" );
|
myEditCurrentArgument->setText( "" );
|
||||||
QString aName;
|
QString aName;
|
||||||
|
|
||||||
|
LightApp_SelectionMgr* aSelMgr = myGeomGUI->getApp()->selectionMgr();
|
||||||
|
SALOME_ListIO aSelList;
|
||||||
|
aSelMgr->selectedObjects(aSelList);
|
||||||
|
|
||||||
if (myEditCurrentArgument == GroupPoints->LineEdit1) {
|
if (myEditCurrentArgument == GroupPoints->LineEdit1) {
|
||||||
int aNbSel = GEOMBase::GetNameOfSelectedIObjects( selectedIO(), aName );
|
int aNbSel = GEOMBase::GetNameOfSelectedIObjects(aSelList, aName);
|
||||||
if ( aNbSel < 1 ) {
|
if ( aNbSel < 1 ) {
|
||||||
myObjects.length(0);
|
myObjects.length(0);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
GEOMBase::ConvertListOfIOInListOfGO( selectedIO(), myObjects );
|
GEOMBase::ConvertListOfIOInListOfGO(aSelList, myObjects);
|
||||||
if (!myObjects.length())
|
if (!myObjects.length())
|
||||||
return;
|
return;
|
||||||
if (aNbSel != 1)
|
if (aNbSel != 1)
|
||||||
aName = tr("%1_objects").arg(aNbSel);
|
aName = tr("%1_objects").arg(aNbSel);
|
||||||
}
|
}
|
||||||
else if (myEditCurrentArgument == GroupPoints->LineEdit2) {
|
else if (myEditCurrentArgument == GroupPoints->LineEdit2) {
|
||||||
if ( IObjectCount() != 1 ) {
|
if (aSelList.Extent() != 1) {
|
||||||
myArgument = GEOM::GEOM_Object::_nil();
|
myArgument = GEOM::GEOM_Object::_nil();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
Standard_Boolean testResult = Standard_False;
|
Standard_Boolean testResult = Standard_False;
|
||||||
GEOM::GEOM_Object_var aSelectedObject = GEOMBase::ConvertIOinGEOMObject( firstIObject(), testResult );
|
GEOM::GEOM_Object_var aSelectedObject = GEOMBase::ConvertIOinGEOMObject(aSelList.First(), testResult);
|
||||||
myArgument = aSelectedObject;
|
myArgument = aSelectedObject;
|
||||||
if (!testResult || CORBA::is_nil(myArgument))
|
if (!testResult || CORBA::is_nil(myArgument))
|
||||||
return;
|
return;
|
||||||
@ -242,9 +246,8 @@ void TransformationGUI_MirrorDlg::SelectionIntoArgument()
|
|||||||
else if ( getConstructorId() == 2 )
|
else if ( getConstructorId() == 2 )
|
||||||
aNeedType = TopAbs_FACE;
|
aNeedType = TopAbs_FACE;
|
||||||
|
|
||||||
LightApp_SelectionMgr* aSelMgr = myGeomGUI->getApp()->selectionMgr();
|
|
||||||
TColStd_IndexedMapOfInteger aMap;
|
TColStd_IndexedMapOfInteger aMap;
|
||||||
aSelMgr->GetIndexes( firstIObject(), aMap );
|
aSelMgr->GetIndexes(aSelList.First(), aMap);
|
||||||
if ( aMap.Extent() == 1 ) {
|
if ( aMap.Extent() == 1 ) {
|
||||||
int anIndex = aMap( 1 );
|
int anIndex = aMap( 1 );
|
||||||
if ( aNeedType == TopAbs_VERTEX )
|
if ( aNeedType == TopAbs_VERTEX )
|
||||||
|
@ -279,7 +279,11 @@ void TransformationGUI_MultiRotationDlg::SelectionIntoArgument()
|
|||||||
{
|
{
|
||||||
myEditCurrentArgument->setText( "" );
|
myEditCurrentArgument->setText( "" );
|
||||||
|
|
||||||
if ( IObjectCount() != 1 ) {
|
LightApp_SelectionMgr* aSelMgr = myGeomGUI->getApp()->selectionMgr();
|
||||||
|
SALOME_ListIO aSelList;
|
||||||
|
aSelMgr->selectedObjects(aSelList);
|
||||||
|
|
||||||
|
if ( aSelList.Extent() != 1 ) {
|
||||||
if ( myEditCurrentArgument == GroupPoints->LineEdit1 ||
|
if ( myEditCurrentArgument == GroupPoints->LineEdit1 ||
|
||||||
myEditCurrentArgument == GroupDimensions->LineEdit1 )
|
myEditCurrentArgument == GroupDimensions->LineEdit1 )
|
||||||
myBase = GEOM::GEOM_Object::_nil();
|
myBase = GEOM::GEOM_Object::_nil();
|
||||||
@ -292,7 +296,7 @@ void TransformationGUI_MultiRotationDlg::SelectionIntoArgument()
|
|||||||
// nbSel == 1
|
// nbSel == 1
|
||||||
Standard_Boolean testResult = Standard_False;;
|
Standard_Boolean testResult = Standard_False;;
|
||||||
GEOM::GEOM_Object_var aSelectedObject =
|
GEOM::GEOM_Object_var aSelectedObject =
|
||||||
GEOMBase::ConvertIOinGEOMObject( firstIObject(), testResult );
|
GEOMBase::ConvertIOinGEOMObject( aSelList.First(), testResult );
|
||||||
|
|
||||||
if ( !testResult || CORBA::is_nil( aSelectedObject) || !GEOMBase::IsShape( aSelectedObject ) )
|
if ( !testResult || CORBA::is_nil( aSelectedObject) || !GEOMBase::IsShape( aSelectedObject ) )
|
||||||
return;
|
return;
|
||||||
@ -308,9 +312,8 @@ void TransformationGUI_MultiRotationDlg::SelectionIntoArgument()
|
|||||||
TopoDS_Shape aShape;
|
TopoDS_Shape aShape;
|
||||||
|
|
||||||
if ( GEOMBase::GetShape( aSelectedObject, aShape, TopAbs_SHAPE ) && !aShape.IsNull() ) {
|
if ( GEOMBase::GetShape( aSelectedObject, aShape, TopAbs_SHAPE ) && !aShape.IsNull() ) {
|
||||||
LightApp_SelectionMgr* aSelMgr = myGeomGUI->getApp()->selectionMgr();
|
|
||||||
TColStd_IndexedMapOfInteger aMap;
|
TColStd_IndexedMapOfInteger aMap;
|
||||||
aSelMgr->GetIndexes( firstIObject(), aMap );
|
aSelMgr->GetIndexes( aSelList.First(), aMap );
|
||||||
if ( aMap.Extent() == 1 ) {
|
if ( aMap.Extent() == 1 ) {
|
||||||
int anIndex = aMap( 1 );
|
int anIndex = aMap( 1 );
|
||||||
aName += QString( ":edge_%1" ).arg( anIndex );
|
aName += QString( ":edge_%1" ).arg( anIndex );
|
||||||
|
@ -293,7 +293,11 @@ void TransformationGUI_MultiTranslationDlg::SelectionIntoArgument()
|
|||||||
{
|
{
|
||||||
myEditCurrentArgument->setText( "" );
|
myEditCurrentArgument->setText( "" );
|
||||||
|
|
||||||
if ( IObjectCount() != 1 ) {
|
LightApp_SelectionMgr* aSelMgr = myGeomGUI->getApp()->selectionMgr();
|
||||||
|
SALOME_ListIO aSelList;
|
||||||
|
aSelMgr->selectedObjects(aSelList);
|
||||||
|
|
||||||
|
if ( aSelList.Extent() != 1 ) {
|
||||||
if ( myEditCurrentArgument == GroupPoints->LineEdit1 ||
|
if ( myEditCurrentArgument == GroupPoints->LineEdit1 ||
|
||||||
myEditCurrentArgument == GroupDimensions->LineEdit1 )
|
myEditCurrentArgument == GroupDimensions->LineEdit1 )
|
||||||
myBase = GEOM::GEOM_Object::_nil();
|
myBase = GEOM::GEOM_Object::_nil();
|
||||||
@ -307,7 +311,7 @@ void TransformationGUI_MultiTranslationDlg::SelectionIntoArgument()
|
|||||||
|
|
||||||
// nbSel == 1
|
// nbSel == 1
|
||||||
Standard_Boolean testResult = Standard_False;;
|
Standard_Boolean testResult = Standard_False;;
|
||||||
GEOM::GEOM_Object_var aSelectedObject = GEOMBase::ConvertIOinGEOMObject( firstIObject(), testResult );
|
GEOM::GEOM_Object_var aSelectedObject = GEOMBase::ConvertIOinGEOMObject( aSelList.First(), testResult );
|
||||||
|
|
||||||
if ( !testResult || CORBA::is_nil( aSelectedObject ) || !GEOMBase::IsShape( aSelectedObject ) )
|
if ( !testResult || CORBA::is_nil( aSelectedObject ) || !GEOMBase::IsShape( aSelectedObject ) )
|
||||||
return;
|
return;
|
||||||
@ -324,9 +328,8 @@ void TransformationGUI_MultiTranslationDlg::SelectionIntoArgument()
|
|||||||
TopoDS_Shape aShape;
|
TopoDS_Shape aShape;
|
||||||
|
|
||||||
if ( GEOMBase::GetShape( aSelectedObject, aShape, TopAbs_SHAPE ) && !aShape.IsNull() ) {
|
if ( GEOMBase::GetShape( aSelectedObject, aShape, TopAbs_SHAPE ) && !aShape.IsNull() ) {
|
||||||
LightApp_SelectionMgr* aSelMgr = myGeomGUI->getApp()->selectionMgr();
|
|
||||||
TColStd_IndexedMapOfInteger aMap;
|
TColStd_IndexedMapOfInteger aMap;
|
||||||
aSelMgr->GetIndexes( firstIObject(), aMap );
|
aSelMgr->GetIndexes( aSelList.First(), aMap );
|
||||||
if ( aMap.Extent() == 1 ) {
|
if ( aMap.Extent() == 1 ) {
|
||||||
int anIndex = aMap( 1 );
|
int anIndex = aMap( 1 );
|
||||||
aName += QString( ":edge_%1" ).arg( anIndex );
|
aName += QString( ":edge_%1" ).arg( anIndex );
|
||||||
|
@ -165,14 +165,18 @@ void TransformationGUI_OffsetDlg::SelectionIntoArgument()
|
|||||||
myEditCurrentArgument->setText( "" );
|
myEditCurrentArgument->setText( "" );
|
||||||
QString aName;
|
QString aName;
|
||||||
|
|
||||||
int aNbSel = GEOMBase::GetNameOfSelectedIObjects( selectedIO(), aName );
|
LightApp_SelectionMgr* aSelMgr = myGeomGUI->getApp()->selectionMgr();
|
||||||
|
SALOME_ListIO aSelList;
|
||||||
|
aSelMgr->selectedObjects(aSelList);
|
||||||
|
|
||||||
|
int aNbSel = GEOMBase::GetNameOfSelectedIObjects(aSelList, aName);
|
||||||
if ( aNbSel < 1 ) {
|
if ( aNbSel < 1 ) {
|
||||||
myObjects.length( 0 );
|
myObjects.length( 0 );
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// nbSel > 0
|
// nbSel > 0
|
||||||
GEOMBase::ConvertListOfIOInListOfGO( selectedIO(), myObjects );
|
GEOMBase::ConvertListOfIOInListOfGO (aSelList, myObjects);
|
||||||
if (!myObjects.length())
|
if (!myObjects.length())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
@ -220,14 +220,18 @@ void TransformationGUI_PositionDlg::SelectionIntoArgument()
|
|||||||
myEditCurrentArgument->setText( "" );
|
myEditCurrentArgument->setText( "" );
|
||||||
QString aName;
|
QString aName;
|
||||||
|
|
||||||
|
LightApp_SelectionMgr* aSelMgr = myGeomGUI->getApp()->selectionMgr();
|
||||||
|
SALOME_ListIO aSelList;
|
||||||
|
aSelMgr->selectedObjects(aSelList);
|
||||||
|
|
||||||
if (myEditCurrentArgument == Group1->LineEdit1) {
|
if (myEditCurrentArgument == Group1->LineEdit1) {
|
||||||
int aNbSel = GEOMBase::GetNameOfSelectedIObjects( selectedIO(), aName );
|
int aNbSel = GEOMBase::GetNameOfSelectedIObjects(aSelList, aName);
|
||||||
if (aNbSel < 1) {
|
if (aNbSel < 1) {
|
||||||
myObjects.length(0);
|
myObjects.length(0);
|
||||||
displayPreview();
|
displayPreview();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
GEOMBase::ConvertListOfIOInListOfGO( selectedIO(), myObjects );
|
GEOMBase::ConvertListOfIOInListOfGO(aSelList, myObjects);
|
||||||
if ( !myObjects.length() ) {
|
if ( !myObjects.length() ) {
|
||||||
displayPreview();
|
displayPreview();
|
||||||
return;
|
return;
|
||||||
@ -235,13 +239,13 @@ void TransformationGUI_PositionDlg::SelectionIntoArgument()
|
|||||||
}
|
}
|
||||||
else if (myEditCurrentArgument == Group1->LineEdit2) {
|
else if (myEditCurrentArgument == Group1->LineEdit2) {
|
||||||
myStartLCS = GEOM::GEOM_Object::_nil();
|
myStartLCS = GEOM::GEOM_Object::_nil();
|
||||||
if ( IObjectCount() != 1 ) {
|
if (aSelList.Extent() != 1) {
|
||||||
displayPreview();
|
displayPreview();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
Standard_Boolean testResult = Standard_False;
|
Standard_Boolean testResult = Standard_False;
|
||||||
myStartLCS = GEOMBase::ConvertIOinGEOMObject( firstIObject(), testResult );
|
myStartLCS = GEOMBase::ConvertIOinGEOMObject(aSelList.First(), testResult);
|
||||||
if ( !testResult || CORBA::is_nil( myStartLCS ) ) {
|
if ( !testResult || CORBA::is_nil( myStartLCS ) ) {
|
||||||
displayPreview();
|
displayPreview();
|
||||||
return;
|
return;
|
||||||
@ -250,13 +254,13 @@ void TransformationGUI_PositionDlg::SelectionIntoArgument()
|
|||||||
}
|
}
|
||||||
else if ( myEditCurrentArgument == Group1->LineEdit3 ) {
|
else if ( myEditCurrentArgument == Group1->LineEdit3 ) {
|
||||||
myEndLCS = GEOM::GEOM_Object::_nil();
|
myEndLCS = GEOM::GEOM_Object::_nil();
|
||||||
if ( IObjectCount() != 1 ) {
|
if ( aSelList.Extent() != 1 ) {
|
||||||
displayPreview();
|
displayPreview();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
Standard_Boolean testResult = Standard_False;
|
Standard_Boolean testResult = Standard_False;
|
||||||
myEndLCS = GEOMBase::ConvertIOinGEOMObject( firstIObject(), testResult );
|
myEndLCS = GEOMBase::ConvertIOinGEOMObject(aSelList.First(), testResult);
|
||||||
if ( !testResult || CORBA::is_nil( myEndLCS ) ) {
|
if ( !testResult || CORBA::is_nil( myEndLCS ) ) {
|
||||||
displayPreview();
|
displayPreview();
|
||||||
return;
|
return;
|
||||||
@ -268,7 +272,6 @@ void TransformationGUI_PositionDlg::SelectionIntoArgument()
|
|||||||
displayPreview();
|
displayPreview();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
//=================================================================================
|
//=================================================================================
|
||||||
// function : LineEditReturnPressed()
|
// function : LineEditReturnPressed()
|
||||||
// purpose :
|
// purpose :
|
||||||
|
@ -233,18 +233,22 @@ void TransformationGUI_RotationDlg::SelectionIntoArgument()
|
|||||||
myEditCurrentArgument->setText( "" );
|
myEditCurrentArgument->setText( "" );
|
||||||
QString aName;
|
QString aName;
|
||||||
|
|
||||||
|
LightApp_SelectionMgr* aSelMgr = myGeomGUI->getApp()->selectionMgr();
|
||||||
|
SALOME_ListIO aSelList;
|
||||||
|
aSelMgr->selectedObjects(aSelList);
|
||||||
|
|
||||||
if (myEditCurrentArgument == GroupPoints->LineEdit1) {
|
if (myEditCurrentArgument == GroupPoints->LineEdit1) {
|
||||||
int aNbSel = GEOMBase::GetNameOfSelectedIObjects( selectedIO(), aName );
|
int aNbSel = GEOMBase::GetNameOfSelectedIObjects(aSelList, aName);
|
||||||
if (aNbSel < 1) {
|
if (aNbSel < 1) {
|
||||||
myObjects.length(0);
|
myObjects.length(0);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
GEOMBase::ConvertListOfIOInListOfGO( selectedIO(), myObjects );
|
GEOMBase::ConvertListOfIOInListOfGO(aSelList, myObjects);
|
||||||
if (!myObjects.length())
|
if (!myObjects.length())
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
if ( IObjectCount() != 1 ) {
|
if (aSelList.Extent() != 1) {
|
||||||
if ( myEditCurrentArgument == GroupPoints->LineEdit2 && getConstructorId() == 0 )
|
if ( myEditCurrentArgument == GroupPoints->LineEdit2 && getConstructorId() == 0 )
|
||||||
myAxis = GEOM::GEOM_Object::_nil();
|
myAxis = GEOM::GEOM_Object::_nil();
|
||||||
else if ( myEditCurrentArgument == GroupPoints->LineEdit2 && getConstructorId() == 1 )
|
else if ( myEditCurrentArgument == GroupPoints->LineEdit2 && getConstructorId() == 1 )
|
||||||
@ -257,7 +261,7 @@ void TransformationGUI_RotationDlg::SelectionIntoArgument()
|
|||||||
}
|
}
|
||||||
|
|
||||||
Standard_Boolean testResult = Standard_False;
|
Standard_Boolean testResult = Standard_False;
|
||||||
GEOM::GEOM_Object_var aSelectedObject = GEOMBase::ConvertIOinGEOMObject( firstIObject(), testResult );
|
GEOM::GEOM_Object_var aSelectedObject = GEOMBase::ConvertIOinGEOMObject(aSelList.First(), testResult);
|
||||||
if ( !testResult || CORBA::is_nil( aSelectedObject ) )
|
if ( !testResult || CORBA::is_nil( aSelectedObject ) )
|
||||||
return;
|
return;
|
||||||
|
|
||||||
@ -268,9 +272,8 @@ void TransformationGUI_RotationDlg::SelectionIntoArgument()
|
|||||||
if ( myEditCurrentArgument == GroupPoints->LineEdit2 && getConstructorId() == 0 )
|
if ( myEditCurrentArgument == GroupPoints->LineEdit2 && getConstructorId() == 0 )
|
||||||
aNeedType = TopAbs_EDGE;
|
aNeedType = TopAbs_EDGE;
|
||||||
|
|
||||||
LightApp_SelectionMgr* aSelMgr = myGeomGUI->getApp()->selectionMgr();
|
|
||||||
TColStd_IndexedMapOfInteger aMap;
|
TColStd_IndexedMapOfInteger aMap;
|
||||||
aSelMgr->GetIndexes( firstIObject(), aMap );
|
aSelMgr->GetIndexes(aSelList.First(), aMap);
|
||||||
if ( aMap.Extent() == 1 ) {
|
if ( aMap.Extent() == 1 ) {
|
||||||
int anIndex = aMap( 1 );
|
int anIndex = aMap( 1 );
|
||||||
if ( aNeedType == TopAbs_EDGE )
|
if ( aNeedType == TopAbs_EDGE )
|
||||||
|
@ -258,25 +258,29 @@ void TransformationGUI_ScaleDlg::SelectionIntoArgument()
|
|||||||
myEditCurrentArgument->setText( "" );
|
myEditCurrentArgument->setText( "" );
|
||||||
QString aName;
|
QString aName;
|
||||||
|
|
||||||
|
LightApp_SelectionMgr* aSelMgr = myGeomGUI->getApp()->selectionMgr();
|
||||||
|
SALOME_ListIO aSelList;
|
||||||
|
aSelMgr->selectedObjects(aSelList);
|
||||||
|
|
||||||
if (myEditCurrentArgument == LineEdit1)
|
if (myEditCurrentArgument == LineEdit1)
|
||||||
{
|
{
|
||||||
int aNbSel = GEOMBase::GetNameOfSelectedIObjects( selectedIO(), aName );
|
int aNbSel = GEOMBase::GetNameOfSelectedIObjects(aSelList, aName);
|
||||||
if (aNbSel < 1)
|
if (aNbSel < 1)
|
||||||
{
|
{
|
||||||
myObjects.length(0);
|
myObjects.length(0);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
GEOMBase::ConvertListOfIOInListOfGO( selectedIO(), myObjects );
|
GEOMBase::ConvertListOfIOInListOfGO(aSelList, myObjects);
|
||||||
if (!myObjects.length())
|
if (!myObjects.length())
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
else if (myEditCurrentArgument == LineEdit2)
|
else if (myEditCurrentArgument == LineEdit2)
|
||||||
{
|
{
|
||||||
GEOM::GEOM_Object_var aSelectedObject = GEOM::GEOM_Object::_nil();
|
GEOM::GEOM_Object_var aSelectedObject = GEOM::GEOM_Object::_nil();
|
||||||
if ( IObjectCount() == 1 )
|
if (aSelList.Extent() == 1)
|
||||||
{
|
{
|
||||||
Standard_Boolean testResult = Standard_False;
|
Standard_Boolean testResult = Standard_False;
|
||||||
aSelectedObject = GEOMBase::ConvertIOinGEOMObject( firstIObject(), testResult );
|
aSelectedObject = GEOMBase::ConvertIOinGEOMObject(aSelList.First(), testResult);
|
||||||
if (testResult)
|
if (testResult)
|
||||||
{
|
{
|
||||||
aName = GEOMBase::GetName(aSelectedObject);
|
aName = GEOMBase::GetName(aSelectedObject);
|
||||||
@ -284,9 +288,8 @@ void TransformationGUI_ScaleDlg::SelectionIntoArgument()
|
|||||||
TopoDS_Shape aShape;
|
TopoDS_Shape aShape;
|
||||||
if (GEOMBase::GetShape(aSelectedObject, aShape, TopAbs_SHAPE) && !aShape.IsNull())
|
if (GEOMBase::GetShape(aSelectedObject, aShape, TopAbs_SHAPE) && !aShape.IsNull())
|
||||||
{
|
{
|
||||||
LightApp_SelectionMgr* aSelMgr = myGeomGUI->getApp()->selectionMgr();
|
|
||||||
TColStd_IndexedMapOfInteger aMap;
|
TColStd_IndexedMapOfInteger aMap;
|
||||||
aSelMgr->GetIndexes( firstIObject(), aMap );
|
aSelMgr->GetIndexes(aSelList.First(), aMap);
|
||||||
if (aMap.Extent() == 1)
|
if (aMap.Extent() == 1)
|
||||||
{
|
{
|
||||||
int anIndex = aMap( 1 );
|
int anIndex = aMap( 1 );
|
||||||
|
@ -274,19 +274,23 @@ void TransformationGUI_TranslationDlg::SelectionIntoArgument()
|
|||||||
myEditCurrentArgument->setText( "" );
|
myEditCurrentArgument->setText( "" );
|
||||||
QString aName;
|
QString aName;
|
||||||
|
|
||||||
|
LightApp_SelectionMgr* aSelMgr = myGeomGUI->getApp()->selectionMgr();
|
||||||
|
SALOME_ListIO aSelList;
|
||||||
|
aSelMgr->selectedObjects(aSelList);
|
||||||
|
|
||||||
if (myEditCurrentArgument == GroupPoints->LineEdit1) {
|
if (myEditCurrentArgument == GroupPoints->LineEdit1) {
|
||||||
int aNbSel = GEOMBase::GetNameOfSelectedIObjects( selectedIO(), aName );
|
int aNbSel = GEOMBase::GetNameOfSelectedIObjects(aSelList, aName);
|
||||||
|
|
||||||
if (aNbSel < 1) {
|
if (aNbSel < 1) {
|
||||||
myObjects.length(0);
|
myObjects.length(0);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
GEOMBase::ConvertListOfIOInListOfGO( selectedIO(), myObjects );
|
GEOMBase::ConvertListOfIOInListOfGO(aSelList, myObjects);
|
||||||
if (!myObjects.length())
|
if (!myObjects.length())
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
if ( IObjectCount() != 1 ) {
|
if (aSelList.Extent() != 1 ) {
|
||||||
if (myEditCurrentArgument == GroupPoints->LineEdit2 && getConstructorId() == 1)
|
if (myEditCurrentArgument == GroupPoints->LineEdit2 && getConstructorId() == 1)
|
||||||
myPoint1 = GEOM::GEOM_Object::_nil();
|
myPoint1 = GEOM::GEOM_Object::_nil();
|
||||||
else if (myEditCurrentArgument == GroupPoints->LineEdit2 && getConstructorId() == 2)
|
else if (myEditCurrentArgument == GroupPoints->LineEdit2 && getConstructorId() == 2)
|
||||||
@ -296,8 +300,8 @@ void TransformationGUI_TranslationDlg::SelectionIntoArgument()
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
Standard_Boolean testResult = Standard_False;;
|
Standard_Boolean testResult = Standard_False;
|
||||||
GEOM::GEOM_Object_var aSelectedObject = GEOMBase::ConvertIOinGEOMObject( firstIObject(), testResult );
|
GEOM::GEOM_Object_var aSelectedObject = GEOMBase::ConvertIOinGEOMObject(aSelList.First(), testResult);
|
||||||
|
|
||||||
if (!testResult || CORBA::is_nil(aSelectedObject))
|
if (!testResult || CORBA::is_nil(aSelectedObject))
|
||||||
return;
|
return;
|
||||||
@ -310,9 +314,8 @@ void TransformationGUI_TranslationDlg::SelectionIntoArgument()
|
|||||||
if ( myEditCurrentArgument == GroupPoints->LineEdit2 && getConstructorId() == 2 )
|
if ( myEditCurrentArgument == GroupPoints->LineEdit2 && getConstructorId() == 2 )
|
||||||
aNeedType = TopAbs_EDGE;
|
aNeedType = TopAbs_EDGE;
|
||||||
|
|
||||||
LightApp_SelectionMgr* aSelMgr = myGeomGUI->getApp()->selectionMgr();
|
|
||||||
TColStd_IndexedMapOfInteger aMap;
|
TColStd_IndexedMapOfInteger aMap;
|
||||||
aSelMgr->GetIndexes( firstIObject(), aMap );
|
aSelMgr->GetIndexes(aSelList.First(), aMap);
|
||||||
if ( aMap.Extent() == 1 )
|
if ( aMap.Extent() == 1 )
|
||||||
{
|
{
|
||||||
int anIndex = aMap( 1 );
|
int anIndex = aMap( 1 );
|
||||||
@ -354,7 +357,6 @@ void TransformationGUI_TranslationDlg::SelectionIntoArgument()
|
|||||||
displayPreview();
|
displayPreview();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
//=================================================================================
|
//=================================================================================
|
||||||
// function : LineEditReturnPressed()
|
// function : LineEditReturnPressed()
|
||||||
// purpose :
|
// purpose :
|
||||||
@ -455,11 +457,15 @@ bool TransformationGUI_TranslationDlg::isValid( QString& /*msg*/ )
|
|||||||
switch (aConstructorId) {
|
switch (aConstructorId) {
|
||||||
case 0:
|
case 0:
|
||||||
{
|
{
|
||||||
Handle(SALOME_InteractiveObject) IO = firstIObject();
|
//LightApp_SelectionMgr* aSelMgr = myGeomGUI->getApp()->selectionMgr();
|
||||||
Standard_Boolean testResult;
|
//SALOME_ListIO aSelList;
|
||||||
GEOM::GEOM_Object_var anObject = GEOMBase::ConvertIOinGEOMObject( IO, testResult );
|
//aSelMgr->selectedObjects(aSelList);
|
||||||
if ( !testResult || anObject->_is_nil() )
|
//
|
||||||
return false;
|
//Handle(SALOME_InteractiveObject) IO = aSelList.First();
|
||||||
|
//Standard_Boolean testResult;
|
||||||
|
//GEOM::GEOM_Object_var anObject = GEOMBase::ConvertIOinGEOMObject(IO, testResult);
|
||||||
|
//if (!testResult || anObject->_is_nil())
|
||||||
|
// return false;
|
||||||
|
|
||||||
return !(myObjects.length() == 0);
|
return !(myObjects.length() == 0);
|
||||||
}
|
}
|
||||||
@ -494,7 +500,8 @@ bool TransformationGUI_TranslationDlg::execute( ObjectList& objects )
|
|||||||
if ( toCreateCopy ) {
|
if ( toCreateCopy ) {
|
||||||
for ( int i = 0; i < myObjects.length(); i++ ) {
|
for ( int i = 0; i < myObjects.length(); i++ ) {
|
||||||
myCurrObject = myObjects[i];
|
myCurrObject = myObjects[i];
|
||||||
anObj = GEOM::GEOM_ITransformOperations::_narrow( getOperation() )->TranslateDXDYDZCopy( myObjects[i], dx, dy, dz );
|
anObj = GEOM::GEOM_ITransformOperations::_narrow( getOperation() )->
|
||||||
|
TranslateDXDYDZCopy( myObjects[i], dx, dy, dz );
|
||||||
if ( !anObj->_is_nil() )
|
if ( !anObj->_is_nil() )
|
||||||
objects.push_back( anObj._retn() );
|
objects.push_back( anObj._retn() );
|
||||||
}
|
}
|
||||||
@ -502,7 +509,8 @@ bool TransformationGUI_TranslationDlg::execute( ObjectList& objects )
|
|||||||
else {
|
else {
|
||||||
for ( int i = 0; i < myObjects.length(); i++ ) {
|
for ( int i = 0; i < myObjects.length(); i++ ) {
|
||||||
myCurrObject = myObjects[i];
|
myCurrObject = myObjects[i];
|
||||||
anObj = GEOM::GEOM_ITransformOperations::_narrow( getOperation() )->TranslateDXDYDZ( myObjects[i], dx, dy, dz );
|
anObj = GEOM::GEOM_ITransformOperations::_narrow( getOperation() )->
|
||||||
|
TranslateDXDYDZ( myObjects[i], dx, dy, dz );
|
||||||
if ( !anObj->_is_nil() )
|
if ( !anObj->_is_nil() )
|
||||||
objects.push_back( anObj._retn() );
|
objects.push_back( anObj._retn() );
|
||||||
}
|
}
|
||||||
@ -515,7 +523,8 @@ bool TransformationGUI_TranslationDlg::execute( ObjectList& objects )
|
|||||||
if ( toCreateCopy ) {
|
if ( toCreateCopy ) {
|
||||||
for ( int i = 0; i < myObjects.length(); i++ ) {
|
for ( int i = 0; i < myObjects.length(); i++ ) {
|
||||||
myCurrObject = myObjects[i];
|
myCurrObject = myObjects[i];
|
||||||
anObj = GEOM::GEOM_ITransformOperations::_narrow( getOperation() )->TranslateTwoPointsCopy( myObjects[i], myPoint1, myPoint2 );
|
anObj = GEOM::GEOM_ITransformOperations::_narrow( getOperation() )->
|
||||||
|
TranslateTwoPointsCopy( myObjects[i], myPoint1, myPoint2 );
|
||||||
if ( !anObj->_is_nil() )
|
if ( !anObj->_is_nil() )
|
||||||
objects.push_back( anObj._retn() );
|
objects.push_back( anObj._retn() );
|
||||||
}
|
}
|
||||||
@ -523,7 +532,8 @@ bool TransformationGUI_TranslationDlg::execute( ObjectList& objects )
|
|||||||
else {
|
else {
|
||||||
for ( int i = 0; i < myObjects.length(); i++ ) {
|
for ( int i = 0; i < myObjects.length(); i++ ) {
|
||||||
myCurrObject = myObjects[i];
|
myCurrObject = myObjects[i];
|
||||||
anObj = GEOM::GEOM_ITransformOperations::_narrow( getOperation() )->TranslateTwoPoints( myObjects[i], myPoint1, myPoint2 );
|
anObj = GEOM::GEOM_ITransformOperations::_narrow( getOperation() )->
|
||||||
|
TranslateTwoPoints( myObjects[i], myPoint1, myPoint2 );
|
||||||
if ( !anObj->_is_nil() )
|
if ( !anObj->_is_nil() )
|
||||||
objects.push_back( anObj._retn() );
|
objects.push_back( anObj._retn() );
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user