Back to home page

EIC code displayed by LXR

 
 

    


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

0001 // Created on: 2004-11-23
0002 // Created by: Pavel TELKOV
0003 // Copyright (c) 2004-2014 OPEN CASCADE SAS
0004 //
0005 // This file is part of Open CASCADE Technology software library.
0006 //
0007 // This library is free software; you can redistribute it and/or modify it under
0008 // the terms of the GNU Lesser General Public License version 2.1 as published
0009 // by the Free Software Foundation, with special exception defined in the file
0010 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
0011 // distribution for complete text of the license and disclaimer of any warranty.
0012 //
0013 // Alternatively, this file may be used under the terms of Open CASCADE
0014 // commercial license or contractual agreement.
0015 
0016 // The original implementation Copyright: (C) RINA S.p.A
0017 
0018 #ifndef TObj_TModel_HeaderFile
0019 #define TObj_TModel_HeaderFile
0020 
0021 #include <TDF_Attribute.hxx>
0022 
0023 class TObj_Model;
0024 
0025 /** 
0026 * Attribute to store OCAF-based models in OCAF tree
0027 * The persistency mechanism of the TObj_TModel allowes to save
0028 * and restore various types of models without recompilation of the schema
0029 */ 
0030 
0031 class TObj_TModel : public TDF_Attribute
0032 {
0033  public:
0034   /**
0035   * Standard methods of attribute
0036   */
0037   
0038   //! Empty constructor
0039   Standard_EXPORT TObj_TModel();
0040   
0041   //! This method is used in implementation of ID()
0042   static Standard_EXPORT const Standard_GUID& GetID();
0043   
0044   //! Returns the ID of TObj_TModel attribute.
0045   Standard_EXPORT const Standard_GUID& ID() const Standard_OVERRIDE;
0046   
0047  public:
0048   //! Methods for setting and obtaining the Model object
0049   
0050   //! Sets the Model object
0051   Standard_EXPORT void Set(const Handle(TObj_Model)& theModel);
0052   
0053   //! Returns the Model object
0054   Standard_EXPORT Handle(TObj_Model) Model() const;
0055   
0056  public:
0057   //! Redefined OCAF abstract methods
0058     
0059   //! Returns an new empty TObj_TModel attribute. It is used by the
0060   //! copy algorithm.
0061   Standard_EXPORT Handle(TDF_Attribute) NewEmpty() const Standard_OVERRIDE;
0062   
0063   //! Restores the backuped contents from <theWith> into this one. It is used 
0064   //! when aborting a transaction.
0065   Standard_EXPORT void Restore (const Handle(TDF_Attribute)& theWith) Standard_OVERRIDE;
0066   
0067   //! This method is used when copying an attribute from a source structure
0068   //! into a target structure.
0069   Standard_EXPORT void Paste (const Handle(TDF_Attribute)& theInto,
0070                               const Handle(TDF_RelocationTable)& theRT) const Standard_OVERRIDE;
0071   
0072  private:
0073   //! Fields
0074   Handle(TObj_Model) myModel; //!< The Model object stored by the attribute
0075   
0076  public:
0077   //! CASCADE RTTI
0078   DEFINE_STANDARD_RTTIEXT(TObj_TModel,TDF_Attribute)
0079 };
0080 
0081 //! Define handle class for TObj_TModel
0082 DEFINE_STANDARD_HANDLE(TObj_TModel,TDF_Attribute)
0083 
0084 #endif
0085 
0086 #ifdef _MSC_VER
0087 #pragma once
0088 #endif