How display vertices with multi color

I have 1000000 points and I would display this points with many color.each 100 points with color.
I use this for built the point:

BRepBuilderAPI_MakeVertex(gp_Pnt(,, );
compoundBuilder.Add( compoundShape,V1);
Handle(AIS_Shape) aShape = new AIS_Shape(compoundShape);

is there a method that gives a color for each point before building the shape.

EricThompson's picture

The typical way to set the color on a vertex is to set the color in the PointAspect for the vertex:

Handle_Prs3d_PointAspect myPointAspect=new Prs3d_PointAspect(Aspect_TOM_POINT,color,size);

Have you tried this before adding the vertex to the compound shape? I don't know if this will work, the point's color might get overridden by the compound shape's color, but it is worth a try.

ATTIA's picture

Thank you Eric but when I compiled, many errors appear:

error C2039: 'Attributes': is not a member of 'TopoDS_Vertex'
error C2065: 'myPointAspect': undeclared identifier

EricThompson's picture

Sorry, that's my mistake. My suggestion only works on individual vertex shapes. It will not work with the compound shape.

EricThompson's picture

You could derive your own subclass from AIS_Shape, and override the compute method. In your overridden compute method, you could loop through all of the verticies, and for each one, set the correct color in the PointAspect, then call StdPrs_WFDeflectionShape::Add(aPresentation,vertex,myDrawer);