42cf5bc1 |
1 | // Created on: 2000-01-28 |
2 | // Created by: data exchange team |
3 | // Copyright (c) 2000-2014 OPEN CASCADE SAS |
4 | // |
5 | // This file is part of Open CASCADE Technology software library. |
6 | // |
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. |
12 | // |
13 | // Alternatively, this file may be used under the terms of Open CASCADE |
14 | // commercial license or contractual agreement. |
15 | |
16 | #ifndef _ShapeExtend_MsgRegistrator_HeaderFile |
17 | #define _ShapeExtend_MsgRegistrator_HeaderFile |
18 | |
19 | #include <Standard.hxx> |
20 | #include <Standard_Type.hxx> |
21 | |
22 | #include <ShapeExtend_DataMapOfTransientListOfMsg.hxx> |
23 | #include <ShapeExtend_DataMapOfShapeListOfMsg.hxx> |
24 | #include <ShapeExtend_BasicMsgRegistrator.hxx> |
25 | #include <Message_Gravity.hxx> |
26 | class Standard_Transient; |
27 | class Message_Msg; |
28 | class TopoDS_Shape; |
29 | |
30 | |
31 | class ShapeExtend_MsgRegistrator; |
32 | DEFINE_STANDARD_HANDLE(ShapeExtend_MsgRegistrator, ShapeExtend_BasicMsgRegistrator) |
33 | |
34 | //! Attaches messages to the objects (generic Transient or shape). |
35 | //! The objects of this class are transmitted to the Shape Healing |
36 | //! algorithms so that they could collect messages occurred during |
37 | //! processing. |
38 | //! |
39 | //! Messages are added to the Maps (stored as a field) that can be |
40 | //! used, for instance, by Data Exchange processors to attach those |
41 | //! messages to initial file entities. |
42 | class ShapeExtend_MsgRegistrator : public ShapeExtend_BasicMsgRegistrator |
43 | { |
44 | |
45 | public: |
46 | |
47 | |
48 | //! Creates an object. |
49 | Standard_EXPORT ShapeExtend_MsgRegistrator(); |
50 | |
51 | //! Sends a message to be attached to the object. |
52 | //! If the object is in the map then the message is added to the |
53 | //! list, otherwise the object is firstly added to the map. |
54 | Standard_EXPORT virtual void Send (const Handle(Standard_Transient)& object, const Message_Msg& message, const Message_Gravity gravity) Standard_OVERRIDE; |
55 | |
56 | //! Sends a message to be attached to the shape. |
57 | //! If the shape is in the map then the message is added to the |
58 | //! list, otherwise the shape is firstly added to the map. |
59 | Standard_EXPORT virtual void Send (const TopoDS_Shape& shape, const Message_Msg& message, const Message_Gravity gravity) Standard_OVERRIDE; |
60 | |
61 | //! Returns a Map of objects and message list |
62 | const ShapeExtend_DataMapOfTransientListOfMsg& MapTransient() const; |
63 | |
64 | //! Returns a Map of shapes and message list |
65 | const ShapeExtend_DataMapOfShapeListOfMsg& MapShape() const; |
66 | |
67 | |
68 | |
69 | |
92efcf78 |
70 | DEFINE_STANDARD_RTTIEXT(ShapeExtend_MsgRegistrator,ShapeExtend_BasicMsgRegistrator) |
42cf5bc1 |
71 | |
72 | protected: |
73 | |
74 | |
75 | |
76 | |
77 | private: |
78 | |
79 | |
80 | ShapeExtend_DataMapOfTransientListOfMsg myMapTransient; |
81 | ShapeExtend_DataMapOfShapeListOfMsg myMapShape; |
82 | |
83 | |
84 | }; |
85 | |
86 | |
87 | #include <ShapeExtend_MsgRegistrator.lxx> |
88 | |
89 | |
90 | |
91 | |
92 | |
93 | #endif // _ShapeExtend_MsgRegistrator_HeaderFile |