33ba8565 |
1 | // Created on: 2017-06-27 |
2 | // Created by: Andrey Betenev |
3 | // Copyright (c) 2017 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 _TopoDS_AlertWithShape_HeaderFile |
17 | #define _TopoDS_AlertWithShape_HeaderFile |
18 | |
19 | #include <Message_Alert.hxx> |
20 | #include <TopoDS_Shape.hxx> |
21 | |
22 | //! Alert object storing TopoDS shape in its field |
23 | class TopoDS_AlertWithShape : public Message_Alert |
24 | { |
25 | public: |
26 | //! Constructor with shape argument |
27 | Standard_EXPORT TopoDS_AlertWithShape (const TopoDS_Shape& theShape); |
28 | |
29 | //! Returns contained shape |
30 | const TopoDS_Shape& GetShape() const { return myShape; } |
13c0e402 |
31 | |
32 | //! Sets the shape |
33 | void SetShape(const TopoDS_Shape& theShape) { myShape = theShape; } |
34 | |
33ba8565 |
35 | //! Returns false. |
36 | virtual Standard_EXPORT Standard_Boolean SupportsMerge () const Standard_OVERRIDE; |
37 | |
38 | //! Returns false. |
39 | virtual Standard_EXPORT Standard_Boolean Merge (const Handle(Message_Alert)& theTarget) Standard_OVERRIDE; |
40 | |
41 | // OCCT RTTI |
42 | DEFINE_STANDARD_RTTIEXT(TopoDS_AlertWithShape, Message_Alert) |
43 | |
44 | private: |
45 | TopoDS_Shape myShape; |
46 | }; |
47 | |
48 | //! Helper macro allowing to define alert with shape argument in one line of code |
49 | #define DEFINE_ALERT_WITH_SHAPE(Alert) \ |
50 | class Alert : public TopoDS_AlertWithShape \ |
51 | { \ |
52 | public:\ |
53 | Alert (const TopoDS_Shape& theShape) : TopoDS_AlertWithShape(theShape) {} \ |
54 | DEFINE_STANDARD_RTTI_INLINE(Alert, TopoDS_AlertWithShape) \ |
55 | }; |
56 | |
57 | #endif // _TopoDS_AlertWithShape_HeaderFile |