0023948: Wrong intersection between a surface of revolution and a plane.
[occt.git] / src / XCAFDoc / XCAFDoc_Location.cxx
1 // Created on: 2000-08-15
2 // Created by: data exchange team
3 // Copyright (c) 2000-2014 OPEN CASCADE SAS
4 //
5 // This file is part of Open CASCADE Technology software library.
6 //
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.
12 //
13 // Alternatively, this file may be used under the terms of Open CASCADE
14 // commercial license or contractual agreement.
15
16 #include <XCAFDoc_Location.ixx>
17
18 //=======================================================================
19 //function : Constructor
20 //purpose  : 
21 //=======================================================================
22
23 XCAFDoc_Location::XCAFDoc_Location()
24 {
25 }
26
27 //=======================================================================
28 //function : GetID
29 //purpose  : 
30 //=======================================================================
31
32 const Standard_GUID& XCAFDoc_Location::GetID() 
33 {
34   static Standard_GUID LocationID ("efd212ef-6dfd-11d4-b9c8-0060b0ee281b");
35   return LocationID; 
36 }
37
38 //=======================================================================
39 //function : Set
40 //purpose  : 
41 //=======================================================================
42
43  Handle(XCAFDoc_Location) XCAFDoc_Location::Set(const TDF_Label& L,const TopLoc_Location& Loc) 
44 {
45   Handle(XCAFDoc_Location) A;
46   if (!L.FindAttribute (XCAFDoc_Location::GetID(), A)) {
47     A = new XCAFDoc_Location ();
48     L.AddAttribute(A);
49   }
50   A->Set (Loc); 
51   return A;
52 }
53
54 //=======================================================================
55 //function : Set
56 //purpose  : 
57 //=======================================================================
58
59  void XCAFDoc_Location::Set(const TopLoc_Location& Loc) 
60 {
61   Backup();
62   myLocation = Loc;
63 }
64
65 //=======================================================================
66 //function : Get
67 //purpose  : 
68 //=======================================================================
69
70 const TopLoc_Location& XCAFDoc_Location::Get() const
71 {
72   return myLocation;
73 }
74
75 //=======================================================================
76 //function : ID
77 //purpose  : 
78 //=======================================================================
79
80 const Standard_GUID& XCAFDoc_Location::ID() const
81 {
82   return GetID();
83 }
84
85 //=======================================================================
86 //function : Restore
87 //purpose  : 
88 //=======================================================================
89
90  void XCAFDoc_Location::Restore(const Handle(TDF_Attribute)& With) 
91 {
92   myLocation = Handle(XCAFDoc_Location)::DownCast(With)->Get();
93 }
94
95 //=======================================================================
96 //function : NewEmpty
97 //purpose  : 
98 //=======================================================================
99
100  Handle(TDF_Attribute) XCAFDoc_Location::NewEmpty() const
101 {
102   return new XCAFDoc_Location();
103 }
104
105 //=======================================================================
106 //function : Paste
107 //purpose  : 
108 //=======================================================================
109
110  void XCAFDoc_Location::Paste(const Handle(TDF_Attribute)& Into,const Handle(TDF_RelocationTable)& /* RT */) const
111 {
112   Handle(XCAFDoc_Location)::DownCast(Into)->Set(myLocation);
113
114 }
115