mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-08-09 13:22:24 +03:00
0025520: To provide info on what has been done by Shape Process and Shape Fix
Messages are registered in ShapeExtend_MsgRegistrator added to ShapeCutom and ShapeUpgrade packages All operators of ShapeProcess_OperLibrary are instrumented with MsgRegistrator 0025520: To provide info on what has been done by Shape Process and Shape Fix Update SHAPE.fr Fix some messages (minor change)
This commit is contained in:
@@ -100,7 +100,8 @@ is
|
||||
SameParameter (shape : Shape from TopoDS;
|
||||
enforce : Boolean;
|
||||
preci : Real = 0.0;
|
||||
theProgress : ProgressIndicator from Message = 0)
|
||||
theProgress : ProgressIndicator from Message = 0;
|
||||
theMsgReg : BasicMsgRegistrator from ShapeExtend = 0)
|
||||
returns Boolean;
|
||||
---Purpose : Runs SameParameter from BRepLib with these adaptations :
|
||||
-- <enforce> forces computations, else they are made only on
|
||||
|
@@ -69,6 +69,8 @@
|
||||
#include <TopExp.hxx>
|
||||
|
||||
#include <Message_ProgressSentry.hxx>
|
||||
#include <Message_Msg.hxx>
|
||||
#include <ShapeExtend_BasicMsgRegistrator.hxx>
|
||||
|
||||
//=======================================================================
|
||||
//function : SameParameter
|
||||
@@ -78,7 +80,8 @@
|
||||
Standard_Boolean ShapeFix::SameParameter(const TopoDS_Shape& shape,
|
||||
const Standard_Boolean enforce,
|
||||
const Standard_Real preci,
|
||||
const Handle(Message_ProgressIndicator)& theProgress)
|
||||
const Handle(Message_ProgressIndicator)& theProgress,
|
||||
const Handle(ShapeExtend_BasicMsgRegistrator)& theMsgReg)
|
||||
{
|
||||
// Calculate number of edges
|
||||
Standard_Integer aNbEdges = 0;
|
||||
@@ -98,6 +101,7 @@ Standard_Boolean ShapeFix::SameParameter(const TopoDS_Shape& shape,
|
||||
Standard_Boolean iatol = (tol > 0);
|
||||
Handle(ShapeFix_Edge) sfe = new ShapeFix_Edge;
|
||||
TopExp_Explorer ex(shape,TopAbs_EDGE);
|
||||
Message_Msg doneMsg("FixEdge.SameParameter.MSG0");
|
||||
|
||||
// Start progress scope (no need to check if progress exists -- it is safe)
|
||||
Message_ProgressSentry aPSentry(theProgress, "Fixing same parameter problem", 0, 2, 1);
|
||||
@@ -135,6 +139,10 @@ Standard_Boolean ShapeFix::SameParameter(const TopoDS_Shape& shape,
|
||||
B.SameRange (E,Standard_False);
|
||||
B.SameParameter (E,Standard_False);
|
||||
}
|
||||
else if ( !theMsgReg.IsNull() && !sfe->Status( ShapeExtend_OK ) )
|
||||
{
|
||||
theMsgReg->Send( E, doneMsg, Message_Warning );
|
||||
}
|
||||
|
||||
// Complete step in current progress scope
|
||||
aPSentry.Next();
|
||||
|
@@ -67,6 +67,7 @@
|
||||
#include <ShapeAnalysis_DataMapOfShapeListOfReal.hxx>
|
||||
#include <TopoDS_Compound.hxx>
|
||||
#include <TopoDS_Iterator.hxx>
|
||||
#include <Message_Msg.hxx>
|
||||
|
||||
ShapeFix_FixSmallFace::ShapeFix_FixSmallFace()
|
||||
{
|
||||
@@ -218,6 +219,7 @@ ShapeFix_FixSmallFace::ShapeFix_FixSmallFace()
|
||||
Context()->Remove(Ed);
|
||||
}
|
||||
Context()->Remove(F);
|
||||
SendWarning( F, Message_Msg( "FixAdvFace.FixSpotFace.MSG0" ));
|
||||
return Standard_True;
|
||||
|
||||
|
||||
@@ -335,6 +337,7 @@ ShapeFix_FixSmallFace::ShapeFix_FixSmallFace()
|
||||
Standard_Boolean ShapeFix_FixSmallFace::RemoveFacesInCaseOfStrip(const TopoDS_Face& F) const
|
||||
{
|
||||
Context()->Remove(F);
|
||||
SendWarning( F, Message_Msg( "FixAdvFace.FixStripFace.MSG0" ));
|
||||
return Standard_True;
|
||||
}
|
||||
|
||||
|
@@ -100,5 +100,6 @@ void ShapeFix_Root::SetMaxTolerance (const Standard_Real maxtol)
|
||||
const Message_Msg& message,
|
||||
const Message_Gravity gravity) const
|
||||
{
|
||||
myMsgReg->Send (shape, message, gravity);
|
||||
if ( !myMsgReg.IsNull() )
|
||||
myMsgReg->Send (shape, message, gravity);
|
||||
}
|
||||
|
@@ -30,6 +30,7 @@
|
||||
#include <TopoDS_Vertex.hxx>
|
||||
#include <TopTools_SequenceOfShape.hxx>
|
||||
#include <TopTools_DataMapOfShapeShape.hxx>
|
||||
#include <Message_Msg.hxx>
|
||||
|
||||
|
||||
//=======================================================================
|
||||
@@ -132,6 +133,8 @@ void ShapeFix_SplitCommonVertex::Perform()
|
||||
|
||||
}
|
||||
}
|
||||
if ( !MapVV.IsEmpty() )
|
||||
SendWarning( Message_Msg( "Fix.SplitCommonVertex.MSG0" ));
|
||||
}
|
||||
|
||||
myShape = Context()->Apply(myShape);
|
||||
|
@@ -53,6 +53,7 @@
|
||||
#include <ShapeConstruct.hxx>
|
||||
#include <ShapeBuild_Edge.hxx>
|
||||
#include <ShapeAnalysis_TransferParametersProj.hxx>
|
||||
#include <Message_Msg.hxx>
|
||||
|
||||
//=======================================================================
|
||||
//function : ShapeFix_Wireframe
|
||||
@@ -189,6 +190,8 @@ ShapeFix_Wireframe::ShapeFix_Wireframe(const TopoDS_Shape& shape)
|
||||
myStatusWireGaps |= ShapeExtend::EncodeStatus( ShapeExtend_DONE2 );
|
||||
if (sfw->StatusGaps2d(ShapeExtend_FAIL))
|
||||
myStatusWireGaps |= ShapeExtend::EncodeStatus( ShapeExtend_FAIL2 );
|
||||
if (sfw->StatusGaps3d(ShapeExtend_DONE) || sfw->StatusGaps2d(ShapeExtend_DONE))
|
||||
SendWarning( itw.Value(), Message_Msg( "FixWireframe.FixFixWireGaps.MSG0" ));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -208,6 +211,8 @@ ShapeFix_Wireframe::ShapeFix_Wireframe(const TopoDS_Shape& shape)
|
||||
myStatusWireGaps |= ShapeExtend::EncodeStatus( ShapeExtend_DONE1 );
|
||||
if (sfw->StatusGaps3d(ShapeExtend_FAIL))
|
||||
myStatusWireGaps |= ShapeExtend::EncodeStatus( ShapeExtend_FAIL1 );
|
||||
if (sfw->StatusGaps3d(ShapeExtend_DONE))
|
||||
SendWarning( expw.Current(), Message_Msg( "FixWireframe.FixFixWireGaps.MSG0" ));
|
||||
}
|
||||
//End Part1========================================================
|
||||
|
||||
@@ -874,11 +879,13 @@ Standard_Boolean ShapeFix_Wireframe::MergeSmallEdges(TopTools_MapOfShape& theSma
|
||||
{
|
||||
Context()->Replace(edge1,edge3);
|
||||
Context()->Remove(edge2);
|
||||
SendWarning( edge2, Message_Msg("FixWireframe.FixSmallEdges.MSG0"));
|
||||
}
|
||||
else
|
||||
{
|
||||
Context()->Replace(edge2,edge3);
|
||||
Context()->Remove(edge1);
|
||||
SendWarning( edge1, Message_Msg("FixWireframe.FixSmallEdges.MSG0"));
|
||||
}
|
||||
if (take_next)
|
||||
{
|
||||
@@ -954,6 +961,7 @@ Standard_Boolean ShapeFix_Wireframe::MergeSmallEdges(TopTools_MapOfShape& theSma
|
||||
aTmpShape = Context()->Apply(tmpedge2);
|
||||
TopoDS_Edge anewedge2 = TopoDS::Edge(aTmpShape);
|
||||
Context()->Remove(remedge);
|
||||
SendWarning( remedge, Message_Msg("FixWireframe.FixSmallEdges.MSG0"));
|
||||
if (theSmallEdges.Contains(remedge))
|
||||
theSmallEdges.Remove(remedge);
|
||||
theEdgeToFaces.UnBind(remedge);
|
||||
@@ -1037,6 +1045,7 @@ Standard_Boolean ShapeFix_Wireframe::MergeSmallEdges(TopTools_MapOfShape& theSma
|
||||
{
|
||||
SFW->WireData()->Remove (index );
|
||||
Context()->Remove(edge1);
|
||||
SendWarning( edge1, Message_Msg("FixWireframe.FixSmallEdges.MSG0"));
|
||||
if (theSmallEdges.Contains(edge1)) theSmallEdges.Remove(edge1);
|
||||
theEdgeToFaces.UnBind(edge1);
|
||||
myStatusSmallEdges |= ShapeExtend::EncodeStatus( ShapeExtend_DONE2 );
|
||||
@@ -1051,6 +1060,7 @@ Standard_Boolean ShapeFix_Wireframe::MergeSmallEdges(TopTools_MapOfShape& theSma
|
||||
{
|
||||
SFW->WireData()->Remove (index );
|
||||
Context()->Remove(edge2);
|
||||
SendWarning( edge2, Message_Msg("FixWireframe.FixSmallEdges.MSG0"));
|
||||
if (theSmallEdges.Contains(edge2)) theSmallEdges.Remove(edge2);
|
||||
theEdgeToFaces.UnBind(edge2);
|
||||
myStatusSmallEdges |= ShapeExtend::EncodeStatus( ShapeExtend_DONE2 );
|
||||
@@ -1069,9 +1079,11 @@ Standard_Boolean ShapeFix_Wireframe::MergeSmallEdges(TopTools_MapOfShape& theSma
|
||||
{
|
||||
SFW->WireData()->Remove(1);
|
||||
Context()->Remove(edge1);
|
||||
SendWarning( edge1, Message_Msg("FixWireframe.FixSmallEdges.MSG0"));
|
||||
theSmallEdges.Remove(edge1);
|
||||
theEdgeToFaces.UnBind(edge1);
|
||||
Context()->Remove(aWire);
|
||||
SendWarning( aWire, Message_Msg("FixWireframe.FixSmallEdges.MSG1"));
|
||||
myStatusSmallEdges |= ShapeExtend::EncodeStatus( ShapeExtend_DONE2 );
|
||||
}
|
||||
}
|
||||
@@ -1084,8 +1096,10 @@ Standard_Boolean ShapeFix_Wireframe::MergeSmallEdges(TopTools_MapOfShape& theSma
|
||||
face.Orientation(facet.Orientation());
|
||||
TopoDS_Shape anewShape = Context()->Apply(face);
|
||||
TopoDS_Iterator aIter(anewShape);
|
||||
if(!aIter.More())
|
||||
if(!aIter.More()) {
|
||||
Context()->Remove(anewShape);
|
||||
SendWarning( face, Message_Msg("FixWireframe.FixSmallEdges.MSG2"));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1313,11 +1327,13 @@ Standard_Boolean ShapeFix_Wireframe::MergeSmallEdges(TopTools_MapOfShape& theSma
|
||||
{
|
||||
Context()->Replace(edge1,edge3);
|
||||
Context()->Remove(edge2);
|
||||
SendWarning( edge2, Message_Msg("FixWireframe.FixSmallEdges.MSG0"));
|
||||
}
|
||||
else
|
||||
{
|
||||
Context()->Replace(edge2,edge3);
|
||||
Context()->Remove(edge1);
|
||||
SendWarning( edge1, Message_Msg("FixWireframe.FixSmallEdges.MSG0"));
|
||||
}
|
||||
if (take_next)
|
||||
{
|
||||
@@ -1393,6 +1409,7 @@ Standard_Boolean ShapeFix_Wireframe::MergeSmallEdges(TopTools_MapOfShape& theSma
|
||||
aTmpShape = Context()->Apply(tmpedge2);
|
||||
TopoDS_Edge anewedge2 = TopoDS::Edge(aTmpShape);
|
||||
Context()->Remove(remedge);
|
||||
SendWarning( remedge, Message_Msg("FixWireframe.FixSmallEdges.MSG0"));
|
||||
if (theSmallEdges.Contains(remedge))
|
||||
theSmallEdges.Remove(remedge);
|
||||
theEdgeToFaces.UnBind(remedge);
|
||||
@@ -1476,6 +1493,7 @@ Standard_Boolean ShapeFix_Wireframe::MergeSmallEdges(TopTools_MapOfShape& theSma
|
||||
{
|
||||
SFW->WireData()->Remove (index );
|
||||
Context()->Remove(edge1);
|
||||
SendWarning( edge1, Message_Msg("FixWireframe.FixSmallEdges.MSG0"));
|
||||
if (theSmallEdges.Contains(edge1)) theSmallEdges.Remove(edge1);
|
||||
theEdgeToFaces.UnBind(edge1);
|
||||
myStatusSmallEdges |= ShapeExtend::EncodeStatus( ShapeExtend_DONE2 );
|
||||
@@ -1490,6 +1508,7 @@ Standard_Boolean ShapeFix_Wireframe::MergeSmallEdges(TopTools_MapOfShape& theSma
|
||||
{
|
||||
SFW->WireData()->Remove (index );
|
||||
Context()->Remove(edge2);
|
||||
SendWarning( edge2, Message_Msg("FixWireframe.FixSmallEdges.MSG0"));
|
||||
if (theSmallEdges.Contains(edge2)) theSmallEdges.Remove(edge2);
|
||||
theEdgeToFaces.UnBind(edge2);
|
||||
myStatusSmallEdges |= ShapeExtend::EncodeStatus( ShapeExtend_DONE2 );
|
||||
@@ -1508,9 +1527,11 @@ Standard_Boolean ShapeFix_Wireframe::MergeSmallEdges(TopTools_MapOfShape& theSma
|
||||
{
|
||||
SFW->WireData()->Remove(1);
|
||||
Context()->Remove(edge1);
|
||||
SendWarning( edge1, Message_Msg("FixWireframe.FixSmallEdges.MSG0"));
|
||||
theSmallEdges.Remove(edge1);
|
||||
theEdgeToFaces.UnBind(edge1);
|
||||
Context()->Remove(aWire);
|
||||
SendWarning( aWire, Message_Msg("FixWireframe.FixSmallEdges.MSG1"));
|
||||
myStatusSmallEdges |= ShapeExtend::EncodeStatus( ShapeExtend_DONE2 );
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user