mirror of
https://github.com/Open-Cascade-SAS/OCCT.git
synced 2026-07-20 06:09:50 +08: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:
@@ -168,7 +168,9 @@ static void DumpMap (const TopTools_DataMapOfShapeShape &map)
|
||||
|
||||
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;
|
||||
@@ -218,17 +220,35 @@ static void RecModif (const TopoDS_Shape &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);
|
||||
@@ -274,6 +294,8 @@ static void RecModif (const TopoDS_Shape &S,
|
||||
! 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)) {
|
||||
@@ -288,7 +310,7 @@ static void RecModif (const TopoDS_Shape &S,
|
||||
|
||||
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 );
|
||||
}
|
||||
}
|
||||
@@ -354,11 +376,12 @@ static void ExplodeModifier (const TopoDS_Shape &S,
|
||||
}
|
||||
|
||||
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 );
|
||||
}
|
||||
|
||||
//=======================================================================
|
||||
|
||||
Reference in New Issue
Block a user