1 // Created on: 2000-01-31
2 // Created by: data exchange team
3 // Copyright (c) 2000-2014 OPEN CASCADE SAS
5 // This file is part of Open CASCADE Technology software library.
7 // This library is free software; you can redistribute it and/or modify it under
8 // the terms of the GNU Lesser General Public License version 2.1 as published
9 // by the Free Software Foundation, with special exception defined in the file
10 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
11 // distribution for complete text of the license and disclaimer of any warranty.
13 // Alternatively, this file may be used under the terms of Open CASCADE
14 // commercial license or contractual agreement.
17 #include <Message_ListOfMsg.hxx>
18 #include <Message_Msg.hxx>
19 #include <ShapeExtend_MsgRegistrator.hxx>
20 #include <Standard_Transient.hxx>
21 #include <Standard_Type.hxx>
22 #include <TopoDS_Shape.hxx>
24 IMPLEMENT_STANDARD_RTTIEXT(ShapeExtend_MsgRegistrator,ShapeExtend_BasicMsgRegistrator)
26 //=======================================================================
27 //function : ShapeExtend_MsgRegistrator
29 //=======================================================================
30 ShapeExtend_MsgRegistrator::ShapeExtend_MsgRegistrator() : ShapeExtend_BasicMsgRegistrator()
34 //=======================================================================
37 //=======================================================================
39 void ShapeExtend_MsgRegistrator::Send(const Handle(Standard_Transient)& object,
40 const Message_Msg& message,
41 const Message_Gravity)
43 if (object.IsNull()) {
45 cout << "Warning: ShapeExtend_MsgRegistrator::Send: null object" << endl;
49 if (myMapTransient.IsBound (object)) {
50 Message_ListOfMsg& list = myMapTransient.ChangeFind (object);
51 list.Append (message);
54 Message_ListOfMsg list;
55 list.Append (message);
56 myMapTransient.Bind (object, list);
60 //=======================================================================
63 //=======================================================================
65 void ShapeExtend_MsgRegistrator::Send(const TopoDS_Shape& shape,
66 const Message_Msg& message,
67 const Message_Gravity)
71 cout << "Warning: ShapeExtend_MsgRegistrator::Send: null shape" << endl;
75 if (myMapShape.IsBound (shape)) {
76 Message_ListOfMsg& list = myMapShape.ChangeFind (shape);
77 list.Append (message);
80 Message_ListOfMsg list;
81 list.Append (message);
82 myMapShape.Bind (shape, list);