MCPcopy Create free account
hub / github.com/MeshInspector/MeshLib / preciseFitDataToScreenBorder

Method preciseFitDataToScreenBorder

source/MRViewer/MRViewportCamera.cpp:396–430  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

394}
395
396void 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
432void Viewport::preciseFitToScreenBorder_( std::function<Box3f( bool zoomFOV, bool globalBasis )> getBoxFn, const BaseFitParams& fitParams )
433{

Callers 12

drawDialogMethod · 0.80
drawDialogMethod · 0.80
sOpenDICOMsFunction · 0.80
openDirectoryMethod · 0.80
actionMethod · 0.80
actionMethod · 0.80
spaceMouseDown_Method · 0.80
mcpViewerFitFunction · 0.80
mcpViewerSetupCameraFunction · 0.80
loadFilesMethod · 0.80

Calls 1

getFunction · 0.50

Tested by

no test coverage detected