Proper Use of TNaming

I have a situation in which I go through the following steps:

  1. Create a Box using BRepPrimAPI_MakeBox
  2. Add the Box and all the Faces to the Data Framework using TNaming_Builder::Generated()
  3. Select Edge 3 on the Box using TNaming_Selector::Select with the Box as the Context Shape
  4. Fillet Edge 3 on the Box using BRepFilletAPI_MakeFillet
  5. Add the FilletedBox to the Data Framework using TNaming_Builder::Modify and TNaming_Builder::Generated as appropriate
  6. "Resize" the Box by creating a new Box2 using BRepPrimAPI_MakeBox
  7. Add the resized Box2 to the Data Framework using TNaming_Builder::Modify and the original Box as the OldShape

So, at this point, I try to get back a reference to Edge 3, which has now changed since its context shape was changed. However, whenever I use TNaming_Selector::NamedShape()->Get() on the Label in which I stored the selected Edge, I end up getting an Edge that is not in the resized Box2. Am a missing some step in adding data to the Data Framework that is needed?

Any help would be appreciated.

Wolfgang Sanyer's picture

If it helps, here is what my Data Framework tree looks like after all of the above operations

0:1 Selection Root Node
0:1:1 Selected edge 3
0:1:1:1 edge 3 context shape?
0:2 Generated Shape node: Box
0:2:1
0:2:2
0:2:3
0:2:4
0:2:5
0:2:6
0:3 Fillet Node
0:3:1 Modified faces
0:3:2 Deleted faces
0:3:3 Faces from edges
0:3:4 Faces from vertices
0:4 Modified Shape Node: Box2
0:4:1
0:4:2
0:4:3
0:4:4
0:4:5

Wolfgang Sanyer's picture

Figured it out: it turns out that when I was making my call to TNaming_Selector::Solve(), the TDF_LabelMap I was passing was not complete enough. I thought passing the node that held the Selection would be enough but it wasn't. I passed a blank TDF_LabelMap, which according to my understanding means that the Solver uses the whole Data Framework tree. This did the trick for me.