Anonymous (not verified) Mon, 08/29/2005 - 14:40 Forums: Other usage issuesif i know a object TDF_Label,i can gain it's TDataStd_Name. But,now ,I know a object TDataStd_Name,how can gain it's TDF_Label ? Thank you very much! sunny Jérome Dufaure Tue, 08/30/2005 - 11:05 You can use the method Label() from TDF_Attribute to retrieve the TDF_Label corresponding to the TDataStd_Name attribute. I hope This will help you. Jerome Log in to post comments SOS:How can I r... (not verified) Wed, 08/31/2005 - 09:21 Thank you very much! I make a box by these codes as follows: TDF_Label TOcaf_Commands::CreateBox(Standard_Real x, Standard_Real y, Standard_Real z, Standard_Real w, Standard_Real l, Standard_Real h, const TCollection_ExtendedString& Name) { TDF_Label L = TDF_TagSource::NewChild(MainLab); TDataStd_Real::Set(L.FindChild(1), w); TDataStd_Real::Set(L.FindChild(2), l); TDataStd_Real::Set(L.FindChild(3), h); TDataStd_Real::Set(L.FindChild(4), x); TDataStd_Real::Set(L.FindChild(5), y); TDataStd_Real::Set(L.FindChild(6), z); TDataStd_Name::Set(L, Name); Handle(TFunction_Function) myFunction = TFunction_Function::Set(L, TOcafFunction_BoxDriver::GetID()); TFunction_Logbook log; Handle(TOcafFunction_BoxDriver) myBoxDriver; if(!TFunction_DriverTable::Get()->FindDriver(TOcafFunction_BoxDriver::GetID(), myBoxDriver)) return L; myBoxDriver->Init(L); if (myBoxDriver->Execute(log)) MessageBox(0,"DFunction_Execute : failed","Box",MB_ICONERROR); return L; } now,I know the box's Name,How can I retrieve the TDF_Label L? Can you tell me the C++ code? Thanks you again! yours, Sunny5688 05.8.31 Log in to post comments SOS:How can I r... (not verified) Wed, 08/31/2005 - 09:23 Thank you very much! I make a box by these codes as follows: TDF_Label TOcaf_Commands::CreateBox(Standard_Real x, Standard_Real y, Standard_Real z, Standard_Real w, Standard_Real l, Standard_Real h, const TCollection_ExtendedString& Name) { TDF_Label L = TDF_TagSource::NewChild(MainLab); TDataStd_Real::Set(L.FindChild(1), w); TDataStd_Real::Set(L.FindChild(2), l); TDataStd_Real::Set(L.FindChild(3), h); TDataStd_Real::Set(L.FindChild(4), x); TDataStd_Real::Set(L.FindChild(5), y); TDataStd_Real::Set(L.FindChild(6), z); TDataStd_Name::Set(L, Name); Handle(TFunction_Function) myFunction = TFunction_Function::Set(L, TOcafFunction_BoxDriver::GetID()); TFunction_Logbook log; Handle(TOcafFunction_BoxDriver) myBoxDriver; if(!TFunction_DriverTable::Get()->FindDriver(TOcafFunction_BoxDriver::GetID(), myBoxDriver)) return L; myBoxDriver->Init(L); if (myBoxDriver->Execute(log)) MessageBox(0,"DFunction_Execute : failed","Box",MB_ICONERROR); return L; } now,I know the box's Name,How can I retrieve the TDF_Label L? Can you tell me the C++ code? Thanks you again! yours, Sunny5688 05.8.31 Log in to post comments
Tue, 08/30/2005 - 11:05
You can use the method Label() from TDF_Attribute to retrieve the TDF_Label corresponding to the TDataStd_Name attribute.
I hope This will help you.
Jerome
Wed, 08/31/2005 - 09:21
Thank you very much!
I make a box by these codes as follows:
TDF_Label TOcaf_Commands::CreateBox(Standard_Real x, Standard_Real y, Standard_Real z, Standard_Real w, Standard_Real l, Standard_Real h, const TCollection_ExtendedString& Name)
{
TDF_Label L = TDF_TagSource::NewChild(MainLab);
TDataStd_Real::Set(L.FindChild(1), w);
TDataStd_Real::Set(L.FindChild(2), l);
TDataStd_Real::Set(L.FindChild(3), h);
TDataStd_Real::Set(L.FindChild(4), x);
TDataStd_Real::Set(L.FindChild(5), y);
TDataStd_Real::Set(L.FindChild(6), z);
TDataStd_Name::Set(L, Name);
Handle(TFunction_Function) myFunction = TFunction_Function::Set(L, TOcafFunction_BoxDriver::GetID());
TFunction_Logbook log;
Handle(TOcafFunction_BoxDriver) myBoxDriver;
if(!TFunction_DriverTable::Get()->FindDriver(TOcafFunction_BoxDriver::GetID(), myBoxDriver)) return L;
myBoxDriver->Init(L);
if (myBoxDriver->Execute(log)) MessageBox(0,"DFunction_Execute : failed","Box",MB_ICONERROR);
return L;
}
now,I know the box's Name,How can I retrieve the TDF_Label L?
Can you tell me the C++ code?
Thanks you again!
yours,
Sunny5688
05.8.31
Wed, 08/31/2005 - 09:23
Thank you very much!
I make a box by these codes as follows:
TDF_Label TOcaf_Commands::CreateBox(Standard_Real x, Standard_Real y, Standard_Real z, Standard_Real w, Standard_Real l, Standard_Real h, const TCollection_ExtendedString& Name)
{
TDF_Label L = TDF_TagSource::NewChild(MainLab);
TDataStd_Real::Set(L.FindChild(1), w);
TDataStd_Real::Set(L.FindChild(2), l);
TDataStd_Real::Set(L.FindChild(3), h);
TDataStd_Real::Set(L.FindChild(4), x);
TDataStd_Real::Set(L.FindChild(5), y);
TDataStd_Real::Set(L.FindChild(6), z);
TDataStd_Name::Set(L, Name);
Handle(TFunction_Function) myFunction = TFunction_Function::Set(L, TOcafFunction_BoxDriver::GetID());
TFunction_Logbook log;
Handle(TOcafFunction_BoxDriver) myBoxDriver;
if(!TFunction_DriverTable::Get()->FindDriver(TOcafFunction_BoxDriver::GetID(), myBoxDriver)) return L;
myBoxDriver->Init(L);
if (myBoxDriver->Execute(log)) MessageBox(0,"DFunction_Execute : failed","Box",MB_ICONERROR);
return L;
}
now,I know the box's Name,How can I retrieve the TDF_Label L?
Can you tell me the C++ code?
Thanks you again!
yours,
Sunny5688
05.8.31