when I set the displaymode=2 on an ais_shape I get a dotted line around the dimensions of TopoDS_Shape.
when I increase the dimensions of the TopoDS_Shape the dotted outline is updated correct - so far, so good.
but if I make a dimension of the TopoDS_Shape smaller, for example the length, the dotted line is not updated at all. But the selection is correct as you can see on the attached picture.
Any help is appreciated!
Discussion
7 archived replies
Posts are displayed in their archived order.
01Author
I bring this up again. I spend now many hours try to fix this. it becomes a real problem now.
let me explain again:
ais_shape, showing a BRepPrimAPI_MakeBox... and with displaymode (dm) 1:
when I change the dimensions of the shap and redisplay all is correct displayed. I can go larder and smaller no problem at all, in all display modes BUT 2
if I switch ONCE to display mode 2, and i increasy the size, all is good. but I can go smaller anymore then the size i had when switching to dm 2.
it is like in dm2 it only updates when it is increasing but not decreasing. This must be a bug.
I tried everything:
//m_occView->context()->Erase(m_aisMain, Standard_False);
//m_occView->context()->Display(m_aisMain, Standard_True);
//m_occView->context()->Redisplay(m_aisMain, Standard_True);
m_aisMain->UnsetAttributes(); // Clears cached visual attributes
m_aisMain->SetToUpdate(); // Marks the shape as needing a full update
m_occView->context()->Redisplay(m_aisMain, true, true);
m_occView->getView()->Invalidate(); // Marks everything as needing a redraw
m_occView->getView()->Update();
m_occView->context()->UpdateCurrentViewer();
nothing works
I so need help here.
Thanks!
02Author
Bnd_Box bbox = m_aisDisplay->BoundingBox(); // Get the bounding box
AIS_Shape::Compute() for display mode 2 displays bounding box of a shape returned by AIS_Shape::BoundingBox().
If you'll take a look at AIS_Shape::BoundingBox() implementation, you'll see that bounding box is cached in myBB and updated only when flag myCompBB is changed:
Neither of the methods resets bounding box (myBB.SetVoid() or similar), hence it is only expanded, which is indeed a bug.
You may file a bugfix to OCCT or workaround bug by clearing myBB on your own or implementing ::Compute() at application level.
Anyway, if you really want to display box around the shape, then overriding ::Compute() and displaying oriented bounding box BRepBndLib::AddOBB() instead of AABB might look better to user.
04Author
Thank you!
Not sure if I have to do something now. Report that bug? Could you do this and I just wait until it is fixed?
During today I will prepare the fix (at the moment writing a tests)
06Author
great news - thanks!
07Commenter-1
Test case:
pload MODELING VISUALIZATION
box b 100 200 300
vinit View1
vdisplay b -dispMode 2
# OK
box b 10 200 300
vdisplay b -dispMode 2
# KO - bounding box is not shrunk