Back to home page

EIC code displayed by LXR

 
 

    


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

0001 // Copyright (c) 2015 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 
0015 #ifndef _StdPersistent_PPrsStd_PatternStd_HeaderFile
0016 #define _StdPersistent_PPrsStd_PatternStd_HeaderFile
0017 
0018 #include <StdObjMgt_Attribute.hxx>
0019 #include <StdLPersistent_HString.hxx>
0020 
0021 #include <TDataXtd_Presentation.hxx>
0022 
0023 class StdPersistent_PPrsStd
0024 {
0025 public:
0026   class AISPresentation : public StdObjMgt_Attribute<TDataXtd_Presentation>
0027   {
0028   public:
0029     //! Read persistent data from a file.
0030     inline void Read (StdObjMgt_ReadData& theReadData)
0031     {
0032       theReadData >> myIsDisplayed >> myDriverGUID
0033         >> myTransparency >> myColor >> myMaterial >> myWidth;
0034     }
0035     //! Write persistent data to a file.
0036     inline void Write (StdObjMgt_WriteData& theWriteData) const
0037     {
0038       theWriteData << myIsDisplayed << myDriverGUID
0039         << myTransparency << myColor << myMaterial << myWidth;
0040     }
0041     //! Gets persistent child objects
0042     inline void PChildren(StdObjMgt_Persistent::SequenceOfPersistent& theChildren) const
0043     {
0044       theChildren.Append(myDriverGUID);
0045     }
0046     //! Returns persistent type name
0047     inline Standard_CString PName() const { return "PPrsStd_AISPresentation"; }
0048 
0049     //! Import transient attribute from the persistent data.
0050     void Import (const Handle(TDataXtd_Presentation)& theAttribute) const;
0051 
0052   private:
0053     Standard_Boolean             myIsDisplayed;
0054     Handle(StdObjMgt_Persistent) myDriverGUID;
0055     Standard_Real                myTransparency;
0056     Standard_Integer             myColor;
0057     Standard_Integer             myMaterial;
0058     Standard_Real                myWidth;
0059   };
0060 
0061   class AISPresentation_1 : public AISPresentation
0062   {
0063   public:
0064     //! Read persistent data from a file.
0065     inline void Read (StdObjMgt_ReadData& theReadData)
0066     {
0067       AISPresentation::Read (theReadData);
0068       theReadData >> myMode;
0069     }
0070     //! Write persistent data to a file.
0071     inline void Write (StdObjMgt_WriteData& theWriteData)
0072     {
0073       AISPresentation::Write (theWriteData);
0074       theWriteData << myMode;
0075     }
0076     //! Returns persistent type name
0077     inline Standard_CString PName() const { return "PPrsStd_AISPresentation_1"; }
0078 
0079     //! Import transient attribute from the persistent data.
0080     void Import (const Handle(TDataXtd_Presentation)& theAttribute) const;
0081 
0082   private:
0083     Standard_Integer myMode;
0084   };
0085 };
0086 
0087 #endif