Change the color of some points in selected point cloud

Hello,
I have rendered a Point cloud succesfully by subclassing AIS_InteractiveObject.

thanks to the guidance in this thread : http://www.opencascade.org/org/forum/thread_1125/

So my compute function is like this:

void AIS_PointCloud::Compute(const Handle(PrsMgr_PresentationManager3d)& aPresentationManager,
                             const Handle(Prs3d_Presentation)& aPresentation,
                             const Standard_Integer aMode)

{

Handle(Graphic3d_Structure) theStructure = Handle(Graphic3d_Structure)::DownCast(aPresentation);

Handle(Graphic3d_Group) theGroup=  theStructure->NewGroup();

Handle(Graphic3d_AspectMarker3d) asp;
asp = myDrawer->PointAspect()->Aspect();

asp->SetType(Aspect_TOM_POINT);

theGroup->SetGroupPrimitivesAspect(asp);

const Graphic3d_ArrayOfPoints& theArray= new Graphic3d_ArrayOfPoints(vertlist.size(),Standard_True); //vertlist is list of your points with colors.

 

 lit  = vertlist.begin();
 lend = vertlist.end();

for(;lit!=lend;++lit){
{            

theArray->AddVertex(lit->pnt, lit->color); //add every point with it color

}

theGroup->AddPrimitiveArray(theArray);

}

When I select this point cloud object,  the point colors changes to the default selection color which is Quantity_NOC_GRAY80. I would like that color points remain unchanged after selection knowing that it is work with OCC 6.7.1
But after migration to OCC 6.8, it didn't work.
 
Please help me.

Daniel Neander's picture

Why not use AIS_PointCloud?

Jihed's picture

Hi Daniel Neander
I am sorry for the late answering,
Do you mean that I should use the OpenCascade's point cloud class ?