Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 10:05:34

0001 // Copyright (c) 2017-2018 OPEN CASCADE SAS
0002 //
0003 // This file is part of Open CASCADE Technology software library.
0004 //
0005 // This library is free software; you can redistribute it and/or modify it under
0006 // the terms of the GNU Lesser General Public License version 2.1 as published
0007 // by the Free Software Foundation, with special exception defined in the file
0008 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
0009 // distribution for complete text of the license and disclaimer of any warranty.
0010 //
0011 // Alternatively, this file may be used under the terms of Open CASCADE
0012 // commercial license or contractual agreement.
0013 
0014 #ifndef _XCAFDoc_NoteComment_HeaderFile
0015 #define _XCAFDoc_NoteComment_HeaderFile
0016 
0017 #include <XCAFDoc_Note.hxx>
0018 
0019 //! A comment note attribute.
0020 //! Contains a textual comment.
0021 class XCAFDoc_NoteComment : public XCAFDoc_Note
0022 {
0023 public:
0024 
0025   DEFINE_STANDARD_RTTIEXT(XCAFDoc_NoteComment, XCAFDoc_Note)
0026 
0027   //! Returns default attribute GUID
0028   Standard_EXPORT static const Standard_GUID& GetID();
0029 
0030   //! Finds a reference attribute on the given label and returns it, if it is found
0031   Standard_EXPORT static Handle(XCAFDoc_NoteComment) Get(const TDF_Label& theLabel);
0032 
0033   //! Create (if not exist) a comment note on the given label.
0034   //! \param [in] theLabel     - note label.
0035   //! \param [in] theUserName  - the name of the user, who created the note.
0036   //! \param [in] theTimeStamp - creation timestamp of the note.
0037   //! \param [in] theComment   - comment text.
0038   Standard_EXPORT static Handle(XCAFDoc_NoteComment) Set(const TDF_Label&                  theLabel,
0039                                                          const TCollection_ExtendedString& theUserName,
0040                                                          const TCollection_ExtendedString& theTimeStamp,
0041                                                          const TCollection_ExtendedString& theComment);
0042 
0043   //! Creates an empty comment note.
0044   Standard_EXPORT XCAFDoc_NoteComment();
0045 
0046   //! Sets the comment text.
0047   Standard_EXPORT void Set(const TCollection_ExtendedString& theComment);
0048 
0049   //! Returns the comment text.
0050   const TCollection_ExtendedString& Comment() const { return myComment; }
0051 
0052 public:
0053 
0054   // Overrides TDF_Attribute virtuals
0055   Standard_EXPORT const Standard_GUID& ID() const Standard_OVERRIDE;
0056   Standard_EXPORT Handle(TDF_Attribute) NewEmpty() const Standard_OVERRIDE;
0057   Standard_EXPORT void Restore(const Handle(TDF_Attribute)& theAttrFrom) Standard_OVERRIDE;
0058   Standard_EXPORT void Paste(const Handle(TDF_Attribute)&       theAttrInto,
0059                              const Handle(TDF_RelocationTable)& theRT) const Standard_OVERRIDE;
0060   Standard_EXPORT Standard_OStream& Dump(Standard_OStream& theOS) const Standard_OVERRIDE;
0061 
0062 protected:
0063 
0064   TCollection_ExtendedString myComment; ///< Comment text.
0065 
0066 };
0067 
0068 DEFINE_STANDARD_HANDLE(XCAFDoc_NoteComment, XCAFDoc_Note)
0069 
0070 #endif // _XCAFDoc_NoteComment_HeaderFile