How to Interrupt BRepAlgoAPI_Cut ?

I use OpenCascade V7.4.0 for windows 32bit.

I tryed to get shape difference by BRepAlgoAPI_Cut , but the process of BRepAlgoAPI_Cut constructor is not return. My application memory keep growing from 100MB to 1.5GB and finally my application crashed.

 [MyCode]
BRepAlgoAPI_Cut cut( shapeBase,  shapeCut);

Then, I outputed shapes before cut for decrease shape error.
 Thereby, My application memory does not keep growing and cut method is finished.

[MyCode 2]
BRepTools::Write( shapeBase, "C:/@test/shapeBase.brep" );
BRepTools::Write( shapeCut, "C:/@test/shapeCut.brep" );

BRep_Builder bb;
BRepTools::Read( shapeBase, "C:/@test/shapeBase.brep", bb );
BRepTools::Read( shapeCut, "C:/@test/shapeCut.brep", bb );
BRepAlgoAPI_Cut cut( shapeBase, shapeCut );

But the processing time is too long and I want to Interrupt cut process by processing time or application memory size. 

Is there any good way?

Best regards.
Keito

Kirill Gavrilov's picture

But the processing time is too long and I want to Interrupt cut process

The general mechanism for progress indication and interruption in OCCT is provided by Message_ProgressIndicator interface.
If you see this field somewhere in algorithm parameters (default argument value is NULL meaning no progress indication) - then you can pass indicator to see/abort progress.

If you don't see such argument, then you are out of luck and progress indication is not yet implemented, cannot be implemented or doesn't make sense to be implemented for particular algorithm.
In this case, you may consider improving OCCT and contributing patch, of course with some help and advices from Open Cascade developers:
https://dev.opencascade.org/index.php?q=home/get_involved

Keito Okajima's picture

Hello, Kirill.

Thank you for your reply.

I could interrupt process of BRepAlgoAPI_Cut class by useing sub class of Message_ProgressIndicator.