wireframe view of AIS_Shape; set color

Hello,

AIS_InteractiveContext::SetDisplayMode(AIS_WireFrame,true/);

shifts the current view of a set of AIS_Shape(s) to wireframe mode.
From pic00.png to pic01.png.

Here each wireframe of each shape is displayed with the color of the shape.

I would like to display the wireframe of each shape in a certain color. For example all the wireframes in black.

How to do this?
Grazie mille
Giovanni

Attachments: 
gkv311 n's picture

Which presentations you have created in the first place (XCAFPrs_AISObject, AIS_ColoredShape, AIS_Shape), and how colors have been assigned to shapes?

If you are using XCAFPrs_AISObject and colors come from document, I may suggest subclassing XCAFPrs_AISObject::Compute() and calling base class implementation for AIS_Shaded display mode and StdPrs_WFShape for AIS_WireFrame (e.g. skip the logic in XCAFPrs_AISObject that does dispatching of colors).

Giovanni Bettega's picture

Thank you very much for the suggestion,
the presentation of the shapes has been built using

AIS_ColoredShape

so, for changing the color of each shape, for example
for obtaining a fully black wireframe, I use

//! ---------------------------------
//! color of the edges for wireframe
//! ---------------------------------
AIS_ListOfInteractive l;
occContext->ObjectsInside(l,AIS_KOI_Shape,-1);
for(AIS_ListIteratorOfListOfInteractive it(l); it.More(); it.Next())
{
occHandle(AIS_ExtendedShape) AIS = occHandle(AIS_ExtendedShape)::DownCast(it.Value());
if(AIS.IsNull()) continue;
TopTools_IndexedMapOfShape M;
TopExp::MapShapes(AIS->Shape(),TopAbs_EDGE,M);
for(int i=1; i<=M.Extent(); i++)
AIS->SetCustomColor(TopoDS::Edge(M.FindKey(i)),Quantity_NOC_BLACK);
}
occContext->SetDisplayMode(AIS_WireFrame,false);

and it works. See pic00_old and pic01_new
Regards