Vertices ans Aspects...

Hi there!

I built a TopoDS_Compound from some vertices and display it. But I want the vertices to be displayed as dots and not as "+".

Handle(AIS_Shape) myShape = new AIS_Shape(myCompound);

Handle(AIS_Drawer) myDrawer = myShape->Attributes();

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

asp->SetType(Aspect_TOM_POINT);

myAISContext->Display(myShape);

But this does not work, it still displays the vertices as "+". Can anybody help me?

Best regards, Jan

Agnes Mendel's picture

Hi Jan!
I had the same problem and found the following answer - so try this:

Handle(Prs3d_PointAspect) Aspect
= new Prs3d_PointAspect(Aspect_TOM_POINT,Quantity_NOC_WHITE,1.0);

Handle(Prs3d_Drawer) myDrawer = myAISContext->DefaultDrawer();
myDrawer->SetPointAspect(Aspect);

TopoDS_Shape topoShape = aComp;
Handle(AIS_Shape) aisShape = new AIS_Shape(topoShape);
myAISContext->Display(aisShape);

A disadvantage of this might be, that all vertices displayed after this, will de displayed the same way: as white dots.

Best regards - Agnes Mendel

Francois Lauzon's picture

Hello Jan,
you just need to do this:
Handle_Prs3d_PointAspect asp=aDrawer->PointAspect();
asp->SetTypeOfMarker(Aspect_TOM_POINT);
myDrawer->SetPointAspect(asp);
myShape->SetAttributes(aDrawer);

And if your object is already displayed, you need to use the context method to update the attributes:
myAISContext->SetLocalAttributes(myShape, myDrawer,Standard_True);

Good Luck,
Francois.