MeshLib Documentation
Loading...
Searching...
No Matches
MRFitData.h
Go to the documentation of this file.
1#pragma once
2
3#include "MRViewerFwd.h"
4#include <MRMesh/MRBox.h>
5
6namespace MR
7{
8
9// Fit mode ( types of objects for which the fit is applied )
10enum class FitMode
11{
12 Visible, // fit all visible objects
13 SelectedPrimitives, // fit only selected primitives
14 SelectedObjects, // fit only selected objects
15 CustomObjectsList // fit only given objects (need additional objects list)
16};
17
19{
20 float factor{ 1.f }; // part of the screen for scene location
21 // snapView - to snap camera angle to closest canonical quaternion
22 // orthographic view: camera moves a bit, fit FOV by the whole width or height
23 // perspective view: camera is static, fit FOV to closest border.
24 bool snapView{ false };
25};
26
28{
30 std::vector<std::shared_ptr<VisualObject>> objsList; // custom objects list. used only with CustomObjectsList mode
31
32 FitDataParams( float factor_ = 1.f, bool snapView_ = false, FitMode mode_ = FitMode::Visible,
33 const std::vector<std::shared_ptr<VisualObject>>& objsList_ = {} ) :
34 BaseFitParams{ factor_, snapView_ },
35 mode( mode_ ),
36 objsList( objsList_ )
37 {};
38};
39
41{
42 Box3f worldBox; // box in world space to fit
43
44 FitBoxParams( const Box3f& worldBox_, float factor_ = 1.f, bool snapView_ = false ) :
45 BaseFitParams{ factor_, snapView_ },
46 worldBox( worldBox_ )
47 {};
48};
49
50} //namespace MR
Definition MRCameraOrientationPlugin.h:8
FitMode
Definition MRFitData.h:11
Definition MRFitData.h:19
bool snapView
Definition MRFitData.h:24
float factor
Definition MRFitData.h:20
Definition MRFitData.h:41
Box3f worldBox
Definition MRFitData.h:42
FitBoxParams(const Box3f &worldBox_, float factor_=1.f, bool snapView_=false)
Definition MRFitData.h:44
Definition MRFitData.h:28
FitMode mode
Definition MRFitData.h:29
FitDataParams(float factor_=1.f, bool snapView_=false, FitMode mode_=FitMode::Visible, const std::vector< std::shared_ptr< VisualObject > > &objsList_={})
Definition MRFitData.h:32
std::vector< std::shared_ptr< VisualObject > > objsList
Definition MRFitData.h:30