DiscussionsIssue archiveVisualization and 3D Viewer

Archived discussion

HOW SHOW A BOUND BOX OF A AIS_TextLabel

Visualization and 3D ViewerTue, 09/24/2024 - 06:190 replies

Browse this forum
QuestionAuthor

Handle(AIS_TextLabel) label = new AIS_TextLabel();
TCollection_ExtendedString labelString(std:string.c_str());
label->SetText(labelString);
Handle(Prs3d_TextAspect) textAspect = label->Attributes()->TextAspect();
Quantity_Color textColor(Quantity_NOC_BLACK);
textAspect->SetColor(textColor);
textAspect->SetHeight(30.0);
label->SetPosition(gp_Pnt);
gp_Trsf translation;
gp_Vec moveVec(50, 50, 0);
label->SetLocalTransformation(translation);
label->SetZoomable(false);
Quantity_Color backgroundColor(Quantity_NOC_GREEN);
label->SetDisplayType(Aspect_TODT_SUBTITLE);
label->SetColorSubTitle(backgroundColor);
AIS_InteractiveContext->Display(label, Standard_True);

Discussion

No archived replies

Posts are displayed in their archived order.