1 // Created on: 2000-08-15
2 // Created by: data exchange team
3 // Copyright (c) 2000-2014 OPEN CASCADE SAS
5 // This file is part of Open CASCADE Technology software library.
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.
13 // Alternatively, this file may be used under the terms of Open CASCADE
14 // commercial license or contractual agreement.
16 #include <XCAFDoc_Location.ixx>
18 //=======================================================================
19 //function : Constructor
21 //=======================================================================
23 XCAFDoc_Location::XCAFDoc_Location()
27 //=======================================================================
30 //=======================================================================
32 const Standard_GUID& XCAFDoc_Location::GetID()
34 static Standard_GUID LocationID ("efd212ef-6dfd-11d4-b9c8-0060b0ee281b");
38 //=======================================================================
41 //=======================================================================
43 Handle(XCAFDoc_Location) XCAFDoc_Location::Set(const TDF_Label& L,const TopLoc_Location& Loc)
45 Handle(XCAFDoc_Location) A;
46 if (!L.FindAttribute (XCAFDoc_Location::GetID(), A)) {
47 A = new XCAFDoc_Location ();
54 //=======================================================================
57 //=======================================================================
59 void XCAFDoc_Location::Set(const TopLoc_Location& Loc)
65 //=======================================================================
68 //=======================================================================
70 const TopLoc_Location& XCAFDoc_Location::Get() const
75 //=======================================================================
78 //=======================================================================
80 const Standard_GUID& XCAFDoc_Location::ID() const
85 //=======================================================================
88 //=======================================================================
90 void XCAFDoc_Location::Restore(const Handle(TDF_Attribute)& With)
92 myLocation = Handle(XCAFDoc_Location)::DownCast(With)->Get();
95 //=======================================================================
98 //=======================================================================
100 Handle(TDF_Attribute) XCAFDoc_Location::NewEmpty() const
102 return new XCAFDoc_Location();
105 //=======================================================================
108 //=======================================================================
110 void XCAFDoc_Location::Paste(const Handle(TDF_Attribute)& Into,const Handle(TDF_RelocationTable)& /* RT */) const
112 Handle(XCAFDoc_Location)::DownCast(Into)->Set(myLocation);