0030700: Visualization, TKOpenGl - support PBR Metallic-Roughness shading model
[occt.git] / src / XCAFDoc / XCAFDoc_NoteBalloon.cxx
CommitLineData
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
14#include <Standard_GUID.hxx>
15#include <TDF_Label.hxx>
16#include <XCAFDoc_NoteBalloon.hxx>
17
18IMPLEMENT_STANDARD_RTTIEXT(XCAFDoc_NoteBalloon, XCAFDoc_NoteComment)
19
8c7fab9b 20// =======================================================================
21// function : GetID
22// purpose :
23// =======================================================================
24const Standard_GUID&
024d6f77 25XCAFDoc_NoteBalloon::GetID()
26{
27 static Standard_GUID s_ID("1127951D-87D5-4ecc-89D5-D1406576C43F");
28 return s_ID;
29}
30
8c7fab9b 31// =======================================================================
32// function : Get
33// purpose :
34// =======================================================================
024d6f77 35Handle(XCAFDoc_NoteBalloon)
36XCAFDoc_NoteBalloon::Get(const TDF_Label& theLabel)
37{
38 Handle(XCAFDoc_NoteBalloon) aThis;
39 theLabel.FindAttribute(XCAFDoc_NoteBalloon::GetID(), aThis);
40 return aThis;
41}
42
8c7fab9b 43// =======================================================================
44// function : Set
45// purpose :
46// =======================================================================
024d6f77 47Handle(XCAFDoc_NoteBalloon)
48XCAFDoc_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
8c7fab9b 64// =======================================================================
65// function : XCAFDoc_NoteBalloon
66// purpose :
67// =======================================================================
024d6f77 68XCAFDoc_NoteBalloon::XCAFDoc_NoteBalloon()
69{
70}
71
8c7fab9b 72// =======================================================================
73// function : ID
74// purpose :
75// =======================================================================
76const Standard_GUID&
024d6f77 77XCAFDoc_NoteBalloon::ID() const
78{
79 return GetID();
80}
81
8c7fab9b 82// =======================================================================
83// function : NewEmpty
84// purpose :
85// =======================================================================
86Handle(TDF_Attribute)
024d6f77 87XCAFDoc_NoteBalloon::NewEmpty() const
88{
89 return new XCAFDoc_NoteBalloon();
90}