| 394 | } |
| 395 | |
| 396 | void Viewport::preciseFitDataToScreenBorder( const FitDataParams& fitParams ) |
| 397 | { |
| 398 | std::vector<std::shared_ptr<VisualObject>> allObj; |
| 399 | if ( fitParams.mode == FitMode::CustomObjectsList ) |
| 400 | { |
| 401 | allObj = fitParams.objsList; |
| 402 | } |
| 403 | else |
| 404 | { |
| 405 | ObjectSelectivityType type = ObjectSelectivityType::Any; |
| 406 | if ( fitParams.mode == FitMode::SelectedObjects ) |
| 407 | { |
| 408 | type = ObjectSelectivityType::Selected; |
| 409 | } |
| 410 | else if ( fitParams.mode == FitMode::SelectableObjects ) |
| 411 | { |
| 412 | type = ObjectSelectivityType::Selectable; |
| 413 | } |
| 414 | |
| 415 | allObj = getAllObjectsInTree<VisualObject>( &SceneRoot::get(), type ); |
| 416 | } |
| 417 | |
| 418 | preciseFitToScreenBorder_( [&] ( bool zoomFov, bool globalBasis ) |
| 419 | { |
| 420 | Space space = Space::CameraOrthographic; |
| 421 | if ( !params_.orthographic ) |
| 422 | { |
| 423 | space = zoomFov ? Space::CameraPerspective : Space::World; |
| 424 | } |
| 425 | if ( !globalBasis ) |
| 426 | return calcBox_( allObj, space, fitParams.mode == FitMode::SelectedPrimitives ); |
| 427 | else |
| 428 | return calcBox_( getViewerInstance().globalBasis->axesChildren(), space, fitParams.mode == FitMode::SelectedPrimitives ); |
| 429 | }, fitParams ); |
| 430 | } |
| 431 | |
| 432 | void Viewport::preciseFitToScreenBorder_( std::function<Box3f( bool zoomFOV, bool globalBasis )> getBoxFn, const BaseFitParams& fitParams ) |
| 433 | { |
no test coverage detected