Dear Author.
The magic sequence you are looking for is in the file: BOPTest_BOPCommands.cxx
Here is some summarizing code:
{
//...
const Standard_Integer aNbOps=5;
Standard_Integer i, iErr;
TopoDS_Shape aS1, aS2, aResult[aNbOps];
BOPCol_ListOfShape aLC;
BOPAlgo_PaveFiller* pPF;
Handle(NCollection_BaseAllocator)aAL=new NCollection_IncAllocator;
pPF=new BOPAlgo_PaveFiller(aAL);
aS1=...;
aS2=...;
aLC.Append(aS1);
aLC.Append(aS2);
pPF->SetArguments(aLC);
pPF->Perform();
iErr=pPF->ErrorStatus();
if (iErr) {
// Error...
return 0;
}
//---------------------------------
BOPAlgo_BOP aBOP;
BOPAlgo_Operation aOps[aNbOps]={
BOPAlgo_COMMON,
BOPAlgo_FUSE,
BOPAlgo_CUT,
BOPAlgo_CUT21,
BOPAlgo_SECTION
};
aBOP.AddArgument(aS1);
aBOP.AddTool(aS2);
for (i=0; i!=aNbOps; ++i) {
aOp=aOps[i];
aBOP.SetOperation(aOp);
aBOP.PerformWithFiller(*pPF);
iErr=aBOP.ErrorStatus();
if (iErr) {
// Error ...
return 0;
}
// the results
aResult[i]=aBOP.Shape();
}
//...
}