Is there a way to zoom a AIS_Shape in the view?, So that the AIS_Shape is maximized in the view?
Do you have any hints on how to achieve this?
Thanks, Guido
Kirill Gavrilov Mon, 06/21/2021 - 16:37
If you mean to fit AIS_Shape bounding box into entire View, then you may call an appropriate V3d_View::FitAll() method.
Handle(V3d_View) theView;
Handle(AIS_Shape) thePrs;
Bnd_Box aBndBox;
thePrs->BoundingBox (aBndBox); // or use another AIS_Shape::BoundingBox() relying on BRepBndLib
if (!aBndBox.IsVoid())
{
theView->FitAll (aBndBox, 0.01, true);
}
Mon, 06/21/2021 - 16:37
If you mean to fit AIS_Shape bounding box into entire View, then you may call an appropriate V3d_View::FitAll() method.
Mon, 06/21/2021 - 18:46
Thanks!
Mon, 06/21/2021 - 16:38
Hi Guido,
something like this
Handle_V3d_View myView;
const Bnd_Box aBndSelected = getBndBoxSelected(myAISContext);
if (!aBndSelected.IsVoid())
{
myView->FitMinMax(myView->Camera(), aBndSelected, 0.01);
myView->Invalidate();
update3dView();
}
This will allow you to zoom into a bounding box, which you should be able to get easily from your shape. Look for FitMinMax for better examples.
Cheers
Luc
Mon, 06/21/2021 - 18:46
Thanks' Luc!