DiscussionsIssue archiveOther usage issues

Archived discussion

How to display points in OCC

Other usage issuesSat, 04/04/2009 - 21:175 replies

Browse this forum
QuestionAuthor

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 ???

Discussion

5 archived replies

Posts are displayed in their archived order.

01Commenter-1

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, ...)

02Commenter-2

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.

03Author

Thank you, macro and Paul. I get it.

04Commenter-1

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

05Author

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);
}
---------------------------------