.Sequence.MSG5
Operateur %d/%d: %s
!
-.Sequence.MSG
+.Sequence.MSG1
+Error: Operator %s is not found
+!
+.Sequence.MSG2
+Error: Operator %s failed with exception %s
+!
+.Sequence.MSG3
+Warning: Shape Processing: sequence not defined for %s
!
! ------------------------------------------------------------------------------
! Messages for printing results of shape processing
.FixWire.FixDegenerated.MSG5
L'Arete n0 %d est degeneree
!
+.FixWire.FixCurve3d.Removed
+Incomplete edge (with no pcurves or 3d curve) removed
+!
.FixAdvWire.FixSmall.MSG0
Petite(s) arete(s) supprimee(s)
!
.FixAdvFace.FixOrientation.MSG11
Impossible d'orienter le contour
!
+! ------------------------------------------------------------------------------
+! Messages for ShapeFix_Wireframe
+!
+.FixWireframe.FixSmallEdges.MSG0
+Small edge removed
+!
+.FixWireframe.FixSmallEdges.MSG1
+Small wire removed
+!
+.FixWireframe.FixSmallEdges.MSG2
+Small face removed
+!
+.FixWireframe.FixFixWireGaps.MSG0
+Gaps in a wire fixed
+!
+!
+.Fix.SplitCommonVertex.MSG0
+Wires with common vertex fixed
+!
+!
.FixAdvShell.FixOrientation.MSG20
Impossible d'orienter les faces dans le shell, creation de plusieurs shells
!
.FixAdvSolid.FixOrientation.MSG30
Solide avec connexions incorrectes, divise en plusieurs parties
!
-.FixAdvFace..MSG0
+.FixAdvFace.FixLoopWire.MSG0
+Wire was splitted on several wires
!
.FixAdvFace..MSG5
!
.FixAdvFace..MSG10
!
+.FixEdge.SameParameter.MSG0
+Not same parameter edge fixed
+!
+! ------------------------------------------------------------------------------
+! Messages for ShapeFix_FixSmallFace
+!
+.FixAdvFace.FixSpotFace.MSG0
+Spot face removed
+!
+.FixAdvFace.FixStripFace.MSG0
+Strip face removed
+!
! ------------------------------------------------------------------------------
! Messages for ShapeFix_Shell
!
.FixAdvShell.FixOrientation.MSG5
Faces mal orientees dans le shell, non corrigees
!
-.FixAdvShell..MSG0
+.FixAdvShell.FixClosedFlag.MSG0
+Shell has incorrect flag isClosed
!
.FixAdvShell..MSG5
!
.FixAdvShell..MSG10
!
+! ------------------------------------------------------------------------------
+! Messages for ShapeUpgrade
+!
+.ShapeDivide.FaceDivide.MSG0
+Face divided
+!
+.ShapeDivide.WireDivide.MSG0
+Wire divided
+!
+.ShapeDivide.EdgeDivide.MSG0
+Edge divided
+!
+.ShapeDivide.FaceConvertToBezier.MSG0
+Face converted to Bezier
+!
+.ShapeDivide.WireConvertToBezier.MSG0
+Wire converted to Bezier
+!
+.ShapeDivide.EdgeConvertToBezier.MSG0
+Edge converted to Bezier
+!
+! ------------------------------------------------------------------------------
+! Messages for ShapeCustom
+!
+.BSplineRestriction.NewSurface.MSG0
+Face converted to BSpline
+!
+.BSplineRestriction.NewSurface.MSG1
+BSpline Face re-approximated
+!
+.BSplineRestriction.NewCurve.MSG0
+Edge converted to BSpline
+!
+.BSplineRestriction.NewCurve.MSG1
+BSpline Edge re-approximated
+!
+!
+.ConvertToBSpline.NewSurface.MSG0
+Face converted to BSpline
+!
+.ConvertToBSpline.NewCurve.MSG0
+Edge converted to BSpline
+!
+!
+.ConvertToRevolution.NewSurface.MSG0
+Face converted to surface of revolution
+!
+!
+.DirectModification.NewSurface.MSG0
+Direction of Face of revolution corrected
+!
+!
+.SweptToElementary.NewSurface.MSG0
+Swept Face converted to elementary
+!
.Sequence.MSG2
Error: Operator %s failed with exception %s
!
-.Sequence.MSG2
-Operator %s failed with exception %s
+.Sequence.MSG3
Warning: Shape Processing: sequence not defined for %s
!
! ------------------------------------------------------------------------------
.FixWire.FixDegenerated.MSG5
Degenerated edge %d detected
!
+.FixWire.FixCurve3d.Removed
+Incomplete edge (with no pcurves or 3d curve) removed
+!
.FixAdvWire.FixSmall.MSG0
Small edge(s) removed
!
.FixAdvFace.FixOrientation.MSG11
Cannot orient wire
!
+! ------------------------------------------------------------------------------
+! Messages for ShapeFix_Wireframe
+!
+.FixWireframe.FixSmallEdges.MSG0
+Small edge removed
+!
+.FixWireframe.FixSmallEdges.MSG1
+Small wire removed
+!
+.FixWireframe.FixSmallEdges.MSG2
+Small face removed
+!
+.FixWireframe.FixFixWireGaps.MSG0
+Gaps in a wire fixed
+!
+!
+.Fix.SplitCommonVertex.MSG0
+Wires with common vertex fixed
+!
+!
.FixAdvShell.FixOrientation.MSG20
Impossible to orient faces in shell, several shells created
!
!
.FixAdvFace..MSG10
!
+.FixEdge.SameParameter.MSG0
+Not same parameter edge fixed
+!
+! ------------------------------------------------------------------------------
+! Messages for ShapeFix_FixSmallFace
+!
+.FixAdvFace.FixSpotFace.MSG0
+Spot face removed
+!
+.FixAdvFace.FixStripFace.MSG0
+Strip face removed
+!
! ------------------------------------------------------------------------------
! Messages for ShapeFix_Shell
!
!
.FixAdvShell..MSG10
!
+! ------------------------------------------------------------------------------
+! Messages for ShapeUpgrade
+!
+.ShapeDivide.FaceDivide.MSG0
+Face divided
+!
+.ShapeDivide.WireDivide.MSG0
+Wire divided
+!
+.ShapeDivide.EdgeDivide.MSG0
+Edge divided
+!
+.ShapeDivide.FaceConvertToBezier.MSG0
+Face converted to Bezier
+!
+.ShapeDivide.WireConvertToBezier.MSG0
+Wire converted to Bezier
+!
+.ShapeDivide.EdgeConvertToBezier.MSG0
+Edge converted to Bezier
+!
+! ------------------------------------------------------------------------------
+! Messages for ShapeCustom
+!
+.BSplineRestriction.NewSurface.MSG0
+Face converted to BSpline
+!
+.BSplineRestriction.NewSurface.MSG1
+BSpline Face re-approximated
+!
+.BSplineRestriction.NewCurve.MSG0
+Edge converted to BSpline
+!
+.BSplineRestriction.NewCurve.MSG1
+BSpline Edge re-approximated
+!
+!
+.ConvertToBSpline.NewSurface.MSG0
+Face converted to BSpline
+!
+.ConvertToBSpline.NewCurve.MSG0
+Edge converted to BSpline
+!
+!
+.ConvertToRevolution.NewSurface.MSG0
+Face converted to surface of revolution
+!
+!
+.DirectModification.NewSurface.MSG0
+Direction of Face of revolution corrected
+!
+!
+.SweptToElementary.NewSurface.MSG0
+Swept Face converted to elementary
+!
TColgp,
Precision,
Message,
- ShapeBuild
+ ShapeBuild,
+ ShapeExtend
is
class RestrictionParameters;
+ deferred class Modification; -- base class of modifications
class DirectModification;
private class TrsfModification;
-- Alternatively, this file may be used under the terms of Open CASCADE
-- commercial license or contractual agreement.
-private class BSplineRestriction from ShapeCustom inherits Modification from BRepTools
+private class BSplineRestriction from ShapeCustom inherits Modification from ShapeCustom
---Purpose: this tool intended for aproximation surfaces, curves and pcurves with
-- specified degree , max number of segments, tolerance 2d, tolerance 3d. Specified
#include <Geom_CylindricalSurface.hxx>
#include <Geom_ToroidalSurface.hxx>
#include <ShapeAnalysis.hxx>
+#include <Message_Msg.hxx>
static GeomAbs_Shape IntegerToGeomAbsShape(const Standard_Integer i)
{
Standard_Boolean IsConv = ConvertSurface(aSurface,S,UF,UL,VF,VL,IsOf);
Tol = Precision::Confusion();//mySurfaceError;
+
+ if ( IsConv )
+ {
+ Standard_Boolean wasBSpline = aSurface->IsKind(STANDARD_TYPE(Geom_BSplineSurface));
+ Handle(Geom_RectangularTrimmedSurface) rts = Handle(Geom_RectangularTrimmedSurface)::DownCast(aSurface);
+ if ( !rts.IsNull() )
+ wasBSpline = rts->BasisSurface()->IsKind(STANDARD_TYPE(Geom_BSplineSurface));
+
+ if ( wasBSpline )
+ SendMsg( F, Message_Msg("BSplineRestriction.NewSurface.MSG1"));
+ else
+ SendMsg( F, Message_Msg("BSplineRestriction.NewSurface.MSG0"));
+ }
+
return IsConv;
}
if(aCurve.IsNull()) {
if(IsConvert) {
C = aCurve;
- Tol = TolCur;
+ Tol = TolCur;
return Standard_True;
}
else return Standard_False;
if(myParameters->ConvertOffsetCurv3d()) IsOf = Standard_False;
Standard_Boolean IsConv = ConvertCurve(aCurve,C,IsConvert,First,Last,TolCur,IsOf);
Tol= BRep_Tool::Tolerance(E);//TolCur;
+
+ if ( IsConv )
+ {
+ Standard_Boolean wasBSpline = aCurve->IsKind(STANDARD_TYPE(Geom_BSplineCurve));
+ Handle(Geom_TrimmedCurve) tc = Handle(Geom_TrimmedCurve)::DownCast(aCurve);
+ if ( !tc.IsNull() )
+ wasBSpline = tc->BasisCurve()->IsKind(STANDARD_TYPE(Geom_BSplineCurve));
+
+ if ( wasBSpline )
+ SendMsg( E, Message_Msg("BSplineRestriction.NewCurve.MSG1"));
+ else
+ SendMsg( E, Message_Msg("BSplineRestriction.NewCurve.MSG0"));
+ }
return IsConv;
}
-- Alternatively, this file may be used under the terms of Open CASCADE
-- commercial license or contractual agreement.
-private class ConvertToBSpline from ShapeCustom inherits Modification from BRepTools
+private class ConvertToBSpline from ShapeCustom inherits Modification from ShapeCustom
---Purpose: implement a modification for BRepTools
-- Modifier algortihm. Converts Surface of
#include <BRep_ListIteratorOfListOfCurveRepresentation.hxx>
#include <BRep_GCurve.hxx>
#include <BRepTools.hxx>
+#include <Message_Msg.hxx>
//=======================================================================
//function : ShapeCustom_ConvertToBSpline
else
S = res;
+ SendMsg( F, Message_Msg("ConvertToBSpline.NewSurface.MSG0"));
+
Tol = BRep_Tool::Tolerance(F);
RevWires = Standard_False;
RevFace = Standard_False;
C = BRep_Tool::Curve ( E, L, f, l );
if ( ! C.IsNull() ) C = Handle(Geom_Curve)::DownCast ( C->Copy() );
Tol = BRep_Tool::Tolerance ( E );
+ SendMsg( E, Message_Msg("ConvertToBSpline.NewCurve.MSG0"));
return Standard_True;
}
return Standard_False;
-- Alternatively, this file may be used under the terms of Open CASCADE
-- commercial license or contractual agreement.
-private class ConvertToRevolution from ShapeCustom inherits Modification from BRepTools
+private class ConvertToRevolution from ShapeCustom inherits Modification from ShapeCustom
---Purpose: implements a modification for the BRepTools
-- Modifier algortihm. Converts all elementary
#include <Geom_TrimmedCurve.hxx>
#include <Geom_Line.hxx>
#include <Geom_SurfaceOfRevolution.hxx>
+#include <Message_Msg.hxx>
//=======================================================================
//function : ShapeCustom_ConvertToRevolution
}
else S = Rev;
}
-
+ SendMsg( F, Message_Msg("ConvertToRevolution.NewSurface.MSG0"));
+
Tol = BRep_Tool::Tolerance(F);
RevWires = Standard_False;
RevFace = Standard_False;
-- commercial license or contractual agreement.
class DirectModification from ShapeCustom
-inherits Modification from BRepTools
+inherits Modification from ShapeCustom
---Purpose: implements a modification for the BRepTools
-- Modifier algortihm. Will redress indirect
#include <BRep_TEdge.hxx>
#include <BRep_ListIteratorOfListOfCurveRepresentation.hxx>
#include <BRep_GCurve.hxx>
+#include <Message_Msg.hxx>
//=======================================================================
//function : ShapeCustom_DirectModification
default: return Standard_False;
}
+ SendMsg( F, Message_Msg("DirectModification.NewSurface.MSG0"));
+
Tol = BRep_Tool::Tolerance(F);
return Standard_True;
--- /dev/null
+-- Copyright (c) 2003-2014 OPEN CASCADE SAS
+--
+-- This file is part of Open CASCADE Technology software library.
+--
+-- This library is free software; you can redistribute it and/or modify it under
+-- the terms of the GNU Lesser General Public License version 2.1 as published
+-- by the Free Software Foundation, with special exception defined in the file
+-- OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
+-- distribution for complete text of the license and disclaimer of any warranty.
+--
+-- Alternatively, this file may be used under the terms of Open CASCADE
+-- commercial license or contractual agreement.
+
+deferred class Modification from ShapeCustom inherits Modification from BRepTools
+
+ ---Purpose: A base class of Modification's from ShapeCustom.
+ -- Implements message sending mechanism.
+
+uses
+ Shape from TopoDS,
+ Msg from Message,
+ Gravity from Message,
+ BasicMsgRegistrator from ShapeExtend
+
+is
+
+ SetMsgRegistrator (me:mutable; msgreg: BasicMsgRegistrator from ShapeExtend) is virtual;
+ ---Purpose: Sets message registrator
+
+ MsgRegistrator (me) returns BasicMsgRegistrator from ShapeExtend;
+ ---Purpose: Returns message registrator
+
+ SendMsg (me; shape : Shape from TopoDS;
+ message: Msg from Message;
+ gravity: Gravity from Message = Message_Info);
+ ---Purpose: Sends a message to be attached to the shape.
+ -- Calls corresponding message of message registrator.
+
+fields
+
+ myMsgReg: BasicMsgRegistrator from ShapeExtend;
+
+end SweptToElementary;
--- /dev/null
+// Copyright (c) 1999-2014 OPEN CASCADE SAS
+//
+// This file is part of Open CASCADE Technology software library.
+//
+// This library is free software; you can redistribute it and/or modify it under
+// the terms of the GNU Lesser General Public License version 2.1 as published
+// by the Free Software Foundation, with special exception defined in the file
+// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
+// distribution for complete text of the license and disclaimer of any warranty.
+//
+// Alternatively, this file may be used under the terms of Open CASCADE
+// commercial license or contractual agreement.
+
+#include <ShapeCustom_Modification.ixx>
+
+#include <Message_Gravity.hxx>
+#include <Message_Msg.hxx>
+#include <ShapeExtend_BasicMsgRegistrator.hxx>
+#include <TopoDS_Shape.hxx>
+
+//=======================================================================
+//function : SetMsgRegistrator
+//purpose :
+//=======================================================================
+
+void ShapeCustom_Modification::SetMsgRegistrator(const Handle(ShapeExtend_BasicMsgRegistrator)& msgreg)
+{
+ myMsgReg = msgreg;
+}
+
+//=======================================================================
+//function : MsgRegistrator
+//purpose : Returns message registrator
+//=======================================================================
+
+Handle(ShapeExtend_BasicMsgRegistrator) ShapeCustom_Modification::MsgRegistrator() const
+{
+ return myMsgReg;
+}
+
+//=======================================================================
+//function : SendMsg
+//purpose :
+//=======================================================================
+
+void ShapeCustom_Modification::SendMsg(const TopoDS_Shape& shape,
+ const Message_Msg& message,
+ const Message_Gravity gravity) const
+{
+ if ( !myMsgReg.IsNull() )
+ myMsgReg->Send (shape, message, gravity);
+}
-- Alternatively, this file may be used under the terms of Open CASCADE
-- commercial license or contractual agreement.
-private class SweptToElementary from ShapeCustom inherits Modification from BRepTools
+private class SweptToElementary from ShapeCustom inherits Modification from ShapeCustom
---Purpose: implements a modification for the BRepTools
-- Modifier algortihm. Converts all elementary
#include <ShapeAnalysis_Surface.hxx>
#include <BRepTools.hxx>
+#include <Message_Msg.hxx>
//=======================================================================
}
}
+ SendMsg( F, Message_Msg("SweptToElementary.NewSurface.MSG0"));
+
Tol = BRep_Tool::Tolerance(F);
RevWires = Standard_False;
RevFace = Standard_False;
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
#include <TopExp.hxx>
#include <Message_ProgressSentry.hxx>
+#include <Message_Msg.hxx>
+#include <ShapeExtend_BasicMsgRegistrator.hxx>
//=======================================================================
//function : SameParameter
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;
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);
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();
#include <ShapeAnalysis_DataMapOfShapeListOfReal.hxx>
#include <TopoDS_Compound.hxx>
#include <TopoDS_Iterator.hxx>
+#include <Message_Msg.hxx>
ShapeFix_FixSmallFace::ShapeFix_FixSmallFace()
{
Context()->Remove(Ed);
}
Context()->Remove(F);
+ SendWarning( F, Message_Msg( "FixAdvFace.FixSpotFace.MSG0" ));
return Standard_True;
Standard_Boolean ShapeFix_FixSmallFace::RemoveFacesInCaseOfStrip(const TopoDS_Face& F) const
{
Context()->Remove(F);
+ SendWarning( F, Message_Msg( "FixAdvFace.FixStripFace.MSG0" ));
return Standard_True;
}
const Message_Msg& message,
const Message_Gravity gravity) const
{
- myMsgReg->Send (shape, message, gravity);
+ if ( !myMsgReg.IsNull() )
+ myMsgReg->Send (shape, message, gravity);
}
#include <TopoDS_Vertex.hxx>
#include <TopTools_SequenceOfShape.hxx>
#include <TopTools_DataMapOfShapeShape.hxx>
+#include <Message_Msg.hxx>
//=======================================================================
}
}
+ if ( !MapVV.IsEmpty() )
+ SendWarning( Message_Msg( "Fix.SplitCommonVertex.MSG0" ));
}
myShape = Context()->Apply(myShape);
#include <ShapeConstruct.hxx>
#include <ShapeBuild_Edge.hxx>
#include <ShapeAnalysis_TransferParametersProj.hxx>
+#include <Message_Msg.hxx>
//=======================================================================
//function : ShapeFix_Wireframe
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" ));
}
}
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========================================================
{
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)
{
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);
{
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 );
{
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 );
{
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 );
}
}
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"));
+ }
}
}
}
{
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)
{
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);
{
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 );
{
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 );
{
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 );
}
}
UOperator from ShapeProcess,
ShapeContext from ShapeProcess,
Modification from BRepTools,
- DataMapOfShapeShape from TopTools
+ DataMapOfShapeShape from TopTools,
+ MsgRegistrator from ShapeExtend
is
ApplyModifier (myclass; S: Shape from TopoDS;
context: ShapeContext from ShapeProcess;
M: Modification from BRepTools;
- map: in out DataMapOfShapeShape from TopTools)
+ map: in out DataMapOfShapeShape from TopTools;
+ msg : MsgRegistrator from ShapeExtend=0)
---Purpose: Applies BRepTools_Modification to a shape,
-- taking into account sharing of components of compounds.
returns Shape from TopoDS;
TopoDS_Shape ShapeProcess_OperLibrary::ApplyModifier (const TopoDS_Shape &S,
const Handle(ShapeProcess_ShapeContext)& context,
const Handle(BRepTools_Modification) &M,
- TopTools_DataMapOfShapeShape &map)
+ TopTools_DataMapOfShapeShape &map,
+ const Handle(ShapeExtend_MsgRegistrator) &msg)
{
// protect against INTERNAL/EXTERNAL shapes
TopoDS_Shape SF = S.Oriented(TopAbs_FORWARD);
// Modify the shape
BRepTools_Modifier MD(SF,M);
- context->RecordModification ( SF, MD );
+ context->RecordModification ( SF, MD, msg );
return MD.ModifiedShape(SF).Oriented(S.Orientation());
}
Handle(ShapeProcess_ShapeContext) ctx = 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;
+
Handle(ShapeCustom_DirectModification) DM = new ShapeCustom_DirectModification;
+ DM->SetMsgRegistrator( msg );
TopTools_DataMapOfShapeShape map;
- TopoDS_Shape res = ShapeProcess_OperLibrary::ApplyModifier ( ctx->Result(), ctx, DM, map );
- ctx->RecordModification ( map );
+ TopoDS_Shape res = ShapeProcess_OperLibrary::ApplyModifier ( ctx->Result(), ctx, DM, map, msg );
+ ctx->RecordModification ( map, msg );
ctx->SetResult ( res );
return Standard_True;
}
//=======================================================================
//function : sameparam
-//purpose :
+//purpose :
//=======================================================================
static Standard_Boolean sameparam (const Handle(ShapeProcess_Context)& context)
{
Handle(ShapeProcess_ShapeContext) ctx = Handle(ShapeProcess_ShapeContext)::DownCast ( context );
if ( ctx.IsNull() ) return Standard_False;
- ShapeFix::SameParameter ( ctx->Result(),
- ctx->IntegerVal ( "Force", Standard_False ),
- ctx->RealVal ( "Tolerance3d", Precision::Confusion() /* -1 */) );
- // WARNING: no update of context yet!
+
+ // activate message mechanism if it is supported by context
+ Handle(ShapeExtend_MsgRegistrator) msg;
+ if ( ! ctx->Messages().IsNull() ) msg = new ShapeExtend_MsgRegistrator;
+
+ ShapeFix::SameParameter ( ctx->Result(),
+ ctx->IntegerVal ( "Force", Standard_False ),
+ ctx->RealVal ( "Tolerance3d", Precision::Confusion() /* -1 */),
+ NULL, msg );
+
+ if ( !msg.IsNull() )
+ {
+ // WARNING: not FULL update of context yet!
+ Handle(ShapeBuild_ReShape) reshape = new ShapeBuild_ReShape;
+ ctx->RecordModification( reshape, msg );
+ }
return Standard_True;
}
//=======================================================================
//function : splitangle
-//purpose :
+//purpose :
//=======================================================================
static Standard_Boolean splitangle (const Handle(ShapeProcess_Context)& context)
{
Handle(ShapeProcess_ShapeContext) ctx = 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;
+
ShapeUpgrade_ShapeDivideAngle SDA ( ctx->RealVal ( "Angle", 2*M_PI ), ctx->Result() );
SDA.SetMaxTolerance ( ctx->RealVal ( "MaxTolerance", 1. ) );
-
+ SDA.SetMsgRegistrator ( msg );
+
if ( ! SDA.Perform() && SDA.Status (ShapeExtend_FAIL) ) {
#ifdef OCCT_DEBUG
cout<<"ShapeDivideAngle failed"<<endl;
#endif
return Standard_False;
}
-
- ctx->RecordModification ( SDA.GetContext() );
+
+ ctx->RecordModification ( SDA.GetContext(), msg );
ctx->SetResult ( SDA.Result() );
return Standard_True;
}
Handle(ShapeProcess_ShapeContext) ctx = 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;
+
Standard_Boolean ModeSurf = ctx->IntegerVal ( "SurfaceMode", Standard_True );
Standard_Boolean ModeC3d = ctx->IntegerVal ( "Curve3dMode", Standard_True );
Standard_Boolean ModeC2d = ctx->IntegerVal ( "Curve2dMode", Standard_True );
new ShapeCustom_BSplineRestriction ( ModeSurf, ModeC3d, ModeC2d,
aTol3d, aTol2d, aCont3d, aCont2d,
aMaxDeg, aMaxSeg, ModeDeg, Rational, aParameters );
+ LD->SetMsgRegistrator( msg );
TopTools_DataMapOfShapeShape map;
- TopoDS_Shape res = ShapeProcess_OperLibrary::ApplyModifier ( ctx->Result(), ctx, LD, map );
- ctx->RecordModification ( map );
+ TopoDS_Shape res = ShapeProcess_OperLibrary::ApplyModifier ( ctx->Result(), ctx, LD, map, msg );
+ ctx->RecordModification ( map, msg );
ctx->SetResult ( res );
return Standard_True;
}
Handle(ShapeProcess_ShapeContext) ctx = Handle(ShapeProcess_ShapeContext)::DownCast ( context );
if ( ctx.IsNull() ) return Standard_False;
- Handle(ShapeCustom_ConvertToRevolution) CR =
- new ShapeCustom_ConvertToRevolution();
+ // activate message mechanism if it is supported by context
+ Handle(ShapeExtend_MsgRegistrator) msg;
+ if ( ! ctx->Messages().IsNull() ) msg = new ShapeExtend_MsgRegistrator;
+
+ Handle(ShapeCustom_ConvertToRevolution) CR = new ShapeCustom_ConvertToRevolution();
+ CR->SetMsgRegistrator( msg );
TopTools_DataMapOfShapeShape map;
- TopoDS_Shape res = ShapeProcess_OperLibrary::ApplyModifier ( ctx->Result(), ctx, CR, map );
- ctx->RecordModification ( map );
+ TopoDS_Shape res = ShapeProcess_OperLibrary::ApplyModifier ( ctx->Result(), ctx, CR, map, msg );
+ ctx->RecordModification ( map, msg );
ctx->SetResult ( res );
return Standard_True;
}
Handle(ShapeProcess_ShapeContext) ctx = 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;
+
Handle(ShapeCustom_SweptToElementary) SE = new ShapeCustom_SweptToElementary();
+ SE->SetMsgRegistrator( msg );
TopTools_DataMapOfShapeShape map;
- TopoDS_Shape res = ShapeProcess_OperLibrary::ApplyModifier ( ctx->Result(), ctx, SE, map );
- ctx->RecordModification ( map );
+ TopoDS_Shape res = ShapeProcess_OperLibrary::ApplyModifier ( ctx->Result(), ctx, SE, map, msg );
+ ctx->RecordModification ( map, msg );
ctx->SetResult ( res );
return Standard_True;
}
Handle(ShapeProcess_ShapeContext) ctx = 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;
+
Standard_Boolean ModeC3d = ctx->BooleanVal ( "Curve3dMode", Standard_False );
Standard_Boolean ModeC2d = ctx->BooleanVal ( "Curve2dMode", Standard_False );
Standard_Boolean ModeSurf = ctx->BooleanVal ( "SurfaceMode", Standard_False );
Standard_Boolean BSplineMode = ctx->BooleanVal ( "BSplineMode", Standard_True );
ShapeUpgrade_ShapeConvertToBezier SCB (ctx->Result());
+ SCB.SetMsgRegistrator( msg );
SCB.SetSurfaceSegmentMode(SegmentMode);
SCB.SetSurfaceConversion (ModeSurf);
SCB.Set2dConversion (ModeC2d);
return Standard_False;
}
- ctx->RecordModification ( SCB.GetContext() );
+ ctx->RecordModification ( SCB.GetContext(), msg );
ctx->SetResult ( SCB.Result() );
return Standard_True;
}
Handle(ShapeProcess_ShapeContext) ctx = 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;
+
Standard_Boolean extrMode = ctx->BooleanVal ( "LinearExtrusionMode", Standard_True );
Standard_Boolean revolMode = ctx->BooleanVal ( "RevolutionMode", Standard_True );
Standard_Boolean offsetMode = ctx->BooleanVal ( "OffsetMode", Standard_True );
CBspl->SetExtrusionMode(extrMode);
CBspl->SetRevolutionMode(revolMode);
CBspl->SetOffsetMode(offsetMode);
+ CBspl->SetMsgRegistrator( msg );
TopTools_DataMapOfShapeShape map;
- TopoDS_Shape res = ShapeProcess_OperLibrary::ApplyModifier ( ctx->Result(), ctx, CBspl, map );
- ctx->RecordModification ( map );
+ TopoDS_Shape res = ShapeProcess_OperLibrary::ApplyModifier( ctx->Result(), ctx, CBspl, map, msg );
+ ctx->RecordModification ( map, msg );
ctx->SetResult ( res );
return Standard_True;
}
Handle(ShapeProcess_ShapeContext) ctx = 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;
+
Standard_Real aTol = ctx->RealVal ( "Tolerance3d", 1.e-7 );
Standard_Real aTol2D = ctx->RealVal ( "Tolerance2d", 1.e-9 );
GeomAbs_Shape aCrvCont = ctx->ContinuityVal ( "CurveContinuity", GeomAbs_C1 );
tool.SetPCurveCriterion(aCrv2dCont);
tool.SetTolerance(aTol);
tool.SetTolerance2d(aTol2D);
-
+
+ tool.SetMsgRegistrator( msg );
+
Standard_Real maxTol;
if ( ctx->GetReal ( "MaxTolerance", maxTol ) ) tool.SetMaxTolerance(maxTol);
return Standard_False;
}
- ctx->RecordModification ( tool.GetContext() );
+ ctx->RecordModification ( tool.GetContext(), msg );
ctx->SetResult ( tool.Result() );
return Standard_True;
}
Handle(ShapeProcess_ShapeContext) ctx = 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;
+
ShapeUpgrade_ShapeDivideClosed tool ( ctx->Result() );
+ tool.SetMsgRegistrator( msg );
Standard_Real closeTol;
if ( ctx->GetReal ( "CloseTolerance", closeTol ) ) tool.SetPrecision(closeTol);
return Standard_False;
}
- ctx->RecordModification ( tool.GetContext() );
+ ctx->RecordModification ( tool.GetContext(), msg );
ctx->SetResult ( tool.Result() );
return Standard_True;
}
Handle(ShapeProcess_ShapeContext) ctx = 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;
+
Handle(ShapeBuild_ReShape) reshape = new ShapeBuild_ReShape;
ShapeFix_FixSmallFace FSC;
FSC.SetContext(reshape);
FSC.Init(ctx->Result());
+ FSC.SetMsgRegistrator ( msg );
Standard_Real aTol;
if ( ctx->GetReal ( "Tolerance", aTol ) ) FSC.SetPrecision (aTol);
TopoDS_Shape newsh = FSC.Shape();
if ( newsh != ctx->Result() ) {
- ctx->RecordModification ( reshape );
+ ctx->RecordModification ( reshape, msg );
ctx->SetResult ( newsh );
}
Handle(ShapeProcess_ShapeContext) ctx = 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;
+
Standard_Real aTol3d = ctx->RealVal ( "Tolerance3d", Precision::Confusion() );
Handle(ShapeBuild_ReShape) reshape = new ShapeBuild_ReShape;
Handle(ShapeFix_Wireframe) sfwf = new ShapeFix_Wireframe(ctx->Result());
+ sfwf->SetMsgRegistrator( msg );
sfwf->SetContext(reshape);
sfwf->SetPrecision(aTol3d);
sfwf->FixWireGaps();
TopoDS_Shape result = sfwf->Shape();
if ( result != ctx->Result() ) {
- ctx->RecordModification ( reshape );
+ ctx->RecordModification ( reshape, msg );
ctx->SetResult ( result );
}
return Standard_True;
Handle(ShapeProcess_ShapeContext) ctx = 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;
+
Standard_Real aTol3d = ctx->RealVal ( "Tolerance3d", Precision::Confusion() );
Handle(ShapeBuild_ReShape) reshape = new ShapeBuild_ReShape;
ShapeFix_Wireframe ShapeFixWireframe(ctx->Result());
ShapeFixWireframe.SetContext(reshape);
ShapeFixWireframe.SetPrecision(aTol3d);
+ ShapeFixWireframe.SetMsgRegistrator( msg );
if ( ShapeFixWireframe.FixSmallEdges() ) {
- ctx->RecordModification ( reshape );
+ ctx->RecordModification ( reshape, msg );
}
return Standard_True;
}
if ( ! ctx->Messages().IsNull() ) msg = new ShapeExtend_MsgRegistrator;
Handle(ShapeFix_Shape) sfs = new ShapeFix_Shape;
- sfs->SetMsgRegistrator ( msg );
Handle(ShapeFix_Face) sff = Handle(ShapeFix_Face)::DownCast(sfs->FixFaceTool());
Handle(ShapeFix_Wire) sfw = Handle(ShapeFix_Wire)::DownCast(sfs->FixWireTool());
+ sfs->SetMsgRegistrator( msg );
sfs->SetPrecision ( ctx->RealVal ( "Tolerance3d", Precision::Confusion() ) );
sfs->SetMinTolerance ( ctx->RealVal ( "MinTolerance3d", Precision::Confusion() ) );
return Standard_False;
TopoDS_Shape result = sfs->Shape();
- if ( result != ctx->Result() ) {
+ if (( result != ctx->Result() ) ||
+ ( !msg.IsNull() && !msg->MapShape().IsEmpty()))
+ {
ctx->RecordModification ( sfs->Context(), msg );
ctx->SetResult ( result );
}
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;
+
Standard_Integer nbSplits = ctx->IntegerVal ( "NbSplitPoints", 1 );
ShapeUpgrade_ShapeDivideClosedEdges tool (ctx->Result());
tool.SetNbSplitPoints(nbSplits);
+ tool.SetMsgRegistrator( msg );
if ( ! tool.Perform() && tool.Status (ShapeExtend_FAIL) ) {
#ifdef OCCT_DEBUG
return Standard_False;
}
- ctx->RecordModification ( tool.GetContext() );
+ ctx->RecordModification ( tool.GetContext(), msg );
ctx->SetResult ( tool.Result() );
return Standard_True;
}
Handle(ShapeProcess_ShapeContext) ctx = 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;
+
Handle(ShapeBuild_ReShape) reshape = new ShapeBuild_ReShape;
ShapeFix_SplitCommonVertex SCV;
SCV.SetContext(reshape);
SCV.Init(ctx->Result());
+ SCV.SetMsgRegistrator( msg );
+
SCV.Perform();
TopoDS_Shape newsh = SCV.Shape();
if ( newsh != ctx->Result() ) {
- ctx->RecordModification ( reshape );
+ ctx->RecordModification ( reshape, msg );
ctx->SetResult ( newsh );
}
-- with explicit definition of mapping from current
-- result to a new one
- RecordModification (me: mutable; repl: DataMapOfShapeShape from TopTools);
+ RecordModification (me: mutable; repl: DataMapOfShapeShape from TopTools;
+ msg : MsgRegistrator from ShapeExtend=0);
RecordModification (me: mutable; repl: ReShape from ShapeBuild;
msg : MsgRegistrator from ShapeExtend);
RecordModification (me: mutable; repl: ReShape from ShapeBuild);
RecordModification (me: mutable; sh : Shape from TopoDS;
- repl: Modifier from BRepTools);
+ repl: Modifier from BRepTools;
+ msg : MsgRegistrator from ShapeExtend=0);
---Purpose: Records modifications and resets result accordingly
-- NOTE: modification of resulting shape should be explicitly
-- defined in the maps along with modifications of subshapes
static void RecModif (const TopoDS_Shape &S,
const TopTools_DataMapOfShapeShape &repl,
+ const Handle(ShapeExtend_MsgRegistrator) &msg,
TopTools_DataMapOfShapeShape &map,
+ Handle(ShapeExtend_MsgRegistrator) &myMsg,
const TopAbs_ShapeEnum until)
{
TopoDS_Shape r = S;
if ( res != r ) map.Bind ( S.Located(aNullLoc), res );
}
+ // update messages (messages must be taken from each level in the substitution map)
+ if ( ! r.IsNull() && ! myMsg.IsNull() &&
+ ! msg.IsNull() && msg->MapShape().Extent() >0 )
+ {
+ const ShapeExtend_DataMapOfShapeListOfMsg& msgmap = msg->MapShape();
+ if ( msgmap.IsBound( r )) {
+ const Message_ListOfMsg &msglist = msgmap.Find (r);
+ for (Message_ListIteratorOfListOfMsg iter (msglist); iter.More(); iter.Next())
+ myMsg->Send ( S, iter.Value(), Message_Warning );
+ }
+ else if ( msgmap.IsBound( S )) {
+ const Message_ListOfMsg &msglist = msgmap.Find (S);
+ for (Message_ListIteratorOfListOfMsg iter (msglist); iter.More(); iter.Next())
+ myMsg->Send ( S, iter.Value(), Message_Warning );
+ }
+ }
+
if ( until == TopAbs_SHAPE || S.ShapeType() >= until ) return;
for ( TopoDS_Iterator it(S); it.More(); it.Next() ) {
- RecModif ( it.Value(), repl, map, until );
+ RecModif ( it.Value(), repl, msg, map, myMsg, until );
}
}
-void ShapeProcess_ShapeContext::RecordModification (const TopTools_DataMapOfShapeShape &repl)
+void ShapeProcess_ShapeContext::RecordModification (const TopTools_DataMapOfShapeShape &repl,
+ const Handle(ShapeExtend_MsgRegistrator)& msg)
{
if ( repl.Extent() <=0 ) return;
- RecModif ( myShape, repl, myMap, myUntil );
+ RecModif ( myShape, repl, msg, myMap, myMsg, myUntil );
if ( myMap.IsBound(myShape) ) myResult = myMap.Find ( myShape );
#ifdef OCCT_DEBUG
// cout << "Modifier: " << endl; DumpMap (myMap);
! msg.IsNull() && msg->MapShape().Extent() >0 ) {
TopoDS_Shape cur, next = r;
const ShapeExtend_DataMapOfShapeListOfMsg& msgmap = msg->MapShape();
+ if ( msgmap.IsBound( S ))
+ next = S;
do {
cur = next;
if (msgmap.IsBound (cur)) {
if ( until == TopAbs_SHAPE || S.ShapeType() >= until ) return;
- for ( TopoDS_Iterator it(S,Standard_False,Standard_False); it.More(); it.Next() ) {
+ for ( TopoDS_Iterator it(S,Standard_False/*,Standard_False*/); it.More(); it.Next() ) {
RecModif ( it.Value(), repl, msg, map, myMsg, until );
}
}
}
void ShapeProcess_ShapeContext::RecordModification (const TopoDS_Shape &S,
- const BRepTools_Modifier &repl)
+ const BRepTools_Modifier &repl,
+ const Handle(ShapeExtend_MsgRegistrator)& msg)
{
TopTools_DataMapOfShapeShape map;
ExplodeModifier ( S, repl, map, myUntil );
- RecordModification ( map );
+ RecordModification ( map, msg );
}
//=======================================================================
Adaptor3d,
GeomAdaptor,
Geom2dAPI,
+ Message,
TopLoc,
TColStd,
TColGeom,
uses
Shape from TopoDS,
- FaceDivide from ShapeUpgrade
+ FaceDivide from ShapeUpgrade,
+ Msg from Message
is
is redefined protected;
---Purpose: Returns the tool for dividing faces.
+ GetFaceMsg (me) returns Msg from Message is redefined protected;
+ GetWireMsg (me) returns Msg from Message is redefined protected;
+ GetEdgeMsg (me) returns Msg from Message is redefined protected;
+ ---Purpose: Returns a message decsribing modification of a shape.
fields
my2dMode : Boolean;
tool->SetSplitSurfaceTool(stool);
}
return tool;
+}
+
+Message_Msg ShapeUpgrade_ShapeConvertToBezier::GetFaceMsg() const
+{
+ return "ShapeDivide.FaceConvertToBezier.MSG0";
+}
+Message_Msg ShapeUpgrade_ShapeConvertToBezier::GetWireMsg() const
+{
+ return "ShapeDivide.WireConvertToBezier.MSG0";
+}
+Message_Msg ShapeUpgrade_ShapeConvertToBezier::GetEdgeMsg() const
+{
+ return "ShapeDivide.EdgeConvertToBezier.MSG0";
}
-
Shape from TopoDS,
Status from ShapeExtend,
ReShape from ShapeBuild,
- FaceDivide from ShapeUpgrade
+ FaceDivide from ShapeUpgrade,
+ Msg from Message,
+ Gravity from Message,
+ BasicMsgRegistrator from ShapeExtend
is
Create returns ShapeDivide from ShapeUpgrade;
SetContext (me: in out; context: ReShape from ShapeBuild);
---Purpose: Sets context with recorded modifications to be applied
-- during next call(s) to Perform(shape,Standard_False)
-
+
+ SetMsgRegistrator (me: in out; msgreg: BasicMsgRegistrator from ShapeExtend) is virtual;
+ ---Purpose: Sets message registrator
+
+ MsgRegistrator (me) returns BasicMsgRegistrator from ShapeExtend;
+ ---Purpose: Returns message registrator
+
+ SendMsg (me; shape : Shape from TopoDS;
+ message: Msg from Message;
+ gravity: Gravity from Message = Message_Info);
+ ---Purpose: Sends a message to be attached to the shape.
+ -- Calls corresponding message of message registrator.
+
Status (me; status: Status from ShapeExtend) returns Boolean;
---Purpose: Queries the status of last call to Perform
-- OK : no splitting was done (or no call to Perform)
-- 1 - only curve 3d from shared edges.
-- 2 - all curve 3d.
+ GetFaceMsg (me) returns Msg from Message is virtual protected;
+ GetWireMsg (me) returns Msg from Message is virtual protected;
+ GetEdgeMsg (me) returns Msg from Message is virtual protected;
+ ---Purpose: Returns a message decsribing modification of a shape.
+
fields
mySplitFaceTool: FaceDivide from ShapeUpgrade;
myContext : ReShape from ShapeBuild is protected;
+ myMsgReg : BasicMsgRegistrator from ShapeExtend is protected;
myShape : Shape from TopoDS is protected;
myResult : Shape from TopoDS is protected;
myPrecision : Real is protected;
#include <ShapeUpgrade_WireDivide.hxx>
#include <Standard_ErrorHandler.hxx>
#include <Standard_Failure.hxx>
+#include <Message_Msg.hxx>
//=======================================================================
//function : ShapeUpgrade_ShapeDivide
myMaxTol = 1; //Precision::Infinite() ?? pdn
mySplitFaceTool = new ShapeUpgrade_FaceDivide;
myContext = new ShapeBuild_ReShape;
+ //myMsgReg = new ShapeExtend_BasicMsgRegistrator;
mySegmentMode = Standard_True;
myEdgeMode = 2;
}
SplitWire->SetMinTolerance(myMinTol);
SplitWire->SetEdgeMode(myEdgeMode);
}
+ Message_Msg doneMsg = GetFaceMsg();
+
for(TopExp_Explorer exp(myShape,TopAbs_FACE); exp.More(); exp.Next()) {
//smh#8
TopoDS_Shape tmpF = exp.Current().Oriented ( TopAbs_FORWARD );
}
if(SplitFace->Status(ShapeExtend_DONE)) {
myContext->Replace(face,SplitFace->Result());
+ SendMsg( face, doneMsg, Message_Info );
if(SplitFace->Status(ShapeExtend_DONE1))
myStatus |= ShapeExtend::EncodeStatus ( ShapeExtend_DONE1 );
if(SplitFace->Status(ShapeExtend_DONE2))
SplitWire->SetMaxTolerance(myMaxTol);
SplitWire->SetMinTolerance(myMinTol);
SplitWire->SetEdgeMode(myEdgeMode);
+ Message_Msg doneMsg = GetWireMsg();
+
TopExp_Explorer exp;//svv Jan 10 2000 : porting on DEC
for (exp.Init (myShape, TopAbs_WIRE, TopAbs_FACE); exp.More(); exp.Next()) {
//smh#8
}
if(SplitWire->Status(ShapeExtend_DONE)) {
myContext->Replace(wire,SplitWire->Wire());
+ SendMsg( wire, doneMsg, Message_Info );
myStatus |= ShapeExtend::EncodeStatus ( ShapeExtend_DONE1 );
}
}
}
// Process free EDGEs
+ Message_Msg edgeDoneMsg = GetEdgeMsg();
for (exp.Init (myShape, TopAbs_EDGE, TopAbs_WIRE); exp.More(); exp.Next()) {
//smh#8
TopoDS_Shape tmpE = exp.Current().Oriented ( TopAbs_FORWARD );
}
if(SplitWire->Status(ShapeExtend_DONE)) {
myContext->Replace(edge,SplitWire->Wire());
+ SendMsg( edge, edgeDoneMsg, Message_Info );
myStatus |= ShapeExtend::EncodeStatus ( ShapeExtend_DONE1 );
}
}
{
myEdgeMode = aEdgeMode;
}
+
+//=======================================================================
+//function : SetMsgRegistrator
+//purpose :
+//=======================================================================
+
+void ShapeUpgrade_ShapeDivide::SetMsgRegistrator(const Handle(ShapeExtend_BasicMsgRegistrator)& msgreg)
+{
+ myMsgReg = msgreg;
+}
+
+//=======================================================================
+//function : MsgRegistrator
+//purpose :
+//=======================================================================
+
+Handle(ShapeExtend_BasicMsgRegistrator) ShapeUpgrade_ShapeDivide::MsgRegistrator() const
+{
+ return myMsgReg;
+}
+
+//=======================================================================
+//function : SendMsg
+//purpose :
+//=======================================================================
+
+void ShapeUpgrade_ShapeDivide::SendMsg(const TopoDS_Shape& shape,
+ const Message_Msg& message,
+ const Message_Gravity gravity) const
+{
+ if ( !myMsgReg.IsNull() )
+ myMsgReg->Send (shape, message, gravity);
+}
+
+Message_Msg ShapeUpgrade_ShapeDivide::GetFaceMsg() const
+{
+ return "ShapeDivide.FaceDivide.MSG0";
+}
+Message_Msg ShapeUpgrade_ShapeDivide::GetWireMsg() const
+{
+ return "ShapeDivide.WireDivide.MSG0";
+}
+Message_Msg ShapeUpgrade_ShapeDivide::GetEdgeMsg() const
+{
+ return "ShapeDivide.EdgeDivide.MSG0";
+}