8c7fab9b |
1 | // Copyright (c) 2017-2018 OPEN CASCADE SAS |
024d6f77 |
2 | // |
3 | // This file is part of Open CASCADE Technology software library. |
4 | // |
5 | // This library is free software; you can redistribute it and/or modify it under |
6 | // the terms of the GNU Lesser General Public License version 2.1 as published |
7 | // by the Free Software Foundation, with special exception defined in the file |
8 | // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT |
9 | // distribution for complete text of the license and disclaimer of any warranty. |
10 | // |
11 | // Alternatively, this file may be used under the terms of Open CASCADE |
12 | // commercial license or contractual agreement. |
13 | |
bc73b006 |
14 | #include <XCAFDoc_NoteBalloon.hxx> |
15 | |
024d6f77 |
16 | #include <Standard_GUID.hxx> |
17 | #include <TDF_Label.hxx> |
024d6f77 |
18 | |
19 | IMPLEMENT_STANDARD_RTTIEXT(XCAFDoc_NoteBalloon, XCAFDoc_NoteComment) |
20 | |
8c7fab9b |
21 | // ======================================================================= |
22 | // function : GetID |
23 | // purpose : |
24 | // ======================================================================= |
25 | const Standard_GUID& |
024d6f77 |
26 | XCAFDoc_NoteBalloon::GetID() |
27 | { |
28 | static Standard_GUID s_ID("1127951D-87D5-4ecc-89D5-D1406576C43F"); |
29 | return s_ID; |
30 | } |
31 | |
8c7fab9b |
32 | // ======================================================================= |
33 | // function : Get |
34 | // purpose : |
35 | // ======================================================================= |
024d6f77 |
36 | Handle(XCAFDoc_NoteBalloon) |
37 | XCAFDoc_NoteBalloon::Get(const TDF_Label& theLabel) |
38 | { |
39 | Handle(XCAFDoc_NoteBalloon) aThis; |
40 | theLabel.FindAttribute(XCAFDoc_NoteBalloon::GetID(), aThis); |
41 | return aThis; |
42 | } |
43 | |
8c7fab9b |
44 | // ======================================================================= |
45 | // function : Set |
46 | // purpose : |
47 | // ======================================================================= |
024d6f77 |
48 | Handle(XCAFDoc_NoteBalloon) |
49 | XCAFDoc_NoteBalloon::Set(const TDF_Label& theLabel, |
50 | const TCollection_ExtendedString& theUserName, |
51 | const TCollection_ExtendedString& theTimeStamp, |
52 | const TCollection_ExtendedString& theComment) |
53 | { |
54 | Handle(XCAFDoc_NoteBalloon) aNoteBalloon; |
55 | if (!theLabel.IsNull() && !theLabel.FindAttribute(XCAFDoc_NoteBalloon::GetID(), aNoteBalloon)) |
56 | { |
57 | aNoteBalloon = new XCAFDoc_NoteBalloon(); |
58 | aNoteBalloon->XCAFDoc_Note::Set(theUserName, theTimeStamp); |
59 | aNoteBalloon->XCAFDoc_NoteComment::Set(theComment); |
60 | theLabel.AddAttribute(aNoteBalloon); |
61 | } |
62 | return aNoteBalloon; |
63 | } |
64 | |
8c7fab9b |
65 | // ======================================================================= |
66 | // function : XCAFDoc_NoteBalloon |
67 | // purpose : |
68 | // ======================================================================= |
024d6f77 |
69 | XCAFDoc_NoteBalloon::XCAFDoc_NoteBalloon() |
70 | { |
71 | } |
72 | |
8c7fab9b |
73 | // ======================================================================= |
74 | // function : ID |
75 | // purpose : |
76 | // ======================================================================= |
77 | const Standard_GUID& |
024d6f77 |
78 | XCAFDoc_NoteBalloon::ID() const |
79 | { |
80 | return GetID(); |
81 | } |
82 | |
8c7fab9b |
83 | // ======================================================================= |
84 | // function : NewEmpty |
85 | // purpose : |
86 | // ======================================================================= |
87 | Handle(TDF_Attribute) |
024d6f77 |
88 | XCAFDoc_NoteBalloon::NewEmpty() const |
89 | { |
90 | return new XCAFDoc_NoteBalloon(); |
91 | } |