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 | #include <TObj_TModel.hxx> |
19 | |
20 | #include <Standard_GUID.hxx> |
21 | #include <TDF_RelocationTable.hxx> |
22 | |
7fd59977 |
23 | |
92efcf78 |
24 | IMPLEMENT_STANDARD_RTTIEXT(TObj_TModel,TDF_Attribute) |
25 | |
7fd59977 |
26 | //======================================================================= |
27 | //function : GetID |
28 | //purpose : |
29 | //======================================================================= |
30 | |
31 | const Standard_GUID& TObj_TModel::GetID() |
32 | { |
33 | static Standard_GUID GModelID ("bbdab6a6-dca9-11d4-ba37-0060b0ee18ea"); |
34 | return GModelID; |
35 | } |
36 | |
37 | //======================================================================= |
38 | //function : TObj_TModel |
39 | //purpose : |
40 | //======================================================================= |
41 | |
42 | TObj_TModel::TObj_TModel() |
43 | { |
44 | } |
45 | |
46 | |
47 | //======================================================================= |
48 | //function : ID |
49 | //purpose : |
50 | //======================================================================= |
51 | |
52 | const Standard_GUID& TObj_TModel::ID() const |
53 | { |
54 | return GetID(); |
55 | } |
56 | |
57 | //======================================================================= |
58 | //function : NewEmpty |
59 | //purpose : |
60 | //======================================================================= |
61 | |
62 | Handle(TDF_Attribute) TObj_TModel::NewEmpty() const |
63 | { |
64 | return new TObj_TModel; |
65 | } |
66 | |
67 | //======================================================================= |
68 | //function : Model |
69 | //purpose : |
70 | //======================================================================= |
71 | |
72 | Handle(TObj_Model) TObj_TModel::Model() const |
73 | { |
74 | return myModel; |
75 | } |
76 | |
77 | //======================================================================= |
78 | //function : Set |
79 | //purpose : |
80 | //======================================================================= |
81 | |
82 | void TObj_TModel::Set(const Handle(TObj_Model)& theModel) |
83 | { |
84 | Backup(); |
85 | myModel = theModel; |
86 | } |
87 | |
88 | //======================================================================= |
89 | //function : Restore |
90 | //purpose : |
91 | //======================================================================= |
92 | |
93 | void TObj_TModel::Restore(const Handle(TDF_Attribute)& theWith) |
94 | { |
95 | Handle(TObj_TModel) R = Handle(TObj_TModel)::DownCast (theWith); |
96 | myModel = R->Model(); |
97 | } |
98 | |
99 | //======================================================================= |
100 | //function : Paste |
101 | //purpose : |
102 | //======================================================================= |
103 | |
104 | void TObj_TModel::Paste (const Handle(TDF_Attribute)& theInto , |
105 | const Handle(TDF_RelocationTable)& /* RT */) const |
106 | { |
107 | Handle(TObj_TModel) R = Handle(TObj_TModel)::DownCast (theInto); |
108 | R->Set(myModel); |
109 | } |