Extracting entity names from STEP Files
I've seen some things about this subject on forums but not exactly answering to my question. I want to extract STEPRepr_RepresentationItem names from STEP File created (in a first time...) in Rhino, and it seems natural for me to use OCAF and XDE. I've read that it was not provided by XCAF (http://opencascade.wikidot.com/entitynames).
My idear was to create a sub class "STEPCAFControl_ReaderBis" of STEPCAFControl_Reader, with a method "ReadNamesBis", which could do the same things for StepRepr_RepresentatonItem names than "STEPCAFControl_Reader::ReadNames" for product names.
The problem is that the property aReader of STEPCAFControlReader is private and that I can't access to the XSControlWorkSession in my class, then I could'nt access to the work session. Does anyone has an idea ?
Thank you very much !
Standard_Boolean ReadNamesBis(const Handle(XSControl_WorkSession)& WS,
Handle(Interface_InterfaceModel) Model = WS->Model(); // Is there any way to access to the WorkSession
Handle(XSControl_TransferReader) TR = WS->TransferReader();
Handle(Transfer_TransientProcess) TP = TR->TransientProcess();
Handle(XCAFDoc_ShapeTool) STool = XCAFDoc_DocumentTool::ShapeTool( doc->Main() );
if ( STool.IsNull() ) return Standard_False;
Standard_Integer nb = Model->NbEntities();
for (Standard_Integer i = 1; i Handle(Standard_Transient) enti = Model->Value(i);
if ( ! enti->DynamicType()->SubType("StepRepr_RepresentationItem")) continue;
Handle(StepRepr_RepresentationItem) SRRI =
Handle(TCollection_HAsciiString) hName = SRRI->Name();
TCollection_ExtendedString myName ( hName->String() );
Handle(Transfer_Binder) binder = TP->Find( enti);
if ( binder.IsNull() || ! binder->HasResult() ) continue;
TopoDS_Shape S = TransferBRep::ShapeResult ( TP, binder );
if ( S.IsNull() ) continue;
if ( ! STool->Search ( S, shL, Standard_True, Standard_True, Standard_True ) ) continue;
Main Function :
IFSelect_ReturnStatus status = aReader.ReadFile(aFileName);
if (status != IFSelect_RetDone)