Manage selection and hilight of each node from shape's decomposition

Is it possible to manage selection and hilight of shape's decomposited nodes (from parent shape) without create specific AIS objects?
I mean the folowing issue.
Here some code.
AISCtx()->InitDetected();
while (AISCtx()->MoreDetected())
{
const TopoDS_Shape &shp = AISCtx()->DetectedShape(); // posible to get decomposed topo object
// AISCtx()->DetectedInteractive(); - this returns hole shape (not decomposed object)
// here I want to hilight or not the node of decomposition (due to my rules).
AISCtx()->NextDetected();
}

Also I want to manage selection like detection how I described above.

Dmitry Kidyaev's picture

Ohhhhhhhhhhhhhhhhhhh.
Solved the hilight case.
Here is the sample.

AISCtx()->InitDetected();
while (AISCtx()->MoreDetected())
{
Handle(AIS_InteractiveObject) aisobj = AISCtx()->DetectedInteractive();
Handle(SelectMgr_EntityOwner) own = AISCtx()->DetectedOwner();
// deside to hilight or not
own->Hilight(AISCtx()->MainPrsMgr());
AISCtx()->RecomputePrsOnly(aisobj);
const TopoDS_Shape &shp = AISCtx()->DetectedShape();
_onDetectShape(shp);
AISCtx()->NextDetected();
}
I do not sure that it the prober solution but it seems that it works.

mfregeau's picture

Did you had to activate the context for detection or anything? I do not detect anything for me, it simply doesn't go inside the loop at all when I have my mouse over a shape. I tried this line at the init stage of the context but without success:

mContext->Activate(TopAbs_SHAPE, Standard_True );