b311480e |
1 | // Created on: 2004-11-23 |
2 | // Created by: Pavel TELKOV |
973c2be1 |
3 | // Copyright (c) 2004-2014 OPEN CASCADE SAS |
b311480e |
4 | // |
973c2be1 |
5 | // This file is part of Open CASCADE Technology software library. |
b311480e |
6 | // |
d5f74e42 |
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 |
973c2be1 |
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. |
b311480e |
12 | // |
973c2be1 |
13 | // Alternatively, this file may be used under the terms of Open CASCADE |
14 | // commercial license or contractual agreement. |
b311480e |
15 | |
7fd59977 |
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 | #include <Handle_TObj_Model.hxx> |
23 | |
24 | class Handle(TDF_RelocationTable); |
25 | class Handle(TObj_TModel); |
26 | |
27 | /** |
28 | * Attribute to store OCAF-based models in OCAF tree |
29 | * The persistency mechanism of the TObj_TModel allowes to save |
30 | * and restore various types of models without recompilation of the schema |
31 | */ |
32 | |
33 | class TObj_TModel : public TDF_Attribute |
34 | { |
35 | public: |
36 | /** |
37 | * Standard methods of attribute |
38 | */ |
39 | |
40 | //! Empty constructor |
41 | Standard_EXPORT TObj_TModel(); |
42 | |
43 | //! This method is used in implementation of ID() |
44 | static Standard_EXPORT const Standard_GUID& GetID(); |
45 | |
46 | //! Returns the ID of TObj_TModel attribute. |
47 | Standard_EXPORT const Standard_GUID& ID() const; |
48 | |
49 | public: |
50 | //! Methods for setting and obtaining the Model object |
51 | |
52 | //! Sets the the Model object |
53 | Standard_EXPORT void Set(const Handle(TObj_Model)& theModel); |
54 | |
55 | //! Returns the Model object |
56 | Standard_EXPORT Handle(TObj_Model) Model() const; |
57 | |
58 | public: |
59 | //! Redefined OCAF abstract methods |
60 | |
61 | //! Returns an new empty TObj_TModel attribute. It is used by the |
62 | //! copy algorithm. |
63 | Standard_EXPORT Handle(TDF_Attribute) NewEmpty() const; |
64 | |
65 | //! Restores the backuped contents from <theWith> into this one. It is used |
66 | //! when aborting a transaction. |
67 | Standard_EXPORT void Restore (const Handle(TDF_Attribute)& theWith); |
68 | |
69 | //! This method is used when copying an attribute from a source structure |
70 | //! into a target structure. |
71 | Standard_EXPORT void Paste (const Handle(TDF_Attribute)& theInto, |
72 | const Handle(TDF_RelocationTable)& theRT) const; |
73 | |
74 | private: |
75 | //! Fields |
76 | Handle(TObj_Model) myModel; //!< The Model object stored by the attribute |
77 | |
78 | public: |
79 | //! CASCADE RTTI |
ec357c5c |
80 | DEFINE_STANDARD_RTTI(TObj_TModel, TDF_Attribute) |
7fd59977 |
81 | }; |
82 | |
83 | //! Define handle class for TObj_TModel |
84 | DEFINE_STANDARD_HANDLE(TObj_TModel,TDF_Attribute) |
85 | |
86 | #endif |
87 | |
88 | #ifdef _MSC_VER |
89 | #pragma once |
90 | #endif |