MeshLib C++ Docs
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 SelectableObjects, // fit only selectable objects (exclude ancillary objects)
16 CustomObjectsList // fit only given objects (need additional objects list)
17};
18
20{
21 float factor{ 1.f }; // part of the screen for scene location
22 // snapView - to snap camera angle to closest canonical quaternion
23 // orthographic view: camera moves a bit, fit FOV by the whole width or height
24 // perspective view: camera is static, fit FOV to closest border.
25 bool snapView{ false };
26};
27
29{
31 std::vector<std::shared_ptr<VisualObject>> objsList; // custom objects list. used only with CustomObjectsList mode
32
33 FitDataParams( float factor_ = 1.f, bool snapView_ = false, FitMode mode_ = FitMode::Visible,
34 const std::vector<std::shared_ptr<VisualObject>>& objsList_ = {} ) :
35 BaseFitParams{ factor_, snapView_ },
36 mode( mode_ ),
37 objsList( objsList_ )
38 {};
39};
40
42{
43 Box3f worldBox; // box in world space to fit
44
45 FitBoxParams( const Box3f& worldBox_, float factor_ = 1.f, bool snapView_ = false ) :
46 BaseFitParams{ factor_, snapView_ },
47 worldBox( worldBox_ )
48 {};
49};
50
51} //namespace MR
Definition MRCameraOrientationPlugin.h:8
FitMode
Definition MRFitData.h:11
Definition MRFitData.h:20
bool snapView
Definition MRFitData.h:25
float factor
Definition MRFitData.h:21
Definition MRFitData.h:42
Box3f worldBox
Definition MRFitData.h:43
FitBoxParams(const Box3f &worldBox_, float factor_=1.f, bool snapView_=false)
Definition MRFitData.h:45
Definition MRFitData.h:29
FitMode mode
Definition MRFitData.h:30
FitDataParams(float factor_=1.f, bool snapView_=false, FitMode mode_=FitMode::Visible, const std::vector< std::shared_ptr< VisualObject > > &objsList_={})
Definition MRFitData.h:33
std::vector< std::shared_ptr< VisualObject > > objsList
Definition MRFitData.h:31