0022627: Change OCCT memory management defaults
[occt.git] / src / XCAFDoc / XCAFDoc_Location.cxx
1 // File:        XCAFDoc_Location.cxx
2 // Created:     Tue Aug 15 11:14:56 2000
3 // Author:      data exchange team
4 //              <det@strelox.nnov.matra-dtv.fr>
5
6
7 #include <XCAFDoc_Location.ixx>
8
9 //=======================================================================
10 //function : Constructor
11 //purpose  : 
12 //=======================================================================
13
14 XCAFDoc_Location::XCAFDoc_Location()
15 {
16 }
17
18 //=======================================================================
19 //function : GetID
20 //purpose  : 
21 //=======================================================================
22
23 const Standard_GUID& XCAFDoc_Location::GetID() 
24 {
25   static Standard_GUID LocationID ("efd212ef-6dfd-11d4-b9c8-0060b0ee281b");
26   return LocationID; 
27 }
28
29 //=======================================================================
30 //function : Set
31 //purpose  : 
32 //=======================================================================
33
34  Handle(XCAFDoc_Location) XCAFDoc_Location::Set(const TDF_Label& L,const TopLoc_Location& Loc) 
35 {
36   Handle(XCAFDoc_Location) A;
37   if (!L.FindAttribute (XCAFDoc_Location::GetID(), A)) {
38     A = new XCAFDoc_Location ();
39     L.AddAttribute(A);
40   }
41   A->Set (Loc); 
42   return A;
43 }
44
45 //=======================================================================
46 //function : Set
47 //purpose  : 
48 //=======================================================================
49
50  void XCAFDoc_Location::Set(const TopLoc_Location& Loc) 
51 {
52   Backup();
53   myLocation = Loc;
54 }
55
56 //=======================================================================
57 //function : Get
58 //purpose  : 
59 //=======================================================================
60
61  TopLoc_Location XCAFDoc_Location::Get() const
62 {
63   return myLocation;
64 }
65
66 //=======================================================================
67 //function : ID
68 //purpose  : 
69 //=======================================================================
70
71 const Standard_GUID& XCAFDoc_Location::ID() const
72 {
73   return GetID();
74 }
75
76 //=======================================================================
77 //function : Restore
78 //purpose  : 
79 //=======================================================================
80
81  void XCAFDoc_Location::Restore(const Handle(TDF_Attribute)& With) 
82 {
83   myLocation = Handle(XCAFDoc_Location)::DownCast(With)->Get();
84 }
85
86 //=======================================================================
87 //function : NewEmpty
88 //purpose  : 
89 //=======================================================================
90
91  Handle(TDF_Attribute) XCAFDoc_Location::NewEmpty() const
92 {
93   return new XCAFDoc_Location();
94 }
95
96 //=======================================================================
97 //function : Paste
98 //purpose  : 
99 //=======================================================================
100
101  void XCAFDoc_Location::Paste(const Handle(TDF_Attribute)& Into,const Handle(TDF_RelocationTable)& /* RT */) const
102 {
103   Handle(XCAFDoc_Location)::DownCast(Into)->Set(myLocation);
104
105 }
106