Misplaced reference

I'm making an XDE step export/import module and have problems with shapes that (I suppose) are references.
Sometimes while testing my import module on step I didn't created, 2 same objects are placed on same position, but are not supposed to (at least on of them). I guess one is a reference of the other, but I don't understand why it is not placed correcly.
I get the free shapes and explore them as assemblies until I find simple shapes, which I decompose into faces to recompose them in my software (where objects are not defined in OCC).

Is there a special treatment before decomposing referenced items ?
Or can it be translations added to Labels or Assembly ?

I explore free shapes like that :

/* code */
for (TDF_ChildIDIterator NodeIterator(Label, XCAFDoc::ShapeRefGUID()); NodeIterator.More(); NodeIterator.Next())
{
Node = Handle(TDataStd_TreeNode)::DownCast(NodeIterator.Value());
if (Node->HasFather())
{
if (Node->Father()->Label().HasChild())
{...} //Recursively explore assembly child
else
{...} //Load faces from SimpleShape with TopExp_Explorer
}
}
/* end of code */

Thanks,
Pierre.

S's picture

I looked into the .stp file, the items are defined like that :

#68=PRODUCT_DEFINITION_WITH_ASSOCIATED_DOCUMENTS('XXXX_+ZP',' ',#67,#3,(#70)) ;
#645=PRODUCT_DEFINITION_WITH_ASSOCIATED_DOCUMENTS('XXXX_-ZP',' ',#644,#3,(#647)) ;
#1222=PRODUCT_DEFINITION_WITH_ASSOCIATED_DOCUMENTS('XXXX_+_-_YP',' ',#1221,#3,(#1224)) ;

#626=NEXT_ASSEMBLY_USAGE_OCCURRENCE('XXXX_+ZP_1','XXXX_+ZP_1','',#62,#68,' ') ;
#1203=NEXT_ASSEMBLY_USAGE_OCCURRENCE('XXXX_-ZP_1','XXXX_-ZP_1','',#62,#645,' ') ;
#1715=NEXT_ASSEMBLY_USAGE_OCCURRENCE('XXXX_+_-_YP_1','XXXX_+_-_YP_1','',#62,#1222,' ') ;
#1730=NEXT_ASSEMBLY_USAGE_OCCURRENCE('XXXX_+_-_YP_2','XXXX_+_-_YP_2','',#62,#1222,' ') ;

How must I do to read them correctly ?

Please help me, its the last bug remaining ...

S's picture

Please, I can't find any solution.
When I explore the document, no Label is reference, nor have any location.
I'm already using BRepMesh_IncrementalMesh on every SimpleShape before getting his faces.

I know its misplaced because with the basic STEPCAFControl_Reader it works fine.
What can I do to be sure every shape is correctly placed ?

Please help me ! :'(