0024157: Parallelization of assembly part of BO
[occt.git] / src / TObj / TObj_TModel.hxx
1 // Created on: 2004-11-23
2 // Created by: Pavel TELKOV
3 // Copyright (c) 2004-2012 OPEN CASCADE SAS
4 //
5 // The content of this file is subject to the Open CASCADE Technology Public
6 // License Version 6.5 (the "License"). You may not use the content of this file
7 // except in compliance with the License. Please obtain a copy of the License
8 // at http://www.opencascade.org and read it completely before using this file.
9 //
10 // The Initial Developer of the Original Code is Open CASCADE S.A.S., having its
11 // main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France.
12 //
13 // The Original Code and all software distributed under the License is
14 // distributed on an "AS IS" basis, without warranty of any kind, and the
15 // Initial Developer hereby disclaims all such warranties, including without
16 // limitation, any warranties of merchantability, fitness for a particular
17 // purpose or non-infringement. Please see the License for the specific terms
18 // and conditions governing the rights and limitations under the License.
19
20 // The original implementation Copyright: (C) RINA S.p.A
21
22 #ifndef TObj_TModel_HeaderFile
23 #define TObj_TModel_HeaderFile
24
25 #include <TDF_Attribute.hxx>
26 #include <Handle_TObj_Model.hxx>
27
28 class Handle(TDF_RelocationTable);
29 class Handle(TObj_TModel);
30
31 /** 
32 * Attribute to store OCAF-based models in OCAF tree
33 * The persistency mechanism of the TObj_TModel allowes to save
34 * and restore various types of models without recompilation of the schema
35 */ 
36
37 class TObj_TModel : public TDF_Attribute
38 {
39  public:
40   /**
41   * Standard methods of attribute
42   */
43   
44   //! Empty constructor
45   Standard_EXPORT TObj_TModel();
46   
47   //! This method is used in implementation of ID()
48   static Standard_EXPORT const Standard_GUID& GetID();
49   
50   //! Returns the ID of TObj_TModel attribute.
51   Standard_EXPORT const Standard_GUID& ID() const;
52   
53  public:
54   //! Methods for setting and obtaining the Model object
55   
56   //! Sets the the Model object
57   Standard_EXPORT void Set(const Handle(TObj_Model)& theModel);
58   
59   //! Returns the Model object
60   Standard_EXPORT Handle(TObj_Model) Model() const;
61   
62  public:
63   //! Redefined OCAF abstract methods
64     
65   //! Returns an new empty TObj_TModel attribute. It is used by the
66   //! copy algorithm.
67   Standard_EXPORT Handle(TDF_Attribute) NewEmpty() const;
68   
69   //! Restores the backuped contents from <theWith> into this one. It is used 
70   //! when aborting a transaction.
71   Standard_EXPORT void Restore (const Handle(TDF_Attribute)& theWith);
72   
73   //! This method is used when copying an attribute from a source structure
74   //! into a target structure.
75   Standard_EXPORT void Paste (const Handle(TDF_Attribute)& theInto,
76                               const Handle(TDF_RelocationTable)& theRT) const;
77   
78  private:
79   //! Fields
80   Handle(TObj_Model) myModel; //!< The Model object stored by the attribute
81   
82  public:
83   //! CASCADE RTTI
84   DEFINE_STANDARD_RTTI(TObj_TModel)
85 };
86
87 //! Define handle class for TObj_TModel
88 DEFINE_STANDARD_HANDLE(TObj_TModel,TDF_Attribute)
89
90 #endif
91
92 #ifdef _MSC_VER
93 #pragma once
94 #endif