1 // File : SALOMEDS_AttributeTarget_i.cxx
2 // Author : Sergey RUIN
7 #include "SALOMEDS_AttributeTarget_i.hxx"
8 #include "SALOMEDSImpl_SObject.hxx"
9 #include "SALOMEDSImpl_Study.hxx"
10 #include "SALOMEDS.hxx"
12 #include <TColStd_HSequenceOfTransient.hxx>
16 void SALOMEDS_AttributeTarget_i::Add(SALOMEDS::SObject_ptr anObject)
18 SALOMEDS::Locker lock;
20 TDF_Tool::Label(_impl->Label().Data(),anObject->GetID(),aLabel,1);
21 (Handle(SALOMEDSImpl_AttributeTarget)::DownCast(_impl))->Add(SALOMEDSImpl_Study::SObject(aLabel));
24 SALOMEDS::Study::ListOfSObject* SALOMEDS_AttributeTarget_i::Get()
26 SALOMEDS::Locker lock;
27 Handle(TColStd_HSequenceOfTransient) aSeq = (Handle(SALOMEDSImpl_AttributeTarget)::DownCast(_impl))->Get();
28 SALOMEDS::Study::ListOfSObject_var aSList = new SALOMEDS::Study::ListOfSObject;
29 int aLength = aSeq->Length(), i;
30 if (aLength == 0) return aSList._retn();
31 aSList->length(aLength);
32 for(i=1; i <=aLength; i++) {
33 SALOMEDS::SObject_var anSO = SALOMEDS_SObject_i::New(Handle(SALOMEDSImpl_SObject)::DownCast(aSeq->Value(i)), _orb);
36 return aSList._retn();
39 void SALOMEDS_AttributeTarget_i::Remove(SALOMEDS::SObject_ptr anObject)
41 SALOMEDS::Locker lock;
43 TDF_Tool::Label(_impl->Label().Data(),anObject->GetID(),aLabel,1);
44 (Handle(SALOMEDSImpl_AttributeTarget)::DownCast(_impl))->Remove(SALOMEDSImpl_Study::SObject(aLabel));