1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-08-04 13:13:25 +03:00

0022746: Progress indicator in ShapeHealing

This commit is contained in:
KGV and DBV
2011-11-18 14:51:14 +00:00
committed by bugmaster
parent ffe74e4685
commit b485ee79ca
23 changed files with 515 additions and 324 deletions

View File

@@ -118,7 +118,8 @@ Standard_Boolean ShapeProcess::Perform (const Handle(ShapeProcess_Context)& cont
context->SetScope ( oper.ToCString() );
try {
OCC_CATCH_SIGNALS
op->Perform ( context );
if ( !op->Perform(context) )
return Standard_False;
}
catch (Standard_Failure) {
Message_Msg SMSG2 ("Sequence.MSG2"); //Operator %s failed with exception %s

View File

@@ -16,10 +16,11 @@ class Context from ShapeProcess inherits TShared from MMgt
uses
Manager from Resource,
AsciiString from TCollection,
Manager from Resource,
AsciiString from TCollection,
HSequenceOfHAsciiString from TColStd,
Messenger from Message
Messenger from Message,
ProgressIndicator from Message
is
@@ -75,6 +76,12 @@ is
Messenger (me) returns Messenger from Message;
---Purpose : Returns Messenger used for outputting messages.
SetProgress (me: mutable; theProgress: ProgressIndicator from Message);
---Purpose : Sets Progress Indicator.
Progress (me) returns ProgressIndicator from Message;
---Purpose : Returns Progress Indicator.
SetTraceLevel (me: mutable; tracelev: Integer);
---Purpose : Sets trace level used for outputting messages
@@ -89,9 +96,10 @@ is
fields
myRC: Manager from Resource;
myScope: HSequenceOfHAsciiString from TColStd;
myRC: Manager from Resource;
myScope: HSequenceOfHAsciiString from TColStd;
myMessenger: Messenger from Message;
myTraceLev : Integer;
myProgress: ProgressIndicator from Message;
myTraceLev: Integer;
end Context;

View File

@@ -353,6 +353,26 @@ Handle(Message_Messenger) ShapeProcess_Context::Messenger () const
return myMessenger;
}
//=======================================================================
//function : SetProgress
//purpose :
//=======================================================================
void ShapeProcess_Context::SetProgress (const Handle(Message_ProgressIndicator)& progress)
{
myProgress = progress;
}
//=======================================================================
//function : Progress
//purpose :
//=======================================================================
Handle(Message_ProgressIndicator) ShapeProcess_Context::Progress() const
{
return myProgress;
}
//=======================================================================
//function : SetTraceLevel
//purpose :

View File

@@ -13,6 +13,8 @@
#include <BRepLib.hxx>
#include <Message_MsgFile.hxx>
#include <Message_ProgressIndicator.hxx>
#include <ShapeExtend_MsgRegistrator.hxx>
#include <ShapeProcess.hxx>
#include <ShapeProcess_UOperator.hxx>
@@ -109,7 +111,7 @@ static Standard_Boolean directfaces (const Handle(ShapeProcess_Context)& context
TopoDS_Shape res = ShapeProcess_OperLibrary::ApplyModifier ( ctx->Result(), ctx, DM, map );
ctx->RecordModification ( map );
ctx->SetResult ( res );
return 0;
return Standard_True;
}
@@ -623,7 +625,11 @@ static Standard_Boolean fixshape (const Handle(ShapeProcess_Context)& context)
sfw->FixNonAdjacentIntersectingEdgesMode() = ctx->IntegerVal ( "FixNonAdjacentIntersectingEdgesMode", -1 );
sfs->Init(ctx->Result());
sfs->Perform();
sfs->Perform(ctx->Progress());
if ( !ctx->Progress().IsNull() && ctx->Progress()->UserBreak() )
return Standard_False;
TopoDS_Shape result = sfs->Shape();
if ( result != ctx->Result() ) {
ctx->RecordModification ( sfs->Context(), msg );