0031687: Draw Harness, ViewerTest - extend command vrenderparams with option updating...
[occt.git] / src / TObj / TObj_TModel.hxx
1 // Created on: 2004-11-23
2 // Created by: Pavel TELKOV
3 // Copyright (c) 2004-2014 OPEN CASCADE SAS
4 //
5 // This file is part of Open CASCADE Technology software library.
6 //
7 // This library is free software; you can redistribute it and/or modify it under
8 // the terms of the GNU Lesser General Public License version 2.1 as published
9 // by the Free Software Foundation, with special exception defined in the file
10 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
11 // distribution for complete text of the license and disclaimer of any warranty.
12 //
13 // Alternatively, this file may be used under the terms of Open CASCADE
14 // commercial license or contractual agreement.
15
16 // The original implementation Copyright: (C) RINA S.p.A
17
18 #ifndef TObj_TModel_HeaderFile
19 #define TObj_TModel_HeaderFile
20
21 #include <TDF_Attribute.hxx>
22
23 class TObj_Model;
24 class TObj_TModel;
25
26 /** 
27 * Attribute to store OCAF-based models in OCAF tree
28 * The persistency mechanism of the TObj_TModel allowes to save
29 * and restore various types of models without recompilation of the schema
30 */ 
31
32 class TObj_TModel : public TDF_Attribute
33 {
34  public:
35   /**
36   * Standard methods of attribute
37   */
38   
39   //! Empty constructor
40   Standard_EXPORT TObj_TModel();
41   
42   //! This method is used in implementation of ID()
43   static Standard_EXPORT const Standard_GUID& GetID();
44   
45   //! Returns the ID of TObj_TModel attribute.
46   Standard_EXPORT const Standard_GUID& ID() const Standard_OVERRIDE;
47   
48  public:
49   //! Methods for setting and obtaining the Model object
50   
51   //! Sets the the Model object
52   Standard_EXPORT void Set(const Handle(TObj_Model)& theModel);
53   
54   //! Returns the Model object
55   Standard_EXPORT Handle(TObj_Model) Model() const;
56   
57  public:
58   //! Redefined OCAF abstract methods
59     
60   //! Returns an new empty TObj_TModel attribute. It is used by the
61   //! copy algorithm.
62   Standard_EXPORT Handle(TDF_Attribute) NewEmpty() const Standard_OVERRIDE;
63   
64   //! Restores the backuped contents from <theWith> into this one. It is used 
65   //! when aborting a transaction.
66   Standard_EXPORT void Restore (const Handle(TDF_Attribute)& theWith) Standard_OVERRIDE;
67   
68   //! This method is used when copying an attribute from a source structure
69   //! into a target structure.
70   Standard_EXPORT void Paste (const Handle(TDF_Attribute)& theInto,
71                               const Handle(TDF_RelocationTable)& theRT) const Standard_OVERRIDE;
72   
73  private:
74   //! Fields
75   Handle(TObj_Model) myModel; //!< The Model object stored by the attribute
76   
77  public:
78   //! CASCADE RTTI
79   DEFINE_STANDARD_RTTIEXT(TObj_TModel,TDF_Attribute)
80 };
81
82 //! Define handle class for TObj_TModel
83 DEFINE_STANDARD_HANDLE(TObj_TModel,TDF_Attribute)
84
85 #endif
86
87 #ifdef _MSC_VER
88 #pragma once
89 #endif