+ CORBA::Short theLimit,
+ CORBA::Boolean theRemoveWebs,
+ const GEOM::ListOfLong& theMaterials)
+{
+ GEOM::GEOM_Object_var aGEOMObject;
+
+ //Set a not done flag
+ GetOperations()->SetNotDone();
+
+ int ind, aLen;
+ Handle(TColStd_HSequenceOfTransient) aShapes = new TColStd_HSequenceOfTransient;
+ Handle(TColStd_HSequenceOfTransient) aTools = new TColStd_HSequenceOfTransient;
+ Handle(TColStd_HSequenceOfTransient) aKeepIns = new TColStd_HSequenceOfTransient;
+ Handle(TColStd_HSequenceOfTransient) aRemIns = new TColStd_HSequenceOfTransient;
+ Handle(TColStd_HArray1OfInteger) aMaterials;
+
+ //Get the shapes
+ aLen = theShapes.length();
+ for (ind = 0; ind < aLen; ind++) {
+ if (theShapes[ind] == NULL) return aGEOMObject._retn();
+ Handle(GEOM_Object) aSh = GetOperations()->GetEngine()->GetObject
+ (theShapes[ind]->GetStudyID(), theShapes[ind]->GetEntry());
+ if (aSh.IsNull()) return aGEOMObject._retn();
+ aShapes->Append(aSh);
+ }
+
+ //Get the tools
+ aLen = theTools.length();
+ for (ind = 0; ind < aLen; ind++) {
+ if (theTools[ind] == NULL) return aGEOMObject._retn();
+ Handle(GEOM_Object) aSh = GetOperations()->GetEngine()->GetObject
+ (theTools[ind]->GetStudyID(), theTools[ind]->GetEntry());
+ if (aSh.IsNull()) return aGEOMObject._retn();
+ aTools->Append(aSh);
+ }
+
+ //Get the keep inside shapes
+ aLen = theKeepIns.length();
+ for (ind = 0; ind < aLen; ind++) {
+ if (theKeepIns[ind] == NULL) return aGEOMObject._retn();
+ Handle(GEOM_Object) aSh = GetOperations()->GetEngine()->GetObject
+ (theKeepIns[ind]->GetStudyID(), theKeepIns[ind]->GetEntry());
+ if (aSh.IsNull()) return aGEOMObject._retn();
+ aKeepIns->Append(aSh);
+ }
+
+ //Get the remove inside shapes
+ aLen = theRemoveIns.length();
+ for (ind = 0; ind < aLen; ind++) {
+ if (theRemoveIns[ind] == NULL) return aGEOMObject._retn();
+ Handle(GEOM_Object) aSh = GetOperations()->GetEngine()->GetObject
+ (theRemoveIns[ind]->GetStudyID(), theRemoveIns[ind]->GetEntry());
+ if (aSh.IsNull()) return aGEOMObject._retn();
+ aRemIns->Append(aSh);
+ }
+
+ //Get the materials
+ aLen = theMaterials.length();
+ if ( aLen ) {
+ aMaterials = new TColStd_HArray1OfInteger (1, aLen);
+ for (ind = 0; ind < aLen; ind++) {
+ aMaterials->SetValue(ind+1, theMaterials[ind]);
+ }
+ }
+
+ // Make Partition
+ Handle(GEOM_Object) anObject =
+ GetOperations()->MakePartition(aShapes, aTools, aKeepIns, aRemIns,
+ theLimit, theRemoveWebs, aMaterials,
+ /*PerformSelfIntersections*/Standard_True);
+ if (!GetOperations()->IsDone() || anObject.IsNull())
+ return aGEOMObject._retn();
+
+ return GetObject(anObject);
+}
+
+//=============================================================================
+/*!
+ * MakePartitionNonSelfIntersectedShape
+ */
+//=============================================================================
+GEOM::GEOM_Object_ptr GEOM_IBooleanOperations_i::MakePartitionNonSelfIntersectedShape
+ (const GEOM::ListOfGO& theShapes,
+ const GEOM::ListOfGO& theTools,
+ const GEOM::ListOfGO& theKeepIns,
+ const GEOM::ListOfGO& theRemoveIns,
+ CORBA::Short theLimit,
+ CORBA::Boolean theRemoveWebs,