0030700: Visualization, TKOpenGl - support PBR Metallic-Roughness shading model
[occt.git] / src / XCAFDoc / XCAFDoc_NoteBalloon.cxx
1 // Copyright (c) 2017-2018 OPEN CASCADE SAS
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
14 #include <Standard_GUID.hxx>
15 #include <TDF_Label.hxx>
16 #include <XCAFDoc_NoteBalloon.hxx>
17
18 IMPLEMENT_STANDARD_RTTIEXT(XCAFDoc_NoteBalloon, XCAFDoc_NoteComment)
19
20 // =======================================================================
21 // function : GetID
22 // purpose  :
23 // =======================================================================
24 const Standard_GUID&
25 XCAFDoc_NoteBalloon::GetID()
26 {
27   static Standard_GUID s_ID("1127951D-87D5-4ecc-89D5-D1406576C43F");
28   return s_ID;
29 }
30
31 // =======================================================================
32 // function : Get
33 // purpose  :
34 // =======================================================================
35 Handle(XCAFDoc_NoteBalloon)
36 XCAFDoc_NoteBalloon::Get(const TDF_Label& theLabel)
37 {
38   Handle(XCAFDoc_NoteBalloon) aThis;
39   theLabel.FindAttribute(XCAFDoc_NoteBalloon::GetID(), aThis);
40   return aThis;
41 }
42
43 // =======================================================================
44 // function : Set
45 // purpose  :
46 // =======================================================================
47 Handle(XCAFDoc_NoteBalloon)
48 XCAFDoc_NoteBalloon::Set(const TDF_Label&                  theLabel,
49                          const TCollection_ExtendedString& theUserName,
50                          const TCollection_ExtendedString& theTimeStamp,
51                          const TCollection_ExtendedString& theComment)
52 {
53   Handle(XCAFDoc_NoteBalloon) aNoteBalloon;
54   if (!theLabel.IsNull() && !theLabel.FindAttribute(XCAFDoc_NoteBalloon::GetID(), aNoteBalloon))
55   {
56     aNoteBalloon = new XCAFDoc_NoteBalloon();
57     aNoteBalloon->XCAFDoc_Note::Set(theUserName, theTimeStamp);
58     aNoteBalloon->XCAFDoc_NoteComment::Set(theComment);
59     theLabel.AddAttribute(aNoteBalloon);
60   }
61   return aNoteBalloon;
62 }
63
64 // =======================================================================
65 // function : XCAFDoc_NoteBalloon
66 // purpose  :
67 // =======================================================================
68 XCAFDoc_NoteBalloon::XCAFDoc_NoteBalloon()
69 {
70 }
71
72 // =======================================================================
73 // function : ID
74 // purpose  :
75 // =======================================================================
76 const Standard_GUID&
77 XCAFDoc_NoteBalloon::ID() const
78 {
79   return GetID();
80 }
81
82 // =======================================================================
83 // function : NewEmpty
84 // purpose  :
85 // =======================================================================
86 Handle(TDF_Attribute)
87 XCAFDoc_NoteBalloon::NewEmpty() const
88 {
89   return new XCAFDoc_NoteBalloon();
90 }