Cannot import STeP layers with 7.4.0.

Hello. I've got the following code fragment, in which I'm trying, in several ways, to detect to which layer[s] a shape is assigned:

 

      TDF_LabelSequence Labels; LayerTool->GetLayerLabels(Labels); std::cout<<Labels.Size()<<std::endl;
      for (Standard_Integer i=1;i<=Labels.Size();++i)
        std::cout<<LayerTool->IsSet(Shape,Labels(i))<<" ";
      std::cout<<std::endl;
      Handle(TColStd_HSequenceOfExtendedString) aLayerS; Standard_Boolean a=LayerTool->GetLayers(Shape,aLayerS);
      std::cout<<a; if (a) std::cout<<" "<<aLayerS->Size(); std::cout<<std::endl;

 

All of them work on 7.3.0, but don't on 7.4.0.

 

I tracked this to the changes in XCAFDoc_ShapeTool::FindShape (XCAFDoc_ShapeTool.cxx:291).

 

Is this  a regression? Would taking the previous version of this method have any side-effect?

Or am I doing it wrong? Is any of the above a supported way to get shape's layer info? How should I do it instead?

 

Thanks in advance.

Kirill Gavrilov's picture

Is this  a regression?

This is difficult to tell straight ahead, as provided code snippet looks incomplete.
If you can provide a reproducible test case (with all necessary details, including a shape), then you may register an issue on Bugtracker:
https://dev.opencascade.org/index.php?q=home/get_involved

I tracked this to the changes in XCAFDoc_ShapeTool::FindShape (XCAFDoc_ShapeTool.cxx:291).

I suppose you are referring to the following commit, you can use git to traverse OCCT history:

0030727: Data Exchange - Problems in Shape Tool

Add protection from return of not top-level shape by FindShape method.
Add protection against located roots into FindMainShape method.
Add new Draw command for FindMainShape.
Add flag findInstance to Draw command FindShape