Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-09-14 09:15:54

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