}
// If only one shape is given we don't split it
// algorithm just returns the unpacked input data
- if(theObjectList.Size() == 1) {
- anOutputSplitDataList.append(anInputSplitDataList);
- if(!theGroupsList.IsEmpty() )
- anOutputSplitDataList.append(anInputGroupList);
- return anOutputSplitDataList;
+ bool limplus1Object(false);
+ if(theObjectList.Size() == 1 ) {
+ if(thePolyline.IsNull()) {
+ anOutputSplitDataList.append(anInputSplitDataList);
+ if(!theGroupsList.IsEmpty() )
+ anOutputSplitDataList.append(anInputGroupList);
+ return anOutputSplitDataList;
+ } else
+ limplus1Object = true;// size =1 && hasLimits
}
HYDROData_DataMapOfShapeListOfString aDM3;
if(!anInputGroupList.isEmpty()) {// Old edge ==> List_Of_Names
}
}
// Step 1. Prepare Partition structures.
+ TopoDS_Shape aResult;
BOPCol_ListOfShape aLS;
QStringList aListOfNames;
TopoDS_Compound aCmp;
BRepTools::Write(aCmp, aNameBefore.ToCString());
#endif
+ HYDROData_DataMapOfShapeListOfShape aDM1;
+ if(anInputSplitDataList.size() > 1) {
HYDROData_Transform splitTool;
const Standard_Integer anErr = SplitFaces(aCmp, splitTool);
if(anErr)
return anOutputSplitDataList;
- const TopoDS_Shape& aResult = splitTool.Shape();
+ aResult = splitTool.Shape();
if (aResult.IsNull())
return anOutputSplitDataList;
BRepCheck_Analyzer aCheck (aResult);
#endif
// Step 3. Collect history
- HYDROData_DataMapOfShapeListOfShape aDM1;
+ //HYDROData_DataMapOfShapeListOfShape aDM1;
BOPCol_ListIteratorOfListOfShape anIt(aLS);
TCollection_AsciiString aNamM ("EdgM_");
TCollection_AsciiString aNamG ("EdgG_");
}
}
}
-
+ } else
+ aResult = anInputSplitDataList.at(0).Shape; // get single input shape
// aDM2: NewShape ==> ListOfOldShapes
HYDROData_DataMapOfShapeListOfShape aDM2;
// make limiting face
HYDROData_DataMapOfShapeListOfShape aDM4;
Standard_Boolean hasLimits(Standard_False);
- if (! thePolyline.IsNull()) {
+ if (! thePolyline.IsNull()) {
//const TopoDS_Shape aShape = thePolyline->GetShape();
const TopoDS_Wire aBndWire = TopoDS::Wire(thePolyline->GetShape());
if(!aBndWire.IsNull()) {
BRepTools::Write(aComResult,"CommonV.brep");
#endif
- hasLimits = Standard_True; // DM2 should filled here
+ hasLimits = Standard_True; // DM2 should be filled here
HYDROData_MapOfShape aView;
TopExp_Explorer exp (aResult, TopAbs_FACE);
- for (int i =1;exp.More();exp.Next(),i++) {
+ for (int i =1;exp.More();exp.Next(),i++) {
const TopoDS_Shape& aFace = exp.Current();
if(!aFace.IsNull()) {
const TopTools_ListOfShape& aListOfNew = mkCom.Modified(aFace);
}
}
//cout << "DM4 Ext = " <<aDM4.Extent() <<endl;
+ if(limplus1Object) {
+ // fill DM1 (old - new) and DM2 (new - old)
+ HYDROData_DataMapIteratorOfDataMapOfShapeListOfShape mIt(aDM4);
+ for(;mIt.More();mIt.Next()) {
+ const TopoDS_Shape& aKey = mIt.Key();//old
+ TopTools_ListOfShape aList;
+ aList.Append(aKey);
+ const TopTools_ListOfShape& aListOfNew = mIt.Value();
+ aDM1.Bind(aKey, aListOfNew);
+ TopTools_ListIteratorOfListOfShape it(aListOfNew);
+ for(;it.More();it.Next()) {
+ if(!aDM2.IsBound(it.Value()))
+ aDM2.Bind(it.Value(), aList);
+ else {
+ TopTools_ListOfShape& aList = aDM2.ChangeFind(it.Value());
+ aList.Prepend(aKey);
+ }
+ }
+ }
+ } else {
HYDROData_DataMapIteratorOfDataMapOfShapeListOfShape aMIt(aDM1);
//DM4 contains Old - New after common op. DM1: old - new after Split op.
- for(;aMIt.More();aMIt.Next()) {
+ for(;aMIt.More();aMIt.Next()) {
const TopoDS_Shape& aKey = aMIt.Key();
TopTools_ListOfShape aList;
aList.Append(aKey);
}
}
}//
- }
+ }
+ }
} else {
hasLimits = Standard_False;
#ifdef DEB_SPLIT_TO_ZONES
}
}
}
- }
+ }// end limits processing
if(!hasLimits) {
HYDROData_DataMapIteratorOfDataMapOfShapeListOfShape aMIt(aDM1);
for(;aMIt.More();aMIt.Next()) {