//draw point
BRepBuilderAPI_MakeVertex ver(gp_Pnt(0,0,10));
TopoDS_Shape topo_shape = ver.Vertex();
Handle(AIS_Shape) pt_ais = new AIS_Shape(topo_shape);
mwin->myContext->Display(pt_ais,true);
//draw text
Handle(AIS_TextLabel) text_label = new AIS_TextLabel();
std::string text_ = "0.06";
TCollection_ExtendedString occ_text((Standard_CString)text_.data());
text_label->SetText(occ_text);
text_label->SetPostion(gp_Pnt(0,0,0));
mwin->myContext->Display(text_label,true);
the code before
when i show point first,the point and text can display both.
when i show text first,the text cannot display.
how can i do? I want display text after point.
Discussion
6 archived replies
Posts are displayed in their archived order.
01Commenter-1
I don't see the issue in the code from the first glance.
The Draw Harness script making similar thing works as expected:
pload MODELING VISUALIZATION
vclear
vinit View1
vdrawtext t "0.06" -pos 0 0 0 -font Arial
vertex v 0 0 10
vdisplay v
vfit
So probably your issue is somewhere around and not exactly in quoted lines.
02Author
Hi:
You show the text first,the point second.This is right.
Can you show the point first,the text second?
The code like below:
pload MODELING VISUALIZATION
vclear
vinit View1
vertex v 0 0 10
vdisplay v
vdrawtext t "0.06" -pos 0 0 0 -font Arial
vfit
03Author
I test opencascade7.3, it is OK
Opencascade 7.4 is wrong!
The Error is TKOpenGL | Type:Error|.........
This is a bug for occ7.4?
what can i do to solve this problem?
Thank you!
04Commenter-1
The Error is TKOpenGL | Type:Error|.........
This is incomplete message.
You show the text first,the point second.This is right.
Test script works in any direction within OCCT 7.4.0 on my workstation.
This is a bug for occ7.4?
To make sure that this is OCCT bug, it is necessary to have a reproducer.
The error message may indicate a bug in application itself (for example - multi-threading issues).
05Author
Hi,
This problem might have something to do with my system!
I changed a computer,it is OK.
Thank you!
06Commenter-2
Hi:
I have a question is,if it is marked the text on a TopoDS_Shape,them,how to clear or erase the text?If I can clear the text,then,I can draw it agin on the other place.
thanks
Commenter-2