1 // File : SALOMEDSImpl_GenericAttribute.hxx
2 // Author : SERGEY_RUIN
6 #include "SALOMEDSImpl_Attributes.hxx"
7 #include "SALOMEDSImpl_Study.hxx"
8 #include "SALOMEDSImpl_StudyBuilder.hxx"
12 IMPLEMENT_STANDARD_HANDLE( SALOMEDSImpl_GenericAttribute, TDF_Attribute )
13 IMPLEMENT_STANDARD_RTTIEXT( SALOMEDSImpl_GenericAttribute, TDF_Attribute )
15 char* SALOMEDSImpl_GenericAttribute::Impl_GetType(const Handle(TDF_Attribute)& theAttr)
17 Handle(SALOMEDSImpl_GenericAttribute) ga = Handle(SALOMEDSImpl_GenericAttribute)::DownCast(theAttr);
18 return ga->Type().ToCString();
21 char* SALOMEDSImpl_GenericAttribute::Impl_GetClassType(const Handle(TDF_Attribute)& theAttr)
23 Handle(SALOMEDSImpl_GenericAttribute) ga = Handle(SALOMEDSImpl_GenericAttribute)::DownCast(theAttr);
24 return ga->GetClassType().ToCString();
27 void SALOMEDSImpl_GenericAttribute::Impl_CheckLocked(const Handle(TDF_Attribute)& theAttr)
29 Handle(SALOMEDSImpl_GenericAttribute) ga = Handle(SALOMEDSImpl_GenericAttribute)::DownCast(theAttr);
33 TCollection_AsciiString SALOMEDSImpl_GenericAttribute::Type()
39 void SALOMEDSImpl_GenericAttribute::CheckLocked()
41 TDF_Label aLabel = Label();
42 if(aLabel.IsNull()) return;
44 Handle(SALOMEDSImpl_Study) aStudy = SALOMEDSImpl_Study::GetStudy(aLabel);
45 if(aStudy.IsNull() || aStudy->NewBuilder()->HasOpenCommand()) return;
46 if(aStudy->IsLocked()) {
47 aStudy->_errorCode = "LockProtection";
48 throw LockProtection("LockProtection");
52 Handle(SALOMEDSImpl_SObject) SALOMEDSImpl_GenericAttribute::GetSObject()
54 TDF_Label aLabel = Label();
55 if(aLabel.IsNull()) return NULL;
56 return SALOMEDSImpl_Study::SObject(aLabel);
59 void SALOMEDSImpl_GenericAttribute::SetModifyFlag()
61 TDF_Label aLabel = Label();
62 if(aLabel.IsNull()) return;
64 Handle(SALOMEDSImpl_Study) aStudy = SALOMEDSImpl_Study::GetStudy(aLabel);
65 if(!aStudy.IsNull()) aStudy->Modify();