1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-08-19 13:40:49 +03:00

0026209: Visualization - provide a method to fit view to the specific bounding box

Methods V3d_View::FitAll and NIS_View::FitAll3d now take arbitrary bounding box as a parameter;
Option -selected added to vfit command to fit only selected entities in Draw;
F key press now fits selected objects if any by default.
This commit is contained in:
vpa
2015-05-14 19:32:05 +03:00
committed by bugmaster
parent ab1c121bb9
commit b586500b1e
15 changed files with 301 additions and 43 deletions

View File

@@ -1451,16 +1451,25 @@ void V3d_View::SetAxialScale( const Standard_Real Sx, const Standard_Real Sy, co
//function : FitAll
//purpose :
//=============================================================================
void V3d_View::FitAll (const Standard_Real theMargin, const Standard_Boolean theToUpdate)
void V3d_View::FitAll (const Quantity_Coefficient theMargin, const Standard_Boolean theToUpdate)
{
Standard_ASSERT_RAISE (theMargin >= 0.0 && theMargin < 1.0, "Invalid margin coefficient");
FitAll (MyView->MinMaxValues(), theMargin, theToUpdate);
}
//=============================================================================
//function : FitAll
//purpose :
//=============================================================================
void V3d_View::FitAll (const Bnd_Box& theBox, const Quantity_Coefficient theMargin, const Standard_Boolean theToUpdate)
{
Standard_ASSERT_RAISE(theMargin >= 0.0 && theMargin < 1.0, "Invalid margin coefficient");
if (MyView->NumberOfDisplayedStructures() == 0)
{
return;
}
if (!FitMinMax (myCamera, MyView->MinMaxValues(), theMargin, 10.0 * Precision::Confusion()))
if (!FitMinMax (myCamera, theBox, theMargin, 10.0 * Precision::Confusion()))
{
return;
}