Back to home page

EIC code displayed by LXR

 
 

    


Warning, file /include/opencascade/XCAFDoc_NoteComment.hxx was not indexed or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).

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   DEFINE_STANDARD_RTTIEXT(XCAFDoc_NoteComment, XCAFDoc_Note)
0025 
0026   //! Returns default attribute GUID
0027   Standard_EXPORT static const Standard_GUID& GetID();
0028 
0029   //! Finds a reference attribute on the given label and returns it, if it is found
0030   Standard_EXPORT static occ::handle<XCAFDoc_NoteComment> Get(const TDF_Label& theLabel);
0031 
0032   //! Create (if not exist) a comment note on the given label.
0033   //! \param[in]  theLabel     - note label.
0034   //! \param[in]  theUserName  - the name of the user, who created the note.
0035   //! \param[in]  theTimeStamp - creation timestamp of the note.
0036   //! \param[in]  theComment   - comment text.
0037   Standard_EXPORT static occ::handle<XCAFDoc_NoteComment> Set(
0038     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   // Overrides TDF_Attribute virtuals
0054   Standard_EXPORT const Standard_GUID& ID() const override;
0055   Standard_EXPORT occ::handle<TDF_Attribute> NewEmpty() const override;
0056   Standard_EXPORT void              Restore(const occ::handle<TDF_Attribute>& theAttrFrom) override;
0057   Standard_EXPORT void              Paste(const occ::handle<TDF_Attribute>&       theAttrInto,
0058                                           const occ::handle<TDF_RelocationTable>& theRT) const override;
0059   Standard_EXPORT Standard_OStream& Dump(Standard_OStream& theOS) const override;
0060 
0061 protected:
0062   TCollection_ExtendedString myComment; ///< Comment text.
0063 };
0064 
0065 #endif // _XCAFDoc_NoteComment_HeaderFile