diff --git a/src/SHMessage/SHAPE.fr b/src/SHMessage/SHAPE.fr index a1fe1e3f16..02aa95080d 100755 --- a/src/SHMessage/SHAPE.fr +++ b/src/SHMessage/SHAPE.fr @@ -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 diff --git a/src/SHMessage/SHAPE.us b/src/SHMessage/SHAPE.us index cf5808f57c..1c708c6fa1 100755 --- a/src/SHMessage/SHAPE.us +++ b/src/SHMessage/SHAPE.us @@ -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 diff --git a/src/ShapeFix/ShapeFix_FixSmallSolid.cdl b/src/ShapeFix/ShapeFix_FixSmallSolid.cdl index 6905446079..9b5f6632c6 100644 --- a/src/ShapeFix/ShapeFix_FixSmallSolid.cdl +++ b/src/ShapeFix/ShapeFix_FixSmallSolid.cdl @@ -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) diff --git a/src/ShapeFix/ShapeFix_FixSmallSolid.cxx b/src/ShapeFix/ShapeFix_FixSmallSolid.cxx index f2b2e25768..dfeb2605fe 100644 --- a/src/ShapeFix/ShapeFix_FixSmallSolid.cxx +++ b/src/ShapeFix/ShapeFix_FixSmallSolid.cxx @@ -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(); diff --git a/src/ShapeProcess/ShapeProcess_OperLibrary.cxx b/src/ShapeProcess/ShapeProcess_OperLibrary.cxx index 040c6bf36f..42f621dafd 100644 --- a/src/ShapeProcess/ShapeProcess_OperLibrary.cxx +++ b/src/ShapeProcess/ShapeProcess_OperLibrary.cxx @@ -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); }