How to display points in OCC

When I display the point, it is visualized like a small "cross", instead of a single point.

Does anybody know how to just show a point like in OpenGL ???

Marco Matt's picture

The quick and dirty solution is to subclass AIS_Point and provide your own implementation.

A better and clean solution can be to look the implementation of all point display related class and try to find if the aspect is customizable (AIS_Point, Prs3d_PointAspect, Graphic3d_AspectMarker3d, ...)

Paul Jimenez's picture

The trick is to use AIS_Drawer::SetPointAspect(Handle(Prs3d_PointAspect)). Check the different values for Aspect_TypeOfMarker, where the one you most likely want is Aspect_TOM_POINT.

Jun WANG's picture

Thank you, macro and Paul. I get it.

Marco Matt's picture

Please share the solution you will find with the other forum users.

Jun WANG's picture

Okay. Thanks for your suggestion.

---------------------------------
void CAIS_TriangleMesh::DrawVertex(const Handle_Prs3d_Presentation& aPresentation)
{
Handle( Graphic3d_Group ) TheGroup = Prs3d_Root::CurrentGroup(aPresentation);
Handle(Graphic3d_AspectMarker3d) asp = myDrawer->PointAspect()->Aspect();
asp->SetType(Aspect_TOM_POINT); // SetTypeOfMarker
TheGroup->SetGroupPrimitivesAspect(asp);

int size = m_pMesh->GetNumberOfVertex();
Graphic3d_Array1OfVertex aQuadArray(1, size);

for (int i = 1; i <= size; i++)
{
gp_Pnt& v = m_pMesh->m_arrTriVertex[i]->m_pt;
aQuadArray(i) = Graphic3d_VertexC(v.X(), v.Y(), v.Z(), Quantity_NOC_YELLOW);
}

TheGroup->MarkerSet(aQuadArray);
}
---------------------------------