mirror of
https://git.salome-platform.org/gitpub/modules/geom.git
synced 2025-04-25 06:32:04 +05:00
Fix for bug PAL14047(EDF PAL 334 : Problem to select merged face with Create group window).
This commit is contained in:
parent
93f9a2030c
commit
840600758d
@ -329,15 +329,36 @@ void GroupGUI_GroupDlg::SelectionIntoArgument()
|
||||
|
||||
GEOM::ListOfGO anObjects;
|
||||
GEOMBase::ConvertListOfIOInListOfGO(selectedIO(), anObjects);
|
||||
|
||||
GEOM::GEOM_ILocalOperations_var aLocOp = getGeomEngine()->GetILocalOperations( getStudyId() );
|
||||
for (int i = 0; i < anObjects.length(); i++) {
|
||||
TopoDS_Shape aShape;
|
||||
if ( GEOMBase::GetShape(anObjects[i], aShape, getShapeType()) ) {
|
||||
CORBA::Long anIndex = aLocOp->GetSubShapeIndex( myMainObj, anObjects[i] );
|
||||
if ( anIndex >= 0 )
|
||||
aMapIndex.Add( anIndex );
|
||||
}
|
||||
}
|
||||
GEOM::GEOM_IShapesOperations_var aShapesOp = getGeomEngine()->GetIShapesOperations( getStudyId() );
|
||||
|
||||
for (int i = 0; i < anObjects.length(); i++)
|
||||
{
|
||||
GEOM::GEOM_Object_var aGeomObj = anObjects[i];
|
||||
GEOM::ListOfGO_var aSubObjects = new GEOM::ListOfGO();
|
||||
TopoDS_Shape aShape;
|
||||
if ( GEOMBase::GetShape(aGeomObj, aShape, getShapeType()) )
|
||||
{
|
||||
aSubObjects->length(1);
|
||||
aSubObjects[0] = aGeomObj;
|
||||
}
|
||||
else if (aGeomObj->GetType() == GEOM_GROUP)
|
||||
aSubObjects = aShapesOp->MakeExplode( aGeomObj, getShapeType(), false);
|
||||
else
|
||||
continue;
|
||||
|
||||
for (int i = 0; i < aSubObjects->length(); i++)
|
||||
{
|
||||
TopoDS_Shape aShape;
|
||||
if ( GEOMBase::GetShape(aSubObjects[i], aShape, getShapeType()) )
|
||||
{
|
||||
CORBA::Long anIndex = aLocOp->GetSubShapeIndex( myMainObj, aSubObjects[i] );
|
||||
if ( anIndex >= 0 )
|
||||
aMapIndex.Add( anIndex );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ( !myMainObj->_is_nil() )
|
||||
localSelection( myMainObj, getShapeType() );
|
||||
@ -432,15 +453,36 @@ void GroupGUI_GroupDlg::add()
|
||||
if ( !aMapIndex.Extent() ) {
|
||||
GEOM::ListOfGO anObjects;
|
||||
GEOMBase::ConvertListOfIOInListOfGO(selectedIO(), anObjects);
|
||||
|
||||
GEOM::GEOM_ILocalOperations_var aLocOp = getGeomEngine()->GetILocalOperations( getStudyId() );
|
||||
for (int i = 0; i < anObjects.length(); i++) {
|
||||
TopoDS_Shape aShape;
|
||||
if ( GEOMBase::GetShape(anObjects[i], aShape, getShapeType()) ) {
|
||||
CORBA::Long anIndex = aLocOp->GetSubShapeIndex( myMainObj, anObjects[i] );
|
||||
if ( anIndex >= 0 )
|
||||
aMapIndex.Add( anIndex );
|
||||
GEOM::GEOM_IShapesOperations_var aShapesOp = getGeomEngine()->GetIShapesOperations( getStudyId() );
|
||||
|
||||
for (int i = 0; i < anObjects.length(); i++)
|
||||
{
|
||||
GEOM::GEOM_Object_var aGeomObj = anObjects[i];
|
||||
GEOM::ListOfGO_var aSubObjects = new GEOM::ListOfGO();
|
||||
TopoDS_Shape aShape;
|
||||
if ( GEOMBase::GetShape(aGeomObj, aShape, getShapeType()) )
|
||||
{
|
||||
aSubObjects->length(1);
|
||||
aSubObjects[0] = aGeomObj;
|
||||
}
|
||||
else if (aGeomObj->GetType() == GEOM_GROUP)
|
||||
aSubObjects = aShapesOp->MakeExplode( aGeomObj, getShapeType(), false);
|
||||
else
|
||||
break;
|
||||
|
||||
for (int i = 0; i < aSubObjects->length(); i++)
|
||||
{
|
||||
TopoDS_Shape aShape;
|
||||
if ( GEOMBase::GetShape(aSubObjects[i], aShape, getShapeType()) )
|
||||
{
|
||||
CORBA::Long anIndex = aLocOp->GetSubShapeIndex( myMainObj, aSubObjects[i] );
|
||||
if ( anIndex >= 0 )
|
||||
aMapIndex.Add( anIndex );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ( aMapIndex.Extent() >= 1 ) {
|
||||
@ -555,27 +597,55 @@ void GroupGUI_GroupDlg::updateState()
|
||||
|
||||
// try to find out and process the object browser selection
|
||||
if ( !aMapIndex.Extent() && !CORBA::is_nil( myMainObj ) ) {
|
||||
isAdd = true;
|
||||
GEOM::ListOfGO anObjects;
|
||||
GEOMBase::ConvertListOfIOInListOfGO(selectedIO(), anObjects);
|
||||
GEOM::GEOM_ILocalOperations_var aLocOp = getGeomEngine()->GetILocalOperations( getStudyId() );
|
||||
for (int i = 0; i < anObjects.length(); i++) {
|
||||
TopoDS_Shape aShape;
|
||||
if ( GEOMBase::GetShape(anObjects[i], aShape, getShapeType()) ) {
|
||||
CORBA::Long anIndex = aLocOp->GetSubShapeIndex( myMainObj, anObjects[i] );
|
||||
if ( anIndex >= 0 )
|
||||
aMapIndex.Add( anIndex );
|
||||
else
|
||||
isAdd = false;
|
||||
}
|
||||
else
|
||||
isAdd = false;
|
||||
|
||||
if ( !isAdd ) {
|
||||
aMapIndex.Clear();
|
||||
break;
|
||||
}
|
||||
}
|
||||
GEOM::GEOM_ILocalOperations_var aLocOp = getGeomEngine()->GetILocalOperations( getStudyId() );
|
||||
GEOM::GEOM_IShapesOperations_var aShapesOp = getGeomEngine()->GetIShapesOperations( getStudyId() );
|
||||
|
||||
isAdd = true;
|
||||
|
||||
for (int i = 0; i < anObjects.length(); i++)
|
||||
{
|
||||
GEOM::GEOM_Object_var aGeomObj = anObjects[i];
|
||||
GEOM::ListOfGO_var aSubObjects = new GEOM::ListOfGO();
|
||||
TopoDS_Shape aShape;
|
||||
if ( GEOMBase::GetShape(aGeomObj, aShape, getShapeType()) )
|
||||
{
|
||||
aSubObjects->length(1);
|
||||
aSubObjects[0] = aGeomObj;
|
||||
}
|
||||
else if (aGeomObj->GetType() == GEOM_GROUP)
|
||||
aSubObjects = aShapesOp->MakeExplode( aGeomObj, getShapeType(), false);
|
||||
else
|
||||
break;
|
||||
|
||||
for (int i = 0; i < aSubObjects->length(); i++)
|
||||
{
|
||||
TopoDS_Shape aShape;
|
||||
aSubObjects[i];
|
||||
if ( GEOMBase::GetShape(aSubObjects[i], aShape, getShapeType()) )
|
||||
{
|
||||
CORBA::Long anIndex = aLocOp->GetSubShapeIndex( myMainObj, aSubObjects[i] );
|
||||
if ( anIndex >= 0 )
|
||||
aMapIndex.Add( anIndex );
|
||||
else
|
||||
isAdd = false;
|
||||
}
|
||||
else
|
||||
isAdd = false;
|
||||
|
||||
if ( !isAdd ) {
|
||||
aMapIndex.Clear();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if ( !isAdd ) {
|
||||
aMapIndex.Clear();
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
isAdd = aMapIndex.Extent() > 0;
|
||||
@ -734,3 +804,4 @@ GEOM::GEOM_Object_ptr GroupGUI_GroupDlg::getFather( GEOM::GEOM_Object_ptr theObj
|
||||
}
|
||||
return aFatherObj._retn();
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user