]> SALOME platform Git repositories - modules/yacs.git/blob - src/SALOMEDSImpl/SALOMEDSImpl_AttributeExternalFileDef.cxx
Salome HOME
PR: merge from branch BR_UnitTests tag mergeto_trunk_17oct05
[modules/yacs.git] / src / SALOMEDSImpl / SALOMEDSImpl_AttributeExternalFileDef.cxx
1 //  File   : SALOMEDSImpl_AttributeExternalFileDef.cxx
2 //  Author : Sergey RUIN
3 //  Module : SALOME
4
5 #include "SALOMEDSImpl_AttributeExternalFileDef.hxx"
6
7 using namespace std;
8
9 IMPLEMENT_STANDARD_HANDLE( SALOMEDSImpl_AttributeExternalFileDef, SALOMEDSImpl_GenericAttribute )
10 IMPLEMENT_STANDARD_RTTIEXT( SALOMEDSImpl_AttributeExternalFileDef, SALOMEDSImpl_GenericAttribute )
11
12 //=======================================================================
13 //function : GetID
14 //purpose  : 
15 //=======================================================================
16 const Standard_GUID& SALOMEDSImpl_AttributeExternalFileDef::GetID () 
17 {
18   static Standard_GUID SALOMEDSImpl_AttributeExternalFileDefID ("7123AD4C-ACDB-4e3a-8FDC-70EA164D2CBE");
19   return SALOMEDSImpl_AttributeExternalFileDefID;
20 }
21
22 //=======================================================================
23 //function : Set
24 //purpose  : 
25 //=======================================================================
26 Handle(SALOMEDSImpl_AttributeExternalFileDef) 
27 SALOMEDSImpl_AttributeExternalFileDef::Set (const TDF_Label& L, const TCollection_ExtendedString& S) 
28 {
29
30   Handle(SALOMEDSImpl_AttributeExternalFileDef) A;
31   if (!L.FindAttribute(SALOMEDSImpl_AttributeExternalFileDef::GetID(),A)) {
32     A = new  SALOMEDSImpl_AttributeExternalFileDef(); 
33     L.AddAttribute(A);
34   }
35   
36   A->SetValue (S); 
37   return A;
38 }
39
40
41 //=======================================================================
42 //function : constructor
43 //purpose  : 
44 //=======================================================================
45 SALOMEDSImpl_AttributeExternalFileDef::SALOMEDSImpl_AttributeExternalFileDef()
46 :SALOMEDSImpl_GenericAttribute("AttributeExternalFileDef")
47 {
48 }
49
50 //=======================================================================
51 //function : SetValue
52 //purpose  :
53 //=======================================================================
54 void SALOMEDSImpl_AttributeExternalFileDef::SetValue (const TCollection_ExtendedString& S)
55 {
56   CheckLocked();
57
58   if(myString == S) return;
59
60   Backup();
61
62   myString = S;
63
64   SetModifyFlag(); //SRN: Mark the study as being modified, so it could be saved 
65 }
66            
67
68
69 //=======================================================================
70 //function : ID
71 //purpose  : 
72 //=======================================================================
73 const Standard_GUID& SALOMEDSImpl_AttributeExternalFileDef::ID () const { return GetID(); }
74
75
76 //=======================================================================
77 //function : NewEmpty
78 //purpose  : 
79 //=======================================================================
80 Handle(TDF_Attribute) SALOMEDSImpl_AttributeExternalFileDef::NewEmpty () const
81 {  
82   return new SALOMEDSImpl_AttributeExternalFileDef(); 
83 }
84
85 //=======================================================================
86 //function : Restore
87 //purpose  : 
88 //=======================================================================
89 void SALOMEDSImpl_AttributeExternalFileDef::Restore(const Handle(TDF_Attribute)& with) 
90 {
91   myString = Handle(SALOMEDSImpl_AttributeExternalFileDef)::DownCast (with)->Value ();
92 }
93
94 //=======================================================================
95 //function : Paste
96 //purpose  : 
97 //=======================================================================
98 void SALOMEDSImpl_AttributeExternalFileDef::Paste (const Handle(TDF_Attribute)& into,
99                                                    const Handle(TDF_RelocationTable)& RT) const
100 {
101   Handle(SALOMEDSImpl_AttributeExternalFileDef) anAttr = Handle(SALOMEDSImpl_AttributeExternalFileDef)::DownCast(into); 
102   anAttr->SetValue(myString);
103 }
104