1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-04-04 18:06:22 +03:00

0025604: To provide info on what has been done by DropSmallSolids operator

This commit is contained in:
eap 2014-12-12 20:09:46 +03:00 committed by bugmaster
parent d5a9d0da1c
commit 7c8996f49f
5 changed files with 32 additions and 4 deletions

View File

@ -186,6 +186,15 @@ Spot face removed
Strip face removed
!
! ------------------------------------------------------------------------------
! Messages for ShapeFix_FixSmallSolid
!
.ShapeFix.FixSmallSolid.MSG0
Small solid removed
!
.ShapeFix.FixSmallSolid.MSG1
Small solid merged with other
!
! ------------------------------------------------------------------------------
! Messages for ShapeFix_Shell
!
.FixAdvShell.FixOrientation.MSG0

View File

@ -186,6 +186,15 @@ Spot face removed
Strip face removed
!
! ------------------------------------------------------------------------------
! Messages for ShapeFix_FixSmallSolid
!
.ShapeFix.FixSmallSolid.MSG0
Small solid removed
!
.ShapeFix.FixSmallSolid.MSG1
Small solid merged with other
!
! ------------------------------------------------------------------------------
! Messages for ShapeFix_Shell
!
.FixAdvShell.FixOrientation.MSG0

View File

@ -13,7 +13,7 @@
-- Alternatively, this file may be used under the terms of Open CASCADE
-- commercial license or contractual agreement.
class FixSmallSolid from ShapeFix
class FixSmallSolid from ShapeFix inherits Root from ShapeFix
---Purpose: Fixing solids with small size
@ -25,10 +25,10 @@ is
Create returns FixSmallSolid;
---Purpose: Construct
SetVolumeThreshold (me: in out; theThreshold: Real = -1.0);
SetVolumeThreshold (me: mutable; theThreshold: Real = -1.0);
---Purpose: Set or clear volume threshold for small solids
SetWidthFactorThreshold (me: in out; theThreshold: Real = -1.0);
SetWidthFactorThreshold (me: mutable; theThreshold: Real = -1.0);
---Purpose: Set or clear width factor threshold for small solids
Remove(me; theShape: Shape from TopoDS; theContext: ReShape from ShapeBuild)

View File

@ -33,6 +33,7 @@
#include <BRepGProp.hxx>
#include <BRep_Builder.hxx>
#include <ShapeBuild_ReShape.hxx>
#include <Message_Msg.hxx>
//=======================================================================
//function : ShapeFix_FixSmallSolid
@ -102,7 +103,10 @@ TopoDS_Shape ShapeFix_FixSmallSolid::Remove (
{
const TopoDS_Shape& aSolid = aSolidIter.Current();
if (IsSmall (aSolid))
{
theContext->Remove (aSolid);
SendWarning ( aSolid, Message_Msg( "ShapeFix.FixSmallSolid.MSG0" ));
}
}
// Return updated shape
@ -441,6 +445,7 @@ TopoDS_Shape ShapeFix_FixSmallSolid::Merge (
// remove the small solid
theContext->Remove (aSmallSolid);
aSmallSolids.Remove (aSolidIter);
SendWarning ( aSmallSolid, Message_Msg( "ShapeFix.FixSmallSolid.MSG1" ));
}
else
aSolidIter.Next();

View File

@ -592,7 +592,12 @@ static Standard_Boolean dropsmallsolids (const Handle(ShapeProcess_Context)& con
Handle(ShapeProcess_ShapeContext)::DownCast (context);
if (ctx.IsNull()) return Standard_False;
// activate message mechanism if it is supported by context
Handle(ShapeExtend_MsgRegistrator) msg;
if ( ! ctx->Messages().IsNull() ) msg = new ShapeExtend_MsgRegistrator;
ShapeFix_FixSmallSolid FSS;
FSS.SetMsgRegistrator( msg );
Standard_Real aThreshold;
if (ctx->GetReal ("VolumeThreshold", aThreshold))
@ -613,7 +618,7 @@ static Standard_Boolean dropsmallsolids (const Handle(ShapeProcess_Context)& con
if (aResult != ctx->Result())
{
ctx->RecordModification (aReShape);
ctx->RecordModification (aReShape, msg);
ctx->SetResult (aResult);
}