+ bool limplus1Object(false);
+ if(theObjectList.Size() == 1 )
+ {
+ if(thePolyline.IsNull())
+ {
+ //anOutputSplitDataList.append(anInputSplitDataList);
+ SplitData SD = anInputSplitDataList.at(0);
+ TopTools_ListOfShape newshs;
+ TopTools_IndexedDataMapOfShapeListOfShape OutOrSh2M;
+ CutFaceByEdges(SD.Face(), newshs, InterPolys, &OutNE, &OutOrSh2M);
+ for (TopTools_ListIteratorOfListOfShape it(newshs); it.More(); it.Next())
+ {
+ SplitData NSD = SD;
+ NSD.Shape = it.Value();
+ anOutputSplitDataList.append(NSD);
+ }
+
+ NCollection_DataMap<TopoDS_Shape, Handle(HYDROData_PolylineXY), TopTools_ShapeMapHasher>::Iterator spit(OutNE);
+ for (;spit.More();spit.Next())
+ {
+ const TopoDS_Edge& E = TopoDS::Edge(spit.Key());
+ if (E.IsNull())
+ continue;
+ SplitData SDI(SplitData::Data_IntEdge, E, spit.Value()->GetName());
+ anOutputSplitDataList.append(SDI);
+ }
+
+#ifndef NDEBUG
+ //check CutFaceByEdges method: ensure that SD.Face() edges fully covered by
+ //history map (OutOrSh2M)
+ if (!OutOrSh2M.IsEmpty())
+ {
+ TopTools_IndexedMapOfShape EE;
+ TopExp::MapShapes(SD.Face(), TopAbs_EDGE, EE);
+ int noncontNb = 0;
+ for (int i = 1; i <= EE.Extent(); i++)
+ {
+ const TopoDS_Shape& E = EE(i);
+ noncontNb += !OutOrSh2M.Contains(E);
+ }
+ //noncontNb > 0 => some problem with edge history
+ assert(noncontNb == 0);
+ }
+#endif
+
+ if(!theGroupsList.IsEmpty() )
+ {
+ SplitDataList ModifInpGroupList;
+ SplitDataListIterator it(anInputGroupList);
+ while( it.hasNext() )
+ {
+ const SplitData& SData = it.next();
+ if (SData.Type != SplitData::Data_Edge)
+ ModifInpGroupList.append(SData); //add as is
+ const TopoDS_Shape& SData_sh = SData.Shape;
+ TopTools_ListOfShape modif_ls;
+ if (!InterPolys.IsEmpty())
+ if (OutOrSh2M.Contains(SData_sh))
+ modif_ls = OutOrSh2M.FindFromKey(SData_sh);
+ //else TODO - show message that one of the object should be updated
+
+#ifndef NDEBUG
+ if (!InterPolys.IsEmpty() && OutOrSh2M.IsEmpty())
+ assert (true);
+#endif
+ if (modif_ls.IsEmpty())
+ ModifInpGroupList.append(SData); //non modified
+ else
+ {
+ TopTools_ListIteratorOfListOfShape itl_modif(modif_ls);
+ for (;itl_modif.More();itl_modif.Next())
+ {
+ const TopoDS_Shape& CSH = itl_modif.Value();
+ if (CSH.ShapeType() == TopAbs_EDGE)
+ {
+ SplitData NewSData;
+ NewSData.ObjectNames = SData.ObjectNames;
+ NewSData.Type = SData.Type;
+ NewSData.Shape = CSH;
+ ModifInpGroupList.append(NewSData);
+ }
+ }
+ }
+
+ }
+ anOutputSplitDataList.append(ModifInpGroupList);
+ }
+ return anOutputSplitDataList;
+ }
+ else
+ limplus1Object = true;// size =1 && hasLimits