TNaming_Selector

hi.

what is the benefit of TNaming_Selector? i know i can name subshapes, etc... what can i do with the TNaming_NamedShape attribute in the label where TNaming_Selector was used?

as far as i've tried, TNaming_Selector doesn't highlight decompositions of a shape programatically.

in a sample program i made, after i used TNaming_Selector on a shape, i can't seem to modify it anymore... i'm not too sure why yet...

thanks for any help in advance...

rgds,

kh

Sergey RUIN's picture

Hi,

TNaming_NamedShape allows to store a TopoDS_Shape in TDF_Data framework. It has method Get to retrieve the stored shape. TNaming_Selector is used to perform a topological naming. More details you can find in Cascade documentation: www.opencascade.org/doc31/index.html, item 6 => Synopsis => Shape Attributes

Best Regards

Sergey

k-chan's picture

hi... thanks for the reply...

i know that it gives us TNaming_NamedShape etc etc... but.. what can i do with it? i can't select it in AIS_InteractiveContext because it isn't an AIS_InteractiveObject and AIS_InteractiveContext doesn't allow me to select a subshape anyway (AddOrRemoveSelected needs an EntityOwner which i don't have).

what application functionality for the user will require me to use TNaming_Selector? it doesn't seem that convenient to use if it's for selection....

rgds,

kh

Sergey RUIN's picture

Hi,

Ok, here is a simplest example the use of TNaming_Selector:

Imagine you created a prism by BRepPrimAPI_MakePrism and display it in the viewer. Now user wants to create an axis passing through one of egdes of prism. He selects the edge you name it and get TNaming_NamedShape which contains a link to selected edge. After you retrieve a geometry of the edge builds the axis. Now you modify the prism by changing its height. What is going to be with axis - it should reflect changes in the prism. That is a NamedShape which contains a link to the edge has to be updated to have a link to a edge of modified prism which corresponds to the edge on which axis was built. This task is performed by TNaming_Selector.

Best Regards

Sergey

k-chan's picture

hi.

thanks Sergey.

i initially thought TNaming_Selector was something that is used on top of the selection services provided in AIS_InteractiveContext.

rgds,

kh