2 // File : SALOMEDS_SComponent_i.cxx
3 // Created : Wed Nov 28 16:24:34 2001
4 // Author : Yves FRICAUD
8 // Copyright : Open CASCADE 2001
11 #include "SALOMEDS_SComponent_i.hxx"
12 #include "utilities.h"
15 //============================================================================
16 /*! Function : constructor
19 //============================================================================
20 SALOMEDS_SComponent_i::SALOMEDS_SComponent_i(const TDF_Label lab, CORBA::ORB_ptr orb)
21 :SALOMEDS_SObject_i(lab,orb)
25 //============================================================================
26 /*! Function : destructor
29 //============================================================================
30 SALOMEDS_SComponent_i::~SALOMEDS_SComponent_i()
35 //============================================================================
36 /*! Function : ComponentDataType
39 //============================================================================
40 char* SALOMEDS_SComponent_i::ComponentDataType()
43 // MESSAGE("In SALOMEDS_SComponent_i::ComponentDataType");
44 // TCollection_AsciiString anEntry;
45 // TDF_Tool::Entry (_lab,anEntry);
46 // MESSAGE("in SALOMEDS_SComponent_i, Entry :"<<anEntry);
49 Standard_CString res = "";
50 Handle(TDataStd_Comment) type;
51 if ( _lab.FindAttribute(TDataStd_Comment::GetID(),type) ) {
52 TCollection_AsciiString ch(type->Get());
56 return CORBA::string_dup(res);
60 //============================================================================
61 /*! Function : ComponentIOR
64 //============================================================================
65 CORBA::Boolean SALOMEDS_SComponent_i::ComponentIOR(CORBA::String_out IOR)
67 Handle(SALOMEDS_IORAttribute) ior;
68 if (!_lab.FindAttribute(SALOMEDS_IORAttribute::GetID(),ior) )
70 TCollection_AsciiString ch(ior->Get());
71 IOR = strdup(ch.ToCString());
76 //============================================================================
80 //============================================================================
81 Standard_Boolean SALOMEDS_SComponent_i::IsA(const TDF_Label Lab)
83 Handle(TDF_Attribute) Att;
84 // scomponent must contain comment and belong to the 2th depth label
85 if ( Lab.FindAttribute(TDataStd_Comment::GetID(), Att) && Lab.Depth() == 2) {
88 return Standard_False;