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 | #ifndef _XCAFDoc_NoteComment_HeaderFile |
15 | #define _XCAFDoc_NoteComment_HeaderFile |
16 | |
17 | #include <XCAFDoc_Note.hxx> |
18 | |
024d6f77 |
19 | //! A comment note attribute. |
20 | //! Contains a textual comment. |
21 | class XCAFDoc_NoteComment : public XCAFDoc_Note |
22 | { |
23 | public: |
24 | |
25 | DEFINE_STANDARD_RTTIEXT(XCAFDoc_NoteComment, XCAFDoc_Note) |
26 | |
8c7fab9b |
27 | //! Returns default attribute GUID |
024d6f77 |
28 | Standard_EXPORT static const Standard_GUID& GetID(); |
29 | |
30 | //! Finds a reference attribute on the given label and returns it, if it is found |
31 | Standard_EXPORT static Handle(XCAFDoc_NoteComment) Get(const TDF_Label& theLabel); |
32 | |
33 | //! Create (if not exist) a comment note on the given label. |
34 | //! \param [in] theLabel - note label. |
35 | //! \param [in] theUserName - the name of the user, who created the note. |
36 | //! \param [in] theTimeStamp - creation timestamp of the note. |
37 | //! \param [in] theComment - comment text. |
38 | Standard_EXPORT static Handle(XCAFDoc_NoteComment) Set(const TDF_Label& theLabel, |
39 | const TCollection_ExtendedString& theUserName, |
40 | const TCollection_ExtendedString& theTimeStamp, |
41 | const TCollection_ExtendedString& theComment); |
42 | |
43 | //! Creates an empty comment note. |
44 | Standard_EXPORT XCAFDoc_NoteComment(); |
45 | |
46 | //! Sets the comment text. |
47 | Standard_EXPORT void Set(const TCollection_ExtendedString& theComment); |
48 | |
49 | //! Returns the comment text. |
8c7fab9b |
50 | const TCollection_ExtendedString& Comment() const { return myComment; } |
024d6f77 |
51 | |
52 | public: |
53 | |
54 | // Overrides TDF_Attribute virtuals |
55 | Standard_EXPORT const Standard_GUID& ID() const Standard_OVERRIDE; |
56 | Standard_EXPORT Handle(TDF_Attribute) NewEmpty() const Standard_OVERRIDE; |
57 | Standard_EXPORT void Restore(const Handle(TDF_Attribute)& theAttrFrom) Standard_OVERRIDE; |
58 | Standard_EXPORT void Paste(const Handle(TDF_Attribute)& theAttrInto, |
59 | const Handle(TDF_RelocationTable)& theRT) const Standard_OVERRIDE; |
60 | Standard_EXPORT Standard_OStream& Dump(Standard_OStream& theOS) const Standard_OVERRIDE; |
61 | |
62 | protected: |
63 | |
64 | TCollection_ExtendedString myComment; ///< Comment text. |
65 | |
66 | }; |
67 | |
8c7fab9b |
68 | DEFINE_STANDARD_HANDLE(XCAFDoc_NoteComment, XCAFDoc_Note) |
69 | |
024d6f77 |
70 | #endif // _XCAFDoc_NoteComment_HeaderFile |