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:
@@ -43,7 +43,8 @@ uses
|
||||
TColgp,
|
||||
Precision,
|
||||
Message,
|
||||
ShapeBuild
|
||||
ShapeBuild,
|
||||
ShapeExtend
|
||||
|
||||
is
|
||||
|
||||
@@ -55,6 +56,7 @@ is
|
||||
|
||||
class RestrictionParameters;
|
||||
|
||||
deferred class Modification; -- base class of modifications
|
||||
class DirectModification;
|
||||
|
||||
private class TrsfModification;
|
||||
|
@@ -14,7 +14,7 @@
|
||||
-- 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
|
||||
|
@@ -70,6 +70,7 @@
|
||||
#include <Geom_CylindricalSurface.hxx>
|
||||
#include <Geom_ToroidalSurface.hxx>
|
||||
#include <ShapeAnalysis.hxx>
|
||||
#include <Message_Msg.hxx>
|
||||
|
||||
static GeomAbs_Shape IntegerToGeomAbsShape(const Standard_Integer i)
|
||||
{
|
||||
@@ -368,6 +369,20 @@ Standard_Boolean ShapeCustom_BSplineRestriction::NewSurface(const TopoDS_Face& F
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
@@ -787,7 +802,7 @@ Standard_Boolean ShapeCustom_BSplineRestriction::NewCurve(const TopoDS_Edge& E,
|
||||
if(aCurve.IsNull()) {
|
||||
if(IsConvert) {
|
||||
C = aCurve;
|
||||
Tol = TolCur;
|
||||
Tol = TolCur;
|
||||
return Standard_True;
|
||||
}
|
||||
else return Standard_False;
|
||||
@@ -796,6 +811,19 @@ Standard_Boolean ShapeCustom_BSplineRestriction::NewCurve(const TopoDS_Edge& E,
|
||||
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;
|
||||
}
|
||||
|
||||
|
@@ -14,7 +14,7 @@
|
||||
-- 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
|
||||
|
@@ -28,6 +28,7 @@
|
||||
#include <BRep_ListIteratorOfListOfCurveRepresentation.hxx>
|
||||
#include <BRep_GCurve.hxx>
|
||||
#include <BRepTools.hxx>
|
||||
#include <Message_Msg.hxx>
|
||||
|
||||
//=======================================================================
|
||||
//function : ShapeCustom_ConvertToBSpline
|
||||
@@ -130,6 +131,8 @@ Standard_Boolean ShapeCustom_ConvertToBSpline::NewSurface (const TopoDS_Face& F,
|
||||
else
|
||||
S = res;
|
||||
|
||||
SendMsg( F, Message_Msg("ConvertToBSpline.NewSurface.MSG0"));
|
||||
|
||||
Tol = BRep_Tool::Tolerance(F);
|
||||
RevWires = Standard_False;
|
||||
RevFace = Standard_False;
|
||||
@@ -161,6 +164,7 @@ Standard_Boolean ShapeCustom_ConvertToBSpline::NewCurve (const TopoDS_Edge& E,
|
||||
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;
|
||||
|
@@ -14,7 +14,7 @@
|
||||
-- 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
|
||||
|
@@ -32,6 +32,7 @@
|
||||
#include <Geom_TrimmedCurve.hxx>
|
||||
#include <Geom_Line.hxx>
|
||||
#include <Geom_SurfaceOfRevolution.hxx>
|
||||
#include <Message_Msg.hxx>
|
||||
|
||||
//=======================================================================
|
||||
//function : ShapeCustom_ConvertToRevolution
|
||||
@@ -158,7 +159,8 @@ Standard_Boolean ShapeCustom_ConvertToRevolution::NewSurface (const TopoDS_Face&
|
||||
}
|
||||
else S = Rev;
|
||||
}
|
||||
|
||||
SendMsg( F, Message_Msg("ConvertToRevolution.NewSurface.MSG0"));
|
||||
|
||||
Tol = BRep_Tool::Tolerance(F);
|
||||
RevWires = Standard_False;
|
||||
RevFace = Standard_False;
|
||||
|
@@ -15,7 +15,7 @@
|
||||
-- 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
|
||||
|
@@ -32,6 +32,7 @@
|
||||
#include <BRep_TEdge.hxx>
|
||||
#include <BRep_ListIteratorOfListOfCurveRepresentation.hxx>
|
||||
#include <BRep_GCurve.hxx>
|
||||
#include <Message_Msg.hxx>
|
||||
|
||||
//=======================================================================
|
||||
//function : ShapeCustom_DirectModification
|
||||
@@ -111,6 +112,8 @@ Standard_Boolean ShapeCustom_DirectModification::NewSurface (const TopoDS_Face&
|
||||
default: return Standard_False;
|
||||
}
|
||||
|
||||
SendMsg( F, Message_Msg("DirectModification.NewSurface.MSG0"));
|
||||
|
||||
Tol = BRep_Tool::Tolerance(F);
|
||||
|
||||
return Standard_True;
|
||||
|
43
src/ShapeCustom/ShapeCustom_Modification.cdl
Normal file
43
src/ShapeCustom/ShapeCustom_Modification.cdl
Normal file
@@ -0,0 +1,43 @@
|
||||
-- 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;
|
52
src/ShapeCustom/ShapeCustom_Modification.cxx
Normal file
52
src/ShapeCustom/ShapeCustom_Modification.cxx
Normal file
@@ -0,0 +1,52 @@
|
||||
// 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);
|
||||
}
|
@@ -13,7 +13,7 @@
|
||||
-- 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
|
||||
|
@@ -43,6 +43,7 @@
|
||||
#include <ShapeAnalysis_Surface.hxx>
|
||||
|
||||
#include <BRepTools.hxx>
|
||||
#include <Message_Msg.hxx>
|
||||
|
||||
|
||||
//=======================================================================
|
||||
@@ -163,6 +164,8 @@ Standard_Boolean ShapeCustom_SweptToElementary::NewSurface(const TopoDS_Face& F,
|
||||
}
|
||||
}
|
||||
|
||||
SendMsg( F, Message_Msg("SweptToElementary.NewSurface.MSG0"));
|
||||
|
||||
Tol = BRep_Tool::Tolerance(F);
|
||||
RevWires = Standard_False;
|
||||
RevFace = Standard_False;
|
||||
|
Reference in New Issue
Block a user