why text set cullingsize is not work

i use AIS_Shape and AIS_TextLab set cullingsize.when Mousewheel,the ais_shape won't be rendered,but the text will.there is any way make text affect.

Handle(AIS_InteractiveContext)thcontext=...;
Handle(V3d_Viewer) theViwer=...;
Graphic3d_ZLayerSetting aSetting=theViwer->ZLayerSetting(Graphic3d_ZLayerId_Default);
aSetting.SetCullingSize(100);
theViwer->SetZLayerSettings(Graphic3d_ZLayerId_Default,aSetting);
TopoDS_Shape shape=BrepBUilderAPI_MakeEdge(gp_Circ(gp::XOY(),5));
Handle(AIS_TextLabel) text=new AIS_TextLabel();
text->SetPosition(gp_Pnt());
text->settext("1");
thcontext->Display(text,true);
thcontext->Display(new AIS_Shape(shape),true);
Luke jk's picture

hello! anyone can reply?

gkv311 n's picture

AIS_Shape is usually used to display a fixed-height text label, which size doesn't depend on camera view. Size culling is designed to clip objects by their size - hence, these two things go into logical conflict.

Distance culling could work, though (within perspective camera). But for the moment culling logic will be enabled only for oriented text labels AIS_TextLabel::SetOrientation3D().

set THE_NB_BOXES 5
set THE_COLORS { RED GREEN BLUE YELLOW PURPLE1 }
pload MODELING VISUALIZATION
vinit View1
vcamera -persp
for { set x 0 } { $x < $THE_NB_BOXES } { incr x } { box b$x $x 0 0 0.5 0.2 0.4; vpoint p$x $x 0 0; vdisplay -mutable p$x; vdisplay -dispMode 1 b$x }
for { set x 0 } { $x < $THE_NB_BOXES } { incr x } { vdrawtext t$x "Label$x" -pos $x 0 0 -plane 1 0 0 0 1 0 -halign RIGHT }
for { set x 0 } { $x < $THE_NB_BOXES } { incr x } { vsetcolor b$x [lindex $THE_COLORS $x] }
vline l 0 0 0 5 0 0
vdisplay -mutable l
vfit
vzlayer default -culldist 7

Luke jk's picture

Hi gkv311 n ,thanks for your reply! i try your code in my computer,but it still didnt work.my environment is windows and OCCT 7.6.0