Merge from BR_Dev_For_6_3_1 03/06/2011

This commit is contained in:
vsr 2011-06-03 09:54:11 +00:00
parent f0a071156a
commit 16ff25c14d
3 changed files with 112 additions and 45 deletions

View File

@ -450,21 +450,23 @@ TopoDS_Shape GEOMImpl_GlueDriver::GlueWithWarnings (const TopoDS_Shape& theShape
return aRes; return aRes;
} }
// 3. Fill shapes to glue aMSG if (theShapeType != TopAbs_FACE) {
TopTools_DataMapOfShapeListOfShape aMSG; // 3. Fill shapes to glue aMSG
const TopTools_DataMapOfShapeListOfShape& aMSD = aGA.ShapesDetected(); TopTools_DataMapOfShapeListOfShape aMSG;
TopTools_DataMapIteratorOfDataMapOfShapeListOfShape aItMSD; const TopTools_DataMapOfShapeListOfShape& aMSD = aGA.ShapesDetected();
aItMSD.Initialize(aMSD); TopTools_DataMapIteratorOfDataMapOfShapeListOfShape aItMSD;
for (; aItMSD.More(); aItMSD.Next()) { aItMSD.Initialize(aMSD);
const TopoDS_Shape& aSx = aItMSD.Key(); for (; aItMSD.More(); aItMSD.Next()) {
const TopTools_ListOfShape& aLSD = aItMSD.Value(); const TopoDS_Shape& aSx = aItMSD.Key();
if (aSx.ShapeType() == theShapeType) { const TopTools_ListOfShape& aLSD = aItMSD.Value();
aMSG.Bind(aSx, aLSD); if (aSx.ShapeType() == theShapeType) {
aMSG.Bind(aSx, aLSD);
}
} }
}
// 4. Set shapes to glue. If the operator is absent, the whole gluing will be done // 4. Set shapes to glue. If the operator is absent, the whole gluing will be done
aGA.SetShapesToGlue(aMSG); aGA.SetShapesToGlue(aMSG);
}
// 5. Gluing // 5. Gluing
aGA.Perform(); aGA.Perform();

View File

@ -235,8 +235,12 @@ void GEOM_Superv_i::getBasicOp()
if (CORBA::is_nil(myGeomEngine)) if (CORBA::is_nil(myGeomEngine))
setGeomEngine(); setGeomEngine();
// get GEOM_IBasicOperations interface // get GEOM_IBasicOperations interface
if (CORBA::is_nil(myBasicOp) || isNewStudy(myLastStudyID,myStudyID)) if (CORBA::is_nil(myBasicOp) || isNewStudy(myLastStudyID,myStudyID)) {
//rnv: to fix bug "IPAL22461 6.3.0: Incorrect study storage if study contains shape modified with YACS"
// Try to get id of the study from the SALOME Session
if(myStudyID < 0 ) SetStudyID(-1);
myBasicOp = myGeomEngine->GetIBasicOperations(myStudyID); myBasicOp = myGeomEngine->GetIBasicOperations(myStudyID);
}
} }
//============================================================================= //=============================================================================
@ -247,8 +251,12 @@ void GEOM_Superv_i::get3DPrimOp()
if (CORBA::is_nil(myGeomEngine)) if (CORBA::is_nil(myGeomEngine))
setGeomEngine(); setGeomEngine();
// get GEOM_I3DPrimOperations interface // get GEOM_I3DPrimOperations interface
if (CORBA::is_nil(my3DPrimOp) || isNewStudy(myLastStudyID,myStudyID)) if (CORBA::is_nil(my3DPrimOp) || isNewStudy(myLastStudyID,myStudyID)) {
//rnv: to fix bug "IPAL22461 6.3.0: Incorrect study storage if study contains shape modified with YACS"
// Try to get id of the study from the SALOME Session
if(myStudyID < 0 ) SetStudyID(-1);
my3DPrimOp = myGeomEngine->GetI3DPrimOperations(myStudyID); my3DPrimOp = myGeomEngine->GetI3DPrimOperations(myStudyID);
}
} }
//============================================================================= //=============================================================================
@ -259,8 +267,12 @@ void GEOM_Superv_i::getBoolOp()
if (CORBA::is_nil(myGeomEngine)) if (CORBA::is_nil(myGeomEngine))
setGeomEngine(); setGeomEngine();
// get GEOM_IBooleanOperations interface // get GEOM_IBooleanOperations interface
if (CORBA::is_nil(myBoolOp) || isNewStudy(myLastStudyID,myStudyID)) if (CORBA::is_nil(myBoolOp) || isNewStudy(myLastStudyID,myStudyID)) {
//rnv: to fix bug "IPAL22461 6.3.0: Incorrect study storage if study contains shape modified with YACS"
// Try to get id of the study from the SALOME Session
if(myStudyID < 0 ) SetStudyID(-1);
myBoolOp = myGeomEngine->GetIBooleanOperations(myStudyID); myBoolOp = myGeomEngine->GetIBooleanOperations(myStudyID);
}
} }
//============================================================================= //=============================================================================
@ -271,8 +283,12 @@ void GEOM_Superv_i::getInsOp()
if (CORBA::is_nil(myGeomEngine)) if (CORBA::is_nil(myGeomEngine))
setGeomEngine(); setGeomEngine();
// get GEOM_IInsertOperations interface // get GEOM_IInsertOperations interface
if (CORBA::is_nil(myInsOp) || isNewStudy(myLastStudyID,myStudyID)) if (CORBA::is_nil(myInsOp) || isNewStudy(myLastStudyID,myStudyID)) {
//rnv: to fix bug "IPAL22461 6.3.0: Incorrect study storage if study contains shape modified with YACS"
// Try to get id of the study from the SALOME Session
if(myStudyID < 0 ) SetStudyID(-1);
myInsOp = myGeomEngine->GetIInsertOperations(myStudyID); myInsOp = myGeomEngine->GetIInsertOperations(myStudyID);
}
} }
//============================================================================= //=============================================================================
@ -283,8 +299,12 @@ void GEOM_Superv_i::getTransfOp()
if (CORBA::is_nil(myGeomEngine)) if (CORBA::is_nil(myGeomEngine))
setGeomEngine(); setGeomEngine();
// get GEOM_ITransformOperations interface // get GEOM_ITransformOperations interface
if (CORBA::is_nil(myTransfOp) || isNewStudy(myLastStudyID,myStudyID)) if (CORBA::is_nil(myTransfOp) || isNewStudy(myLastStudyID,myStudyID)) {
//rnv: to fix bug "IPAL22461 6.3.0: Incorrect study storage if study contains shape modified with YACS"
// Try to get id of the study from the SALOME Session
if(myStudyID < 0 ) SetStudyID(-1);
myTransfOp = myGeomEngine->GetITransformOperations(myStudyID); myTransfOp = myGeomEngine->GetITransformOperations(myStudyID);
}
} }
//============================================================================= //=============================================================================
@ -295,8 +315,12 @@ void GEOM_Superv_i::getShapesOp()
if (CORBA::is_nil(myGeomEngine)) if (CORBA::is_nil(myGeomEngine))
setGeomEngine(); setGeomEngine();
// get GEOM_IShapesOperations interface // get GEOM_IShapesOperations interface
if (CORBA::is_nil(myShapesOp) || isNewStudy(myLastStudyID,myStudyID)) if (CORBA::is_nil(myShapesOp) || isNewStudy(myLastStudyID,myStudyID)) {
//rnv: to fix bug "IPAL22461 6.3.0: Incorrect study storage if study contains shape modified with YACS"
// Try to get id of the study from the SALOME Session
if(myStudyID < 0 ) SetStudyID(-1);
myShapesOp = myGeomEngine->GetIShapesOperations(myStudyID); myShapesOp = myGeomEngine->GetIShapesOperations(myStudyID);
}
} }
//============================================================================= //=============================================================================
@ -307,8 +331,12 @@ void GEOM_Superv_i::getBlocksOp()
if (CORBA::is_nil(myGeomEngine)) if (CORBA::is_nil(myGeomEngine))
setGeomEngine(); setGeomEngine();
// get GEOM_IBlocksOperations interface // get GEOM_IBlocksOperations interface
if (CORBA::is_nil(myBlocksOp) || isNewStudy(myLastStudyID,myStudyID)) if (CORBA::is_nil(myBlocksOp) || isNewStudy(myLastStudyID,myStudyID)) {
//rnv: to fix bug "IPAL22461 6.3.0: Incorrect study storage if study contains shape modified with YACS"
// Try to get id of the study from the SALOME Session
if(myStudyID < 0 ) SetStudyID(-1);
myBlocksOp = myGeomEngine->GetIBlocksOperations(myStudyID); myBlocksOp = myGeomEngine->GetIBlocksOperations(myStudyID);
}
} }
//============================================================================= //=============================================================================
@ -319,8 +347,12 @@ void GEOM_Superv_i::getCurvesOp()
if (CORBA::is_nil(myGeomEngine)) if (CORBA::is_nil(myGeomEngine))
setGeomEngine(); setGeomEngine();
// get GEOM_ICurvesOperations interface // get GEOM_ICurvesOperations interface
if (CORBA::is_nil(myCurvesOp) || isNewStudy(myLastStudyID,myStudyID)) if (CORBA::is_nil(myCurvesOp) || isNewStudy(myLastStudyID,myStudyID)) {
//rnv: to fix bug "IPAL22461 6.3.0: Incorrect study storage if study contains shape modified with YACS"
// Try to get id of the study from the SALOME Session
if(myStudyID < 0 ) SetStudyID(-1);
myCurvesOp = myGeomEngine->GetICurvesOperations(myStudyID); myCurvesOp = myGeomEngine->GetICurvesOperations(myStudyID);
}
} }
//============================================================================= //=============================================================================
@ -331,8 +363,12 @@ void GEOM_Superv_i::getLocalOp()
if (CORBA::is_nil(myGeomEngine)) if (CORBA::is_nil(myGeomEngine))
setGeomEngine(); setGeomEngine();
// get GEOM_ILocalOperations interface // get GEOM_ILocalOperations interface
if (CORBA::is_nil(myLocalOp) || isNewStudy(myLastStudyID,myStudyID)) if (CORBA::is_nil(myLocalOp) || isNewStudy(myLastStudyID,myStudyID)) {
//rnv: to fix bug "IPAL22461 6.3.0: Incorrect study storage if study contains shape modified with YACS"
// Try to get id of the study from the SALOME Session
if(myStudyID < 0 ) SetStudyID(-1);
myLocalOp = myGeomEngine->GetILocalOperations(myStudyID); myLocalOp = myGeomEngine->GetILocalOperations(myStudyID);
}
} }
//============================================================================= //=============================================================================
@ -343,8 +379,12 @@ void GEOM_Superv_i::getGroupOp()
if (CORBA::is_nil(myGeomEngine)) if (CORBA::is_nil(myGeomEngine))
setGeomEngine(); setGeomEngine();
// get GEOM_IGroupOperations interface // get GEOM_IGroupOperations interface
if (CORBA::is_nil(myGroupOp) || isNewStudy(myLastStudyID,myStudyID)) if (CORBA::is_nil(myGroupOp) || isNewStudy(myLastStudyID,myStudyID)) {
//rnv: to fix bug "IPAL22461 6.3.0: Incorrect study storage if study contains shape modified with YACS"
// Try to get id of the study from the SALOME Session
if(myStudyID < 0 ) SetStudyID(-1);
myGroupOp = myGeomEngine->GetIGroupOperations(myStudyID); myGroupOp = myGeomEngine->GetIGroupOperations(myStudyID);
}
} }
//============================================================================= //=============================================================================
@ -355,8 +395,12 @@ void GEOM_Superv_i::getAdvancedOp()
if (CORBA::is_nil(myGeomEngine)) if (CORBA::is_nil(myGeomEngine))
setGeomEngine(); setGeomEngine();
// get GEOM_IAdvancedOperations interface // get GEOM_IAdvancedOperations interface
if (CORBA::is_nil(myAdvancedOp) || isNewStudy(myLastStudyID,myStudyID)) if (CORBA::is_nil(myAdvancedOp) || isNewStudy(myLastStudyID,myStudyID)) {
//rnv: to fix bug "IPAL22461 6.3.0: Incorrect study storage if study contains shape modified with YACS"
// Try to get id of the study from the SALOME Session
if(myStudyID < 0 ) SetStudyID(-1);
myAdvancedOp = myGeomEngine->GetIAdvancedOperations(myStudyID); myAdvancedOp = myGeomEngine->GetIAdvancedOperations(myStudyID);
}
} }
//============================================================================= //=============================================================================

View File

@ -422,10 +422,13 @@ void GroupGUI_GroupDlg::setInPlaceObj(GEOM::GEOM_Object_var theObj, const bool i
GEOM::ListOfGO_var aSubObjects = aShapesOp->MakeExplode(myInPlaceObj, getShapeType(), false); GEOM::ListOfGO_var aSubObjects = aShapesOp->MakeExplode(myInPlaceObj, getShapeType(), false);
for (int i = 0; i < aSubObjects->length(); i++) for (int i = 0; i < aSubObjects->length(); i++)
{ {
CORBA::Long aMainIndex = aLocOp->GetSubShapeIndex(myMainObj, aSubObjects[i]); GEOM::GEOM_Object_var aSS = aShapesOp->GetSame(myMainObj, aSubObjects[i]);
CORBA::Long aPlaceIndex = aLocOp->GetSubShapeIndex(myInPlaceObj, aSubObjects[i]); if (!CORBA::is_nil(aSS)) {
if (aMainIndex >= 0 && aPlaceIndex > 0) CORBA::Long aMainIndex = aLocOp->GetSubShapeIndex(myMainObj, aSS);
myMain2InPlaceIndices.Bind(aMainIndex, aPlaceIndex); CORBA::Long aPlaceIndex = aLocOp->GetSubShapeIndex(myInPlaceObj, aSubObjects[i]);
if (aMainIndex >= 0 && aPlaceIndex > 0)
myMain2InPlaceIndices.Bind(aMainIndex, aPlaceIndex);
}
} }
} }
myInPlaceObjSelectState = subSelectionWay(); myInPlaceObjSelectState = subSelectionWay();
@ -806,29 +809,47 @@ void GroupGUI_GroupDlg::activateSelection()
TopoDS_Shape aMainShape = GEOM_Client::get_client().GetShape(GeometryGUI::GetGeomGen(), myMainObj); TopoDS_Shape aMainShape = GEOM_Client::get_client().GetShape(GeometryGUI::GetGeomGen(), myMainObj);
TopoDS_Shape aRestrictionShape; TopoDS_Shape aRestrictionShape;
if (subSelectionWay() == ALL_SUBSHAPES)
if (subSelectionWay() == ALL_SUBSHAPES) {
aRestrictionShape = aMainShape; aRestrictionShape = aMainShape;
else if (!myInPlaceObj->_is_nil())
aRestrictionShape = GEOM_Client::get_client().GetShape(GeometryGUI::GetGeomGen(), myInPlaceObj);
else ;
TopTools_IndexedMapOfShape aSubShapesMap; TopTools_IndexedMapOfShape aSubShapesMap;
TopExp::MapShapes(aMainShape, aSubShapesMap); TopExp::MapShapes(aMainShape, aSubShapesMap);
CORBA::String_var aMainEntry = myMainObj->GetStudyEntry(); CORBA::String_var aMainEntry = myMainObj->GetStudyEntry();
QString anEntryBase = aMainEntry.in(); QString anEntryBase = aMainEntry.in();
TopExp_Explorer anExp (aRestrictionShape, getShapeType()); TopExp_Explorer anExp (aRestrictionShape, getShapeType());
for (; anExp.More(); anExp.Next()) for (; anExp.More(); anExp.Next()) {
{ TopoDS_Shape aSubShape = anExp.Current();
TopoDS_Shape aSubShape = anExp.Current(); int index = aSubShapesMap.FindIndex(aSubShape);
int index = aSubShapesMap.FindIndex(aSubShape); QString anEntry = anEntryBase + QString("_%1").arg(index);
QString anEntry = anEntryBase + QString("_%1").arg(index);
SALOME_Prs* aPrs = aDisplayer->buildSubshapePresentation(aSubShape, anEntry, aView); SALOME_Prs* aPrs = aDisplayer->buildSubshapePresentation(aSubShape, anEntry, aView);
if (aPrs) { if (aPrs) {
displayPreview(aPrs, true, false); // append, do not update displayPreview(aPrs, true, false); // append, do not update
}
} }
} }
else if (!myInPlaceObj->_is_nil()) {
TopTools_IndexedMapOfShape aSubShapesMap;
TopExp::MapShapes(aMainShape, aSubShapesMap);
CORBA::String_var aMainEntry = myMainObj->GetStudyEntry();
QString anEntryBase = aMainEntry.in();
TColStd_DataMapIteratorOfDataMapOfIntegerInteger aM2IPit (myMain2InPlaceIndices);
for (; aM2IPit.More(); aM2IPit.Next()) {
int index = aM2IPit.Key();
TopoDS_Shape aSubShape = aSubShapesMap.FindKey(index);
QString anEntry = anEntryBase + QString("_%1").arg(index);
SALOME_Prs* aPrs = aDisplayer->buildSubshapePresentation(aSubShape, anEntry, aView);
if (aPrs) {
displayPreview(aPrs, true, false); // append, do not update
}
}
}
else ;
aDisplayer->UpdateViewer(); aDisplayer->UpdateViewer();
aDisplayer->SetDisplayMode(prevDisplayMode); aDisplayer->SetDisplayMode(prevDisplayMode);
} }